Fix rmail-mbox handling of terminating newlines.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
a0241d01
KH
12011-11-07 Kenichi Handa <handa@m17n.org>
2
3 * coding.c (coding_set_destination): Check coding->src_pos only
4 when coding->src_object is a buffer (bug#9910).
5
6 * process.c (send_process): Set the member src_multibyte of coding
7 to 0 (bug#9911) when sending a unibyte text.
8
9 * callproc.c (Fcall_process): Set the member src_multibyte of
10 process_coding to 0 (bug#9912).
11
a64bfdfa 122011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
13
14 * xmenu.c (cleanup_widget_value_tree): New function.
15 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16 calling free_menubar_widget_value_tree directly (Bug#9830).
17
cb41b32a
PE
182011-11-06 Paul Eggert <eggert@cs.ucla.edu>
19
20 Fix some portability problems with 'inline'.
21 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
22 (window_box_width, window_box_left, window_box_left_offset)
23 (window_box_right, window_box_right_offset): Declare extern.
24 Otherwise, these inline functions do not conform to C99 and
25 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
26 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
27 * intervals.c (adjust_intervals_for_insertion)
28 (adjust_intervals_for_deletion): Now extern, because otherwise the
29 extern inline functions 'offset_intervals' couldn't refer to it.
30 (static_offset_intervals): Remove.
31 (offset_intervals): Rewrite using the old contents of
32 static_offset_intervals. The old version didn't conform to C99
33 because an extern inline function contained a reference to an
34 identifier with static linkage.
35
b7041366
AS
362011-11-06 Andreas Schwab <schwab@linux-m68k.org>
37
38 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
39 GC.
40
88a37c4d
EZ
412011-11-06 Eli Zaretskii <eliz@gnu.org>
42
43 * xdisp.c (init_iterator, reseat_to_string): Don't set the
44 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
45 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
46 return Qleft_to_right.
47
49745b39
CY
482011-11-06 Chong Yidong <cyd@gnu.org>
49
50 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
51 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
52 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
53 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
54 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
55 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
56 (Fwindow_vscroll): Doc fix.
57 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
58 argument, since it makes no sense to pass a live window and for
59 consistency with window-child.
60
1f05cd82
CS
612011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
62
63 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
64 support MSVC.
65
22610910
JR
662011-11-05 Jason Rumney <jasonr@gnu.org>
67
68 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
69 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
70 fonts (Bug#6029).
71 (add_font_entity_to_list): Fix logic errors in mixed boolean and
72 bitwise arithmetic preventing use of unicode-sip and non-truetype
73 opentype fonts.
74
a06776b2
EZ
752011-11-05 Eli Zaretskii <eliz@gnu.org>
76
3ad924ba
EZ
77 * s/ms-w32.h (fstat, stat, utime): Move redirections to
78 "emacs"-only part.
79
a06776b2
EZ
80 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
81 initialization code to keep similarity to xfns.c after changes
82 from 2011-11-05.
83
c9e7db78
JD
842011-11-05 Jan Djärv <jan.h.d@swipnet.se>
85
a97f8f3f
JD
86 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
87 (unwind_create_frame): New function (Bug#9943).
88 (Fx_create_frame): Restructure code to be more similar to the one in
89 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
90 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
91 Move terminal->reference_count++ just before making the frame official
92 (Bug#9943).
93
94 * nsterm.m (x_free_frame_resources): New function.
95 (x_destroy_window): Move code to x_free_frame_resources.
96
c9e7db78
JD
97 * xfns.c (unwind_create_frame): Fix comment.
98 (Fx_create_frame, x_create_tip_frame): Move
99 terminal->reference_count++ just before making the frame
100 official. Move initialization of image_cache_refcount and
101 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
102
a6fc3b5c
EZ
1032011-11-05 Eli Zaretskii <eliz@gnu.org>
104
105 Support MSVC build with newer versions of Visual Studio.
106 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
107 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
108 nt/gmake.defs.
109
110 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
111 which are not supported by MSVC.
112 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
113 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
114 bitfields.
115 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
116 types in bitfields.
117 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
118
119 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
120
1212011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
122
123 Support MSVC build with newer versions of Visual Studio.
124 * w32.c: Don't include w32api.h for MSVC.
125 (init_environment) [_MSC_VER]: Call sys_access, not _access.
126
127 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
128 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
129 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
130 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
131 e_* cousins.
132 (alloca) [_MSC_VER]: Define to _alloca.
133
134 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
135
136 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
137
a58c13ed
EZ
1382011-11-04 Eli Zaretskii <eliz@gnu.org>
139
140 * xdisp.c (note_mouse_highlight): If either of
141 previous/next-single-property-change returns nil, treat that as
142 the beginning or the end of the buffer. (Bug#9955)
143
fe0b6370
JD
1442011-11-04 Jan Djärv <jan.h.d@swipnet.se>
145
a58c13ed 146 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
147 label is not null (Bug#9951).
148 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
149 may be NULL.
150
89bd5ee1
EZ
1512011-11-04 Eli Zaretskii <eliz@gnu.org>
152
153 * window.c (Fwindow_body_size): Mention in the doc string that the
154 return value is in frame's canonical units. (Bug#9949)
155
84c3edb9
EZ
1562011-11-03 Eli Zaretskii <eliz@gnu.org>
157
4e2fb5c7
EZ
158 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
159
84c3edb9 160 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 161 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 162 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 163
bc17a887
EZ
1642011-11-01 Eli Zaretskii <eliz@gnu.org>
165
166 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
167 Don't stop backward scan on the continuation glyph, even though
168 its CHARPOS is positive.
26b46e51
EZ
169 (mouse_face_from_buffer_pos, note_mouse_highlight): Rename
170 cover_string to disp_string.
bc17a887 171
4ee88440
MR
1722011-11-01 Martin Rudalics <rudalics@gmx.at>
173
174 * window.c (temp_output_buffer_show): Don't use
175 Vtemp_buffer_show_specifiers.
176 (Vtemp_buffer_show_specifiers): Remove unused variable.
177
c2ff3c02
EZ
1782011-10-30 Eli Zaretskii <eliz@gnu.org>
179
180 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
181 past the beginning of the current glyph matrix.
182
6e56383b
JD
1832011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
184
185 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
186 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
187 HAVE_GTK3 (Bug#9869).
b77a6a7f 188
3b574623
JD
189 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
190 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
191
b77a6a7f
JD
192 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
193
194 * xterm.c: Declare x_handle_net_wm_state to return int.
195 (handle_one_xevent): Check if we are iconified but don't have
196 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
197 (get_current_wm_state): Return non-zero if not hidden,
198 check for _NET_WM_STATE_HIDDEN (Bug#9893).
199 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
200 (x_handle_net_wm_state): Return what get_current_wm_state returns.
201 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
202
196e41e4
PE
2032011-10-29 Paul Eggert <eggert@cs.ucla.edu>
204
205 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
206 so that this new function doesn't get optimized away by a
207 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
208
021f2e1a
AS
2092011-10-29 Andreas Schwab <schwab@linux-m68k.org>
210
211 * frame.h (MOUSE_HL_INFO): Remove excess parens.
212
8b058d44
EZ
2132011-10-29 Eli Zaretskii <eliz@gnu.org>
214
215 Fix the `xbytecode' command.
216 * .gdbinit (xprintbytestr): New command.
217 (xwhichsymbols): Renamed from `which'; all callers changed.
218 (xbytecode): Print the byte-code string as well.
219
4452fb80
EZ
2202011-10-29 Kim Storm <storm@cua.dk>
221
8b058d44
EZ
222 * alloc.c (which_symbols): New function.
223
21b72067
AS
2242011-10-29 Andreas Schwab <schwab@linux-m68k.org>
225
226 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
227 line. (Bug#9903)
228
83ed7b5c
GM
2292011-10-29 Glenn Morris <rgm@gnu.org>
230
231 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
232 Not clear what it was for, and it causes various bugs. (Bug#9839)
233
5a7a728b
EZ
2342011-10-28 Eli Zaretskii <eliz@gnu.org>
235
236 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
237 possible random value that matches one of those tested as
238 condition to clear the mouse face.
239
d3d0842f
CY
2402011-10-28 Chong Yidong <cyd@gnu.org>
241
242 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
243
31b39d13
DN
2442011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
245
246 * window.c (make_window): Initialize phys_cursor_on_p.
247
9aba6043
SM
2482011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
249
250 * lisp.h (struct Lisp_Symbol): Update comments.
251
c20992f4
JB
2522011-10-28 Juanma Barranquero <lekktu@gmail.com>
253
254 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
255
db4f02f2
EZ
2562011-10-28 Eli Zaretskii <eliz@gnu.org>
257
258 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
259 <oslsachem@gmail.com> for helping to debug this.
260
261 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
262 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
263 (g_b_init_get_glyph_outline_w): New static variables.
264 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
265 (GetGlyphOutlineW_Proc): New typedefs.
266 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
267 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
268 New functions.
269 (w32font_open_internal, compute_metrics):
270 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
271 instead of calling the "wide" APIs directly.
272
273 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
274
275 * w32.h (syms_of_w32font): Add prototype.
276
87e68db4
JB
2772011-10-27 Juanma Barranquero <lekktu@gmail.com>
278
279 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
280 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
281 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
282 (Fmove_to_window_line): Doc fix.
283
435c1d67
CY
2842011-10-27 Chong Yidong <cyd@gnu.org>
285
286 * process.c (make_process): Set gnutls_state to NULL.
287
288 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
289 non-NULL, regardless of GNUTLS_INITSTAGE.
290 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
291 an error. Set process slots as soon as we allocate them.
292
293 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
294
9c6c6f49
CY
2952011-10-27 Chong Yidong <cyd@gnu.org>
296
9aba6043
SM
297 * gnutls.c (emacs_gnutls_deinit): New function.
298 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
299 (Fgnutls_deinit, Fgnutls_boot): Use it.
300
301 * process.c (make_process): Initialize GnuTLS credentials to NULL.
302 (deactivate_process): Call emacs_gnutls_deinit.
303
657d08d3
JB
3042011-10-27 Juanma Barranquero <lekktu@gmail.com>
305
306 * image.c (x_create_x_image_and_pixmap):
307 * w32.c (sys_rename, w32_delayed_load):
308 * w32font.c (fill_in_logfont):
309 * w32reg.c (x_get_string_resource): Silence compiler warnings.
310
5430d399
JB
3112011-10-26 Juanma Barranquero <lekktu@gmail.com>
312
313 * w32fns.c (w32_default_color_map): New function,
314 extracted from Fw32_default_color_map.
a7ef684b 315 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 316
fe0055fa
PE
3172011-10-25 Paul Eggert <eggert@cs.ucla.edu>
318
319 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
320
e6346438
SM
3212011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
322
323 * keyboard.c (test_undefined): New function (bug#9751).
324 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
325
e112cc37
ET
3262011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
327
328 * sysdep.c (init_sys_modes): Fix the check for the controlling
329 terminal (Bug#6649).
330
7b5d6677
EZ
3312011-10-20 Eli Zaretskii <eliz@gnu.org>
332
333 * dispextern.h (struct bidi_it): New member next_en_type.
334
335 * bidi.c (bidi_line_init): Initialize the next_en_type member.
336 (bidi_resolve_explicit_1): When next_en_pos is valid for the
337 current character, check also for next_en_type being WEAK_EN.
338 (bidi_resolve_weak): Don't enter the expensive loop if the current
339 position is before next_en_pos. Record the bidi type of the first
340 non-ET, non-BN character we find, in addition to its position.
341 (bidi_level_of_next_char): Invalidate next_en_type when
342 next_en_pos is over-stepped.
343
7da0b018
PE
3442011-10-20 Paul Eggert <eggert@cs.ucla.edu>
345
346 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
347 * editfns.c: Rewrite current-time-zone so that it invokes
348 the equivalent of (format-time-string "%Z") to get the time zone name.
349 This fixes a bug when the time zone name contains characters that
350 need converting from the system time locale to Emacs internal format.
351 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
352 that patch fixed format-time-string to do the conversion, but
353 I forgot to fix current-time-zone.
354 (format_time_string): New function, containing most of
355 what Fformat_time_string used to contain.
356 (Fformat_time_string): Rewrite in terms of format_time_string.
357 This doesn't change this function's behavior.
358 (current-time-zone): Rewrite to use format_time_string.
359 This fixes the bug reported by Michael Schierl in
360 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
361 Jason Rumney's 2007-06-07 change worked around this bug, but
362 didn't fix it.
363 * systime.h (tzname, timezone): Remove no-longer-used declarations.
364
8547b010
EZ
3652011-10-19 Eli Zaretskii <eliz@gnu.org>
366
367 * xdisp.c (start_display): If the character at POS is displayed
368 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
369 (try_window_reusing_current_matrix): If a line ends in a display
370 vector or the next line starts in a display vector, continue
371 redrawing the window even though the character position of
372 start_row was reached.
8547b010
EZ
373 (Bug#9771, part 2)
374
4e948d15
CY
3752011-10-18 Chong Yidong <cyd@gnu.org>
376
377 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
378 with nobreak-char-display too.
379
4787455f
EZ
3802011-10-18 Eli Zaretskii <eliz@gnu.org>
381
382 Fix part 3 of bug#9771.
383 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
384 (bidi_resolve_neutral): Don't enter the expensive loop looking for
385 non-neutral characters if the current character is a paragraph
386 separator (a.k.a. Newline). This avoids running the same
387 expensive loop twice, once when we consume the preceding newline
388 and the other time when the line actually needs to be displayed.
389 Avoid the loop when we see neutrals on the base embedding level
390 following a character whose directionality is the same as the
391 paragraph's. This avoids running the expensive loop when a line
392 ends in a long sequence of neutrals, like control characters.
393 Add assertion against STRONG_AL type. Slightly rearrange code
394 that determines the type of a neutral given the first non-neutral
395 that follows it.
396 (bidi_level_of_next_char): Set next_en_pos to zero when
397 invalidating its info.
398
2c91f553
EZ
3992011-10-17 Eli Zaretskii <eliz@gnu.org>
400
401 * xdisp.c (push_display_prop): Determine whether to record string
402 or buffer position by IT->string, not by IT->method. Allow
403 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
404 (move_it_vertically_backward): Don't look for character position
405 immediately after the newline when in a continuation line.
406 (Bug#9771, part 1)
2c91f553 407
c7b08b0d
MR
4082011-10-15 Martin Rudalics <rudalics@gmx.at>
409
410 * window.c (coordinates_in_window): Rewrite and delabelize
411 vertical border check. (Bug#5357) (Bug#9618)
412
6b02f655
SM
4132011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
414
415 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
416 errors in XSetWindowBorder (bug#9310).
417
81d40c92
DA
4182011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
419
420 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
421 avoid crash when xmalloc overrun checking is enabled.
422
d4172c3b
EZ
4232011-10-13 Eli Zaretskii <eliz@gnu.org>
424
425 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
426 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
427 cursor motion with <left> and <right> arrow keys.
428
429 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
430 some callers set that themselves.
431
b00eea75
EZ
4322011-10-12 Eli Zaretskii <eliz@gnu.org>
433
434 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
435 display string and the previous row comes from the same string and
436 is empty. (Bug#9739) (Bug#9738)
437
8fe012c4
SM
4382011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
439
440 * doc.c (get_doc_string): Encode file name (bug#9735).
441
0074aef2
EZ
4422011-10-12 Eli Zaretskii <eliz@gnu.org>
443
79beb178
EZ
444 * bidi.c (bidi_level_of_next_char):
445 * xdisp.c (get_visually_first_element): Remove old incorrect
446 comments regarding the Unicode Line Separator character.
447
0074aef2
EZ
448 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
449
6e4b3fbe
DA
4502011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
451
452 * alloc.c (Fgc_status): Do not access beyond zombies array
453 boundary if nzombies > MAX_ZOMBIES.
454 * alloc.c (dump_zombies): Add missing format specifier.
455
0324f3af
PE
4562011-10-12 Paul Eggert <eggert@cs.ucla.edu>
457
b5525cac
PE
458 * xdisp.c (set_cursor_from_row): Simplify conditionals,
459 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
460
0324f3af
PE
461 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
462 Some packages use them to denote characters with modifiers.
463
e9b5f888
AS
4642011-10-11 Andreas Schwab <schwab@linux-m68k.org>
465
466 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
467 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
468 matching a pp-number. Rename parameter var to var1.
469
127827c0
SM
4702011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
471
472 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
473
c8fd3bd0
GM
4742011-10-08 Glenn Morris <rgm@gnu.org>
475
476 * callint.c (Fcall_interactively): Give a more explicit error for the
477 'c' case with a non-character input. (Bug#8479)
478
352ec8ff
EZ
4792011-10-08 Eli Zaretskii <eliz@gnu.org>
480
03669ccb
EZ
481 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
482 lines.
7061c986
EZ
483 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
484 lines that are hscrolled on the left.
03669ccb 485
352ec8ff
EZ
486 * dispnew.c (buffer_posn_from_coords): Account for a possible
487 presence of header-line. (Bug#4426)
488
a66cfb1c
SM
4892011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
490
6b02f655
SM
491 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
492 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 493
7c5ee88e
PE
4942011-10-07 Paul Eggert <eggert@cs.ucla.edu>
495
496 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
497 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
498 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
499 this makes Emacs dump core during garbage collection on rare
500 occasions. sizeof is obviously inferior to offsetof here, so
501 stick with offsetof.
502 (GC_POINTER_ALIGNMENT): New macro.
503 (mark_memory): Omit 3rd (offset) arg; caller changed.
504 Don't assume EMACS_INT alignment is the same as pointer alignment.
505
df1bbe5b
SM
5062011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
507
508 * keyboard.c (read_key_sequence_remapped): New var.
509 (read_key_sequence): Compute remapping in the right buffer.
510 (command_loop_1): Use read_key_sequence's remapping directly.
511
51553db6
SM
5122011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
513
32c1fffd
SM
514 * dired.c (file_name_completion): Don't expand file name.
515 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
516 before checking file name handler.
517
51553db6
SM
518 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
519 they've been requested explicitly (bug#9591).
520
b6bd1599 5212011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
522
523 * keymap.c (Fsingle_key_description): Use make_specified_string
524 instead of build_string to build string from push_key_description.
525 (Bug#5193)
526
f701dc2a
PE
5272011-09-30 Paul Eggert <eggert@cs.ucla.edu>
528
4222c55d
PE
529 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
530 This fixes a Y2038 bug on 64-bit hosts.
531 * buffer.c (reset_buffer):
532 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
533 (Fclear_buffer_auto_save_failure):
534 Use 0, not -1, to represent an unset failure time, since time_t
535 might not be signed.
536
f701dc2a
PE
537 Remove dependency on glibc malloc internals.
538 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
539 Move back here from lisp.h, but with their new implementations.
540 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
541 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
542 * charset.c (charset_table_init): New static var.
543 (syms_of_charset): Use it instead of xmalloc. This removes a
544 dependency on glibc malloc internals. See Eli Zaretskii's comment in
545 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
546 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
547 Move back to alloc.c.
548 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
549 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
550
9ceebf39
JD
5512011-09-30 Jan Djärv <jan.h.d@swipnet.se>
552
553 * nsterm.m (windowDidResize): Call x_set_window_size only when
554 ns_in_resize is true. Otherwise set pixelwidth/height and
555 call change_frame_size (Bug#9628).
556
cb993c58
PE
5572011-09-30 Paul Eggert <eggert@cs.ucla.edu>
558
3930c88b
PE
559 Port --enable-checking=all to Fedora 14 x86-64.
560 * charset.c (syms_of_charset): Also account for glibc malloc's
561 internal overhead when calculating the initial malloc maximum.
562
cb993c58
PE
563 Port --enable-checking=all to Fedora 14 x86.
564 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
565 Move to lisp.h.
566 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
567 (overrun_check_realloc, overrun_check_free):
568 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
569 That way, xmalloc returns a properly-aligned pointer even if
570 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
571 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
572 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
573 into account when calculating the initial malloc maximum.
574 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
575 Move here from alloc.c, so that charset.c can use it too.
576 Properly align; the old code wasn't right for common 32-bit hosts
577 when configured with --enable-checking=all.
578 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
579 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
580
31bed486
EZ
5812011-09-29 Eli Zaretskii <eliz@gnu.org>
582
04c70788 583 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
584 use EDOM.
585
fbcaa2f3
EZ
5862011-09-28 Eli Zaretskii <eliz@gnu.org>
587
588 * xdisp.c (compute_display_string_end): If there's no display
589 string at CHARPOS, return -1.
590
591 * bidi.c (bidi_fetch_char): When compute_display_string_end
592 returns a negative value, treat the character as a normal
593 character not covered by a display string. (Bug#9624)
594
a239d4e9
JB
5952011-09-28 Juanma Barranquero <lekktu@gmail.com>
596
597 * lread.c (Fread_from_string): Fix typo in docstring.
598
88652fd5
EZ
5992011-09-27 Eli Zaretskii <eliz@gnu.org>
600
601 * xdisp.c (handle_invisible_prop): If invisible text ends on a
602 newline, reseat the iterator instead of bidi-iterating there one
603 character at a time. (Bug#9610)
32c1fffd
SM
604 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
605 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 606
ed497dd4
AS
6072011-09-27 Andreas Schwab <schwab@linux-m68k.org>
608
609 * lread.c (readevalloop): Use correct code for NBSP.
610 (read1): Likewise. (Bug#9608)
611
b2bf61aa
MA
6122011-09-25 Michael Albinus <michael.albinus@gmx.de>
613
614 * dbusbind.c (Fdbus_register_signal): When service is not
615 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
616
32bbb17c
GM
6172011-09-25 Glenn Morris <rgm@gnu.org>
618
619 * buffer.c (truncate-lines): Doc fix.
620
94e0933e
CY
6212011-09-24 Chong Yidong <cyd@stupidchicken.com>
622
623 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
624 (Fset_window_next_buffers): Doc fix.
625
cddde921
GM
6262011-09-24 Glenn Morris <rgm@gnu.org>
627
628 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
629
1260aef1
PE
6302011-09-24 Paul Eggert <eggert@cs.ucla.edu>
631
25b4bfa0
PE
632 Fix minor problems found by static checking.
633 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
634 * indent.c (Fvertical_motion): Fix == vs = typo.
635
e3cbd34b
EZ
6362011-09-24 Eli Zaretskii <eliz@gnu.org>
637
a66cfb1c
SM
638 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
639 Default value is now t. Doc fix.
6bf7006f 640
e3cbd34b 641 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 642 logic when moving up, not only when moving down. Fix the
e3cbd34b 643 confusing name and values of the it_overshoot_expected variable;
32c1fffd 644 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
645
646 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
647 CHARPOS is covered by a display string which includes newlines.
648 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
649 is covered by a display string with embedded newlines.
650
a3de0cbd
MA
6512011-09-24 Michael Albinus <michael.albinus@gmx.de>
652
653 * dbusbind.c (Fdbus_register_signal): Add match rule to
654 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
655 (Fdbus_register_method, Vdbus_registered_objects_table):
656 Fix docstring.
a3de0cbd 657
b260039d
JM
6582011-09-24 Jim Meyering <meyering@redhat.com>
659
32c1fffd 660 do not ignore write error for any output size
b260039d
JM
661 The previous change was incomplete.
662 While it makes emacs --batch detect the vast majority of stdout
663 write failures, errors were still ignored whenever the output size is
664 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
665 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
666 && echo FAIL: ignored write error
667 FAIL: ignored write error
668 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
669 && echo FAIL: ignored write error
670 FAIL: ignored write error
671 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
672
8eca8a7c
AS
6732011-09-23 Andreas Schwab <schwab@linux-m68k.org>
674
675 * emacs.c (Fkill_emacs): In noninteractive mode exit
676 non-successfully if a write error occurred on stdout. (Bug#9574)
677
3341db62
EZ
6782011-09-21 Eli Zaretskii <eliz@gnu.org>
679
680 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
681 the xassert test.
682
683 * dispextern.h (struct it): Update the comment documenting what
684 can it->OBJECT be.
685
8c203dbf
EZ
6862011-09-20 Eli Zaretskii <eliz@gnu.org>
687
688 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
689 a display string, extend search for cursor position to end of row.
690 (find_row_edges): If the row ends in a newline from a display
691 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
692 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
693 (Fcurrent_bidi_paragraph_direction): Fix search for previous
694 non-empty line. Fixes confusing cursor motion with arrow keys at
695 the beginning of a line that starts with whitespace.
8c203dbf 696
a4824228
LMI
6972011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
698
699 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
700 (bug#9493).
701
33ed493b
CY
7022011-09-18 Chong Yidong <cyd@stupidchicken.com>
703
704 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
705 boolean (Bug#9154).
706
56cd55c8
EZ
7072011-09-18 Eli Zaretskii <eliz@gnu.org>
708
709 * xdisp.c (display_line): Record maximum and minimum buffer
710 positions even if no glyphs were produced (e.g., by a zero-width
711 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
712 buffer positions that will be removed from the glyph row because
713 they don't fit.
c02dcedf
EZ
714 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
715 column is beyond frame width: don't subtract 1 "pixel" when
716 computing width of the stretch.
3e62b7e0
EZ
717 (reseat_at_next_visible_line_start): Undo the change made on
718 2011-09-17 that saved paragraph information and restored it after
719 the call to `reseat'. (Bug#9545)
56cd55c8 720
5ed99d36 7212011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
722
723 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
724 and turn window cursor on if cleared (Bug#9415).
725
5ed99d36 7262011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
727
728 * search.c (boyer_moore): Take unibyte characters from pattern
729 literally. (Bug#9458)
730
9bade7b2
EZ
7312011-09-18 Eli Zaretskii <eliz@gnu.org>
732
733 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
734
e5e9d610
PE
7352011-09-18 Paul Eggert <eggert@cs.ucla.edu>
736
87e4427a
PE
737 Fix minor problem found by static checking.
738 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
739 initialized, to pacify gcc -Wuninitialized.
740
e5e9d610
PE
741 * fileio.c: Report proper errno when syscall falls.
742 (Finsert_file_contents): Save and restore errno,
743 so that report_file_error outputs the correct diagnostic.
744 (Fwrite_region) [CLASH_DETECTION]: Likewise.
745
a1674f0b
EZ
7462011-09-18 Eli Zaretskii <eliz@gnu.org>
747
748 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
749
fbfb6dd4
EZ
7502011-09-17 Eli Zaretskii <eliz@gnu.org>
751
752 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
753 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
754
bb187662
EZ
7552011-09-17 Eli Zaretskii <eliz@gnu.org>
756
1137e8b8 757 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 758 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
759
760 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
761 (bidi_find_paragraph_start): Search back for paragraph beginning
762 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
763 (bidi_move_to_visually_next): Only trigger paragraph-related
764 computations when the last character is a newline or at EOB, not
765 just any NEUTRAL_B. (Bug#9470)
766
bb187662
EZ
767 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
768 truncated lines if point is covered by a display string. (Bug#9524)
769
2e621251
PE
7702011-09-16 Paul Eggert <eggert@cs.ucla.edu>
771
772 * xselect.c: Relax test for outgoing X longs (Bug#9498).
773 (cons_to_x_long): New function.
774 (lisp_data_to_selection_data): Use it. Correct the test for
775 short-versus-long data; it was negated. Break out of vector
776 loop, for efficiency, when a long datum is discovered.
777
91a15bc6
SM
7782011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
779
780 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
781
b41c3a35
EZ
7822011-09-16 Eli Zaretskii <eliz@gnu.org>
783
784 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
785 GCC PR/17406) by declaring this function with external scope.
786
7812ba2d
PE
7872011-09-15 Paul Eggert <eggert@cs.ucla.edu>
788
789 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
790 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
791
cf7edc2a
AS
7922011-09-15 Andreas Schwab <schwab@linux-m68k.org>
793
794 * editfns.c (Fformat): Correctly handle text properties on "%%".
795
bd01620e
EZ
7962011-09-15 Eli Zaretskii <eliz@gnu.org>
797
798 * xterm.c (x_draw_composite_glyph_string_foreground):
799 * w32term.c (x_draw_composite_glyph_string_foreground):
800 * term.c (encode_terminal_code):
801 * composite.c (composition_update_it, get_composition_id):
802 * xdisp.c (get_next_display_element)
803 (fill_composite_glyph_string): Add comments about special meaning
804 of TAB characters in a composition.
805
a02719a3
PE
8062011-09-15 Paul Eggert <eggert@cs.ucla.edu>
807
808 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
809 This occurs when processing a multibyte format.
810 Problem reported by Wolfgang Jenker.
a02719a3 811
72589a3c
JB
8122011-09-15 Johan Bockgård <bojohan@gnu.org>
813
814 * xdisp.c (try_cursor_movement): Only check for exact match if
815 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
816
1c14176c
PE
8172011-09-14 Paul Eggert <eggert@cs.ucla.edu>
818
819 Remove unused external symbols.
820 * dispextern.h (calc_pixel_width_or_height): Remove decl.
821 * xdisp.c (calc_pixel_width_or_height): Now static.
822 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
823 * indent.c (check_display_width):
824 * w32term.c: Fix comment to match code.
825 * xterm.c, xterm.h (x_catching_errors): Remove.
826
d2eea5b5
PE
8272011-09-14 Paul Eggert <eggert@cs.ucla.edu>
828
829 * xselect.c: Use signed conversions more consistently (Bug#9498).
830 (selection_data_to_lisp_data): Assume incoming selection data are
831 signed integers, not unsigned. This is to be consistent with
832 outgoing selection data, which was modified to use signed integers
833 in as part of the fix to Bug#9196 in response to Jan D.'s comment
834 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
835 expects long, not unsigned long.
836
46888499
EZ
8372011-09-14 Eli Zaretskii <eliz@gnu.org>
838
839 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
840 computation of loop end. Reported by Johan Bockgård
841 <bojohan@gnu.org>.
842
ef8ef9fb
CY
8432011-09-13 Chong Yidong <cyd@stupidchicken.com>
844
845 * frame.c (Fother_visible_frames_p): Function deleted.
846
fa819fed
EZ
8472011-09-12 Eli Zaretskii <eliz@gnu.org>
848
849 * indent.c (compute_motion): Process display vector front to back
850 rather than the other way around. (Bug#2496)
851
2ba8e008
SM
8522011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
853
854 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
855
20f53c69
CY
8562011-09-11 Chong Yidong <cyd@stupidchicken.com>
857
858 * minibuf.c (Fread_from_minibuffer): Doc fix.
859
d562d7a4
EZ
8602011-09-11 Eli Zaretskii <eliz@gnu.org>
861
862 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
863 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
864
1c4d7f3d
LMI
8652011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
866
867 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
868 value for non-existent files.
869
b885bf36
EZ
8702011-09-11 Eli Zaretskii <eliz@gnu.org>
871
872 * fileio.c (Finsert_file_contents): If the file cannot be opened,
873 set its "size" to -1. This will set the modtime_size field of
874 the corresponding buffer to -1, which is what
875 verify-visited-file-modtime expects for files that do not exist.
876 (Bug#9139)
877
6612f0bf
PE
8782011-09-11 Paul Eggert <eggert@cs.ucla.edu>
879
880 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
881 here ...
882 * lisp.h: ... from here. push_key_description is no longer
883 defined in keyboard.c, so its declaration should not be in
884 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
885 logically belongs with push_key_description.
886
dfb3f755
PE
8872011-09-10 Paul Eggert <eggert@cs.ucla.edu>
888
889 * buffer.h: Include <sys/types.h> instead of <time.h>.
890 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
891 Problem reported by Herbert J. Skuhra.
892
3134906c
LMI
8932011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
894
895 * xml.c (parse_region): Make the parsing work for
896 non-comment-starting XML files again (bug#9144).
897
8d903f4e
AS
8982011-09-10 Andreas Schwab <schwab@linux-m68k.org>
899
900 * image.c (gif_load): Fix calculation of bottom and right corner.
901 (Bug#9468)
902
80ad64f4
EZ
9032011-09-10 Eli Zaretskii <eliz@gnu.org>
904
905 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
906 redisplay in small windows.
907
208a048d
EZ
9082011-09-09 Eli Zaretskii <eliz@gnu.org>
909
910 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
911
9b1c252e
MR
9122011-09-08 Martin Rudalics <rudalics@gmx.at>
913
914 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
915 Operate on live windows only.
916
2949f33b
JB
9172011-09-08 Juanma Barranquero <lekktu@gmail.com>
918
919 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
920
e08dcafd
EZ
9212011-09-07 Eli Zaretskii <eliz@gnu.org>
922
923 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
924 only under bidi iteration.
925
115b96bd
JD
9262011-09-07 Jan Djärv <jan.h.d@swipnet.se>
927
928 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
929
c8199d0f
PE
9302011-09-06 Paul Eggert <eggert@cs.ucla.edu>
931
932 isnan: Fix porting problem to Solaris 10 with bundled gcc.
933 Without this fix, the command to link temacs failed due to an
934 undefined symbol __builtin_isnan. This is because
935 /usr/include/iso/math_c99.h #defines isnan(x) to
936 __builtin_isnan(x), but the bundled gcc, which identifies itself
937 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
938 a __builtin_isnan.
939 * floatfns.c (isnan): #undef, and then #define to a clone of
940 what's in data.c.
941 (Fisnan): Always define, since it's always available now.
942 (syms_of_floatfns): Always define isnan at the Lisp level.
943
e39b275c 9442011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
945
946 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
947
b2db44d9 9482011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 949
f4af5137 950 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
951 The previous code assumed that file offsets (off_t values) fit in
952 EMACS_INT variables, which is not true on typical 32-bit hosts.
953 The code messed up by falsely reporting buffer overflow in cases
954 such as (insert-file-contents "big" nil 1 2) into an empty buffer
955 when "big" contains more than 2**29 bytes, even though this
956 inserts just one byte and does not overflow the buffer.
957 (Finsert_file_contents): Store file offsets as off_t
958 values, not as EMACS_INT values. Check for overflow when
959 converting between EMACS_INT and off_t. When checking for
960 buffer overflow or for overlap, take the offsets into account.
961 Don't use EMACS_INT for small values where int suffices.
962 When checking for overlap, fix a typo: ZV was used where
963 ZV_BYTE was intended.
964 (Fwrite_region): Don't assume off_t fits into 'long'.
965 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
966
ecfc0a49
MA
9672011-09-05 Michael Albinus <michael.albinus@gmx.de>
968
969 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
970
6511acf2 9712011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 972
0999621a 973 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
974
975 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 976 (esprintf, exprintf, evxprintf): New functions.
62f19c19 977 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 978 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
979 (modify_event_symbol): Do not assume that the length of
980 name_alist_or_stem is safe to alloca and fits in int.
981 (Fexecute_extended_command): Likewise for function name and binding.
982 (Frecursion_depth): Wrap around reliably on integer overflow.
983 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
984 since some callers pass EMACS_INT values.
985 (Fsingle_key_description): Don't crash if symbol name contains more
986 than MAX_ALLOCA bytes.
987 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
988 (get_minibuffer): Arg is now EMACS_INT, not int.
989 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 990 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
991 * window.h (command_loop_level, minibuf_level): Reflect API changes.
992
2be7d702
PE
993 * dbusbind.c (signature_cat): New function.
994 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
995 Do not overrun buffer; instead, report string overflow.
996
9d1df220
PE
997 * dispnew.c (add_window_display_history): Don't overrun buffer.
998 Truncate instead; this is OK since it's just a log.
999
33ef5c64
PE
1000 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
1001 even if the time zone offset is outlandishly large.
1002 Don't mishandle offset == INT_MIN.
1003
66c6fdd5
PE
1004 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
1005 when creating daemon; the previous buffer-overflow check was incorrect.
1006
d749b01b
PE
1007 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
1008 which has the guts of the old verror function.
1009
b5cd1905
PE
1010 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
1011 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
1012
6e1a67fb
PE
1013 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
1014 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 1015 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 1016 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
1017 length of string rather than counting it via multiple sprintfs;
1018 that's simpler and more reliable.
c21721cc
PE
1019 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
1020 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
1021 sprintf, in case result does not fit in int.
1022
c57b67fc
PE
1023 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
1024 (fontset_from_font): Print it.
1025
8a401434
PE
1026 * frame.c (tty_frame_count): Now printmax_t, not int.
1027 (make_terminal_frame, set_term_frame_name): Print it.
1028 (x_report_frame_params): In X, window IDs are unsigned long,
1029 not signed long, so print them as unsigned.
1030 (validate_x_resource_name): Check for implausibly long names,
1031 and don't assume name length fits in 'int'.
1032 (x_get_resource_string): Don't blindly alloca invocation name;
1033 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
1034 not fit in int.
1035
6e1a67fb
PE
1036 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
1037 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
1038 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
1039
0df02bf3
PE
1040 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
1041 Use esprintf, not sprintf, in case result does not fit in int.
1042
48e30793
PE
1043 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
1044 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
1045 it as a large positive number.
1046 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
1047 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
1048
a66ff6d8
PE
1049 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
1050 in case result does not fit in int.
1051
aca216ff
PE
1052 * print.c (float_to_string): Detect width overflow more reliably.
1053 (print_object): Make sprintf buffer a bit bigger, to avoid potential
1054 buffer overrun. Don't assume list length fits in 'int'. Treat
1055 print length of 0 as 0, not as infinity; to be consistent with other
1056 uses of print length in this function. Don't overflow print length
1057 index. Don't assume hash table size fits in 'long', or that
1058 vectorlike size fits in 'unsigned long'.
1059
31c286f7
PE
1060 * process.c (make_process): Use printmax_t, not int, to format
1061 process-name gensyms.
1062
55e5faa1
PE
1063 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
1064
80f2e268
PE
1065 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
1066 to avoid potential buffer overrun.
1067
670741ab
PE
1068 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
1069 if X resource line is longer than 512 bytes.
1070
b7163a50
PE
1071 * xfns.c (x_window): Make sprintf buffer a bit bigger
1072 to avoid potential buffer overrun.
1073
ae58ff1f
PE
1074 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
1075
c43c8a6a
PE
1076 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
1077
3f8236f4
PE
10782011-09-04 Paul Eggert <eggert@cs.ucla.edu>
1079
53e9fe90 1080 Integer overflow fixes for scrolling, etc.
6511acf2
PE
1081 Without these, Emacs silently mishandles large integers sometimes.
1082 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
1083 it were "C-u 1 M-x recenter" on a typical 64-bit host.
1084
6511acf2
PE
1085 * xdisp.c (try_window_id): Check Emacs fixnum range before
1086 converting to 'int'.
806add1d 1087
6511acf2 1088 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
1089 Check that an Emacs fixnum is in range before assigning it to 'int'.
1090 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
1091 values converted from Emacs fixnums.
1092 (Frecenter): Don't wrap around a line count if it is out of 'int'
1093 range; instead, treat it as an extreme value.
1094 (Fset_window_configuration, compare_window_configurations):
1095 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
1096
6511acf2
PE
1097 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
1098 that can exceed INT_MAX. Check that EMACS_INT value is in range
1099 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
1100 (match_limit): Don't assume that a fixnum can fit in 'int'.
1101
6511acf2 1102 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
1103 exceed INT_MAX.
1104
6511acf2 1105 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
1106 (Fvertical_motion): Don't wrap around LINES values that don't fit
1107 in 'int'. Instead, treat them as extreme values. This is good
1108 enough for windows, which can't have more than INT_MAX lines anyway.
1109
fcb901a7
LMI
11102011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
1111
0f2f6b6d
LMI
1112 * Require libxml/parser.h to avoid compilation warning.
1113
fcb901a7
LMI
1114 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
1115
1116 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
1117 since this reportedly can destroy thread storage.
1118
6e20a0d4
CY
11192011-08-30 Chong Yidong <cyd@stupidchicken.com>
1120
1121 * syntax.c (find_defun_start): Update all cache variables if
1122 exiting early (Bug#9401).
1123
148ae00e
EZ
11242011-08-30 Eli Zaretskii <eliz@gnu.org>
1125
f6cfbd8f
EZ
1126 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
1127
148ae00e
EZ
1128 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
1129 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
1130 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
1131
1132 * term.c (tty_append_glyph): New function.
1133 (produce_stretch_glyph): Static function and its prototype deleted.
1134
a66cfb1c
SM
1135 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
1136 Add prototypes.
148ae00e 1137
c4a07a4c
PE
11382011-08-29 Paul Eggert <eggert@cs.ucla.edu>
1139
1140 * image.c (parse_image_spec): Check for nonnegative, not for positive,
1141 when checking :margin (Bug#9390).
1142 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 1143 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
1144 so that the name doesn't mislead. All uses changed.
1145
6bc8cd65
JB
11462011-08-28 Johan Bockgård <bojohan@gnu.org>
1147
1148 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
1149 set_tty_hooks.
1150
dca4927e
EZ
11512011-08-27 Eli Zaretskii <eliz@gnu.org>
1152
1153 * xdisp.c (move_it_to): Don't bail out early when reaching
1154 position beyond to_charpos, if we are scanning backwards.
1155 (move_it_vertically_backward): When DY == 0, make sure we get to
1156 the first character in the line after the newline.
1157
f2cad773
PE
11582011-08-27 Paul Eggert <eggert@cs.ucla.edu>
1159
1160 * ccl.c: Improve and simplify overflow checking (Bug#9196).
1161 (ccl_driver): Do not generate an out-of-range pointer.
1162 (Fccl_execute_on_string): Remove unnecessary check for
1163 integer overflow, noted by Stefan Monnier in
1164 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
1165 Remove a FIXME that didn't need fixing.
1166 Simplify the newly-introduced buffer reallocation code.
1167
0cae2cdb
JB
11682011-08-27 Juanma Barranquero <lekktu@gmail.com>
1169
1170 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
1171
5fc295a4 11722011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 1173
70c60eb2 1174 Integer and memory overflow issues (Bug#9196).
726e0ab1 1175
d31850da
PE
1176 * doc.c (get_doc_string): Rework so that
1177 get_doc_string_buffer_size is the actual buffer size, rather than
1178 being 1 less than the actual buffer size; this makes xpalloc more
1179 convenient.
1180
a69fbedb
PE
1181 * image.c (x_allocate_bitmap_record, cache_image):
1182 * xselect.c (Fx_register_dnd_atom):
1183 Simplify previous changes by using xpalloc.
1184
fe5c5d37
PE
1185 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
1186 since either will do and ptrdiff_t is convenient with xpalloc.
1187
0065d054
PE
1188 * charset.c (charset_table_size)
1189 (struct charset_sort_data.priority): Now ptrdiff_t.
1190 (charset_compare): Don't overflow if priorities differ greatly.
1191 (Fsort_charsets): Don't assume list length fits in int.
1192 Check for size-calculation overflow when allocating sort data.
1193 (syms_of_charset): Allocate an initial charset table that is
1194 just under 64 KiB, to avoid problems with glibc malloc and mmap.
1195
1196 * cmds.c (internal_self_insert): Check for size-calculation overflow.
1197
1198 * composite.h (struct composition.glyph_len): Now int, not unsigned.
1199 The actual value is always <= INT_MAX, and leaving it unsigned made
1200 overflow checking harder.
1201
1202 * dispextern.h (struct glyph_matrix.rows_allocated)
1203 (struct face_cache.size): Now ptrdiff_t, for convenience in use
1204 with xpalloc. The values are still always <= INT_MAX.
1205
1206 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
1207
1208 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
1209 (SAFE_NALLOCA): New macro.
1210
1211 * region-cache.c (struct boundary.pos, find_cache_boundary)
1212 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
1213 (set_cache_region, invalidate_region_cache)
1214 (revalidate_region_cache, know_region_cache, region_cache_forward)
1215 (region_cache_backward, pp_cache):
1216 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
1217 so that ptrdiff_t * can be passed to xpalloc.
1218 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
1219 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
1220 (pp_cache): Don't assume cache_len fits in int.
1221 * region-cache.h: Adjust extern decls to match.
1222
1223 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
1224 EMACS_INT, since either will do, for xpalloc.
1225
1226 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
1227 (xnmalloc, xnrealloc, xpalloc): New functions.
1228
726e0ab1
PE
1229 * bidi.c (bidi_shelve_header_size): New constant.
1230 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
1231 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
1232
51f30bc5 1233 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
1234 * buffer.c (overlays_at, overlays_in, record_overlay_string)
1235 (overlay_strings):
1236 Don't update size of array until after memory allocation succeeds,
1237 because xmalloc/xrealloc may not return.
0065d054
PE
1238 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
1239 now that we have proper integer overflow checking.
1240 (record_overlay_string, overlay_strings): Catch overflows when
1241 calculating size of overlay_str_buf.
726e0ab1 1242
0065d054
PE
1243 * callproc.c (Fcall_process): Check for size overflow when
1244 calculating size of args2.
1245 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
1246 Normally we prefer signed values, but sticking with ptrdiff_t would
1247 require adding more-complicated checks.
726e0ab1
PE
1248
1249 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
1250 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
1251 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 1252 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
1253
1254 * character.c (Fstring): Check for size-calculation overflow.
1255
1256 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
1257 unnecessary integer overflow. Check for size overflow.
1258 (encode_coding_object): Don't update size until xmalloc succeeds.
1259
1260 * composite.c (get_composition_id): Check for overflow in glyph
1261 length calculations.
1262
1263 Integer and memory overflow fixes for display code.
1264 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
1265 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
1266 (scrolling_window): Check for overflow in size calculations.
1267 (line_draw_cost, realloc_glyph_pool, add_row_entry):
1268 Don't assume glyph table len fits in int.
1269 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
1270 (row_table_size): Now ptrdiff_t, not int.
1271 (scrolling_window): Avoid overflow in size calculations.
1272 Don't update size until allocation succeeds.
1273 * fns.c (concat): Check for overflow in size calculations.
1274 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
1275 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
1276 (NEXT_ALMOST_PRIME_LIMIT): New constant.
1277
1278 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
1279 (get_doc_string): Check for size calculation overflow.
1280 Don't update size until allocation succeeds.
1281 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
1282 EMACS_INT, where ptrdiff_t will do.
1283 (Fsubstitute_command_keys): Check for string overflow.
1284
1285 * editfns.c (set_time_zone_rule): Don't assume environment length
1286 fits in int.
1287 (message_length): Now ptrdiff_t, not int.
1288 (Fmessage_box): Don't update size until allocation succeeds.
1289 Don't assume message length fits in int.
1290 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
1291
0065d054
PE
1292 * emacs.c (main): Do not reallocate argv, since there is a null at
1293 the end that can be overwritten, and this way there's no need to
1294 worry about size-calculation overflow.
1295 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
1296
1297 * eval.c (init_eval_once, grow_specpdl): Don't update size until
1298 alloc succeeds.
1299 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
1300
1301 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
1302 (x_set_scroll_bar_width, x_figure_window_size):
1303 Check for integer overflow.
1304 (x_set_alpha): Do not assume XINT fits in int.
1305
1306 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
1307 This is for the members text_lines, text_cols, total_lines, total_cols,
1308 where the system imposes an 'int' limit.
1309
1310 * fringe.c (Fdefine_fringe_bitmap):
1311 Don't update size until alloc works.
1312
1313 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
1314 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
1315
1316 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
1317 Check for size-calculation overflow.
1318 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
1319 do, as we prefer signed integers.
1320 (id_to_widget.max_size, id_to_widget.used)
1321 (xg_store_widget_in_map, xg_remove_widget_from_map)
1322 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
1323 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
1324 Use and return ptrdiff_t, not int.
1325 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
1326 * gtkutil.h: Change prototypes to match the above.
1327
1328 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
1329 are duplicate now that they've been promoted to lisp.h.
1330 (x_allocate_bitmap_record, x_alloc_image_color)
1331 (make_image_cache, cache_image, xpm_load):
1332 Don't update size until alloc is done.
1333 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
1334 (x_detect_edges):
3256efce 1335 Check for size calculation overflow.
726e0ab1
PE
1336 (ct_colors_allocated_max): New constant.
1337 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
1338 overflow.
3256efce 1339
726e0ab1
PE
1340 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
1341 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
1342 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
1343 Use ptrdiff_t, not int, to count maps.
1344 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
1345 calculations. Don't update size until allocation succeeds.
1346 Redo calculations to avoid overflow.
726e0ab1
PE
1347 * keyboard.h: Change prototypes to match the above.
1348
1349 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
1350 to count maps.
1351 (current_minor_maps): Check for size calculation overflow.
1352 * keymap.h: Change prototypes to match the above.
1353
1354 * lread.c (read1, init_obarray): Don't update size until alloc done.
1355
1356 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
1357 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
1358
726e0ab1
PE
1359 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
1360 Now ptrdiff_t, not int.
1361 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
1362 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
1363
1364 * process.c (Fnetwork_interface_list): Check for overflow
1365 in size calculation.
1366
1367 * region-cache.c (move_cache_gap): Check for size calculation overflow.
1368
1369 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
1370 overflow. Don't bother calling xmalloc when xrealloc will do.
1371
1372 * search.c (Freplace_match): Check for size calculation overflow.
1373 (Fset_match_data): Don't assume list lengths fit in 'int'.
1374
1375 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
1376 for command line length. Do not attempt to address one before the
1377 beginning of an array, as that's not portable.
1378
1379 * term.c (max_frame_lines): Remove; unused.
1380 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
1381 not int.
1382 (encode_terminal_code, calculate_costs): Check for size
1383 calculation overflow.
1384 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
1385 table lengths and related sizes. Don't update size until alloc
1386 done. Redo calculations to avoid overflow.
1387 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
1388
1389 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
1390 subtracting pointers.
1391 (gobble_line): Check for overflow more carefully. Don't update size
1392 until alloc done.
1393
1394 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
1395 Don't update size until alloc done.
1396 Redo size calculations to avoid overflow.
1397 Check for size calculation overflow.
0065d054 1398 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
1399
1400 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
1401 Use ptrdiff_t, not int, for sizes.
1402 (store_mode_line_noprop_char): Don't update size until alloc done.
1403
0065d054
PE
1404 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
1405 Use ptrdiff_t, not int, for sizes.
1406 (Finternal_make_lisp_face, cache_face):
1407 Check for size calculation overflow.
1408 (cache_face): Treat size calculation overflows as if they were
1409 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
1410
1411 * xfns.c (x_encode_text, x_set_name_internal)
1412 (Fx_change_window_property): Use ptrdiff_t, not int, to count
1413 sizes, since they can exceed INT_MAX in size. Check for size
1414 calculation overflow.
1415
0065d054
PE
1416 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
1417 (xg_select): Check for size calculation overflow.
726e0ab1
PE
1418 Don't update size until alloc done.
1419
0065d054 1420 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 1421 as sprintf is limited to int lengths.
1d526e2f 1422
252c5ee1
PE
1423 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
1424 (X_LONG_MIN): New macros.
864d7ce7
PE
1425 Use them to make the following changes clearer.
1426 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
1427 This change doesn't affect the value now, but it may help remind
1428 future maintainers not to raise the value too much later.
1429 (SELECTION_QUANTUM): Remove, replacing with ...
1430 (selection_quantum): ... new function, which avoids overflow.
1431 All uses changed.
1432 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
1433 assumption that selection length fits in 'int'.
1434 (x_reply_selection_request, x_handle_selection_request)
1435 (x_get_window_property, receive_incremental_selection)
1436 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
1437 (lisp_data_to_selection_data, clean_local_selection_data):
1438 Use ptrdiff_t, not int, to record length of selection.
1439 (x_reply_selection_request, x_get_window_property)
1440 (receive_incremental_selection, x_property_data_to_lisp):
1441 Redo calculations to avoid overflow.
1442 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 1443 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
1444 something.
1445 (x_get_window_property, receive_incremental_selection)
1446 (lisp_data_to_selection_data, x_property_data_to_lisp):
1447 Check for size-calculation overflow.
1448 (x_get_window_property, receive_incremental_selection)
1449 (lisp_data_to_selection_data, Fx_register_dnd_atom):
1450 Don't store size until memory allocation succeeds.
1451 (x_get_window_property): Plug memory leak on memory exhaustion.
1452 Don't double-block input; malloc is safe here. Don't assume 2**34
1453 - 4 fits in unsigned long. Add an xassert to check
1454 XGetWindowProperty overflow. Be more careful about overflow
1455 calculations, and distinguish size from memory overflow better.
1456 (receive_incremental_selection): When tracing, don't assume
1457 unsigned int is less than INT_MAX.
1458 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
1459 harmful) conversions of unsigned short to int.
1460 (lisp_data_to_selection_data): Don't assume that integers
1461 in the range -65535 through -1 fit in an X unsigned short.
1462 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
1463 result parameters unless successful. Rely on cons_to_unsigned
1464 to report problems with elements; the old code wasn't right anyway.
1465 (x_check_property_data): Check for int overflow; we cannot use
1466 a wider type due to X limits.
1467 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
1468
726e0ab1 1469 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 1470
0065d054
PE
1471 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
1472 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
1473 (x_color_cells): Don't store size until memory allocation succeeds.
1474 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 1475 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
1476 (x_term_init): Don't assume length fits in int (sprintf is limited
1477 to int size).
bc18e09d 1478
ebfa62c0
PE
1479 Use ptrdiff_t for composition IDs.
1480 * character.c (lisp_string_width):
1481 * composite.c (composition_table_size, n_compositions)
1482 (get_composition_id, composition_gstring_from_id):
1483 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
1484 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
1485 * window.c (Frecenter):
1486 Use ptrdiff_t, not int, for composition IDs.
1487 * composite.c (get_composition_id): Check for integer overflow.
1488 * composite.h: Adjust prototypes to match the above changes.
1489
d3411f89
PE
1490 Use ptrdiff_t for hash table indexes.
1491 * category.c (hash_get_category_set):
1492 * ccl.c (ccl_driver):
1493 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
1494 * coding.c (coding_system_charset_list, detect_coding_system):
1495 * coding.h (struct coding_system.id):
1496 * composite.c (get_composition_id, gstring_lookup_cache):
1497 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
1498 * image.c (xpm_get_color_table_h):
1499 * lisp.h (hash_lookup, hash_put):
1500 * minibuf.c (Ftest_completion):
1501 Use ptrdiff_t for hash table indexes, not int (which is too
1502 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
1503 32-bit --with-wide-int hosts).
1504
e097a6fa
PE
1505 * charset.c (Fdefine_charset_internal): Check for integer overflow.
1506 Add a FIXME comment about memory leaks.
1507 (syms_of_charset): Don't assume xmalloc returns.
1508
5637687f
PE
1509 Don't assume that stated character widths fit in int.
1510 * character.c (Fchar_width, c_string_width, lisp_string_width):
1511 * character.h (CHAR_WIDTH):
1512 * indent.c (MULTIBYTE_BYTES_WIDTH):
1513 Use sanitize_char_width to avoid undefined and/or bad behavior
1514 with outlandish widths.
a66cfb1c 1515 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
1516 now that we have two such functions. All uses changed.
1517 (sanitize_char_width): New inline function.
1518
a2271ba2
PE
1519 Don't assume that tab-width fits in int.
1520 * character.h (sanitize_width): New inline function.
1521 (SANE_TAB_WIDTH): New macro.
1522 (ASCII_CHAR_WIDTH): Use it.
1523 * indent.c (sane_tab_width): Remove. All uses replaced by
1524 SANE_TAB_WIDTH (current_buffer).
1525 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
1526
18c52557
PE
1527 * fileio.c: Integer overflow issues with file modes.
1528 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
1529
caeeedc1
PE
1530 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
1531 Remove unreachable code.
1532 (read_hex, load_charset_map_from_file): Check for integer overflow.
1533
50849c52
PE
1534 * xterm.c: don't go over XClientMessageEvent limit
1535 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
1536 (x_send_scroll_bar_event): Likewise. Check that the size does not
1537 exceed limits imposed by XClientMessageEvent, as well as the usual
1538 ptrdiff_t and size_t limits.
1539
b13995db
PE
1540 * keyboard.c: Overflow, signedness and related fixes.
1541 (make_lispy_movement): Use same integer type in forward decl
1542 that is used in the definition.
1543 (read_key_sequence, keyremap_step):
1544 Change bufsize argument back to int, undoing my 2011-03-30 change.
1545 We prefer signed types, and int is wide enough here.
1546 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
1547 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
1548 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
1549 length, not size_t. Use ptrdiff_t for index, not int.
1550 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
1551 possibility of integer overflow.
1552
13464394
PE
1553 Overflow, signedness and related fixes for images.
1554
1555 * dispextern.h (struct it.stack[0].u.image.image_id)
1556 (struct_it.image_id, struct image.id, struct image_cache.size)
1557 (struct image_cache.used, struct image_cache.ref_count):
1558 * gtkutil.c (update_frame_tool_bar):
1559 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
1560 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
1561 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
1562 * nsmenu.m (update_frame_tool_bar):
1563 * xdisp.c (calc_pixel_width_or_height):
1564 * xfns.c (image_cache_refcount):
1565 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
1566 on typical 64-bit hosts.
1567
1568 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
1569 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
1570 Omit unnecessary casts to int.
1571 (parse_image_spec): Check that integers fall into 'int' range
1572 when the callers expect that.
1573 (image_ascent): Redo ascent calculation to avoid int overflow.
1574 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
1575 (lookup_image): Remove unnecessary tests.
1576 (xbm_image_p): Locals are now of int, not EMACS_INT,
1577 since parse_image_check makes sure they fit into int.
1578 (png_load, gif_load, svg_load_image):
1579 Prefer int to unsigned where either will do.
1580 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
1581 old tiff_error_handler and tiff_warning_handler.
1582 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
1583 stack buffer overflows. It uses only the features of vsnprintf
1584 that are common to both POSIX and native Microsoft.
1585 (tiff_error_handler, tiff_warning_handler): Use it.
1586 (tiff_load, gif_load, imagemagick_load_image):
1587 Don't assume :index value fits in 'int'.
1588 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
1589 (imagemagick_load_image): Check that crop parameters fit into
1590 the integer types that MagickCropImage accepts. Don't assume
1591 Vimagemagick_render_type has a nonnegative value. Don't assume
1592 size_t fits in 'long'.
1593 (gs_load): Use printmax_t to print the widest integers possible.
1594 Check for integer overflow when computing image height and width.
1595
c11821d4
EZ
15962011-08-26 Eli Zaretskii <eliz@gnu.org>
1597
1598 * xdisp.c (redisplay_window): Don't force window start if point
1599 will be invisible in the resulting window. (Bug#9324)
1600
0c95fcf7
EZ
16012011-08-25 Eli Zaretskii <eliz@gnu.org>
1602
1603 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
1604 the display spec is of the form `(space ...)'.
1605 (handle_display_spec): Return the value returned by
1606 handle_single_display_spec, not just 1 or zero.
1607 (handle_single_display_spec): If the display spec is of the form
1608 `(space ...)', and specifies display in the text area, return 2
1609 rather than 1.
fee65a97 1610 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
1611 accurately, and prefer exact match for point under bidi.
1612 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
1613
1614 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
1615 into disp_prop; all users changed.
1616
1617 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
1618 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
1619 for the text covered by the display property.
1620
e4ed06f1
CY
16212011-08-25 Chong Yidong <cyd@stupidchicken.com>
1622
1623 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
1624 Change return value to nil.
1625 (Frecord_buffer): Delete unused function.
1626
f67cdd7f
EZ
16272011-08-24 Eli Zaretskii <eliz@gnu.org>
1628
5980d4c6
EZ
1629 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
1630 buffers, return left-to-right.
8610fe8b
EZ
1631 (set_cursor_from_row): Consider candidate row a win if its glyph
1632 represents a newline and point is on that newline. Fixes cursor
1633 positioning on the newline at EOL of R2L text within L2R
1634 paragraph, and vice versa.
1635 (try_cursor_movement): Check continued rows, in addition to
1636 continuation rows. Fixes unwarranted scroll when point enters a
1637 continued line of R2L text within an L2R paragraph, or vice versa.
1638 (cursor_row_p): Consider the case of point being equal to
1639 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
1640 from the end of a short line to the beginning of a continued line
1641 of R2L text within L2R paragraph.
1642 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
1643 composed characters.
5980d4c6 1644
f67cdd7f
EZ
1645 * bidi.c (bidi_check_type): Use xassert.
1646 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
1647 members.
1648
bca633fb
EZ
16492011-08-23 Eli Zaretskii <eliz@gnu.org>
1650
1651 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
1652 a character.
1653
4a5885a7
CY
16542011-08-23 Chong Yidong <cyd@stupidchicken.com>
1655
1656 * nsfont.m (ns_otf_to_script): Fix typo.
1657
0902a04e
KH
16582011-08-22 Kenichi Handa <handa@m17n.org>
1659
1660 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
1661 extra slot even if the purpose is char-code-property-table.
1662
1a2e6670
EZ
16632011-08-23 Eli Zaretskii <eliz@gnu.org>
1664
8ddde651
EZ
1665 * xdisp.c (redisplay_window): When computing centering_position,
1666 account for the height of the header line. (Bug#8874)
1667
425cc014
EZ
1668 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
1669 instead of CHAR_TO_BYTE. Fixes a crash when a completion
1670 candidate is selected by the mouse, and that candidate has a
1671 composed character under the mouse.
1672
1a2e6670
EZ
1673 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
1674 coordinates reported by pos-visible-in-window-p for a composed
1675 character in column zero.
1676
8b76d6f8
SM
16772011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
1678
1679 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
1680
dac347dd
EZ
16812011-08-22 Eli Zaretskii <eliz@gnu.org>
1682
1683 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
1684 consider it a hit if to_charpos is anywhere in the range of the
1685 composed buffer positions.
1686
e013fb34
CY
16872011-08-22 Chong Yidong <cyd@stupidchicken.com>
1688
1689 * image.c (gif_load): Don't assume that each subimage has the same
1690 dimensions as the base image. Handle disposal method that is
1691 "undefined" by the gif spec (Bug#9335).
1692
bd1ba3e8
CY
16932011-08-20 Chong Yidong <cyd@stupidchicken.com>
1694
1695 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 1696 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 1697
54a1215b
EZ
16982011-08-19 Eli Zaretskii <eliz@gnu.org>
1699
823564e5
EZ
1700 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
1701 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
1702 from an Org mode buffer to a Speedbar frame.
1703
54a1215b
EZ
1704 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
1705 a composition, take its buffer position from IT->cmp_it.charpos.
1706 Fixes cursor positioning at the beginning of a line that begins
1707 with a composed character.
1708
9778ebcc
EZ
17092011-08-18 Eli Zaretskii <eliz@gnu.org>
1710
0be6ee06
EZ
1711 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
1712 character bidirectional type, use STRONG_L instead. Fixes crashes
1713 in a buffer produced by `describe-categories'.
1714
9778ebcc
EZ
1715 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
1716 members before the level stack, so they would be saved and
1717 restored when copying iterator state. Fixes incorrect reordering
1718 around TABs covered by display properties.
1719
156bffbe
AS
17202011-08-18 Andreas Schwab <schwab@linux-m68k.org>
1721
6b02f655 1722 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 1723
72ad093b
CY
17242011-08-17 Chong Yidong <cyd@stupidchicken.com>
1725
1726 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
1727 (internal_condition_case_2, internal_condition_case_n):
1728 Remove unnecessary aborts (Bug#9081).
72ad093b 1729
35774242
EZ
17302011-08-17 Eli Zaretskii <eliz@gnu.org>
1731
1732 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
1733 has no `load' handler, try opening the file locally. (Bug#9311)
1734
db76dd85
KB
17352011-08-16 Ken Brown <kbrown@cornell.edu>
1736
1737 * gmalloc.c: Expand comment.
1738
b215eee5
EZ
17392011-08-16 Eli Zaretskii <eliz@gnu.org>
1740
1741 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
1742 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
1743
a4579d33
KB
17442011-08-16 Ken Brown <kbrown@cornell.edu>
1745
1746 Fix memory allocation problems in Cygwin build (Bug#9273).
1747
1748 * unexcw.c ( __malloc_initialized): Declare external variable.
1749 (fixup_executable): Force the dumped emacs to reinitialize malloc.
1750
8b76d6f8
SM
1751 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
1752 New variables.
a4579d33
KB
1753 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
1754 dumped emacs.
1755 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
1756 in the static heap.
1757 [CYGWIN] (special_realloc): New function.
1758 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
1759 requests to realloc storage in the static heap.
1760
3ebec551
PE
17612011-08-15 Paul Eggert <eggert@cs.ucla.edu>
1762
1763 * bidi.c (bidi_initialize): Remove unused local.
1764
9fd8be00
EZ
17652011-08-15 Eli Zaretskii <eliz@gnu.org>
1766
6b02f655
SM
1767 * bidimirror.h:
1768 * biditype.h: Remove file.
1769 * makefile.w32-in ($(BLD)/bidi.$(O)):
1770 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
1771
1772 * dispextern.h: Fix a typo in the comment to bidi_type_t.
1773
1774 * chartab.c: Improve commentary for the uniprop_table API.
1775
32413314
EZ
1776 * bidi.c (bidi_paragraph_init): Support zero value of
1777 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
1778 (bidi_initialize): Use uniprop_table instead of including
1779 biditype.h and bidimirror.h.
32413314 1780
9fd8be00
EZ
1781 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
1782 coordinates of the iterator when restoring from ppos_it.
1783 (Bug#9296)
1784
5cf2b69b
KH
17852011-08-14 Kenichi Handa <handa@m17n.org>
1786
1787 * process.c (create_process): Call setup_process_coding_systems
72ad093b 1788 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 1789
daf17d00
EZ
17902011-08-14 Eli Zaretskii <eliz@gnu.org>
1791
1792 * xdisp.c (move_it_in_display_line_to): Don't invoke
1793 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
1794 ppos_it. Fixes vertical cursor motion when line beginning is
1795 covered by an image. (Bug#9296)
1796
08e3161a
JD
17972011-08-14 Jan Djärv <jan.h.d@swipnet.se>
1798
1799 * nsterm.h (ns_run_ascript): Declare.
1800 (NSAPP_DATA2_RUNASSCRIPT): Define.
1801
1802 * nsfns.m (as_script, as_result, as_status): New static variables.
1803 (ns_run_ascript): New function.
5e617bc2 1804 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
1805 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
1806 the event loop. Get status from as_status (Bug#7276).
1807
1808 * nsterm.m (sendEvent): If event is NSApplicationDefined and
1809 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
1810 the event loop (Bug#7276).
1811
a3720aa2
AS
18122011-08-14 Andreas Schwab <schwab@linux-m68k.org>
1813
1814 * gnutls.c (QCgnutls_bootprop_priority)
1815 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
1816 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
1817 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
1818 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
1819 (QCgnutls_bootprop_verify_hostname_error)
1820 (QCgnutls_bootprop_callbacks_verify): Rename from
1821 Qgnutls_bootprop_..., all uses changed.
1822
1823 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
1824 uses changed.
1825
0a0d27fb
PE
18262011-08-14 Paul Eggert <eggert@cs.ucla.edu>
1827
19d5c50c
PE
1828 * xfaces.c (Qframe_set_background_mode): Now static.
1829 * dispextern.h (Qframe_set_background_mode): Remove decl.
1830
0a0d27fb
PE
1831 * process.c (Fnetwork_interface_info): Declare local only if needed.
1832
377538cb
JD
18332011-08-13 Jan Djärv <jan.h.d@swipnet.se>
1834
1835 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
1836 (Fnetwork_interface_list): Allocate in increments of bytes instead
1837 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
1838 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
1839 sockaddr.
1840 (struct ifflag_def): notrailers is smart on OSX.
1841 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
1842 Get hardware address with getifaddrs if available.
1843
08fff70c
EZ
18442011-08-12 Eli Zaretskii <eliz@gnu.org>
1845
1846 * xdisp.c (iterate_out_of_display_property): xassert that
1847 IT->position is set to within IT->object's boundaries. Break from
1848 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
1849 when IT->position is set up wrongly due to some bug.
1850 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
1851 (push_display_prop): Allow GET_FROM_STRING as IT->method on
1852 entry. Force push_it to save on the stack the current
1853 buffer/string position, to be restored by pop_it. Fix flags in
1854 the iterator structure wrt the object coming from a display
1855 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
1856 properties. (Bug#9284)
1857
7be1c708 18582011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 1859
7be1c708
CY
1860 * fontset.c (fontset_get_font_group): Add proper type checks.
1861 (Bug#9172)
aac0c6e3 1862
7be1c708 18632011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 1864
7be1c708
CY
1865 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
1866 and LC_VERSION_MIN_MACOSX.
1867 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
1868 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 1869
97bb72a6
EZ
18702011-08-08 Eli Zaretskii <eliz@gnu.org>
1871
1872 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
1873 no-display-properties-and-no-overlays under bidi display.
1874 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 1875 properties and overlays.
97bb72a6 1876
d5617611
CY
18772011-08-08 Chong Yidong <cyd@stupidchicken.com>
1878
37e11a63
CY
1879 * editfns.c (Fset_time_zone_rule): Document relationship with the
1880 setenv function.
1881
d5617611
CY
1882 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
1883 the font entity extracted from the cache (Bug#8109).
1884
58872834
CY
18852011-08-07 Chong Yidong <cyd@stupidchicken.com>
1886
1887 * composite.c (autocmp_chars): Don't reset point. That is done by
1888 restore_point_unwind (Bug#5984).
1889
75bfc667
JL
18902011-08-07 Juri Linkov <juri@jurta.org>
1891
1892 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
1893 to show the arg `TIME' instead of `TIMEVAL'.
1894
d1410150
EZ
18952011-08-06 Eli Zaretskii <eliz@gnu.org>
1896
1897 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
1898 display property strides EOL and includes a newline, as in
1899 longlines-mode. (Bug#9254)
75b771e4
EZ
1900 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
1901 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
1902
1903 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
1904 is non-zero, even if the data buffer is NULL. Fixes a crash in
1905 vertical-motion with longlines-mode. (Bug#9254)
1906
35928349
EZ
19072011-08-05 Eli Zaretskii <eliz@gnu.org>
1908
ec7cc85b
EZ
1909 * bidi.c <bidi_cache_total_alloc>: Now static.
1910 (bidi_initialize): Initialize bidi_cache_total_alloc.
1911
8b76d6f8 1912 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
1913 cache. (Bug#9221)
1914
1915 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
1916 amount allocated this far in `bidi_cache_total_alloc'.
1917 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
1918 non-zero, only free the data buffer without restoring the cache
1919 contents. All callers changed.
1920
1921 * dispextern.h (bidi_unshelve_cache): Update prototype.
1922
1923 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
1924 (move_it_in_display_line, move_it_to)
1925 (move_it_vertically_backward, move_it_by_lines): Replace the call
1926 to xfree to an equivalent call to bidi_unshelve_cache.
1927 (move_it_in_display_line_to): Fix logic of returning
412b6358 1928 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 1929
e2e2423b
EZ
19302011-08-05 Eli Zaretskii <eliz@gnu.org>
1931
1932 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
1933 came from a string character with a `cursor' property. (Bug#9229)
1934
ae9e757a
JD
19352011-08-04 Jan Djärv <jan.h.d@swipnet.se>
1936
1937 * Makefile.in (LIB_PTHREAD): New variable.
1938 (LIBES): Add LIB_PTHREAD (Bug#9216).
1939
1940 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
1941 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
1942
213bd7f2
AS
19432011-08-04 Andreas Schwab <schwab@linux-m68k.org>
1944
6b02f655 1945 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 1946
99aaf75f
JD
19472011-08-04 Jan Djärv <jan.h.d@swipnet.se>
1948
1949 * xterm.c (x_find_topmost_parent): New function.
1950 (x_set_frame_alpha): Find topmost parent window with
1951 x_find_topmost_parent and set the property there also (bug#9181).
1952 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
1953
c74e9d86
PE
19542011-08-04 Paul Eggert <eggert@cs.ucla.edu>
1955
1956 * callproc.c (Fcall_process): Avoid vfork clobbering
1957 the local vars buffer, coding_systems, current_dir.
1958
640c8776
SM
19592011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
1960
1961 * keymap.c (Fmake_composed_keymap): Move to subr.el.
1962
f26d0e4c
PE
19632011-08-03 Paul Eggert <eggert@cs.ucla.edu>
1964
8a10d76c
PE
1965 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
1966 so that it is not optimized away.
1967
f26d0e4c
PE
1968 * xdisp.c (compute_display_string_pos): Remove unused local.
1969
55439c61
EZ
19702011-08-02 Eli Zaretskii <eliz@gnu.org>
1971
1972 Fix slow cursor motion and scrolling in large buffers with
1973 selective display, like Org Mode buffers. (Bug#9218)
1974
1975 * dispextern.h (struct bidi_it): New member disp_prop_p.
1976
1977 * xdisp.c: Remove one-slot cache of display string positions.
1978 (compute_display_string_pos): Accept an additional argument
5e617bc2 1979 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
1980 for a display string or property. If found, set DISP_PROP_P
1981 non-zero.
1982
1983 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
1984 DISP_PROP_P, and pass it to compute_display_string_pos.
1985 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
1986 non-zero. All callers of bidi_fetch_char changed.
1987
fb33fa43
SM
19882011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
1989
1990 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
1991
b099e063
DM
19922010-12-03 Don March <don@ohspite.net>
1993
1994 * keymap.c (Fdefine_key): Fix non-prefix key error message when
1995 last character M-[char] is translated to ESC [char] (bug#7541).
1996
5cc7f7af
KH
19972011-08-02 Kenichi Handa <handa@m17n.org>
1998
d0fffa3f 1999 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
2000
2001 * chartab.c (uniprop_table): Make it non-static.
2002
525d5e6e
EZ
20032011-08-01 Eli Zaretskii <eliz@gnu.org>
2004
2005 * xdisp.c (forward_to_next_line_start): Accept additional argument
2006 BIDI_IT_PREV, and store into it the state of the bidi iterator had
2007 on the newline.
2008 (reseat_at_next_visible_line_start): Use the bidi iterator state
2009 returned by forward_to_next_line_start to restore the state of
2010 it->bidi_it after backing up to previous newline. (Bug#9212)
2011
31011111
AS
20122011-07-30 Andreas Schwab <schwab@linux-m68k.org>
2013
2014 * regex.c (re_comp): Protoize.
2015 (re_exec): Fix return type.
2016 (regexec): Fix type of `ret'. (Bug#9203)
2017
476371c4
PE
20182011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2019
e5d76069
PE
2020 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
2021 This is needed if max-image-size is a floating-point number.
2022
9a79b20c
AS
20232011-07-28 Andreas Schwab <schwab@linux-m68k.org>
2024
2025 * print.c (print_object): Print empty symbol as ##.
2026
2027 * lread.c (read1): Read ## as empty symbol.
2028
d8c2fa78
AA
20292011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
2030
2031 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
2032 setting frame foreground color (Bug#9175).
2033 (x_set_background_color): Likewise.
2034
ffe57a7a
AA
2035 * nsmenu.m (-setText): Size tooltip dimensions precisely to
2036 contents (Bug#9176).
2037 (EmacsTooltip -init): Remove bezels and add shadows to
2038 tooltip windows.
2039
bf3492a5
AA
2040 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
2041 or scroll bar (Bug#8470).
2042
d55e9c53
AA
2043 * nsfont.m (nsfont_open): Remove assignment to voffset and
2044 unnecessary vars hshink, expand, hd, full_height, min_height.
2045 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
2046
2047 * nsterm.h (nsfont_info): Remove voffset field.
2048
d8c2fa78 20492011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
2050
2051 Implement strike-through and overline on NextStep (Bug#8863).
2052
2053 * nsfont.m (nsfont_open): Use underline position provided by font,
2054 instead of hard-coded value of 2.
2055 (nsfont_draw): Call ns_draw_text_decoration instead.
2056
2057 * nsterm.h: Add declaration for ns_draw_text_decoration.
2058
2059 * nsterm.m (ns_draw_text_decoration): New function for drawing
2060 underline, overline, and strike-through.
2061 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
2062 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 2063 accommodate underlining, etc.
4843aac3 2064
4cc60b9b
EZ
20652011-07-28 Eli Zaretskii <eliz@gnu.org>
2066
bc7ece87
EZ
2067 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
2068 default.
4cc60b9b 2069
476371c4
PE
20702011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2071
66606eea
PE
2072 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
2073 Without this fix, if a signal arrives just after memory fills up,
2074 'malloc' might be invoked reentrantly.
2075
476371c4
PE
2076 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
2077 In other words, assume that every image size is allowed, on non-X
2078 hosts. This assumption is probably wrong, but it lets Emacs compile.
2079
f3fcc40d
AS
20802011-07-28 Andreas Schwab <schwab@linux-m68k.org>
2081
2082 * regex.c (re_iswctype): Convert return values to boolean.
2083
350c992f
EZ
20842011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
2085
2086 * xdisp.c (compute_display_string_pos): Don't use cached display
2087 string position if the buffer had its restriction changed.
2088 (Bug#9184)
2089
5266b4bb
PE
20902011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2091
2092 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
2093
2573a837 20942011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 2095
41f55ccd 2096 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 2097
39e378da
PE
2098 * bidi.c: Integer size and overflow fixes.
2099 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
2100 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
2101 (bidi_cache_find_level_change, bidi_cache_ensure_space)
2102 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
2103 (bidi_find_other_level_edge):
2104 Use ptrdiff_t instead of EMACS_INT where either will do.
2105 This works better on 32-bit hosts configured --with-wide-int.
2106 (bidi_cache_ensure_space): Check for size-calculation overflow.
2107 Use % rather than repeated addition, for better worst-case speed.
2108 Don't set bidi_cache_size until after xrealloc returns, because it
2109 might not return.
2110 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
2111 (bidi_cache_ensure_space): Also check that the bidi cache size
2112 does not exceed that of the largest Lisp string or buffer. See Eli
2113 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 2114
5e927815
PE
2115 * alloc.c (__malloc_size_t): Remove.
2116 All uses replaced by size_t. See Andreas Schwab's note
2117 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
2118
ca4aa935
PE
2119 * image.c: Improve checking for integer overflow.
2120 (check_image_size): Assume that f is nonnull, since
2121 it is always nonnull in practice. This is one less thing to
2122 worry about when checking for integer overflow later.
2123 (x_check_image_size): New function, which checks for integer
2124 overflow issues inside X.
2125 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
2126 This removes the need for a memory_full check.
2127 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
2128 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
2129 (xbm_read_bitmap_data): Change locals back to 'int', since
2130 their values must fit in 'int'.
2131 (xpm_load_image, png_load, tiff_load):
2132 Invoke x_create_x_image_and_pixmap earlier,
2133 to avoid much needless work if the image is too large.
2134 (tiff_load): Treat overly large images as if
2135 x_create_x_image_and_pixmap failed, not as malloc failures.
2136 (gs_load): Use x_check_image_size.
2137
5f8f9cc2
PE
2138 * gtkutil.c: Omit integer casts.
2139 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
2140 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
2141
5adf60bc
PE
2142 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
2143
c8907a93
PE
2144 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
2145 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
2146 would wrongly return t on a 64-bit host.
2147
e3c25c68
PE
2148 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
2149 The plain *_OVERFLOW macros run afoul of GCC bug 49705
2150 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
2151 and therefore cause GCC to emit a bogus diagnostic in some cases.
2152
3f791afe
PE
2153 * image.c: Integer signedness and overflow and related fixes.
2154 This is not an exhaustive set of fixes, but it's time to
2155 record what I've got.
2156 (lookup_pixel_color, check_image_size): Remove redundant decls.
2157 (check_image_size): Don't assume that arbitrary EMACS_INT values
2158 fit in 'int', or that arbitrary 'double' values fit in 'int'.
2159 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
2160 (tiff_load, imagemagick_load_image):
2161 Check for overflow in size calculations.
2162 (x_create_x_image_and_pixmap): Remove unnecessary test for
2163 xmalloc returning NULL; that can't happen.
2164 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
2165 (xpm_color_bucket): Use better integer hashing function.
2166 (xpm_cache_color): Don't possibly over-allocate memory.
2167 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
2168 (gif_memory_source):
2169 Use ptrdiff_t, not int or size_t, to record sizes.
2170 (png_load): Don't assume values greater than 2**31 fit in 'int'.
2171 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
2172 either works, as we prefer signed integers.
2173 (tiff_read_from_memory, tiff_write_from_memory):
2174 Return tsize_t, not size_t, since that's what the TIFF API wants.
2175 (tiff_read_from_memory): Don't fail simply because the read would
2176 go past EOF; instead, return a short read.
2177 (tiff_load): Omit no-longer-needed casts.
2178 (Fimagemagick_types): Don't assume size fits into 'int'.
2179
3cc5a532
PE
2180 Improve hashing quality when configured --with-wide-int.
2181 * fns.c (hash_string): New function, taken from sxhash_string.
2182 Do not discard information about ASCII character case; this
2183 discarding is no longer needed.
2184 (sxhash-string): Use it. Change sig to match it. Caller changed.
2185 * lisp.h: Declare it.
2186 * lread.c (hash_string): Remove, since we now use fns.c's version.
2187 The fns.c version returns a wider integer if --with-wide-int is
2188 specified, so this should help the quality of the hashing a bit.
2189
b312a492
PE
2190 * emacs.c: Integer overflow minor fix.
2191 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
2192 Define only if GNU_LINUX.
2193 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
2194
dfd153ae
PE
2195 * dispnew.c: Integer signedness and overflow fixes.
2196 Remove unnecessary forward decls, that were a maintenance hassle.
2197 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
2198 All uses changed.
2199 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
2200 (scrolling_window): Use ptrdiff_t, not int, for byte count.
2201 (prepare_desired_row, line_draw_cost):
2202 Use int, not unsigned, where either works.
2203 (save_current_matrix, restore_current_matrix):
2204 Use ptrdiff_t, not size_t, where either works.
2205 (init_display): Check for overflow more accurately, and without
2206 relying on undefined behavior.
2207
a81d11a3
PE
2208 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
2209 Remove, replacing with the new symbols in lisp.h. All uses changed.
2210 * fileio.c (make_temp_name):
2211 * filelock.c (lock_file_1, lock_file):
2212 * xdisp.c (message_dolog):
2213 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
2214 Use pMd etc. instead.
2215 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
2216 replacing the pWIDE etc. symbols removed from editfns.c.
2217
3300e6fd
PE
2218 * keyboard.h (num_input_events): Now uintmax_t.
2219 This is (very slightly) less likely to mess up due to wraparound.
2220 All uses changed.
2221
fd05c7e9
PE
2222 * buffer.c: Integer signedness fixes.
2223 (alloc_buffer_text, enlarge_buffer_text):
2224 Use ptrdiff_t rather than size_t when either will do, as we prefer
2225 signed integers.
2226
903fe15d
PE
2227 * alloc.c: Integer signedness and overflow fixes.
2228 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
2229 (__malloc_size_t): Default to size_t, not to int.
2230 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
2231 (Fgarbage_collect, mark_object_loop_halt, mark_object):
2232 Prefer ptrdiff_t to size_t when either would do, as we prefer
2233 signed integers.
2234 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
2235 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
2236 Now const. Initialize with values that are in range even if char
2237 is signed.
2238 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
2239 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
2240 These functions do the right thing with sizes > 2**32.
2241 (check_depth): Now ptrdiff_t, not int.
2242 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
2243 Adjust to new way of storing sizes. Check for size overflow bugs
2244 in rest of code.
2245 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
2246 slightly wrong anyway, as it missed one instance of
2247 XMALLOC_OVERRUN_CHECK_OVERHEAD.
2248 (refill_memory_reserve): Omit needless cast to size_t.
2249 (mark_object_loop_halt): Mark as externally visible.
2250
ac82cc6a
PE
2251 * xselect.c: Integer signedness and overflow fixes.
2252 (Fx_register_dnd_atom, x_handle_dnd_message):
2253 Use ptrdiff_t, not size_t, since we prefer signed.
2254 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
2255 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
2256 x_dnd_atoms_size and x_dnd_atoms_length.
2257
c2d1e36d
PE
2258 * doprnt.c: Prefer signed to unsigned when either works.
2259 * eval.c (verror):
2260 * doprnt.c (doprnt):
2261 * lisp.h (doprnt):
2262 * xdisp.c (vmessage):
2263 Use ptrdiff_t, not size_t, when using or implementing doprnt,
2264 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
2265 prefer signed arithmetic to avoid comparison confusion.
2266 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
2267 but is a bit tricky.
2268
0e926e56
PE
2269 Assume freestanding C89 headers, string.h, stdlib.h.
2270 * data.c, doprnt.c, floatfns.c, print.c:
2271 Include float.h unconditionally.
2272 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
2273 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
2274 * regex.c: Likewise for stddef.h, string.h.
2275 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
2276 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
2277 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
2278 (STDC_HEADERS): Remove obsolete defines.
2279 * sysdep.c: Include limits.h unconditionally.
2280
9cfdb3ec
PE
2281 Assume support for memcmp, memcpy, memmove, memset.
2282 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
2283 * regex.c (memcmp, memcpy):
2284 Remove; we assume C89 now.
2285
2286 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
2287 (__malloc_safe_bcopy): Remove; no longer needed.
2288
cf950e6b 2289 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
2290 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
2291 well either way, and we prefer signed to unsigned.
2292
dbf38e02
LMI
22932011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
2294
2295 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
2296 closes the connection while we're reading (bug#9182).
2297
d6f0886c 22982011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 2299
d6f0886c
JD
2300 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
2301 are specified (Bug#9168).
24e0f6b1 2302
2eb1f9e6
PE
23032011-07-25 Paul Eggert <eggert@cs.ucla.edu>
2304
2305 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
2306 Found by GCC static checking and --with-wide-int on a 32-bit host.
2307
22381272 23082011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
2309
2310 * xdisp.c (compute_display_string_pos): Fix logic of caching
2311 previous display string position. Initialize cached_prev_pos to
2312 -1. Fixes slow-down at the beginning of a buffer.
2313
f25e39b4
EZ
23142011-07-24 Eli Zaretskii <eliz@gnu.org>
2315
2316 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
2317 for attrs[LFACE_FONTSET_INDEX].
2318
04c4b52e
PE
23192011-07-23 Paul Eggert <eggert@cs.ucla.edu>
2320
2321 * xml.c (parse_region): Remove unused local
2322 that was recently introduced.
2323
c1734fbd
EZ
23242011-07-23 Eli Zaretskii <eliz@gnu.org>
2325
be18c5a5
EZ
2326 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
2327 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
2328
c1734fbd
EZ
2329 * xdisp.c (move_it_in_display_line_to): Record the best matching
2330 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
2331 exit if none of the characters scanned was an exact match.
2332 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
2333 when exact match is impossible due to invisible text, and the
2334 lines are truncated.
2335
a258d627
JD
23362011-07-23 Jan Djärv <jan.h.d@swipnet.se>
2337
2338 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
2339 for OSX >= 10.7.
2340
b6d5a689
EZ
23412011-07-22 Eli Zaretskii <eliz@gnu.org>
2342
0f74f785
EZ
2343 Fix a significant slow-down of cursor motion with C-n, C-p,
2344 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
2345 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 2346 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
2347 (next_element_from_buffer): Call compute_stop_pos_backwards to
2348 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
2349 base_level_stop.
2350 (reseat): Don't look for prev_stop, as that could mean a very long
2351 run.
2352 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
2353 <cached_disp_overlay_modiff>: Cache for last found display string
2354 position.
551918c1 2355 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
2356 about the same buffer in the same area of character positions, and
2357 the buffer wasn't changed since the time the display string
2358 position was cached.
551918c1 2359
b2d0c91a
EZ
23602011-07-22 Eli Zaretskii <eliz@gnu.org>
2361
2362 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
2363 is an integer, which is important for empty lines. (Bug#9149)
2364
043604ee
CY
23652011-07-22 Chong Yidong <cyd@stupidchicken.com>
2366
2367 * frame.c (Fmodify_frame_parameters): In tty case, update the
2368 default face if necessary (Bug#4238).
2369
da4adb04
CY
23702011-07-21 Chong Yidong <cyd@stupidchicken.com>
2371
2372 * editfns.c (Fstring_to_char): No need to explain what a character
2373 is in the docstring (Bug#6576).
2374
9abd0532
LMI
23752011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
2376
2377 * xml.c (parse_region): Make sure we always return a tree.
2378
36881d16
HK
23792011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
2380
2381 * xml.c (parse_region): If a document contains only comments,
2382 return that, too.
2383
1e98674d
LMI
23842011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
2385
2386 * xml.c (make_dom): Return comments, too.
2387
590bd467
PE
23882011-07-19 Paul Eggert <eggert@cs.ucla.edu>
2389
2390 Port to OpenBSD.
2391 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
2392 and the surrounding thread.
2393 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
2394 rather than fgets, and retry after EINTR. Otherwise, 'emacs
2395 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
2396 timer goes off.
2397 * s/openbsd.h (BROKEN_SIGIO): Define.
2398 * unexelf.c (unexec) [__OpenBSD__]:
2399 Don't update the .mdebug section of the Alpha COFF symbol table.
2400
f41628b2
LMI
24012011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2402
2403 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
2404 (bug#8460).
2405
b59b67c5
PE
24062011-07-18 Paul Eggert <eggert@cs.ucla.edu>
2407
15e3a074
PE
2408 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
2409 This fixes some race conditions on the permissions of any newly
2410 created file.
2411
41bed37d
PE
2412 * alloc.c (valid_pointer_p): Use pipe, not open.
2413 This fixes some permissions issues when debugging.
2414
b59b67c5
PE
2415 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
2416 If fchown fails to set both uid and gid, try to set just gid,
2417 as that is sometimes allowed. Adjust the file's mode to eliminate
2418 setuid or setgid bits that are inappropriate if fchown fails.
2419
925a6be7
SM
24202011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2421
2422 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
2423 to compare Lisp_Objects.
2424 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
2425 global_gnutls_log_level, don't mistake it for a Lisp_Object.
2426 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
2427
52968808
AS
24282011-07-17 Andreas Schwab <schwab@linux-m68k.org>
2429
0a6a104b
AS
2430 * lread.c (read_integer): Unread even EOF character.
2431 (read1): Likewise. Properly record start position of symbol.
2432
52968808
AS
2433 * lread.c (read1): Read `#:' as empty uninterned symbol if no
2434 symbol character follows.
2435
9e381cdd
PE
24362011-07-17 Paul Eggert <eggert@cs.ucla.edu>
2437
2438 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
2439 This works around a problem with the previous change to Fcopy_file.
2440 Recent glibc declares fchown with __attribute__((warn_unused_result)),
2441 and without this change, GCC might complain about discarding
2442 fchown's return value.
2443
b5641435
JB
24442011-07-16 Juanma Barranquero <lekktu@gmail.com>
2445
2446 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
2447
a8031457
PE
24482011-07-16 Paul Eggert <eggert@cs.ucla.edu>
2449
2450 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
2451
dd889327
LMI
24522011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
2453
750c33f7
LMI
2454 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
2455 it's used from the C level.
2456
dd889327
LMI
2457 * process.c: Use the same condition for POLL_FOR_INPUT in both
2458 keyboard.c and process.c (bug#1858).
2459
87e86684
LM
24602011-07-09 Lawrence Mitchell <wence@gmx.li>
2461
2462 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
2463 (Fgnutls_boot): Use it.
2464
64348f40
AS
24652011-07-15 Andreas Schwab <schwab@linux-m68k.org>
2466
2467 * doc.c (Fsubstitute_command_keys): Revert last change.
2468
1d698799
LMI
24692011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
2470
f863868c
LMI
2471 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
2472 quotes the next character, and doesn't affect other longer
2473 sequences (bug#8935).
2474
1d698799
LMI
2475 * lread.c (syms_of_lread): Clarify that is isn't only
2476 `eval-buffer' and `eval-defun' that's affected by
2477 `lexical-binding' (bug#8460).
2478
aa4b6df6
EZ
24792011-07-15 Eli Zaretskii <eliz@gnu.org>
2480
2481 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 2482 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 2483
5d856da6
PE
24842011-07-14 Paul Eggert <eggert@cs.ucla.edu>
2485
ad6042bb
PE
2486 Fix minor problems found by static checking.
2487 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
2488 (elsz): Now a signed constant, not a size_t var. We prefer signed
2489 types to unsigned, to avoid integer comparison confusion. Without
2490 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
2491 "cannot optimize loop, the loop counter may overflow", a symptom
2492 of the confusion.
f00bbb22 2493 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
2494 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
2495
6468f31c
LMI
24962011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2497
49080b10
LMI
2498 * search.c (Fre_search_backward): Mention `case-fold-search' in
2499 all the re_search_* functions (bug#8138).
2500
6468f31c
LMI
2501 * keyboard.c (Fopen_dribble_file): Document when the file is
2502 closed (bug#8056).
2503
c965adc5
EZ
25042011-07-14 Eli Zaretskii <eliz@gnu.org>
2505
df9733bf
EZ
2506 * bidi.c (bidi_dump_cached_states): Fix format of displaying
2507 bidi_cache_idx.
2508
0bb23927
EZ
2509 Support bidi reordering of display and overlay strings.
2510 * xdisp.c (compute_display_string_pos)
2511 (compute_display_string_end): Accept additional argument STRING.
2512 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
2513 (reseat_to_string): Initialize bidi_it->string.s and
2514 bidi_it->string.schars.
2515 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
2516 NULL (avoids a crash in bidi_paragraph_init).
2517 Initialize itb.string.lstring.
0bb23927
EZ
2518 (init_iterator): Call bidi_init_it only of a valid
2519 buffer position was specified. Initialize paragraph_embedding to
2520 L2R.
2521 (reseat_to_string): Initialize the bidi iterator.
2522 (display_string): If we need to ignore text properties of
2523 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
2524 original value of -1 will not work with bidi.)
2525 (compute_display_string_pos): First arg is now struct
2526 `text_pos *'; all callers changed. Support display properties on
2527 Lisp strings.
2528 (compute_display_string_end): Support display properties on Lisp
2529 strings.
2530 (init_iterator, reseat_1, reseat_to_string): Initialize the
2531 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
2532 when iterating on a string not from display properties).
640c8776
SM
2533 (compute_display_string_pos, compute_display_string_end):
2534 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
2535 arrow keys.
2536 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
2537 base_level_stop; instead, set base_level_stop to BEGV.
2538 Fixes crashes in vertical-motion.
0bb23927
EZ
2539 (next_element_from_buffer): Improve commentary for when
2540 the iterator is before prev_stop.
2541 (init_iterator): Initialize bidi_p from the default value of
2542 bidi-display-reordering, not from buffer-local value. Use the
2543 buffer-local value only if initializing for buffer iteration.
2544 (handle_invisible_prop): Support invisible properties on strings
2545 that are being bidi-reordered.
2546 (set_iterator_to_next): Support bidi reordering of C strings and
2547 Lisp strings.
2548 (next_element_from_string): Support bidi reordering of Lisp
2549 strings.
2550 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
2551 (display_string): Support display of R2L glyph rows.
2552 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
2553 (init_iterator): Don't initialize it->bidi_p for strings
2554 here.
2555 (reseat_to_string): Initialize it->bidi_p for strings here.
2556 (next_element_from_string, next_element_from_c_string)
2557 (next_element_from_buffer): Add xassert's for correspondence
2558 between IT's object being iterated and it->bidi_it.string
2559 structure.
2560 (face_before_or_after_it_pos): Support bidi iteration.
2561 (next_element_from_c_string): Handle the case of the first string
2562 character that is not the first one in the visual order.
2563 (get_visually_first_element): New function, refactored from common
2564 parts of next_element_from_buffer, next_element_from_string, and
2565 next_element_from_c_string.
2566 (tool_bar_lines_needed, redisplay_tool_bar)
2567 (display_menu_bar): Force left-to-right direction. Add a FIXME
2568 comment for making that be controlled by a user option.
2569 (push_it, pop_it): Save and restore the state of the
2570 bidi iterator. Save and restore the bidi_p flag.
2571 (pop_it): Iterate out of display property for string iteration as
2572 well.
2573 (iterate_out_of_display_property): Support iteration over strings.
2574 (handle_single_display_spec): Set up it->bidi_it for iteration
2575 over a display string, and call bidi_init_it.
2576 (handle_single_display_spec, next_overlay_string)
2577 (get_overlay_strings_1, push_display_prop): Set up the bidi
2578 iterator for displaying display or overlay strings.
2579 (forward_to_next_line_start): Don't use the shortcut if
2580 bidi-iterating.
2581 (back_to_previous_visible_line_start): If handle_display_prop
2582 pushed the iterator stack, restore the internal state of the bidi
2583 iterator by calling bidi_pop_it same number of times.
2584 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
2585 and we are bidi-iterating, don't decrement the iterator position;
2586 instead, set the first_elt flag in the bidi iterator, to produce
2587 the same effect.
2588 (reseat_1): Remove redundant setting of string_from_display_prop_p.
2589 (push_display_prop): xassert that we are iterating a buffer.
2590 (push_it, pop_it): Save and restore paragraph_embedding member.
2591 (handle_single_display_spec, next_overlay_string)
2592 (get_overlay_strings_1, reseat_1, reseat_to_string)
2593 (push_display_prop): Set up the `unibyte' member of bidi_it.string
2594 correctly. Don't assume unibyte strings are not bidi-reordered.
2595 (compute_display_string_pos)
2596 (compute_display_string_end): Fix handling the case of C string.
2597 (push_it, pop_it): Save and restore from_disp_prop_p.
2598 (handle_single_display_spec, push_display_prop): Set the
2599 from_disp_prop_p flag.
2600 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
2601 (pop_it): Call iterate_out_of_display_property only if we are
2602 popping after iteration over a string that came from a display
2603 property. Fix a typo in popping stretch info. Add an assertion
2604 for verifying that the iterator position is in sync with the bidi
2605 iterator.
2606 (handle_single_display_spec, get_overlay_strings_1)
2607 (push_display_prop): Fix initialization of paragraph direction for
2608 string when that of the parent object is not yet determined.
2609 (reseat_1): Call bidi_init_it to resync the bidi
2610 iterator with IT's position. (Bug#7616)
2611 (find_row_edges): If ROW->start.pos gives position
2612 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
2613 (handle_stop, back_to_previous_visible_line_start, reseat_1):
2614 Reset the from_disp_prop_p flag.
2615 (SAVE_IT, RESTORE_IT): New macros.
2616 (pos_visible_p, face_before_or_after_it_pos)
2617 (back_to_previous_visible_line_start)
2618 (move_it_in_display_line_to, move_it_in_display_line)
2619 (move_it_to, move_it_vertically_backward, move_it_by_lines)
2620 (try_scrolling, redisplay_window, display_line): Use them when
2621 saving a temporary copy of the iterator and restoring it back.
2622 (back_to_previous_visible_line_start, reseat_1)
2623 (init_iterator): Empty the bidi cache "stack".
2624 (move_it_in_display_line_to): If iterator ended up at
2625 EOL, but we never saw any buffer positions smaller than
2626 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
2627 motion in bidi-reordered lines.
2628 (move_it_in_display_line_to): Record prev_method and prev_pos
2629 immediately before the call to set_iterator_to_next. Fixes cursor
2630 motion in bidi-reordered lines with stretch glyphs and strings
2631 displayed in margins. (Bug#8133) (Bug#8867)
2632 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
2633 TO_CHARPOS.
640c8776
SM
2634 (pos_visible_p): Support positions in bidi-reordered lines.
2635 Save and restore bidi cache.
0bb23927
EZ
2636
2637 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
2638 (bidi_paragraph_info): Delete unused struct.
2639 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
2640 (bidi_cache_start): New variable.
2641 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
2642 to zero.
2643 (bidi_cache_fetch_state, bidi_cache_search)
2644 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2645 (bidi_cache_find, bidi_peek_at_next_level)
2646 (bidi_level_of_next_char, bidi_find_other_level_edge)
2647 (bidi_move_to_visually_next): Compare cache index with
2648 bidi_cache_start rather than with zero.
2649 (bidi_fetch_char): Accept new argument STRING; all callers
2650 changed. Support iteration over a string. Support strings with
2651 display properties. Support unibyte strings. Fix the type of
2652 `len' according to what STRING_CHAR_AND_LENGTH expects.
2653 (bidi_paragraph_init, bidi_resolve_explicit_1)
2654 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
2655 (bidi_level_of_next_char, bidi_move_to_visually_next):
2656 Support iteration over a string.
0bb23927
EZ
2657 (bidi_set_sor_type, bidi_resolve_explicit_1)
2658 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
2659 can now be zero (for strings); special values 0 and -1 were
2660 changed to -1 and -2, respectively.
2661 (bidi_char_at_pos): New function.
2662 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
2663 Call it instead of FETCH_MULTIBYTE_CHAR.
2664 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
2665 initialized to valid values.
2666 (bidi_init_it): Don't initialize charpos and bytepos with invalid
2667 values.
2668 (bidi_level_of_next_char): Allow the sentinel "position" to pass
2669 the test for valid cached positions. Fix the logic for looking up
2670 the sentinel state in the cache. GCPRO the Lisp string we are
2671 iterating.
2672 (bidi_push_it, bidi_pop_it): New functions.
2673 (bidi_initialize): Initialize the bidi cache start stack pointer.
2674 (bidi_cache_ensure_space): New function, refactored from part of
2675 bidi_cache_iterator_state. Don't assume the required size is just
2676 one BIDI_CACHE_CHUNK away.
2677 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
2678 (bidi_count_bytes, bidi_char_at_pos): New functions.
2679 (bidi_cache_search): Don't assume bidi_cache_last_idx is
2680 always valid if bidi_cache_idx is valid.
2681 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
2682 is valid if it's going to be used.
2683 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
2684 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
2685 (bidi_cache_find_level_change, bidi_cache_ensure_space)
2686 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
2687 (bidi_find_other_level_edge, bidi_cache_start_stack):
2688 All variables related to cache indices are now EMACS_INT.
c965adc5 2689
0bb23927
EZ
2690 * dispextern.h (struct bidi_string_data): New structure.
2691 (struct bidi_it): New member `string'. Make flag members be 1-bit
2692 fields, and put them last in the struct.
640c8776
SM
2693 (compute_display_string_pos, compute_display_string_end):
2694 Update prototypes.
0bb23927
EZ
2695 (bidi_push_it, bidi_pop_it): Add prototypes.
2696 (struct iterator_stack_entry): New members bidi_p,
2697 paragraph_embedding, and from_disp_prop_p.
2698 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
2699 (bidi_shelve_cache, bidi_unshelve_cache):
2700 Declare prototypes.
0bb23927
EZ
2701
2702 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
2703 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
2704 and vector-like objects.
2705
2706 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
2707 cache around display iteration.
2708
2709 * window.c (Fwindow_end, window_scroll_pixel_based)
2710 (displayed_window_lines, Frecenter): Save and restore the bidi
2711 cache around display iteration.
2712
3bbd2265
LMI
27132011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2714
2715 * editfns.c (Fdelete_region): Clarify the use of the named
2716 parameters (bug#6788).
2717
adc47434
MR
27182011-07-14 Martin Rudalics <rudalics@gmx.at>
2719
2720 * indent.c (Fvertical_motion): Set and restore w->pointm when
2721 saving and restoring the window's buffer (Bug#9006).
2722
837c31f8
LMI
27232011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
2724
2725 * editfns.c (Fstring_to_char): Clarify just what is returned
2726 (bug#6576). Text by Eli Zaretskii.
2727
ac389d0c
JB
27282011-07-13 Juanma Barranquero <lekktu@gmail.com>
2729
2730 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
2731
0be0ce47
EZ
27322011-07-13 Eli Zaretskii <eliz@gnu.org>
2733
2734 * buffer.c (mmap_find): Fix a typo.
2735
cd18e7e3
JB
27362011-07-13 Johan Bockgård <bojohan@gnu.org>
2737
2738 Fix execution of x selection hooks.
2739 * xselect.c (Qx_lost_selection_functions)
2740 (Qx_sent_selection_functions): New vars.
2741 (syms_of_xselect): DEFSYM them.
2742 (x_handle_selection_request): Pass Qx_sent_selection_functions
2743 rather than Vx_sent_selection_functions to Frun_hook_with_args.
2744 (x_handle_selection_clear,x_clear_frame_selections):
2745 Pass Qx_lost_selection_functions rather than
2746 Vx_lost_selection_functions to Frun_hook_with_args.
2747
47ea7f44
PE
27482011-07-13 Paul Eggert <eggert@cs.ucla.edu>
2749
ac389d0c 2750 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
2751 The old code sometimes used this field without initializing it.
2752
47ea7f44
PE
2753 * alloc.c (gc_sweep): Don't read past end of array.
2754 In theory, the old code could also have corrupted Emacs internals,
2755 though it'd be very unlikely.
2756
bc985c87
AS
27572011-07-12 Andreas Schwab <schwab@linux-m68k.org>
2758
2759 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 2760 argument. (Bug#4026)
bc985c87 2761
0cf34688
LMI
27622011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2763
b3dadd76
LMI
2764 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
2765 key" (bug#4257).
2766
0cf34688
LMI
2767 * window.c (Fset_window_start): Doc fix (bug#4199).
2768 (Fset_window_hscroll): Ditto.
2769
270768cd
PE
27702011-07-12 Paul Eggert <eggert@cs.ucla.edu>
2771
077e3dda 2772 Fix minor new problems caught by GCC 4.6.1.
270768cd 2773 * term.c (init_tty): Remove unused local.
490011a6 2774 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 2775 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 2776 not used otherwise.
270768cd 2777
b1f58454
CY
27782011-07-12 Chong Yidong <cyd@stupidchicken.com>
2779
2780 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
2781
22b9578d
LMI
27822011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
2783
6e70ab07
LMI
2784 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
2785 are the mini-buffer and the echo area (bug#3320).
2786
22b9578d
LMI
2787 * term.c (init_tty): Remove support for supdup, c10 and perq
2788 terminals, which are no longer supported (bug#1482).
2789
8974cc9f
JB
27902011-07-10 Johan Bockgård <bojohan@gnu.org>
2791
2792 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
2793
a560d974
JD
27942011-07-10 Jan Djärv <jan.h.d@swipnet.se>
2795
2796 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
2797 for non-popups (Bug#3642).
2798
1dae0f0a
AS
27992011-07-10 Andreas Schwab <schwab@linux-m68k.org>
2800
268c2c36 2801 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 2802 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
2803 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
2804 * cm.c (losecursor): Likewise.
1dae0f0a
AS
2805 * data.c (fmod): Likewise.
2806 * dispnew.c (swap_glyphs_in_rows): Likewise.
2807 * emacs.c (memory_warning_signal): Likewise.
2808 * floatfns.c (float_error): Likewise.
2809 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
2810 (otf_open, font_otf_capability, generate_otf_features)
2811 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
2812 Likewise.
2813 * image.c (pbm_read_file): Likewise.
2814 * indent.c (string_display_width): Likewise.
2815 * intervals.c (check_for_interval, search_for_interval)
2816 (inc_interval_count, count_intervals, root_interval)
2817 (adjust_intervals_for_insertion, make_new_interval): Likewise.
2818 * lread.c (defalias): Likewise.
268c2c36 2819 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
2820 * regex.c (set_image_of_range_1, set_image_of_range)
2821 (regex_grow_registers): Likewise.
2822 * sysdep.c (strerror): Likewise.
2823 * termcap.c (valid_filename_p, tprint, main): Likewise.
2824 * tparam.c (main): Likewise.
2825 * unexhp9k800.c (run_time_remap, save_data_space)
2826 (update_file_ptrs, read_header, write_header, calculate_checksum)
2827 (copy_file, copy_rest, display_header): Likewise.
2828 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
2829 Likewise.
2830 * xdisp.c (check_it): Likewise.
2831 * xfaces.c (register_color, unregister_color, unregister_colors):
2832 Likewise.
2833 * xfns.c (print_fontset_result): Likewise.
2834 * xrdb.c (member, fatal, main): Likewise.
2835
99033785
PE
28362011-07-10 Paul Eggert <eggert@cs.ucla.edu>
2837
2838 Fix minor problems found by static checking (Bug#9031).
2839 * chartab.c (char_table_set_range, map_sub_char_table):
2840 Remove unused locals.
2841 (uniprop_table): Now static.
2842 * composite.c (_work_char): Remove unused static var.
2843
9cb2ac56
JB
28442011-07-09 Juanma Barranquero <lekktu@gmail.com>
2845
2846 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
2847
f25661f0
JD
28482011-07-09 Jan Djärv <jan.h.d@swipnet.se>
2849
2850 * gtkutil.c (qttip_cb): Remove code without function.
2851
8278c4fe
EZ
28522011-07-09 Eli Zaretskii <eliz@gnu.org>
2853
2854 * w32.c (pthread_sigmask): New stub.
2855
1692ae2d 28562011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 2857
8a6ebd58 2858 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
2859 sigprocmask is portable only for single-threaded applications, and
2860 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
2861 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
2862 (LIBES): Use it.
2863 * callproc.c (Fcall_process):
2864 * process.c (create_process):
2865 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
2866 Use pthread_sigmask, not sigprocmask.
123403e4 2867
1b854618
JD
28682011-07-08 Jan Djärv <jan.h.d@swipnet.se>
2869
2870 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
2871 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
2872 wrong (Bug#8591).
2873
3fe4b549
JD
28742011-07-08 Jan Djärv <jan.h.d@swipnet.se>
2875
0ce7e563
JD
2876 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
2877 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
2878 (xg_hide_tooltip): Fix comment.
2879
3fe4b549
JD
2880 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
2881 in registerServicesMenuSendTypes.
2882 (validRequestorForSendType): Don't check ns_return_types.
2883
2884 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
2885 ns_return_type.
2886
5df75e47
JR
28872011-07-08 Jason Rumney <jasonr@gnu.org>
2888
22610910
JR
2889 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
2890 SH_SHOW for hidden windows (Bug#5482).
2891
5df75e47
JR
2892 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
2893 frame struct members of non-existent frames (Bug#6284).
2894
699c10bd
JD
28952011-07-08 Jan Djärv <jan.h.d@swipnet.se>
2896
4393663b
JD
2897 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
2898 variable firstTime not needed on OSX >= 10.6.
2899 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
2900 >= 10.5. Use setKnobProportion, setDoubleValue.
2901
2902 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
2903 (MAC_OS_X_VERSION_10_5): Define if not defined.
2904 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
2905 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
2906 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
2907
2908 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
2909 cString and lossyCString on OSX >= 10.4
2910
2911 * nsmenu.m (fillWithWidgetValue): Don't use depercated method
2912 sizeToFit on OSX >= 10.2.
2913
2914 * nsimage.m (allocInitFromFile): Don't use deprecated method
2915 bestRepresentationForDevice on OSX >= 10.6.
2916
2917 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
2918 to avoid warning.
2919
2920 * emacs.c: Declare unexec_init_emacs_zone.
2921
a63e0781
JD
2922 * nsgui.h: Fix compiler warning about gnulib redefining verify.
2923
699c10bd
JD
2924 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
2925
2926 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
2927 on svcsMenu (Bug#8842).
2928
2929 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
2930 ns_return_types.
2931 (Fns_list_services): Just return Qnil on 10.6, code not working there.
2932
2933 * nsterm.m (QUTF8_STRING): Declare.
2934 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
2935 (validRequestorForSendType): Return type is (id).
2936 Change indexOfObjectIdenticalTo to indexOfObject.
2937 Check if we have local selection before returning self (Bug#8842).
2938 (writeSelectionToPasteboard): Put local selection into paste board
2939 if we have a local selection (Bug#8842).
2940 (syms_of_nsterm): DEFSYM QUTF8_STRING.
2941
2942 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
2943 (ns_get_local_selection): Declare.
2944
54e10184
LMI
29452011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
2946
9888ff71
LMI
2947 * keymap.c (describe_map_tree): Don't insert a double newline at
2948 the end of the buffer (bug#1169) and return whether we inserted
2949 something.
2950
54e10184
LMI
2951 * callint.c (Fcall_interactively): Change "reading args" to
2952 "providing args" to try to clarify what it does (bug#1010).
2953
15fa4783
KH
29542011-07-07 Kenichi Handa <handa@m17n.org>
2955
2956 * composite.c (composition_compute_stop_pos): Ignore a static
2957 composition starting before CHARPOS (Bug#8915).
2958
2959 * xdisp.c (handle_composition_prop): Likewise.
2960
a8815b00
EZ
29612011-07-07 Eli Zaretskii <eliz@gnu.org>
2962
2963 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
2964 (Bug#9015)
2965
ef7b981d 29662011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
2967
2968 * character.h (unicode_category_t): New enum type.
2969
2970 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
2971 (Qchar_code_property_table): New variable.
2972 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
2973 (UNIPROP_COMPRESSED_FORM_P): New macros.
2974 (char_table_ascii): Uncompress the compressed values.
2975 (sub_char_table_ref): New arg is_uniprop. Callers changed.
2976 Uncompress the compressed values.
ac389d0c 2977 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
2978 (char_table_ref_and_range): Uncompress the compressed values.
2979 (sub_char_table_set): New arg is_uniprop. Callers changed.
2980 Uncompress the compressed values.
2981 (sub_char_table_set_range): Args changed. Callers changed.
2982 (char_table_set_range): Adjuted for the above change.
2983 (map_sub_char_table): Delete args default_val and parent. Add arg
2984 top. Give decoded values to a Lisp function.
640c8776 2985 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
2986 values to a Lisp function. Gcpro more variables.
2987 (uniprop_table_uncompress)
2988 (uniprop_decode_value_run_length): New functions.
2989 (uniprop_decoder, uniprop_decoder_count): New variables.
2990 (uniprop_get_decoder, uniprop_encode_value_character)
2991 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
2992 New functions.
2993 (uniprop_encoder, uniprop_encoder_count): New variables.
2994 (uniprop_get_encoder, uniprop_table)
2995 (Funicode_property_table_internal, Fget_unicode_property_internal)
2996 (Fput_unicode_property_internal): New functions.
2997 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
2998 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 2999 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
3000 char-code-property-alist.
3001
640c8776 3002 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
3003 Vunicode_category_table.
3004
640c8776 3005 * font.c (font_range): Adjust for the change of
c805dec0
KH
3006 Vunicode_category_table.
3007
76b397fb
DN
30082011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
3009
3010 * m/iris4d.h: Remove file, move contents ...
3011 * s/irix6-5.h: ... here.
3012
22b4128e
PE
30132011-07-06 Paul Eggert <eggert@cs.ucla.edu>
3014
3015 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
3016 * alloc.c (mark_buffer):
3017 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
3018 (clone_per_buffer_values): Don't assume that
22b4128e
PE
3019 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
3020 This isn't true in general, and it's particularly not true
3021 if Emacs is configured with --with-wide-int.
3022 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
3023 New macros, used in the buffer.c change.
3024
869795d6
JD
30252011-07-05 Jan Djärv <jan.h.d@swipnet.se>
3026
3027 * xsettings.c: Use both GConf and GSettings if both are available.
3028 (store_config_changed_event): Add comment.
3029 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
3030 (store_tool_bar_style_changed): New functions.
5e617bc2 3031 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
3032 (struct xsettings): Move font inside HAVE_XFT.
3033 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 3034 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 3035 Move inside HAVE_XFT.
640c8776 3036 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
3037 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
3038 also.
3039 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 3040 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 3041 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
3042 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
3043 (parse_settings): Move check for font inside HAVE_XFT.
3044 (read_settings, apply_xft_settings): Add comment.
3045 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
3046 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
3047 call store_font_name_changed.
3048 (xft_settings_event): Add comment.
3049 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
3050 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
3051 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
3052 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
3053 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
3054 (xsettings_get_system_font, xsettings_get_system_normal_font):
3055 Add comment.
869795d6 3056
d8ed26bd
PE
30572011-07-05 Paul Eggert <eggert@cs.ucla.edu>
3058
3059 Random fixes. E.g., (random) never returned negative values.
3060 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
3061 subseconds part to the entropy, as that's a bit more random.
3062 Prefer signed to unsigned, since the signedness doesn't matter and
3063 in general we prefer signed. When given a limit, use a
3064 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
3065 latter isn't right if USE_2_TAGS_FOR_INTS.
3066 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
3067 not 0..VALMASK. Don't discard "excess" bits that random () returns.
3068
cabf1cac
SM
30692011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3070
3071 * textprop.c (text_property_stickiness):
3072 Obey Vtext_property_default_nonsticky.
3073 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
3074 * w32fns.c (syms_of_w32fns):
3075 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
3076
6e9b2be9
PE
30772011-07-04 Paul Eggert <eggert@cs.ucla.edu>
3078
3079 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
3080 This is more efficient than Ffile_directory_p and avoids a minor race.
3081
90186c68
LMI
30822011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
3083
7c301272
LMI
3084 * buffer.c (Foverlay_put): Say what the return value is
3085 (bug#7835).
3086
c4f2d8d4
LMI
3087 * fileio.c (barf_or_query_if_file_exists): Check first if the file
3088 is a directory before asking whether to use the file name
3089 (bug#7564).
ad637907
LMI
3090 (barf_or_query_if_file_exists): Make the "File is a directory"
3091 error be more correct.
c4f2d8d4 3092
90186c68
LMI
3093 * fns.c (Frequire): Remove the mention of the .gz files, since
3094 that's installation-specific, but keep the mention of
3095 `get-load-suffixes'.
3096
da64016e
PE
30972011-07-04 Paul Eggert <eggert@cs.ucla.edu>
3098
3099 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
3100 Report string overflow if the output is too long.
3101
7d47b580
JB
31022011-07-04 Juanma Barranquero <lekktu@gmail.com>
3103
a555cb87
JB
3104 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
3105 (syms_of_gnutls): Remove duplicate DEFSYM for
3106 Qgnutls_bootprop_verify_hostname_error, an error for
3107 Qgnutls_bootprop_verify_error (which is no longer used).
3108
7d47b580
JB
3109 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
3110 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
3111 Also (re)move comments that are misplaced or no longer relevant.
3112
1e49bfab
LMI
31132011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3114
3115 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
3116
1485f4c0
CY
31172011-07-03 Chong Yidong <cyd@stupidchicken.com>
3118
3119 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
3120 and background color parameters if they have been changed.
3121
a9ab721e
LMI
31222011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3123
3124 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
3125
cf7cff57
PE
31262011-07-03 Paul Eggert <eggert@cs.ucla.edu>
3127
2e13213d
PE
3128 * xsettings.c (SYSTEM_FONT): Define only when used.
3129 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
3130
cf7cff57
PE
3131 * keymap.c (access_keymap_1): Now static.
3132
7a8e04f7
CY
31332011-07-02 Chong Yidong <cyd@stupidchicken.com>
3134
3135 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
3136 leave any prefix arg for the up event (Bug#1586).
3137
61352f62
LMI
31382011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
3139
69bb1ef7
LMI
3140 * lread.c (syms_of_lread): Mention single symbols defined by
3141 `defvar' or `defconst' (bug#7154).
3142
61352f62 3143 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 3144 (Frequire): Mention get-load-suffixes.
61352f62 3145
28545e04
MR
31462011-07-02 Martin Rudalics <rudalics@gmx.at>
3147
3148 * window.h (window): Remove clone_number slot.
3149 * window.c (Fwindow_clone_number, Fset_window_clone_number):
3150 Remove.
3151 (make_parent_window, make_window, saved_window)
3152 (Fset_window_configuration, save_window_save): Don't deal with
3153 clone numbers.
3154 * buffer.c (Qclone_number): Remove declaration.
3155 (sort_overlays, overlay_strings): Don't deal with clone numbers.
3156
3349e122
SM
31572011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
3158
3159 Add multiple inheritance to keymaps.
3160 * keymap.c (Fmake_composed_keymap): New function.
3161 (Fset_keymap_parent): Simplify.
3162 (fix_submap_inheritance): Remove.
3163 (access_keymap_1): New function extracted from access_keymap to handle
3164 embedded parents and handle lists of maps.
3165 (access_keymap): Use it.
3166 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
3167 (Fcopy_keymap): Handle embedded parents.
3168 (Fcommand_remapping, define_as_prefix): Simplify.
3169 (Fkey_binding): Simplify.
3170 (syms_of_keymap): Move minibuffer-local-completion-map,
3171 minibuffer-local-filename-completion-map,
3172 minibuffer-local-must-match-map, and
3173 minibuffer-local-filename-must-match-map to Elisp.
3174 (syms_of_keymap): Defsubr make-composed-keymap.
3175 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
3176 (parse_menu_item): Trivial simplification.
3177
3279eb87
GM
31782011-07-01 Glenn Morris <rgm@gnu.org>
3179
3180 * Makefile.in (SETTINGS_LIBS): Fix typo.
3181
4550efdf
KI
31822011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
3183
3184 * coding.c (Fencode_coding_string): Record the last coding system
3185 used, as the function doc string says (bug#8738).
3186
0949d2b6
JD
31872011-07-01 Jan Djärv <jan.h.d@swipnet.se>
3188
3189 * xsettings.c (store_monospaced_changed): Take new font as arg and
3190 check for change against current_mono_font.
3191 (EMACS_TYPE_SETTINGS): Remove this and related defines.
3192 (emacs_settings_constructor, emacs_settings_get_property)
3193 (emacs_settings_set_property, emacs_settings_class_init)
3194 (emacs_settings_init, gsettings_obj): Remove.
3195 (something_changedCB): New function for HAVE_GSETTINGS.
3196 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
3197 with value as argument.
3198 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
3199 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 3200 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
3201 "changed".
3202
3203 * xgselect.c: Add defined (HAVE_GSETTINGS).
3204 (xgselect_initialize): Ditto.
3205
3206 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
3207 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
3208 xg_select.
3209
bbc6b304
PE
32102011-07-01 Paul Eggert <eggert@cs.ucla.edu>
3211
3212 * eval.c (struct backtrace): Simplify and port the data structure.
3213 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
3214 signed bit field, as this assumption is not portable and it makes
3215 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
3216 "char debug_on_exit : 1" as this is not portable either; instead,
3217 use the portable "unsigned int debug_on_exit : 1". Remove unused
3218 member evalargs. Remove obsolete comments about cc bombing out.
3219
9851bfc5
JD
32202011-06-30 Jan Djärv <jan.h.d@swipnet.se>
3221
51bb811f 3222 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
3223 Let HAVE_GSETTINGS override HAVE_GCONF.
3224 (store_monospaced_changed): New function.
3225 (EMACS_SETTINGS): A new type derived from GObject to handle
3226 GSettings notifications.
3227 (emacs_settings_constructor, emacs_settings_get_property)
3228 (emacs_settings_set_property, emacs_settings_class_init):
3229 New functions.
3230 (gsettings_client, gsettings_obj): New variables.
3231 (GSETTINGS_SCHEMA): New define.
3232 (something_changedCB): Call store_monospaced_changed.
3233 (init_gsettings): New function.
3234 (xsettings_initialize): Call init_gsettings.
3235 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
3236 to NULL.
3237
640c8776 3238 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
3239 GCONF_CFLAGS/LIBS.
3240
5386012d
MR
32412011-06-29 Martin Rudalics <rudalics@gmx.at>
3242
3243 * window.c (resize_root_window, grow_mini_window)
3244 (shrink_mini_window): Rename Qresize_root_window to
3245 Qwindow_resize_root_window and Qresize_root_window_vertically to
3246 Qwindow_resize_root_window_vertically.
3247
f13e0b08
PE
32482011-06-28 Paul Eggert <eggert@cs.ucla.edu>
3249
3250 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
3251
94515237
JB
32522011-06-27 Juanma Barranquero <lekktu@gmail.com>
3253
3254 * makefile.w32-in: Redesign dependencies so they reflect more
3255 clearly which files are directly included by each source file,
3256 and not through other includes.
3257
e43b6e43
MR
32582011-06-27 Martin Rudalics <rudalics@gmx.at>
3259
3260 * buffer.c (Qclone_number): Declare static and DEFSYM it.
3261 (sort_overlays, overlay_strings): When an overlay's clone number
3262 matches the window's clone number process the overlay even if
3263 the overlay's window property doesn't match the current window.
3264
d68443dc
MR
3265 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
3266 (Fwindow_hchild): Rename to Fwindow_left_child.
3267 (Fwindow_next): Rename to Fwindow_next_sibling.
3268 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
3269 (resize_window_check): Rename to window_resize_check.
3270 (resize_window_apply): Rename to window_resize_apply.
3271 (Fresize_window_apply): Rename to Fwindow_resize_apply.
3272 (Fdelete_other_windows_internal, resize_frame_windows)
3273 (Fsplit_window_internal, Fdelete_window_internal)
3274 (grow_mini_window, shrink_mini_window)
3275 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 3276
c7e73be5
JD
32772011-06-26 Jan Djärv <jan.h.d@swipnet.se>
3278
3279 * emacsgtkfixed.h: State that this is only used with Gtk+3.
3280 (emacs_fixed_set_min_size): Remove.
3281 (emacs_fixed_new): Take frame as argument.
3282
3283 * emacsgtkfixed.c: State that this is only used with Gtk+3.
3284 (_EmacsFixedPrivate): Remove minwidth/height.
3285 Add struct frame *f.
3286 (emacs_fixed_init): Initialize priv->f.
3287 (get_parent_class, emacs_fixed_set_min_size): Remove.
3288 (emacs_fixed_new): Set priv->f to argument.
3289 (emacs_fixed_get_preferred_width)
3290 (emacs_fixed_get_preferred_height): Use min_width/height from
3291 frames size_hint to set minimum and natural (Bug#8919).
3292 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
3293 and use min_width/height from frames size_hint to set
3294 min_width/height (Bug#8919).
3295
3296 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
3297 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
3298 Fix indentation.
c7e73be5 3299
cf99dcf8
EZ
33002011-06-26 Eli Zaretskii <eliz@gnu.org>
3301
3302 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
3303 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
3304 called at ZV.
3305
029529ac
CY
33062011-06-26 Chong Yidong <cyd@stupidchicken.com>
3307
3308 * process.c (wait_reading_process_output): Bypass select if
3309 waiting for a cell while ignoring keyboard input, and input is
3310 pending. Suggested by Jan Djärv (Bug#8869).
3311
7a7ef429
PE
33122011-06-25 Paul Eggert <eggert@cs.ucla.edu>
3313
3314 Use gnulib's dup2 module instead of rolling our own.
3315 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
3316
11fdef7d 33172011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
3318
3319 * dispnew.c (scrolling_window): Before scrolling, turn off a
3320 mouse-highlight in the window being scrolled.
3321
cd3520a4
JB
33222011-06-24 Juanma Barranquero <lekktu@gmail.com>
3323
3324 Move DEFSYM to lisp.h and use everywhere.
3325
3326 * character.h (DEFSYM): Move declaration...
3327 * lisp.h (DEFSYM): ...here.
3328
3329 * gnutls.c:
3330 * minibuf.c:
3331 * w32menu.c:
3332 * w32proc.c:
3333 * w32select.c: Don't include character.h.
3334
3335 * alloc.c (syms_of_alloc):
3336 * buffer.c (syms_of_buffer):
3337 * bytecode.c (syms_of_bytecode):
3338 * callint.c (syms_of_callint):
3339 * casefiddle.c (syms_of_casefiddle):
3340 * casetab.c (init_casetab_once):
3341 * category.c (init_category_once, syms_of_category):
3342 * ccl.c (syms_of_ccl):
3343 * cmds.c (syms_of_cmds):
3344 * composite.c (syms_of_composite):
3345 * dbusbind.c (syms_of_dbusbind):
3346 * dired.c (syms_of_dired):
3347 * dispnew.c (syms_of_display):
3348 * doc.c (syms_of_doc):
3349 * editfns.c (syms_of_editfns):
3350 * emacs.c (syms_of_emacs):
3351 * eval.c (syms_of_eval):
3352 * fileio.c (syms_of_fileio):
3353 * fns.c (syms_of_fns):
3354 * frame.c (syms_of_frame):
3355 * fringe.c (syms_of_fringe):
3356 * insdel.c (syms_of_insdel):
3357 * keymap.c (syms_of_keymap):
3358 * lread.c (init_obarray, syms_of_lread):
3359 * macros.c (syms_of_macros):
3360 * msdos.c (syms_of_msdos):
3361 * print.c (syms_of_print):
3362 * process.c (syms_of_process):
3363 * search.c (syms_of_search):
3364 * sound.c (syms_of_sound):
3365 * syntax.c (init_syntax_once, syms_of_syntax):
3366 * terminal.c (syms_of_terminal):
3367 * textprop.c (syms_of_textprop):
3368 * undo.c (syms_of_undo):
3369 * w32.c (globals_of_w32):
3370 * window.c (syms_of_window):
3371 * xdisp.c (syms_of_xdisp):
3372 * xfaces.c (syms_of_xfaces):
3373 * xfns.c (syms_of_xfns):
3374 * xmenu.c (syms_of_xmenu):
3375 * xsettings.c (syms_of_xsettings):
3376 * xterm.c (syms_of_xterm): Use DEFSYM.
3377
4228cf16
TZ
33782011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
3379
cd3520a4 3380 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 3381
7fcccf1e
PE
33822011-06-23 Paul Eggert <eggert@cs.ucla.edu>
3383
7efb4e0e
PE
3384 Integer and buffer overflow fixes (Bug#8873).
3385
ff5844ad
PE
3386 * print.c (printchar, strout): Check for string overflow.
3387 (PRINTPREPARE, printchar, strout):
3388 Don't set size unless allocation succeeds.
3389
90532f02
PE
3390 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
3391 for sizes. Check for string overflow more accurately.
3392 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
3393
6d84508d
PE
3394 * macros.c: Integer and buffer overflow fixes.
3395 * keyboard.h (struct keyboard.kbd_macro_bufsize):
3396 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
3397 Use ptrdiff_t, not int, for sizes.
3398 Don't increment bufsize until after realloc succeeds.
3399 Check for size-calculation overflow.
3400 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
3401
437b2cb4
PE
3402 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
3403
8b9ac8b4
PE
3404 * lread.c: Integer overflow fixes.
3405 (read_integer): Radix is now EMACS_INT, not int,
3406 to improve quality of diagnostics for out-of-range radices.
3407 Calculate buffer size correctly for out-of-range radices.
3408 (read1): Check for integer overflow in radices, and in
3409 read-circle numbers.
82cb60d3
PE
3410 (read_escape): Avoid int overflow.
3411 (Fload, openp, read_buffer_size, read1)
3412 (substitute_object_recurse, read_vector, read_list, map_obarray):
3413 Use ptrdiff_t, not int, for sizes.
3414 (read1): Use EMACS_INT, not int, for sizes.
20270765 3415 Check for size overflow.
8b9ac8b4 3416
7fcccf1e
PE
3417 * image.c (cache_image): Check for size arithmetic overflow.
3418
bfbbd7e7
PE
3419 * lread.c: Integer overflow issues.
3420 (saved_doc_string_size, saved_doc_string_length)
3421 (prev_saved_doc_string_size, prev_saved_doc_string_length):
3422 Now ptrdiff_t, not int.
3423 (read1): Don't assume doc string length fits in int. Check for
3424 out-of-range doc string lengths.
3425 (read_list): Don't assume file position fits in int.
39019e54 3426 (read_escape): Check for hex character overflow.
bfbbd7e7 3427
4e323265
LL
34282011-06-22 Leo Liu <sdl.web@gmail.com>
3429
3430 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
3431 Move to minibuffer.el.
3432
85fece3e
PE
34332011-06-22 Paul Eggert <eggert@cs.ucla.edu>
3434
20b84ce9 3435 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
3436 The following patches are for when GLYPH_DEBUG && !XASSERT.
3437 * dispextern.h (trace_redisplay_p, dump_glyph_string):
3438 * dispnew.c (flush_stdout):
3439 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
3440 Mark as externally visible.
3441 * dispnew.c (check_window_matrix_pointers): Now static.
3442 * dispnew.c (window_to_frame_vpos):
3443 * xfns.c (unwind_create_frame):
3444 * xterm.c (x_check_font): Remove unused local.
3445 * scroll.c (CHECK_BOUNDS):
3446 * xfaces.c (cache_fache): Rename local to avoid shadowing.
3447 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
3448 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
3449 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
3450 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
3451 Now static.
3452 (debug_method_add): Use va_list and vsprintf rather than relying
3453 on undefined behavior with wrong number of arguments.
3454 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
3455 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
3456 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
3457 since we're not interested in debugging glyphs with old libraries.
3458 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
3459 GCC 4.6.0's static checking.
3460
0766b489
PE
34612011-06-22 Paul Eggert <eggert@cs.ucla.edu>
3462
31fd4b32
PE
3463 Integer overflow and signedness fixes (Bug#8873).
3464 A few related buffer overrun fixes, too.
3465
b79e8648
PE
3466 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
3467
0766b489
PE
3468 * dispextern.h (struct face.stipple):
3469 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
3470 (x_bitmap_mask, x_allocate_bitmap_record)
3471 (x_create_bitmap_from_data, x_create_bitmap_from_file)
3472 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
3473 (x_create_bitmap_from_xpm_data):
3474 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
3475 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
3476 (.bitmaps_last):
3477 * xfaces.c (load_pixmap):
3478 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
3479 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
3480 (.bitmaps_last, struct x_output.icon_bitmap):
3481 Use ptrdiff_t, not int, for bitmap indexes.
3482 (x_allocate_bitmap_record): Check for size overflow.
3483 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
3484
b081724f
PE
3485 Use ptrdiff_t, not int, for overlay counts.
3486 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
3487 * editfns.c (overlays_around, get_pos_property):
3488 * textprop.c (get_char_property_and_overlay):
3489 * xdisp.c (next_overlay_change, note_mouse_highlight):
3490 * xfaces.c (face_at_buffer_position):
21514da7
PE
3491 * buffer.c (OVERLAY_COUNT_MAX): New macro.
3492 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
3493 (Fnext_overlay_change, Fprevious_overlay_change)
3494 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 3495 Use ptrdiff_t, not int, for sizes.
21514da7 3496 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 3497
3de73e5e
PE
3498 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
3499
2606c57b
PE
3500 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
3501 (x_session_initialize): Do not assume string length fits in int.
3502
aaafe47a
PE
3503 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
3504 This is unlikely, but can occur if DPI is outlandish.
3505
2674ddc8 3506 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
3507 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
3508
28154962
PE
3509 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
3510 * xrdb.c (magic_file_p, search_magic_path):
3511 Omit last arg SUFFIX; it was always 0. All callers changed.
3512 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
3513
7de51af5
PE
3514 * xfont.c (xfont_match): Avoid need for strlen.
3515
25ed6cc3
PE
3516 * xfns.c: Don't assume strlen fits in int.
3517 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
3518
4eab31dd
PE
3519 * xdisp.c (message_log_check_duplicate): Return intmax_t,
3520 not unsigned long, as we prefer signed integers. All callers changed.
3521 Detect integer overflow in repeat count.
3522 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 3523 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 3524
171e2a58
PE
3525 * termcap.c: Don't assume sizes fit in int and never overflow.
3526 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
3527 (gobble_line): Check for size-calculation overflow.
3528
ad39faca 3529 * minibuf.c (Fread_buffer):
6e5bb2dc 3530 * lread.c (intern, intern_c_string):
74ca2eb3
PE
3531 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
3532 Don't assume string length fits in int.
3533
52c61c22 3534 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
3535 * gtkutil.c (style_changed_cb): Avoid need for strlen.
3536
b5b8c9e5
PE
3537 * font.c: Don't assume string length fits in int.
3538 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
3539 Use ptrdiff_t, not int.
ccd6111c
PE
3540 (font_intern_prop): Don't assume string length fits in int.
3541 Don't assume integer property fits in fixnum.
3542 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 3543
882f0d81 3544 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 3545 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
3546 Reformulate so as not to need the command string.
3547 Invoke gzip -cd rather than gunzip, as it's more portable.
3548 (lock_info_type, lock_file_1, lock_file):
3549 Don't assume pid_t and time_t fit in unsigned long.
3550 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
3551 (current_lock_owner): Prefer signed type for sizes.
3552 Use memcpy, not strncpy, where memcpy is what is really wanted.
3553 Don't assume (via atoi) that time_t and pid_t fit in int.
3554 Check for time_t and/or pid_t out of range, e.g., via a network share.
3555 Don't alloca where an auto var works fine.
3556
93f4cf88
PE
3557 * fileio.c: Fix some integer overflow issues.
3558 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
3559 Don't assume string length fits in int.
3560 (directory_file_name): Don't assume string length fits in long.
3561 (make_temp_name): Don't assume pid fits in int, or that its print
3562 length is less than 20.
3563
f3e92b69
PE
3564 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
3565
1bfdaf10
PE
3566 * coding.c (make_subsidiaries): Don't assume string length fits in int.
3567
35016e9a
PE
3568 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
3569
3d1e65a1
PE
3570 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
3571 We prefer signed integers, even for size calculations.
3572
0b963a93
PE
3573 * emacs.c: Don't assume string length fits in 'int'.
3574 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
3575 (main): Don't invoke strlen when not needed.
3576
573f4b54
PE
3577 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
3578 (XD_DEBUG_MESSAGE): Don't waste a byte.
3579
989f33ba
PE
3580 * callproc.c (getenv_internal_1, getenv_internal)
3581 (Fgetenv_internal):
965d34eb
PE
3582 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
3583
e4d29b33
PE
3584 * lread.c (invalid_syntax): Omit length argument.
3585 All uses changed. This doesn't fix a bug, but it simplifies the
3586 code away from its former Hollerith-constant appearance, and it's
3587 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 3588 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 3589
eb49b136
PE
3590 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
3591 This didn't break anything, but it didn't help either.
3592 It's confusing to put a bogus integer in a place where the actual
3593 value does not matter.
9f62aeb1 3594 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 3595 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 3596
15375a22
PE
3597 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
3598 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
3599 implementation.
b61cc01c
PE
3600 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
3601 We prefer signed types, and the value cannot exceed the EMACS_INT
3602 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
3603 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
3604 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
3605 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 3606
53b2623d
PE
3607 * indent.c (sane_tab_width): New function.
3608 (current_column, scan_for_column, Findent_to, position_indentation)
3609 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 3610 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 3611
51cab52b 3612 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 3613
f2ed8a70
PE
3614 * lisp.h (lint_assume): New macro.
3615 * composite.c (composition_gstring_put_cache):
3616 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
3617
abe80cc6
PE
3618 * editfns.c, insdel.c:
3619 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 3620
b02c740e
PE
3621 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
3622
ebc96716
PE
3623 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
3624
b4e50fa0 3625 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 3626 Use much-faster test for byte-length change.
311d5d7c 3627 Don't assume string byte-length fits in 'int'.
a4cf38e4 3628 Check that character arg fits in 'int'.
85461888 3629 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 3630
c0c1ee9f
PE
3631 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
3632
a498d7f4
PE
3633 * fns.c (concat): Catch string overflow earlier.
3634 Do not rely on integer wraparound.
3635
51cab52b
PE
3636 * dispextern.h (struct it.overlay_strings_charpos)
3637 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
3638 * xdisp.c (forward_to_next_line_start)
3639 (back_to_previous_visible_line_start)
3640 (reseat_at_next_visible_line_start, next_element_from_buffer):
3641 Don't arbitrarily truncate the value of 'selective' to int.
3642
76031fad
PE
3643 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
3644
5eb55db9
PE
3645 * composite.c: Don't truncate sizes to 'int'.
3646 (composition_gstring_p, composition_reseat_it)
3647 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
3648 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
3649 not EMACS_UINT, for indexes.
5eb55db9 3650
0703a717
PE
3651 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
3652
d6202519
PE
3653 * buffer.c: Include <verify.h>.
3654 (struct sortvec.priority, struct sortstr.priority):
8961a454 3655 Now EMACS_INT, not int.
c20998a7 3656 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
3657 (struct sortstr.size, record_overlay_string)
3658 (struct sortstrlist.size, struct sortlist.used):
3659 Don't truncate size to int.
3660 (record_overlay_string): Check for size-calculation overflow.
d6202519 3661 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 3662
d5a19415
JM
36632011-06-22 Jim Meyering <meyering@redhat.com>
3664
029529ac 3665 Don't leak an XBM-image-sized buffer
d5a19415
JM
3666 * image.c (xbm_load): Free the image buffer after using it.
3667
a9041e6c
PE
36682011-06-21 Paul Eggert <eggert@cs.ucla.edu>
3669
3670 Port to Sun C.
3671 * composite.c (find_automatic_composition): Omit needless 'return 0;'
3672 that Sun C diagnosed.
3673 * fns.c (secure_hash): Fix pointer signedness issue.
3674 * intervals.c (static_offset_intervals): New function.
3675 (offset_intervals): Use it.
3676
7f3f739f
LL
36772011-06-21 Leo Liu <sdl.web@gmail.com>
3678
3679 * deps.mk (fns.o):
3680 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
3681 sha512.h.
3682
3683 * fns.c (secure_hash): Rename from crypto_hash_function and change
3684 the first arg to accept symbols.
5b66d427 3685 (Fsecure_hash): New primitive.
7f3f739f
LL
3686 (syms_of_fns): New symbols.
3687
76147d94
DD
36882011-06-20 Deniz Dogan <deniz@dogan.se>
3689
3690 * process.c (Fset_process_buffer): Clarify return value in
3691 docstring.
3692
7d7d0045
CY
36932011-06-18 Chong Yidong <cyd@stupidchicken.com>
3694
3695 * dispnew.c (add_window_display_history): Use BVAR.
3696
3697 * xdisp.c (debug_method_add): Use BVAR.
3698 (check_window_end, dump_glyph_matrix, dump_glyph)
3699 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
3700
3701 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
3702 Likewise.
3703
3704 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
3705 check till after the cache is created in init_frame_faces.
3706
ff2bc410
SM
37072011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
3708
3709 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
3710
28177add
PE
37112011-06-16 Paul Eggert <eggert@cs.ucla.edu>
3712
dd3482fe
PE
3713 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
3714 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
3715 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
3716
393d71f3 3717 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
3718 * fileio.c (Finsert_file_contents):
3719 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
3720 Remove the old (too-loose) buffer overflow checks.
3721 They weren't needed, since make_gap checks for buffer overflow.
3722 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
3723 The old code merely checked for Emacs fixnum overflow, and relied
3724 on undefined (wraparound) behavior. The new code avoids undefined
3725 behavior, and also checks for ptrdiff_t and/or size_t overflow.
3726
2e6813b0 3727 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
3728 Tune. Don't use wider integers than needed. Don't use alloca.
3729 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 3730
599a9e4f
PE
3731 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
3732
99561444
PE
3733 * insdel.c, lisp.h (buffer_overflow): New function.
3734 (insert_from_buffer_1, replace_range, replace_range_2):
3735 * insdel.c (make_gap_larger):
3736 * editfns.c (Finsert_char):
3737 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
3738
28177add
PE
3739 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
3740
e69dafad
PE
37412011-06-15 Paul Eggert <eggert@cs.ucla.edu>
3742
a7af7fde 3743 Integer overflow and signedness fixes (Bug#8873).
ff672d2c 3744
b1c46f02
PE
3745 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
3746 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
3747
e69dafad
PE
3748 * fileio.c: Don't assume EMACS_INT fits in off_t.
3749 (emacs_lseek): New static function.
3750 (Finsert_file_contents, Fwrite_region): Use it.
3751 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
3752
566684ea
PE
3753 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
3754
e6966cd6
PE
3755 * fns.c: Don't overflow int when computing a list length.
3756 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
3757 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
3758 truncation on 64-bit hosts. Check for QUIT every
3759 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
3760 faster and is responsive enough.
3761 (Flength): Report an error instead of overflowing an integer.
3762 (Fsafe_length): Return a float if the value is not representable
3763 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 3764 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 3765 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 3766
dd0b0efb
PE
3767 * alloc.c: Check that resized vectors' lengths fit in fixnums.
3768 (header_size, word_size): New constants.
3769 (allocate_vectorlike): Don't check size overflow here.
3770 (allocate_vector): Check it here instead, since this is the only
3771 caller of allocate_vectorlike that could cause overflow.
3772 Check that the new vector's length is representable as a fixnum.
3773
86fe5cfe
PE
3774 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
3775 The previous code was bogus. For example, next_almost_prime (32)
3776 returned 39, which is undesirable as it is a multiple of 3; and
3777 next_almost_prime (24) returned 25, which is a multiple of 5 so
3778 why was the code bothering to check for multiples of 7?
3779
80e88859
PE
3780 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
3781
4a2f0ad6
PE
3782 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
3783
f66c7cf8
PE
3784 Variadic C functions now count arguments with ptrdiff_t.
3785 This partly undoes my 2011-03-30 change, which replaced int with size_t.
3786 Back then I didn't know that the Emacs coding style prefers signed int.
3787 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
3788 were being counted with int, which may truncate counts on 64-bit
3789 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
3790 * lisp.h (struct Lisp_Subr.function.aMANY)
3791 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
3792 Arg counts are now ptrdiff_t, not size_t.
3793 All variadic functions and their callers changed accordingly.
3794 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
3795 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
3796 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
3797 * callint.c (Fcall_interactively): Check arg count for overflow,
3798 to avoid potential buffer overrun. Use signed char, not 'int',
3799 for 'varies' array, so that we needn't bother to check its size
3800 calculation for overflow.
3801 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
3802 * eval.c (apply_lambda):
3803 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
3804 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
3805 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
3806
a1759b76
PE
3807 * callint.c (Fcall_interactively): Don't use index var as event count.
3808
d96be9fc
PE
3809 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
3810 * mem-limits.h (SIZE): Remove; no longer used.
3811
a690a978 3812 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 3813
578c21e6
PE
3814 Remove unnecessary casts.
3815 * xterm.c (x_term_init):
3816 * xfns.c (x_set_border_pixel):
3817 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
3818 These aren't needed now that we assume ANSI C.
3819
96f53c6c
PE
3820 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
3821 It's more likely to cause problems (due to unsigned overflow)
3822 than to cure them.
3823
83c77d31
PE
3824 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
3825
ee2079f1
PE
3826 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
3827
6da65536
PE
3828 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
3829
7147c4a4
PE
3830 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
3831
193e32d9
PE
3832 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
3833
e5533da6
PE
3834 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
3835
9910e595
PE
3836 GLYPH_CODE_FACE returns EMACS_INT, not int.
3837 * dispextern.h (merge_faces):
3838 * xfaces.c (merge_faces):
01103c44
PE
3839 * xdisp.c (get_next_display_element, next_element_from_display_vector):
3840 Don't assume EMACS_INT fits in int.
9910e595 3841
2638320e
PE
3842 * character.h (CHAR_VALID_P): Remove unused parameter.
3843 * fontset.c, lisp.h, xdisp.c: All uses changed.
3844
045eb8d9
PE
3845 * editfns.c (Ftranslate_region_internal): Omit redundant test.
3846
c1f134b5
PE
3847 * fns.c (concat): Minor tuning based on overflow analysis.
3848 This doesn't fix any bugs. Use int to hold character, instead
3849 of constantly refetching from Emacs object. Use XFASTINT, not
3850 XINT, for value known to be a character. Don't bother comparing
3851 a single byte to 0400, as it's always less.
3852
395fcb93 3853 * floatfns.c (Fexpt):
327eeec8
PE
3854 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
3855
abbd3d23
PE
3856 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
3857 for characters.
3858
684a03ef
PE
3859 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
3860
0fed43f3
PE
3861 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
3862 Without this fix, on a 64-bit host (aset S 0 4294967386) would
3863 incorrectly succeed when S was a string, because 4294967386 was
3864 truncated before it was used.
3865
8fd02eb7
PE
3866 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
3867 Otherwise, an out-of-range integer could cause undefined behavior
3868 on a 64-bit host.
3869
f8c86b69
PE
3870 * composite.c: Use int, not EMACS_INT, for characters.
3871 (fill_gstring_body, composition_compute_stop_pos): Use int, not
3872 EMACS_INT, for values that are known to be in character range.
3873 This doesn't fix any bugs but is the usual style inside Emacs and
3874 may generate better code on 32-bit machines.
3875
34206dd2
PE
3876 Make sure a 64-bit char is never passed to ENCODE_CHAR.
3877 This is for reasons similar to the recent CHAR_STRING fix.
3878 * charset.c (Fencode_char): Check that character arg is actually
3879 a character. Pass an int to ENCODE_CHAR.
3880 * charset.h (ENCODE_CHAR): Verify that the character argument is no
3881 wider than 'int', as a compile-time check to prevent future regressions
3882 in this area.
3883
c5958d4c 3884 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
3885
3886 Make sure a 64-bit char is never passed to CHAR_STRING.
3887 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
3888 by silently ignoring the top 32 bits, allowing some values
3889 that were far too large to be valid characters.
3890 * character.h: Include <verify.h>.
3891 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
3892 arguments are no wider than unsigned, as a compile-time check
3893 to prevent future regressions in this area.
3894 * data.c (Faset):
01103c44 3895 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
3896 (Fsubst_char_in_region):
3897 * fns.c (concat):
3898 * xdisp.c (decode_mode_spec_coding):
3899 Adjust to CHAR_STRING's new requirement.
3900 * editfns.c (Finsert_char, Fsubst_char_in_region):
3901 * fns.c (concat): Check that character args are actually
3902 characters. Without this test, these functions did the wrong
3903 thing with wildly out-of-range values on 64-bit hosts.
3904
d37ca623
PE
3905 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
3906 These casts should not be needed on 32-bit hosts, either.
3907 * keyboard.c (read_char):
3908 * lread.c (Fload): Remove casts to unsigned.
3909
ea204efb
PE
3910 * lisp.h (UNSIGNED_CMP): New macro.
3911 This fixes comparison bugs on 64-bit hosts.
3912 (ASCII_CHAR_P): Use it.
3913 * casefiddle.c (casify_object):
01103c44 3914 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
3915 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
3916 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
3917 * dispextern.h (FACE_FROM_ID):
3918 * keyboard.c (read_char): Use UNSIGNED_CMP.
3919
41cb286c
PE
3920 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
3921 not to EMACS_INT, to avoid GCC warning.
3922
4a1b9832
PE
3923 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
3924
55daad71
PE
3925 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
3926 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
3927 isn't needed on 32-bit machines.
8f95c75c 3928
01103c44
PE
3929 * buffer.c (Fgenerate_new_buffer_name):
3930 Use EMACS_INT for count, not int.
0ceccced 3931 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
3932
3933 * data.c (Qcompiled_function): Now static.
3934
c6f072e7
PE
3935 * window.c (window_body_lines): Now static.
3936
20ce5912
PE
3937 * image.c (gif_load): Rename local to avoid shadowing.
3938
9c4c5f81
PE
3939 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
3940 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
3941 * alloc.c (make_save_value): Integer argument is now of type
3942 ptrdiff_t, not int.
3943 (mark_object): Use ptrdiff_t, not int.
3944 * lisp.h (pD): New macro.
3945 * print.c (print_object): Use it.
3946
c0c5c8ae
PE
3947 * alloc.c: Use EMACS_INT, not int, to count objects.
3948 (total_conses, total_markers, total_symbols, total_vector_size)
3949 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
3950 (total_free_floats, total_floats, total_free_intervals)
3951 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
3952 Now EMACS_INT, not int. All uses changed.
3953 (Fgarbage_collect): Compute overall total using a double, so that
3954 integer overflow is less likely to be a problem. Check for overflow
3955 when converting back to an integer.
5a25e253
PE
3956 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
3957 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
3958 These were 'int' variables that could overflow on 64-bit hosts;
3959 they were never used, so remove them instead of repairing them.
211a0b2a 3960 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
3961 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
3962 Previously, this ceilinged at INT_MAX, but that doesn't work on
3963 64-bit machines.
e46bb31a 3964 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 3965
c78baabf 3966 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 3967 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
3968 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
3969 when a (possibly-narrower) signed value would do just as well.
3970 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 3971
c9d624c6
PE
3972 * alloc.c: Catch some string size overflows that we were missing.
3973 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
3974 for convenience in STRING_BYTES_MAX.
3975 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
3976 The definition here is exact; the one in lisp.h was approximate.
3977 (allocate_string_data): Check for string overflow. This catches
3978 some instances we weren't catching before. Also, it catches
3979 size_t overflow on (unusual) hosts where SIZE_MAX <= min
3980 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
3981 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 3982
c9d624c6
PE
3983 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
3984 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 3985 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 3986
353032ce
PE
3987 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
3988
2bccce07
PE
3989 * alloc.c (Fmake_string): Check for out-of-range init.
3990
0ac30604
SM
39912011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
3992
3993 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
3994
c195f2de
JD
39952011-06-14 Jan Djärv <jan.h.d@swipnet.se>
3996
3997 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
3998 xg_get_default_scrollbar_width.
3999
4000 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
4001 (int_gtk_range_get_value): Move to the scroll bar part of the file.
4002 (style_changed_cb): Call update_theme_scrollbar_width and call
4003 x_set_scroll_bar_default_width and xg_frame_set_char_size for
4004 all frames (Bug#8505).
4005 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
4006 Call gtk_window_set_resizable if HAVE_GTK3.
4007 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
4008 and height if HAVE_GTK3 (Bug#8505).
4009 (scroll_bar_width_for_theme): New variable.
4010 (update_theme_scrollbar_width): New function.
4011 (xg_get_default_scrollbar_width): Move code to
4012 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
4013 (xg_initialize): Call update_theme_scrollbar_width.
4014
4015 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
4016
4017 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
4018
e10ac9f1
MR
40192011-06-12 Martin Rudalics <rudalics@gmx.at>
4020
4021 * frame.c (make_frame): Call other_buffer_safely instead of
4022 other_buffer.
4023
4024 * window.c (temp_output_buffer_show): Call display_buffer with
4025 second argument Vtemp_buffer_show_specifiers and reset latter
4026 immediately after the call.
4027 (Vtemp_buffer_show_specifiers): New variable.
4028 (auto_window_vscroll_p, next_screen_context_lines)
4029 (Vscroll_preserve_screen_position): Remove leading asterisks from
4030 doc-strings.
4031
2d3c217e 40322011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 4033
7b7f97e8 4034 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
4035 * buffer.c (Qclone_number): Remove for now, as it's unused.
4036 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
4037 (record_buffer): Remove unused local.
4038 * frame.c (other_visible_frames, frame_buffer_list): Now static.
4039 (set_frame_buffer_list): Remove; unused.
4040 * frame.h (other_visible_frames): Remove decl.
4041 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
4042 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
4043 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
4044 if HAVE_GPM.
4045 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
4046 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
4047 Define only if HAVE_GPM.
4048 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
4049 (update_hints_inhibit): Remove; never set. All uses removed.
4050 * widgetprv.h (emacsFrameClassRec): Remove decl.
4051 * window.c (delete_deletable_window): Now returns void, since it
4052 wasn't returning anything.
4053 (compare_window_configurations): Remove unused locals.
4054 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
4055 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
4056 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
4057 the same widths as pointers. This follows up on the 2011-05-06 patch.
4058 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
4059 * xterm.h: Likewise.
4060 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
4061
1384b89e
JB
40622011-06-12 Juanma Barranquero <lekktu@gmail.com>
4063
4064 * makefile.w32-in: Update dependencies.
4065 (LISP_H): Add lib/intprops.h.
4066
1100a63c
CY
40672011-06-11 Chong Yidong <cyd@stupidchicken.com>
4068
4069 * image.c (gif_load): Add animation frame delay to the metadata.
4070 (syms_of_image): Use DEFSYM. New symbol `delay'.
4071
6198ccd0
MR
40722011-06-11 Martin Rudalics <rudalics@gmx.at>
4073
4074 * window.c (delete_deletable_window): Re-add.
4075 (Fset_window_configuration): Rewrite to handle dead buffers and
4076 consequently deletable windows.
4077 (window_tree, Fwindow_tree): Remove. Supply functionality in
4078 window.el.
4079 (compare_window_configurations): Simplify code.
4080
b6e3633c
AS
40812011-06-11 Andreas Schwab <schwab@linux-m68k.org>
4082
1ab0dee5
AS
4083 * image.c (imagemagick_load_image): Fix type mismatch.
4084 (Fimagemagick_types): Likewise.
4085
b6e3633c
AS
4086 * window.h (replace_buffer_in_windows): Declare.
4087
9397e56f
MR
40882011-06-11 Martin Rudalics <rudalics@gmx.at>
4089
4090 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
4091 Qclone_number. Remove external declaration of Qdelete_window.
4092 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
4093 code.
640c8776
SM
4094 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
4095 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
4096 (Fother_buffer): Rewrite doc-string. Major rewrite for new
4097 buffer list implementation.
4098 (other_buffer_safely): New function.
4099 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
4100 calls to replace_buffer_in_windows and
4101 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
4102 if allowed.
4103 (record_buffer): Inhibit quitting and rewrite using quittable
4104 functions. Run Qbuffer_list_update_hook if allowed.
4105 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
4106 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
4107 Move switch-to-buffer to window.el.
9397e56f
MR
4108 (bury-buffer): Move to window.el.
4109 (Vbuffer_list_update_hook): New variable.
4110
4111 * lisp.h (other_buffer_safely): Add prototype in buffer.c
4112 section.
4113
4114 * window.h (resize_frame_windows): Move up in code.
4115 (Fwindow_frame): Remove EXFUN.
4116 (replace_buffer_in_all_windows): Remove prototype.
4117 (replace_buffer_in_windows_safely): Add prototype.
4118
4119 * window.c: Declare Qdelete_window static again. Move down
4120 declaration of select_count.
4121 (Fnext_window, Fprevious_window): Rewrite doc-strings.
4122 (Fother_window): Move to window.el.
4123 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
4124 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
4125 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
4126 window.el.
4127 (replace_buffer_in_windows): Implement by calling
4128 Qreplace_buffer_in_windows.
4129 (replace_buffer_in_all_windows): Remove with some functionality
4130 moved into replace_buffer_in_windows_safely.
4131 (replace_buffer_in_windows_safely): New function.
4132 (select_window_norecord, select_frame_norecord): Move in front
4133 of run_window_configuration_change_hook. Remove now obsolete
4134 declarations.
640c8776
SM
4135 (Fset_window_buffer): Rewrite doc-string.
4136 Call Qrecord_window_buffer.
9397e56f
MR
4137 (keys_of_window): Move binding for other-window to window.el.
4138
b50691aa
CY
41392011-06-11 Chong Yidong <cyd@stupidchicken.com>
4140
4141 * dispextern.h (struct image): Replace data member, whose int_val
4142 and ptr_val fields were not used by anything, with a single
4143 lisp_val object.
4144
4145 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
4146 (gif_clear_image, gif_load, imagemagick_load_image)
4147 (gs_clear_image, gs_load): Callers changed.
4148
3f754b86
PE
41492011-06-10 Paul Eggert <eggert@cs.ucla.edu>
4150
cca69397
PE
4151 * buffer.h: Include <time.h>, for time_t.
4152 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
4153
109e28d0
PE
4154 Fix minor problems found by static checking.
4155
60737f02
PE
4156 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
4157
4b66faf3
PE
4158 Make identifiers static if they are not used in other modules.
4159 * data.c (Qcompiled_function, Qframe, Qvector):
4160 * image.c (QimageMagick, Qsvg):
4161 * minibuf.c (Qmetadata):
4162 * window.c (resize_window_check, resize_root_window): Now static.
4163 * window.h (resize_window_check, resize_root_window): Remove decls.
4164
109e28d0
PE
4165 * window.c (window_deletion_count, delete_deletable_window):
4166 Remove; unused.
46a4ce9e
PE
4167 (window_body_lines): Now static.
4168 (Fdelete_other_windows_internal): Mark vars as initialized.
4169 Make sure 'resize_failed' is initialized.
4170 (run_window_configuration_change_hook): Rename local to avoid shadowing.
4171 (resize_window_apply): Remove unused local.
4172 * window.h (delete_deletable_window): Remove decl.
4173
109e28d0 4174 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
4175 (imagemagick_load_image): Fix pointer signedness problem by changing
4176 last arg from unsigned char * to char *. All uses changed.
4177 Also, fix a local for similar reasons.
4178 Remove unused locals. Remove locals to avoid shadowing.
4179 (fn_rsvg_handle_free): Remove; unused.
4180 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 4181 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 4182
3f754b86
PE
4183 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
4184
2547adb1
CY
41852011-06-10 Chong Yidong <cyd@stupidchicken.com>
4186
4187 * image.c (gif_load): Fix omitted cast error introduced by
4188 2011-06-06 change.
4189
2c8e37d4
MR
41902011-06-10 Martin Rudalics <rudalics@gmx.at>
4191
4192 * window.h (resize_proportionally, orig_total_lines)
4193 (orig_top_line): Remove from window structure.
4194 (set_window_height, set_window_width, change_window_heights)
4195 (Fdelete_window): Remove prototypes.
4196 (resize_frame_windows): Remove duplicate declaration.
4197
440a42e3
EZ
41982011-06-10 Eli Zaretskii <eliz@gnu.org>
4199
4200 * window.h (resize_frame_windows, resize_window_check)
4201 (delete_deletable_window, resize_root_window)
4202 (resize_frame_windows): Declare prototypes.
4203
4204 * window.c (resize_window_apply): Make definition be "static" to
4205 match the prototype.
4206
562dd5e9
MR
42072011-06-10 Martin Rudalics <rudalics@gmx.at>
4208
4209 * window.c: Remove declarations of Qwindow_size_fixed,
4210 window_min_size_1, window_min_size_2, window_min_size,
4211 size_window, window_fixed_size_p, enlarge_window, delete_window.
4212 Remove static from declaration of Qdelete_window, it's
4213 temporarily needed by Fbury_buffer.
4214 (replace_window): Don't assign orig_top_line and
4215 orig_total_lines.
4216 (Fdelete_window, delete_window): Remove. Window deletion is
4217 handled by window.el.
640c8776
SM
4218 (window_loop): Remove DELETE_OTHER_WINDOWS case.
4219 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
4220 (Fdelete_other_windows): Remove. Deleting other windows is
4221 handled by window.el.
4222 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
4223 handled in window.el.
4224 (window_min_size_2, window_min_size_1, window_min_size): Remove.
4225 Window minimum sizes are handled in window.el.
4226 (shrink_windows, size_window, set_window_height)
4227 (set_window_width, change_window_heights, window_height)
4228 (window_width, CURBEG, CURSIZE, enlarge_window)
4229 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
4230 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
4231 handled in window.el.
4232 (make_dummy_parent): Rename to make_parent_window and give it a
4233 second argument horflag.
4234 (make_window): Don't set resize_proportionally any more.
4235 (Fsplit_window): Remove. Windows are split in window.el.
4236 (save_restore_action, save_restore_orig_size)
4237 (shrink_window_lowest_first, save_restore_orig_size): Remove.
4238 Resize mini windows in window.el.
4239 (grow_mini_window, shrink_mini_window): Implement by calling
4240 Qresize_root_window_vertically, resize_window_check and
4241 resize_window_apply.
640c8776
SM
4242 (saved_window, Fset_window_configuration, save_window_save):
4243 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
4244 resize_proportionally.
4245 (window_min_height, window_min_width): Move to window.el.
4246 (keys_of_window): Move bindings for delete-other-windows,
4247 split-window, delete-window and enlarge-window to window.el.
4248
4249 * buffer.c: Temporarily extern Qdelete_window.
4250 (Fbury_buffer): Temporarily call Qdelete_window instead of
4251 Fdelete_window (Fbury_buffer will move to window.el soon).
4252
4253 * frame.c (set_menu_bar_lines_1): Remove code handling
4254 orig_top_line and orig_total_lines.
4255
4256 * dispnew.c (adjust_frame_glyphs_initially): Don't use
4257 set_window_height but set heights directly.
4258 (change_frame_size_1): Use resize_frame_windows.
4259
4260 * xdisp.c (init_xdisp): Don't use set_window_height but set
4261 heights directly.
4262
640c8776
SM
4263 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
4264 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
4265 run_window_configuration_change_hook.
4266
4267 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
4268 instead of change_window_heights and run
4269 run_window_configuration_change_hook.
4270
1a13852e
MR
42712011-06-09 Martin Rudalics <rudalics@gmx.at>
4272
4273 * window.c (replace_window): Rename second argument REPLACEMENT to
4274 NEW. New third argument SETFLAG. Rewrite.
4275 (delete_window, make_dummy_parent): Call replace_window with
4276 third argument 1.
4277 (window_list_1): Move down in code.
4278 (run_window_configuration_change_hook): Move set_buffer part
4279 before select_frame_norecord part in order to unwind correctly.
4280 Rename count1 to count.
4281 (recombine_windows, delete_deletable_window, resize_root_window)
4282 (Fdelete_other_windows_internal)
4283 (Frun_window_configuration_change_hook, make_parent_window)
4284 (resize_window_check, resize_window_apply, Fresize_window_apply)
4285 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
4286 (Fdelete_window_internal, Fresize_mini_window_internal):
4287 New functions.
1a13852e
MR
4288 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
4289
f3d1777e
MR
42902011-06-08 Martin Rudalics <rudalics@gmx.at>
4291
496e208e
MR
4292 * window.h (window): Add some new members to window structure -
4293 normal_lines, normal_cols, new_total, new_normal, clone_number,
4294 splits, nest, prev_buffers, next_buffers.
4295 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 4296 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 4297
f3d1777e
MR
4298 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
4299 Remove.
496e208e
MR
4300 (make_dummy_parent): Set new members of windows structure.
4301 (make_window): Move down in code. Handle new members of window
4302 structure.
4303 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
4304 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
4305 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
4306 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
4307 (Fset_window_next_buffers, Fset_window_clone_number):
4308 New functions.
496e208e
MR
4309 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
4310 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
4311 Doc-string fixes.
4312 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
4313 Argument WINDOW can be now internal window too.
4314 (Fwindow_use_time): Move up in code.
4315 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
4316 Rewrite doc-string.
4317 (Fset_window_configuration, saved_window)
4318 (Fcurrent_window_configuration, save_window_save): Handle new
4319 members of window structure.
b9e809c2
MR
4320 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
4321 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
4322 (syms_of_window): New Lisp objects Qrecord_window_buffer,
4323 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
4324 Qget_mru_window, Qresize_root_window,
4325 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
4326 Qauto_buffer_name; staticpro them.
f3d1777e 4327
abde8f8c
MR
43282011-06-07 Martin Rudalics <rudalics@gmx.at>
4329
4330 * window.c (Fwindow_total_size, Fwindow_left_column)
4331 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
4332 (Fwindow_list_1): New functions.
4333 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
4334 (Fwindow_width, Fscroll_left, Fscroll_right):
4335 Use window_body_cols instead of window_box_text_cols.
4336 (delete_window, Fset_window_configuration):
4337 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
4338 (delete_all_subwindows): Take a window as argument and not a
4339 structure. Rewrite.
190b47e6
MR
4340 (window_loop): Remove handling of GET_LRU_WINDOW and
4341 GET_LARGEST_WINDOW.
4342 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
4343
4344 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
4345 window_box_text_cols. delete_all_subwindows now takes a
4346 Lisp_Object as argument.
abde8f8c 4347
640c8776
SM
4348 * indent.c (compute_motion, Fcompute_motion):
4349 Use window_body_cols instead of window_box_text_cols.
abde8f8c 4350
fa8a67e6
MR
4351 * frame.c (delete_frame): Call delete_all_subwindows with root
4352 window as argument.
4353
a54e3482
DC
43542011-06-07 Daniel Colascione <dan.colascione@gmail.com>
4355
4356 * fns.c (Fputhash): Document return value.
4357
60002bf5
CY
43582011-06-06 Chong Yidong <cyd@stupidchicken.com>
4359
4360 * image.c (gif_load): Implement gif89a spec "no disposal" method.
4361
0c671da6 43622011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 4363
b862a52a 4364 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 4365
be44ca6c
PE
4366 Check for overflow when converting integer to cons and back.
4367 * charset.c (Fdefine_charset_internal, Fdecode_char):
4368 Use cons_to_unsigned to catch overflow.
4369 (Fencode_char): Use INTEGER_TO_CONS.
4370 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
4371 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
4372 * data.c (long_to_cons, cons_to_long): Remove.
4373 (cons_to_unsigned, cons_to_signed): New functions.
4374 These signal an error for invalid or out-of-range values.
4375 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
4376 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
4377 * font.c (Ffont_variation_glyphs):
4378 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
4379 * lisp.h: Include <intprops.h>.
4380 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
4381 (cons_to_signed, cons_to_unsigned): New decls.
4382 (long_to_cons, cons_to_long): Remove decls.
4383 * undo.c (record_first_change): Use INTEGER_TO_CONS.
4384 (Fprimitive_undo): Use CONS_TO_INTEGER.
4385 * xfns.c (Fx_window_property): Likewise.
4386 * xselect.c: Include <limits.h>.
4387 (x_own_selection, selection_data_to_lisp_data):
4388 Use INTEGER_TO_CONS.
4389 (x_handle_selection_request, x_handle_selection_clear)
4390 (x_get_foreign_selection, Fx_disown_selection_internal)
4391 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
4392 (lisp_data_to_selection_data): Use cons_to_unsigned.
4393 (x_fill_property_data): Use cons_to_signed.
4394 Report values out of range.
4395
d1f3d2af
PE
4396 Check for buffer and string overflow more precisely.
4397 * buffer.h (BUF_BYTES_MAX): New macro.
4398 * lisp.h (STRING_BYTES_MAX): New macro.
4399 * alloc.c (Fmake_string):
4400 * character.c (string_escape_byte8):
4401 * coding.c (coding_alloc_by_realloc):
4402 * doprnt.c (doprnt):
4403 * editfns.c (Fformat):
4404 * eval.c (verror):
4405 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
4406 since they may not be the same number.
4407 * editfns.c (Finsert_char):
4408 * fileio.c (Finsert_file_contents):
4409 Likewise for BUF_BYTES_MAX.
4410
dd52fcea
PE
4411 * image.c: Use ptrdiff_t, not int, for sizes.
4412 (slurp_file): Switch from int to ptrdiff_t.
4413 All uses changed.
4414 (slurp_file): Check that file size fits in both size_t (for
4415 malloc) and ptrdiff_t (for sanity and safety).
4416
7f9bbdbb
PE
4417 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
4418 if b->modtime has its maximal value.
4419
dfe18f82
PE
4420 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
4421
84acfcf0
PE
4422 Don't assume time_t can fit into int.
4423 * buffer.h (struct buffer.modtime): Now time_t, not int.
4424 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
4425 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
4426
ccd9a01a
PE
4427 Minor fixes for signed vs unsigned integers.
4428 * character.h (MAYBE_UNIFY_CHAR):
4429 * charset.c (maybe_unify_char):
4430 * keyboard.c (read_char, reorder_modifiers):
4431 XINT -> XFASTINT, since the integer must be nonnegative.
4432 * ftfont.c (ftfont_spec_pattern):
4433 * keymap.c (access_keymap, silly_event_symbol_error):
4434 XUINT -> XFASTINT, since the integer must be nonnegative.
4435 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
4436 since it makes no difference and we prefer signed.
4437 * keyboard.c (record_char): Use XUINT when all the neighbors do.
4438 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
4439 nonnegative.
4440
d6d100dd
SM
44412011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
4442
4443 * window.h (Fwindow_frame): Declare.
4444
2b6148e4
PE
44452011-06-06 Paul Eggert <eggert@cs.ucla.edu>
4446
4447 * alloc.c: Simplify handling of large-request failures (Bug#8800).
4448 (SPARE_MEMORY): Always define.
4449 (LARGE_REQUEST): Remove.
4450 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
4451
f230ecc9
MR
44522011-06-06 Martin Rudalics <rudalics@gmx.at>
4453
727e958e
MR
4454 * lisp.h: Move EXFUNS for Fframe_root_window,
4455 Fframe_first_window and Fset_frame_selected_window to window.h.
4456
4457 * window.h: Move EXFUNS for Fframe_root_window,
4458 Fframe_first_window and Fset_frame_selected_window here from
4459 lisp.h.
4460
4461 * frame.c (Fwindow_frame, Fframe_first_window)
4462 (Fframe_root_window, Fframe_selected_window)
4463 (Fset_frame_selected_window): Move to window.c.
4464 (Factive_minibuffer_window): Move to minibuf.c.
4465 (Fother_visible_frames_p): New function.
4466
4467 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
4468
f230ecc9
MR
4469 * window.c (decode_window, decode_any_window): Move up in code.
4470 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
4471 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
4472 (Fwindow_buffer): Move up and rewrite doc-string.
4473 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
4474 (Fwindow_prev): New functions.
727e958e
MR
4475 (Fwindow_frame): Move here from frame.c. Accept any window as
4476 argument.
4477 (Fframe_root_window, Fframe_first_window)
4478 (Fframe_selected_window): Move here from frame.c. Accept frame
4479 or arbitrary window as argument. Update doc-strings.
4480 (Fminibuffer_window): Move up in code.
4481 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
4482 (Fset_frame_selected_window): Move here from frame.c.
4483 Marginal rewrite.
727e958e
MR
4484 (Fselected_window, select_window, Fselect_window): Move up in
4485 code. Minor doc-string fixes.
f230ecc9 4486
4d09bcf6
PE
44872011-06-06 Paul Eggert <eggert@cs.ucla.edu>
4488
4489 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
4490 Do not assume that spare memory exists; that assumption is valid
4491 only if SYSTEM_MALLOC.
4492 (LARGE_REQUEST): New macro, so that the issue of large requests
4493 is separated from the issue of spare memory.
4494
810928a2
AS
44952011-06-05 Andreas Schwab <schwab@linux-m68k.org>
4496
172418ad
AS
4497 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
4498 format. (Bug#8806)
4499
43f862f7
AS
4500 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
4501
810928a2
AS
4502 * xfns.c (x_set_scroll_bar_default_width): Move declarations
4503 before statements.
4504
a059fe24
JD
45052011-06-05 Jan Djärv <jan.h.d@swipnet.se>
4506
4507 * gtkutil.c (xg_get_default_scrollbar_width): New function.
4508
4509 * gtkutil.h: Declare xg_get_default_scrollbar_width.
4510
4511 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
4512 min width by calling x_set_scroll_bar_default_width (Bug#8505).
4513
989bf368
JB
45142011-06-05 Juanma Barranquero <lekktu@gmail.com>
4515
4516 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
4517
4b80f674
CY
45182011-06-04 Chong Yidong <cyd@stupidchicken.com>
4519
4520 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
4521 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
4522 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
4523 New error handlers.
4b80f674
CY
4524 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
4525 Obey Vx_select_enable_clipboard_manager. Catch errors in
4526 x_clipboard_manager_save (Bug#8779).
4527 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 4528 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 4529
99a33b77 45302011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
4531
4532 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
4533
99a33b77 45342011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
4535
4536 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
4537 in the current matrix if keep_current_p is non-zero.
4538
8264569d
EZ
45392011-06-04 Eli Zaretskii <eliz@gnu.org>
4540
4541 * bidi.c (bidi_level_of_next_char): Fix last change.
4542
57f97249
EZ
45432011-06-03 Eli Zaretskii <eliz@gnu.org>
4544
fec2107c 4545 Support bidi reordering of text covered by display properties.
57f97249 4546
fec2107c
EZ
4547 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
4548 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
4549 (bidi_cache_search, bidi_cache_iterator_state)
4550 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
4551 (bidi_level_of_next_char, bidi_move_to_visually_next):
4552 Support character positions inside a run of characters covered by a
fec2107c
EZ
4553 display string.
4554 (bidi_paragraph_init, bidi_resolve_explicit_1)
4555 (bidi_level_of_next_char): Call bidi_fetch_char and
4556 bidi_fetch_char_advance instead of FETCH_CHAR and
4557 FETCH_CHAR_ADVANCE.
4558 (bidi_init_it): Initialize new members.
4559 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
4560 definitions.
4561 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
4562 instead of using explicit *_CHAR codes.
d6d100dd
SM
4563 (bidi_resolve_explicit, bidi_resolve_weak):
4564 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
4565 bidirectional text is supported only in multibyte buffers.
4566 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
4567 it to initialize the frame_window_p member of struct bidi_it.
4568 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
4569 (bidi_resolve_explicit, bidi_resolve_weak)
4570 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
4571 bidi_it->nchars is non-positive.
4572 (bidi_level_of_next_char): Don't try to lookup the cache for the
4573 next/previous character if nothing is cached there yet, or if we
4574 were just reseat()'ed to a new position.
c40e2fb2 4575
0e14fe90
EZ
4576 * xdisp.c (set_cursor_from_row): Set start and stop points
4577 according to the row's direction when priming the loop that looks
4578 for the glyph on which to display cursor.
4579 (single_display_spec_intangible_p): Function deleted.
4580 (display_prop_intangible_p): Reimplement to call
4581 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
4582 Accept 3 additional arguments needed by handle_display_spec.
4583 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
4584 values: lists, `(when COND...)' forms, etc.
4585 (single_display_spec_string_p): Support property values that are
4586 lists with the argument STRING its top-level element.
4587 (display_prop_string_p): Fix the condition for processing a
4588 property that is a list to be consistent with handle_display_spec.
fec2107c 4589 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
4590 last portion of handle_display_prop.
4591 (compute_display_string_pos): Accept additional argument
4592 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
4593 value of a `display' property is a "replacing spec".
4594 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
4595 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
4596 the display property, but just return a value indicating whether
4597 the display property will replace the characters it covers.
4598 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
4599 frame_window_p members of struct bidi_it.
d6d100dd
SM
4600 (compute_display_string_pos, compute_display_string_end):
4601 New functions.
fec2107c
EZ
4602 (push_it): Accept second argument POSITION, where pop_it should
4603 jump to continue iteration.
4604 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 4605
fec2107c
EZ
4606 * keyboard.c (adjust_point_for_property): Adjust the call to
4607 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
4608
4609 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
4610 (bidi_init_it): Update prototypes.
4611 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
4612 (compute_display_string_pos, compute_display_string_end):
4613 Declare prototypes.
fec2107c
EZ
4614 (struct bidi_it): New members nchars and disp_pos. ch_len is now
4615 EMACS_INT.
fc6f18ce 4616
40087514 46172011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 4618
57f53182
PE
4619 Malloc failure behavior now depends on size of allocation.
4620 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
4621 * lisp.h: Change signatures accordingly.
4622 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
4623 All callers changed. (Bug#8762)
4624
4625 * gnutls.c: Use Emacs's memory allocators.
4626 Without this change, the gnutls library would invoke malloc etc.
4627 directly, which causes problems on non-SYNC_INPUT hosts, and which
4628 runs afoul of improving memory_full behavior. (Bug#8761)
4629 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
4630 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
4631 xfree instead of the default malloc, realloc, free.
4632 (Fgnutls_boot): No need to check for memory allocation failure,
4633 since xmalloc does that for us.
4634
ac32cd99 4635 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
4636 * category.c (hash_get_category_set):
4637 * ccl.c (ccl_driver):
4638 * charset.c (Fdefine_charset_internal):
4639 * charset.h (struct charset.hash_index):
4640 * composite.c (get_composition_id, gstring_lookup_cache)
4641 (composition_gstring_put_cache):
4642 * composite.h (struct composition.hash_index):
4643 * dispextern.h (struct image.hash):
4644 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
4645 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4646 (hashfn_equal, hashfn_user_defined, make_hash_table)
4647 (maybe_resize_hash_table, hash_lookup, hash_put)
4648 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
4649 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
4650 (Fsxhash, Fgethash, Fputhash, Fmaphash):
4651 * image.c (make_image, search_image_cache, lookup_image)
4652 (xpm_put_color_table_h):
4653 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 4654 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 4655 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 4656 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
4657 * alloc.c (allocate_vectorlike):
4658 Check for overflow in vector size calculations.
4659 * ccl.c (ccl_driver):
4660 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
4661 * fns.c, image.c: Remove unnecessary static decls that would otherwise
4662 need to be updated by these changes.
40087514
PE
4663 * fns.c (make_hash_table, maybe_resize_hash_table):
4664 Check for integer overflow with large hash tables.
0de4bb68
PE
4665 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
4666 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
4667 (SXHASH_REDUCE): New macro.
4668 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
4669 Use it instead of discarding useful hash info with large hash values.
4670 (sxhash_float): New function.
4671 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
4672 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
4673 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
4674 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
4675 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
4676 Adjust signatures to match updated version of code.
4677 (consing_since_gc): Now EMACS_INT, since a single hash table can
4678 use more than INT_MAX bytes.
4679
698d32e2
DN
46802011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
4681
4682 Make it possible to build with GCC-4.6+ -O2 -flto.
4683
4684 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
4685
fd6fa53f
SM
46862011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
4687
4688 * minibuf.c (get_minibuffer, read_minibuf_unwind):
4689 Call minibuffer-inactive-mode.
4690
864db017
JB
46912011-05-31 Juanma Barranquero <lekktu@gmail.com>
4692
4693 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
4694 Update dependencies.
4695
2ad0baf4
DN
46962011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4697
4698 * data.c (init_data): Remove code for UTS, this system is not
4699 supported anymore.
4700
4fcc2638
DN
47012011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4702
4703 Don't force ./temacs to start in terminal mode.
4704
4705 * frame.c (make_initial_frame): Initialize faces in all cases, not
4706 only when CANNOT_DUMP is defined.
4707 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
4708
c56e0fd5
DN
47092011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4710
4711 * dispnew.c (add_window_display_history): Use const for the string
4712 pointer. Remove declaration, not needed.
4713
333d54da 47142011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 4715
55d4c1b2 4716 Use 'inline', not 'INLINE'.
333d54da 4717 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
4718 * alloc.c, fontset.c (INLINE): Remove.
4719 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
4720 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
4721 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
4722 * gmalloc.c (register_heapinfo): Use inline unconditionally.
4723 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
4724
738db178
DN
47252011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4726
4727 Make it possible to run ./temacs.
4728
4729 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
4730 syms_of_callproc does the same thing. Remove test for
4731 "initialized", do it in the caller.
4732 * emacs.c (main): Avoid calling set_initial_environment when dumping.
4733
620c53a6
SM
47342011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
4735
4736 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
4737 (read_minibuf): Use get_minibuffer.
4738 (syms_of_minibuf): Use DEFSYM.
4739 (Qmetadata): New var.
4740 * data.c (Qbuffer): Don't make it static.
4741 (syms_of_data): Use DEFSYM.
4742
e003a292
PE
47432011-05-31 Paul Eggert <eggert@cs.ucla.edu>
4744
4745 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
4746 (CCL_CODE_MIN): New macro.
4747
ed008a6d
PE
47482011-05-30 Paul Eggert <eggert@cs.ucla.edu>
4749
3687c2ef
PE
4750 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
4751
ed008a6d
PE
4752 * eval.c (Qdebug): Now static.
4753 * lisp.h (Qdebug): Remove decl. This reverts a part of the
4754 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
4755 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
4756
d66c4c7c
CY
47572011-05-29 Chong Yidong <cyd@stupidchicken.com>
4758
4759 * image.c: Various fixes to ImageMagick code comments.
4760 (Fimagemagick_types): Doc fix.
4761
5fbc2025
PE
47622011-05-29 Paul Eggert <eggert@cs.ucla.edu>
4763
0196f88a
PE
4764 Minor fixes prompted by GCC 4.6.0 warnings.
4765
4766 * xselect.c (converted_selections, conversion_fail_tag): Now static.
4767
5fbc2025
PE
4768 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
4769 (x_clipboard_manager_save_all): Move extern decl to ...
4770 * xterm.h: ... here, so that it can be checked for consistency.
4771
1dd3c2d9
CY
47722011-05-29 Chong Yidong <cyd@stupidchicken.com>
4773
4774 * xselect.c (x_clipboard_manager_save_frame)
4775 (x_clipboard_manager_save_all): New functions.
4776 (Fx_clipboard_manager_save): Lisp function deleted.
4777
4778 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
4779 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
4780
4781 * xterm.h: Update prototype.
4782
5ba6571d
WX
47832011-05-28 William Xu <william.xwl@gmail.com>
4784
4785 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
4786 exiting (Bug#8239).
4787
3eaff834
JM
47882011-05-28 Jim Meyering <meyering@redhat.com>
4789
e1900994 4790 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
4791 * fns.c (to_uchar): Define.
4792 (crypto_hash_function): Use it to convert some newly-signed
4793 variables to unsigned, to avoid sign-extension bugs. For example,
4794 without this change, (md5 "truc") would evaluate to
4795 45723a2aff78ff4fff7fff1114760e62 rather than the expected
4796 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 4797 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 4798
0f6990a7
PE
47992011-05-27 Paul Eggert <eggert@cs.ucla.edu>
4800
4801 Integer overflow fixes.
c8a9ca5a 4802
08686060
PE
4803 * dbusbind.c: Serial number integer overflow fixes.
4804 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
4805 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
4806 to hold a serial number that is too large for a fixnum.
4807 (Fdbus_method_return_internal, Fdbus_method_error_internal):
4808 Check for serial numbers out of range. Decode any serial number
59568bf0 4809 that was so large that it became a float. (Bug#8722)
08686060 4810
2d1fc3c7
PE
4811 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
4812 (Fdbus_call_method, Fdbus_call_method_asynchronously):
4813 Use XFASTINT rather than XUINT when numbers are nonnegative.
4814 (xd_append_arg, Fdbus_method_return_internal):
4815 (Fdbus_method_error_internal): Likewise. Also, for unsigned
4816 arguments, check that Lisp number is nonnegative, rather than
59568bf0 4817 silently wrapping negative numbers around. (Bug#8722)
30217ff0 4818 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 4819 (Bug#8722)
2d1fc3c7 4820
c8a9ca5a
PE
4821 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
4822
519e1d69
PE
4823 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
4824
30569699
PE
4825 ccl: add integer overflow checks
4826 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
4827 (IN_INT_RANGE): New macros.
4828 (ccl_driver): Use them to check for integer overflow when
4829 decoding a CCL program. Many of the new checks are whether XINT (x)
4830 fits in int; it doesn't always, on 64-bit hosts. The new version
4831 doesn't catch all possible integer overflows, but it's an
847044ea 4832 improvement. (Bug#8719)
30569699 4833
c11285dc
PE
4834 * alloc.c (make_event_array): Use XINT, not XUINT.
4835 There's no need for unsigned here.
4836
fdccd48e
PE
4837 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
4838 This follows up to the 2011-05-06 change that substituted uintptr_t
4839 for EMACS_INT. This case wasn't caught back then.
4840
37910ab2
PE
4841 Rework Fformat to avoid integer overflow issues.
4842 * editfns.c: Include <float.h> unconditionally, as it's everywhere
4843 now (part of C89). Include <verify.h>.
4844 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
4845 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
4846 (Fformat): Avoid the prepass trying to compute sizes; it was only
4847 approximate and thus did not catch overflow reliably. Instead, walk
4848 through the format just once, formatting and computing sizes as we go,
4849 checking for integer overflow at every step, and allocating a larger
4850 buffer as needed. Keep track separately whether the format is
4851 multibyte. Keep only the most-recently calculated precision, rather
4852 than them all. Record whether each argument has been converted to
4853 string. Use EMACS_INT, not int, for byte and char and arg counts.
4854 Support field widths and precisions larger than INT_MAX. Avoid
4855 sprintf's undefined behavior with conversion specifications such as %#d
4856 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
4857 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
4858 formatting out-of-range floating point numbers with int
9173deec 4859 formats. (Bug#8668)
37910ab2 4860
2e6578fb
PE
4861 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
4862
0ae6bdee
PE
4863 * data.c: Avoid integer truncation in expressions involving floats.
4864 * data.c: Include <intprops.h>.
4865 (arith_driver): When there's an integer overflow in an expression
4866 involving floating point, convert the integers to floating point
4867 so that the resulting value does not suffer from catastrophic
4868 integer truncation. For example, on a 64-bit host (* 4
4869 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
4870 Do not rely on undefined behavior after integer overflow.
4871
de883a70
PE
4872 merge count_size_as_multibyte, parse_str_to_multibyte
4873 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 4874 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
4875 Check for integer overflow.
4876 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
4877 since it's now a duplicate of the other. This is more of
4878 a character than a buffer op, so better that it's in character.c.
4879 * fns.c, print.c: Adjust to above changes.
4880
2ff916cb
PE
48812011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
4882
4883 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
4884
f1b54466
PE
48852011-05-27 Paul Eggert <eggert@cs.ucla.edu>
4886
fb1ac845
PE
4887 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
4888 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
4889 (x_clipboard_manager_save): Now static.
4890 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
4891
f1b54466
PE
4892 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
4893 (crypto_hash_function): Now static.
4894 Fix pointer signedness problems. Avoid unnecessary initializations.
4895
a9f737ee
CY
48962011-05-27 Chong Yidong <cyd@stupidchicken.com>
4897
4898 * termhooks.h (Vselection_alist): Make it terminal-local.
4899
4900 * terminal.c (create_terminal): Initialize it.
4901
4902 * xselect.c: Support for clipboard managers.
4903 (Vselection_alist): Move to termhooks.h as terminal-local var.
4904 (LOCAL_SELECTION): New macro.
4905 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
4906 (symbol_to_x_atom): Remove gratuitous arg.
4907 (x_handle_selection_request, lisp_data_to_selection_data)
4908 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
4909 (x_own_selection, x_get_local_selection, x_convert_selection):
4910 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
4911 (some_frame_on_display): Delete unused function.
4912 (Fx_own_selection_internal, Fx_get_selection_internal)
4913 (Fx_disown_selection_internal, Fx_selection_owner_p)
4914 (Fx_selection_exists_p): New optional frame arg.
4915 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
4916 (x_handle_selection_clear): Don't treat other terminals with the
4917 same keyboard specially. Use the terminal-local Vselection_alist.
4918 (x_clear_frame_selections): Use Frun_hook_with_args.
4919
4920 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
4921
4922 * xterm.h: Add support for those atoms.
4923
e067f0c1
CY
49242011-05-26 Chong Yidong <cyd@stupidchicken.com>
4925
4926 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
4927 (converted_selections, conversion_fail_tag): New global variables.
4928 (x_selection_request_lisp_error): Free the above.
4929 (x_get_local_selection): Remove unnecessary code.
4930 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
4931 of converted selections stored in converted_selections.
4932 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
4933 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
4934 (x_convert_selection): New function.
4935 (x_handle_selection_event): Simplify.
4936 (x_get_foreign_selection): Don't ignore incoming requests while
4937 waiting for an answer; this will fail when we implement
4938 SAVE_TARGETS, and seems unnecessary anyway.
4939 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
4940 (Vx_sent_selection_functions): Doc fix.
4941
0f4aebc0
LL
49422011-05-26 Leo Liu <sdl.web@gmail.com>
4943
4944 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
4945
e61124cd
YM
49462011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4947
4948 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
4949
4950 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
4951 for fringe update if it has periodic bitmap.
ac389d0c 4952 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
4953 and fringe_bitmap_periodic_p.
4954
4955 * fringe.c (get_fringe_bitmap_data): New function.
4956 (draw_fringe_bitmap_1, update_window_fringes): Use it.
4957 (update_window_fringes): Record periodicity of fringe bitmap in glyph
4958 row. Mark glyph row for fringe update if periodicity changed.
4959
4960 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
4961 for fringe update unless it has periodic bitmap.
4962
f16d9837
KH
49632011-05-25 Kenichi Handa <handa@m17n.org>
4964
4965 * xdisp.c (get_next_display_element): Set correct it->face_id for
4966 a static composition.
4967
e1b90ef6
LL
49682011-05-24 Leo Liu <sdl.web@gmail.com>
4969
4970 * deps.mk (fns.o):
4971 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
4972
4973 * fns.c (crypto_hash_function, Fsha1): New function.
4974 (Fmd5): Use crypto_hash_function.
4975 (syms_of_fns): Add Ssha1.
4976
7400048f
PE
49772011-05-22 Paul Eggert <eggert@cs.ucla.edu>
4978
4979 * gnutls.c: Remove unused macros.
4980 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
4981 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
4982 Remove macros that are defined and never used.
4983 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
4984
abb71cf4
CY
49852011-05-22 Chong Yidong <cyd@stupidchicken.com>
4986
4987 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
4988 (Fx_get_selection_internal): Minor cleanup.
4989 (Fx_own_selection_internal): Rename arguments for consistency with
4990 select.el.
4991
6307db39
PE
49922011-05-22 Paul Eggert <eggert@cs.ucla.edu>
4993
4994 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
4995
f3d4e0a4
CY
49962011-05-22 Chong Yidong <cyd@stupidchicken.com>
4997
4998 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
4999
4d8ade89
YM
50002011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5001
5002 * dispnew.c (scrolling_window): Don't exclude the case that the
5003 last enabled row in the desired matrix touches the bottom boundary.
5004
32078c8d
GM
50052011-05-21 Glenn Morris <rgm@gnu.org>
5006
5007 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
5008 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
5009 and add some more files.
32078c8d 5010
7285dc67
EZ
50112011-05-20 Eli Zaretskii <eliz@gnu.org>
5012
5013 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
5014 report_file_error introduced by the change from 2011-05-07.
5015
89d1bd22
PE
50162011-05-20 Paul Eggert <eggert@cs.ucla.edu>
5017
5018 * systime.h (Time): Define only if emacs is defined.
5019 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
5020 where the include path doesn't have X11/X.h by default. See
5021 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
5022
e23640bb 50232011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
5024
5025 * composite.c (find_automatic_composition): Fix previous change.
5026
b9704ad9
GM
50272011-05-20 Glenn Morris <rgm@gnu.org>
5028
5029 * lisp.mk: New file, split from Makefile.in.
5030 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
5031 (shortlisp): Remove.
5032 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
5033
4a720484
GM
50342011-05-19 Glenn Morris <rgm@gnu.org>
5035
5036 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
5037 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
5038 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
5039 (lisp): Set the order to that of loadup.el.
5040 (shortlisp): Make it a copy of $lisp.
5041 (SOME_MACHINE_LISP): Remove.
5042 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
5043 Use just $shortlisp, not $SOME_MACHINE_LISP too.
5044
a28d4396
KH
50452011-05-18 Kenichi Handa <handa@m17n.org>
5046
5047 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
5048 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
5049 (find_automatic_composition): Mostly rewrite for efficiency.
5050
a2b1fa8e
JB
50512011-05-18 Juanma Barranquero <lekktu@gmail.com>
5052
5053 * makefile.w32-in: Update dependencies.
5054
8e1f5610
CS
50552011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
5056
5057 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 5058 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 5059
7025ee00 50602011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 5061
cdfa6eab
PE
5062 Fix some integer overflow issues, such as string length overflow.
5063
06d6db33
PE
5064 * insdel.c (count_size_as_multibyte): Check for string overflow.
5065
2b4560a8
PE
5066 * character.c (lisp_string_width): Check for string overflow.
5067 Use EMACS_INT, not int, for string indexes and lengths; in
5068 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
5069 the resulting string length overflows an EMACS_INT; instead,
5070 report a string overflow if no precision given. When checking for
5071 precision exhaustion, use a check that cannot possibly have
5072 integer overflow. (Bug#8675)
5073 * character.h (lisp_string_width): Adjust to new signature.
5074
cb93f9be
PE
5075 * alloc.c (string_overflow): New function.
5076 (Fmake_string): Use it. This doesn't change behavior, but saves
5077 a few bytes and will simplify future changes.
5078 * character.c (string_escape_byte8): Likewise.
5079 * lisp.h (string_overflow): New decl.
5080
1a1f3366
PE
5081 Fixups, following up to the user-interface timestamp change.
5082 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
5083 for UI timestamps, instead of unsigned long.
9fbd6841
PE
5084 * msdos.c (mouse_get_pos): Likewise.
5085 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
5086 * w32gui.h (Time): Define by including "systime.h" rather than by
5087 declaring it ourselves. (Bug#8664)
5088
d4e3e4d3
PE
5089 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
5090 * image.c (clear_image_cache): Likewise.
5091
f6a24d19
PE
5092 * term.c (term_mouse_position): Don't assume time_t wraparound.
5093
08dc5ae6
PE
5094 Be more systematic about user-interface timestamps.
5095 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
5096 and sometimes 'EMACS_UINT', to represent these timestamps.
5097 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
5098 This makes the code easier to follow, and makes it easier to catch
5099 integer overflow bugs such as Bug#8664.
5100 * frame.c (Fmouse_position, Fmouse_pixel_position):
5101 Use Time, not unsigned long, for user-interface timestamps.
5102 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
5103 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
5104 * keyboard.h (last_event_timestamp): Likewise.
5105 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
5106 * menu.h (xmenu_show): Likewise.
5107 * term.c (term_mouse_position): Likewise.
5108 * termhooks.h (struct input_event.timestamp): Likewise.
5109 (struct terminal.mouse_position_hook): Likewise.
5110 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
5111 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
5112 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
5113 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
5114 what it was before.
5115 * menu.h, termhooks.h: Include "systime.h", for Time.
5116
8e55734a
PE
5117 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
5118 Don't assume that the difference between two unsigned long values
5119 can fit into an integer. At this point, we know button_down_time
5120 <= event->timestamp, so the difference must be nonnegative, so
5121 there's no need to cast the result if double-click-time is
5122 nonnegative, as it should be; check that it's nonnegative, just in
5123 case. This bug is triggered when events are more than 2**31 ms
86db42d2 5124 apart (about 25 days). (Bug#8664)
8e55734a 5125
841f1b75 5126 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 5127 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 5128
3e26f69c
PE
5129 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
5130 that always fit in int. Use a sentinel instead of a counter, to
5131 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
5132 * frame.h (struct frame): Use int for menu_bar_items_used
5133 instead of EMACS_INT, since it always fits in int.
3e26f69c 5134
5cc152c0
PE
5135 * menu.c (grow_menu_items): Check for int overflow.
5136
d89eb65e
PE
5137 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
5138
5235bd3e
PE
5139 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
5140 Before, the code was not consistent. These values cannot exceed
5141 2**31 - 1 so there's no need to make them unsigned.
5142 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
5143 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
5144 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
5145 as modifiers.
5146 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
5147
bc827e23
PE
5148 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
5149 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
5150 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
5151 presumably because the widths might not match.
5152
78eb494e
PE
5153 * window.c (size_window): Avoid needless test at loop start.
5154
04f2d78b
CB
51552011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
5156
5157 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
5158
d2fc7e3d 51592011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
5160
5161 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
5162
d2fc7e3d 51632011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
5164
5165 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
5166 `width' to `bar_area_x' and `bar_area_width', respectively.
5167 (x_scroll_run): Take account of fringe background extension.
5168
04f2d78b
CB
5169 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
5170 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
5171 `bar_area_width', respectively.
5172 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
5173 background extension.
5174
79b70037
GM
51752011-05-10 Jim Meyering <meyering@redhat.com>
5176
5177 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
5178
2f142cc5
JB
51792011-05-10 Juanma Barranquero <lekktu@gmail.com>
5180
5181 * image.c (Finit_image_library): Return t for built-in image types,
5182 like pbm and xbm. (Bug#8640)
5183
57679c86
AS
51842011-05-09 Andreas Schwab <schwab@linux-m68k.org>
5185
5186 * w32menu.c (set_frame_menubar): Fix submenu allocation.
5187
888c9e86
EZ
51882011-05-07 Eli Zaretskii <eliz@gnu.org>
5189
b0512a1d
EZ
5190 * w32console.c (Fset_screen_color): Doc fix.
5191 (Fget_screen_color): New function.
5192 (syms_of_ntterm): Defsubr it.
5193
7285dc67
EZ
5194 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
5195 unlink the temporary file if Fcall_process didn't create it in the
5196 first place.
5197 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
5198 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
5199 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
5200 cue to call_process_cleanup not to close that handle.
5201
4d3fcc8e
BK
52022011-05-07 Ben Key <bkey76@gmail.com>
5203
5204 * makefile.w32-in: The bootstrap-temacs rule now makes use of
5205 one of two shell specific rules, either bootstrap-temacs-CMD or
5206 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
5207 to the previous implementation of the bootstrap-temacs rule.
5208 The bootstrap-temacs-CMD rule is similar to the previous
5209 implementation of the bootstrap-temacs rule except that it
5210 makes use of the ESC_CFLAGS variable instead of the CFLAGS
5211 variable.
5212
5213 These changes, along with some changes to nt/configure.bat,
5214 nt/gmake.defs, and nt/nmake.defs, are required to extend my
5215 earlier fix to add support for --cflags and --ldflags options
5216 that include quotes so that it works whether make uses cmd or
5217 sh as the shell.
5218
b4289b64
MA
52192011-05-06 Michael Albinus <michael.albinus@gmx.de>
5220
5221 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
5222 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
5223 is a constant.
5224 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
5225 a string. Handle both cases.
5226 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
5227 (Fdbus_register_method): Use Qinvalid_function.
5228
af4c0e28
JB
52292011-05-06 Juanma Barranquero <lekktu@gmail.com>
5230
5231 * makefile.w32-in: Update dependencies.
5232 (LISP_H): Add inttypes.h and stdin.h.
5233 (PROCESS_H): Add unistd.h.
5234
c51453d9
EZ
52352011-05-06 Eli Zaretskii <eliz@gnu.org>
5236
5237 * lread.c: Include limits.h (fixes the MS-Windows build broken by
5238 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
5239
8ff0ac3c 52402011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 5241
4c4b566b
PE
5242 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
5243
aab2b9b5
PE
5244 * term.c (vfatal): Remove stray call to va_end.
5245 It's not needed and the C Standard doesn't allow it here anyway.
5246
c378da0b
PE
5247 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
5248 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
5249
288b08c7
PE
5250 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
5251 bytes.
5252
e3601888
PE
5253 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
5254
db6c0e74
PE
5255 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5256
dd5963ea
PE
5257 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
5258
88c9450f
PE
5259 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
5260
2f9442b8
PE
5261 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
5262
c032b5f8
PE
5263 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
5264 * charset.c (Fdefine_charset_internal): Don't initialize
5265 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 5266 32-bit int (Bug#8600).
a108c10b
PE
5267
5268 * lread.c (read_integer): Be more consistent with string-to-number.
5269 Use string_to_number to do the actual conversion; this avoids
5270 rounding errors and fixes some other screwups. Without this fix,
5271 for example, #x1fffffffffffffff was misread as -2305843009213693952.
5272 (digit_to_number): Move earlier, for benefit of read_integer.
5273 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 5274 not a digit in any supported base. (Bug#8602)
a108c10b 5275
ad5f9eea
PE
5276 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
5277
aec1708a
PE
5278 * dispnew.c (scrolling_window): Return 1 if we scrolled,
5279 to match comment at start of function. This also removes a
5280 GCC warning about overflow in a 32+64-bit port.
5281
47be4ab5
PE
5282 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
5283
371cac43
PE
5284 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
5285 Reported by Stefan Monnier in
5286 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
5287 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
5288 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 5289
d01a7826
PE
5290 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
5291 (EMACS_UINTPTR): Likewise, with uintptr_t.
5292
7fd47d5c
PE
5293 * lisp.h: Prefer 64-bit EMACS_INT if available.
5294 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
5295 on 32-bit hosts that have 64-bit int, so that they can access
5296 large files.
122b0c86
PE
5297 However, temporarily disable this change unless the temporary
5298 symbol WIDE_EMACS_INT is defined.
7fd47d5c 5299
8727937b
PE
5300 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
5301
8ac068ac
PE
5302 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
5303 This removes an assumption that EMACS_INT and long are the same
5304 width as pointers. The assumption is true for Emacs porting targets
5305 now, but we want to make other targets possible.
5306 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
5307 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
5308 In the rest of the code, change types of integers that hold casted
5309 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
5310 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
5311 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
5312 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
5313 No need to cast type when ORing.
5314 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
5315 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
5316 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
5317 assume EMACS_INT is the same width as char *.
5318 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
5319 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
5320 Remove no-longer-needed casts.
5321 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
5322 (xg_tool_bar_help_callback, xg_make_tool_item):
5323 Use EMACS_INTPTR to hold an integer
5324 that will be cast to void *; this can avoid a GCC warning
5325 if EMACS_INT is not the same width as void *.
5326 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
5327 * xdisp.c (display_echo_area_1, resize_mini_window_1):
5328 (current_message_1, set_message_1):
5329 Use a local to convert to proper width without a cast.
5330 * xmenu.c (dialog_selection_callback): Likewise.
5331
ede49d71
PE
5332 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
5333 Also, don't assume VALBITS / RAND_BITS is less than 5,
5334 and don't rely on undefined behavior when shifting a 1 left into
5335 the sign bit.
5336 * lisp.h (get_random): Change signature to match.
5337
2f30ecd0
PE
5338 * lread.c (hash_string): Use size_t, not int, for hash computation.
5339 Normally we prefer signed values; but hashing is special, because
5340 it's better to use unsigned division on hash table sizes so that
5341 the remainder is nonnegative. Also, size_t is the natural width
5342 for hashing into memory. The previous code used 'int', which doesn't
5343 retain enough info to hash well into very large tables.
5344 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
5345
2a866e7b
PE
5346 * dbusbind.c: Don't possibly lose pointer info when converting.
5347 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
5348 Use XPNTR rather than XHASH, so that the high-order bits of
5349 the pointer aren't lost when converting through void *.
5350
51639eac
PE
5351 * eval.c (Fautoload): Don't double-shift a pointer.
5352
92394119
PE
5353 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
5354
dbdb9a7c
JB
53552011-05-06 Juanma Barranquero <lekktu@gmail.com>
5356
5357 * gnutls.c (DEF_GNUTLS_FN):
5358 * image.c (DEF_IMGLIB_FN): Make function pointers static.
5359
db7a0b4f
AS
53602011-05-05 Andreas Schwab <schwab@linux-m68k.org>
5361
5362 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
5363 marker. (Bug#8610)
5364
f7ff1b0f 53652011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
5366
5367 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
5368 New version that can reserve upto 2GB of heap space.
5369
f7ff1b0f 53702011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
5371
5372 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
5373
639c109b
TZ
53742011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
5375
5376 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
5377 `gnutls_certificate_set_x509_key_file'.
5378
d2127135
JB
53792011-05-05 Juanma Barranquero <lekktu@gmail.com>
5380
5381 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
5382 Update dependencies.
5383
e968f4f3
JB
53842011-05-04 Juanma Barranquero <lekktu@gmail.com>
5385
5386 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
5387 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5388 Remove unused parameter `fildes'.
5389 * process.c (read_process_output, send_process): Don't pass it.
5390
84d358f0
JB
53912011-05-04 Juanma Barranquero <lekktu@gmail.com>
5392
5393 Fix previous change: the library cache is defined in w32.c.
5394 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
5395 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
5396
0898ca10
JB
53972011-05-04 Juanma Barranquero <lekktu@gmail.com>
5398
5399 Implement dynamic loading of GnuTLS on Windows.
5400
5401 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
5402 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
5403 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
5404 Declare.
5405
5406 * gnutls.c (Qgnutls_dll): Define.
5407 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
5408 (gnutls_*): Declare function pointers.
5409 (init_gnutls_functions): New function to initialize function pointers.
5410 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
5411 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
5412 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
5413 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
5414 (emacs_gnutls_write, emacs_gnutls_read)
5415 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
5416 (Fgnutls_available_p): New function.
5417 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
5418 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
5419 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
5420
5421 * image.c: Include w32.h.
5422 (Vimage_type_cache): Delete.
5423 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
5424 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
5425 (w32_delayed_load): Move to w32.c.
5426
5427 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
5428
5429 * w32.c (QCloaded_from, Vlibrary_cache): Define.
5430 (w32_delayed_load): Move from image.c. When loading a library, record
5431 its filename in the :loaded-from property of the library id.
5432 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
5433 Initialize and staticpro them.
5434 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
5435
5436 * process.c: Include lisp.h before w32.h, not after.
5437 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
5438 instead of gnutls_record_check_pending.
5439
5440 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
5441
ff4de4aa
TZ
54422011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
5443
5444 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
5445 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
5446 as passed in.
5447
abe95abb
JD
54482011-05-03 Jan Djärv <jan.h.d@swipnet.se>
5449
5450 * xterm.c (x_set_frame_alpha): Do not set property on anything
5451 else than FRAME_X_OUTER_WINDOW (Bug#8608).
5452
e16e55d4
JB
54532011-05-02 Juanma Barranquero <lekktu@gmail.com>
5454
5455 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
5456
bafcf6a5
JB
54572011-05-02 Juanma Barranquero <lekktu@gmail.com>
5458
5459 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
5460 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
5461 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
5462 (gnutls_global_initialized, Qgnutls_bootprop_priority)
5463 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
5464 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
5465 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
5466 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
5467 (Qgnutls_bootprop_callbacks_verify): Make static.
5468
e7a6747f
AS
54692011-05-01 Andreas Schwab <schwab@linux-m68k.org>
5470
19ed11ba
AS
5471 * callproc.c: Indentation fixup.
5472
e7a6747f 5473 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
5474 (wait_for_termination, interruptible_wait_for_termination):
5475 Move after wait_for_termination_1.
e7a6747f 5476
1ef14cb4
LMI
54772011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
5478
5479 * sysdep.c (interruptible_wait_for_termination): New function
5480 which is like wait_for_termination, but allows keyboard
5481 interruptions.
5482
5483 * callproc.c (Fcall_process): Add (:file "file") as an option for
5484 the STDOUT buffer.
5485 (Fcall_process_region): Ditto.
5486
330d880c
EZ
54872011-04-30 Eli Zaretskii <eliz@gnu.org>
5488
8db90b73
EZ
5489 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
5490 rather than `XVECTOR (FOO)->size'.
5491
330d880c
EZ
5492 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
5493 inttypes.h, as a gnulib replacement is used if it not available in
5494 system headers.
5495
15cbd324
EZ
54962011-04-21 Eli Zaretskii <eliz@gnu.org>
5497
5498 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
5499 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
5500 of MOST_POSITIVE_FIXNUM. (Bug#8528)
5501
5502 * coding.c (coding_alloc_by_realloc): Error out if destination
5503 will grow beyond MOST_POSITIVE_FIXNUM.
5504 (decode_coding_emacs_mule): Abort if there isn't enough place in
5505 charbuf for the composition carryover bytes. Reserve an extra
5506 space for up to 2 characters produced in a loop.
5507 (decode_coding_iso_2022): Abort if there isn't enough place in
5508 charbuf for the composition carryover bytes.
5509
55102011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 5511
ae940cca
EZ
5512 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
5513 aborting when %lld or %lll format is passed.
5514 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
5515 %llo or %llx format is passed. (Bug#8545)
5516
03ab8921
EZ
5517 * window.c (window_scroll_line_based): Use a marker instead of
5518 simple variables to record original value of point. (Bug#7952)
5519
afda1437
EZ
5520 * doprnt.c (doprnt): Fix the case where a multibyte sequence
5521 produced by %s or %c overflows available buffer space. (Bug#8545)
5522
f76dee0c
PE
55232011-04-28 Paul Eggert <eggert@cs.ucla.edu>
5524
5525 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 5526 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 5527
fdc5744d
JB
55282011-04-28 Juanma Barranquero <lekktu@gmail.com>
5529
5530 * w32.c (init_environment): Warn about defaulting HOME to C:\.
5531
638f053a
JB
55322011-04-28 Juanma Barranquero <lekktu@gmail.com>
5533
5534 * keyboard.c (Qdelayed_warnings_hook): Define.
5535 (command_loop_1): Run `delayed-warnings-hook'
5536 if Vdelayed_warnings_list is non-nil.
5537 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
5538 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
5539
d178f871
EZ
55402011-04-28 Eli Zaretskii <eliz@gnu.org>
5541
5542 * doprnt.c (doprnt): Don't return value smaller than the buffer
5543 size if the message was truncated. (Bug#8545).
5544
b124fd93
JB
55452011-04-28 Juanma Barranquero <lekktu@gmail.com>
5546
5547 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
5548 (Fx_window_property): #if-0 the whole functions, not just the bodies.
5549
e810457d
PE
55502011-04-27 Paul Eggert <eggert@cs.ucla.edu>
5551
5552 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
5553
ea51cceb
JB
55542011-04-27 Juanma Barranquero <lekktu@gmail.com>
5555
5556 * makefile.w32-in: Update dependencies.
5557
94dcfacf
EZ
55582011-04-27 Eli Zaretskii <eliz@gnu.org>
5559
5560 Improve `doprnt' and its usage. (Bug#8545)
5561 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
5562 `format_end'. Remove support for %l as a conversion specifier.
5563 Don't use xrealloc. Improve diagnostics when the %l size modifier
5564 is used. Update the commentary.
5565
5566 * eval.c (verror): Simplify calculation of size_t.
5567
5568 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
5569 messages.
5570
f61f41d7
PE
55712011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
5572
5573 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
5574 change.
5575
96fb4434
PE
55762011-04-27 Paul Eggert <eggert@cs.ucla.edu>
5577
5578 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
5579 This makes this file independent of the recent pseudovector change.
5580
671875da 55812011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 5582
69e9b5a3
PE
5583 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
5584
b5f869a7 5585 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 5586 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 5587 Remove unused local.
c8926152 5588 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 5589
841a1577 5590 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
5591 GCC 4.6.0 optimizes based on type-based alias analysis.
5592 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
5593 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
5594 != &v->size, and therefore "v->size = 1; b->size = 2; return
5595 v->size;" must therefore return 1. This assumption is incorrect
5596 for Emacs, since it type-puns struct Lisp_Vector * with many other
5597 types. To fix this problem, this patch adds a new type struct
f904488f 5598 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
5599 and pseudovectors, and helps optimizing compilers not get fooled
5600 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
5601 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
5602 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
5603 the size member.
eab3844f
PE
5604 (XSETPVECTYPE): Rewrite in terms of new macro.
5605 (XSETPVECTYPESIZE): New macro, specifying both type and size.
5606 This is a bit clearer, and further avoids the possibility of
5607 undesirable aliasing.
5608 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 5609 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
5610 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
5611 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
5612 (ASIZE): Now uses header.size rather than size.
5613 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
5614 to avoid the hassle of writing XVECTOR (foo)->header.size.
5615 (struct vectorlike_header): New type.
eab3844f
PE
5616 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
5617 object, to help avoid aliasing.
5618 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
5619 (SUBRP): Likewise, since Lisp_Subr is a special case.
5620 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
5621 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
5622 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 5623 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
5624 changed to be "header.size" and "header.next".
5625 * buffer.h (struct buffer): Likewise.
5626 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
5627 * frame.h (struct frame): Likewise.
5628 * process.h (struct Lisp_Process): Likewise.
5629 * termhooks.h (struct terminal): Likewise.
5630 * window.c (struct save_window_data, struct saved_window): Likewise.
5631 * window.h (struct window): Likewise.
5632 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
5633 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
5634 * buffer.c (init_buffer_once): Likewise.
5635 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
5636 special case.
5637 * process.c (Fformat_network_address): Use local var for size,
5638 for brevity.
5639
0df1eac5
PE
5640 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
5641
847ab9d1 5642 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
5643 * data.c (atof): Remove decl; no longer used or needed.
5644 (digit_to_number): Move to lread.c.
5645 (Fstring_to_number): Use new string_to_number function, to be
5646 consistent with how the Lisp reader treats infinities and NaNs.
5647 Do not assume that floating-point numbers represent EMACS_INT
5648 without losing information; this is not true on most 64-bit hosts.
5649 Avoid double-rounding errors, by insisting on integers when
5650 parsing non-base-10 numbers, as the documentation specifies.
5651 * lisp.h (string_to_number): New decl, replacing ...
5652 (isfloat_string): Remove.
bc0a5c13 5653 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 5654 (read1): Do not accept +. and -. as integers; this
452f4150
PE
5655 appears to have been a coding error. Similarly, do not accept
5656 strings like +-1e0 as floating point numbers. Do not report
5657 overflow for integer overflows unless the base is not 10 which
5658 means we have no simple and reliable way to continue.
5659 Break out the floating-point parsing into a new
5660 function string_to_number, so that Fstring_to_number parses
5661 floating point numbers consistently with the Lisp reader.
04f2d78b 5662 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
5663 (E_CHAR, EXP_INT): Remove, replacing with ...
5664 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
5665 (string_to_number): New function, replacing isfloat_string.
5666 This function checks for valid syntax and produces the resulting
5667 Lisp float number too. Rework it so that string-to-number
bc0a5c13 5668 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
5669 so that overflow for non-base-10 numbers is reported only when
5670 there's no portable and simple way to convert to floating point.
452f4150 5671
67769ffc
PE
5672 * textprop.c (set_text_properties_1): Rewrite for clarity,
5673 and to avoid GCC warning about integer overflow.
5674
c20db43f
PE
5675 * intervals.h (struct interval): Use EMACS_INT for members
5676 where EMACS_UINT might cause problems. See
5677 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
5678 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
5679 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
5680 All uses changed.
37aa2f85
PE
5681 (offset_intervals): Tell GCC not to worry about length overflow
5682 when negating a negative length.
c20db43f 5683
2538aa2f
PE
5684 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
5685 (overrun_check_free): Likewise.
5686
f2d3008d
PE
5687 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
5688 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
5689 word size.
5690
ec8df744
PE
5691 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
5692 (gnutls_make_error): Rename local to avoid shadowing.
5693 (gnutls_emacs_global_deinit): ifdef out; not used.
5694 (Fgnutls_boot): Use const for pointer to readonly storage.
5695 Comment out unused local. Fix pointer signedness problems.
5696
640ee02d
PE
5697 * lread.c (openp): Don't stuff size_t into an 'int'.
5698 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
5699 about possible signed overflow.
5700
6048fb2a
PE
5701 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
5702 (GDK_KEY_g): Don't define if already defined.
5703 (xg_prepare_tooltip): Avoid pointer signedness problem.
5704 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
5705
fa3c87e1
PE
5706 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
5707 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
5708
2172544b
PE
5709 * xfns.c (Fx_window_property): Simplify a bit,
5710 to make a bit faster and to avoid GCC 4.6.0 warning.
5711 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
5712
9b821a21
PE
5713 * fns.c (internal_equal): Don't assume size_t fits in int.
5714
3c616cfa
PE
5715 * alloc.c (compact_small_strings): Tighten assertion a little.
5716
c2982e87
PE
5717 Replace pEd with more-general pI, and fix some printf arg casts.
5718 * lisp.h (pI): New macro, generalizing old pEd macro to other
5719 conversion specifiers. For example, use "...%"pI"d..." rather
5720 than "...%"pEd"...".
5721 (pEd): Remove. All uses replaced with similar uses of pI.
5722 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
5723 * alloc.c (check_pure_size): Don't overflow by converting size to int.
5724 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
5725 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
5726 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
5727 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
5728 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
5729 64-bit hosts.
5730 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
5731 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
5732 * print.c (safe_debug_print, print_object): Likewise.
5733 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
5734 to int.
6f04d126
PE
5735 Use pI instead of if-then-else-abort. Use %p to avoid casts,
5736 avoiding the 0 flag, which is not portable.
c2982e87
PE
5737 * process.c (Fmake_network_process): Use pI to avoid cast.
5738 * region-cache.c (pp_cache): Likewise.
5739 * xdisp.c (decode_mode_spec): Likewise.
5740 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
5741 behavior on 64-bit hosts with printf arg.
6f04d126 5742 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
5743 (x_stop_queuing_selection_requests): Likewise.
5744 (x_get_window_property): Don't truncate byte count to an 'int'
5745 when tracing.
0b432f21 5746
5e073ec7
PE
5747 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
5748 here, since it parses constructs like leading '-' and spaces,
5749 which are not wanted; and it overflows with large numbers.
5750 Instead, simply match F[0-9]+, which is what is wanted anyway.
5751
36372bf9
PE
5752 * alloc.c: Remove unportable assumptions about struct layout.
5753 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
5754 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
5755 (allocate_vectorlike, make_pure_vector): Use the new macros,
5756 plus offsetof, to remove unportable assumptions about struct layout.
5757 These assumptions hold on all porting targets that I know of, but
5758 they are not guaranteed, they're easy to remove, and removing them
5759 makes further changes easier.
5760
0b432f21
PE
5761 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
5762 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
5763 (string_overrun_cookie): Now const. Use initializers that
5764 don't formally overflow signed char, to avoid warnings.
000098c1
PE
5765 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
5766 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
5767 (allocate_buffer): Don't assume sizeof (struct buffer) is a
5768 multiple of sizeof (EMACS_INT); it need not be, if
5769 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 5770 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 5771
895009e1
JB
57722011-04-26 Juanma Barranquero <lekktu@gmail.com>
5773
5774 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
5775
6a7a1b0b
TZ
57762011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
5777
5778 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 5779 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
5780 Reported by Paul Eggert <eggert@cs.ucla.edu>.
5781
841a1577 57822011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
5783
5784 * lisp.h (Qdebug): List symbol.
895009e1 5785 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
5786 * keyboard.c (debug-on-event): New variable.
5787 (handle_user_signal): Break into debugger when debug-on-event
5788 matches the current signal symbol.
5789
f2d3ba6f
DN
57902011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
5791
5792 * alloc.c (check_sblock, check_string_bytes)
5793 (check_string_free_list): Convert to standard C.
5794
42ce4c63
TZ
57952011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
5796
5797 * w32.c (emacs_gnutls_push): Fix typo.
5798
825cd63c
EZ
57992011-04-25 Eli Zaretskii <eliz@gnu.org>
5800
fb11d64d
EZ
5801 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
5802 "cast to pointer from integer of different size".
5803
825cd63c
EZ
5804 Improve doprnt and its use in verror. (Bug#8545)
5805 * doprnt.c (doprnt): Document the set of format control sequences
5806 supported by the function. Use SAFE_ALLOCA instead of always
5807 using `alloca'.
5808
5809 * eval.c (verror): Don't limit the buffer size at size_max-1, that
5810 is one byte too soon. Don't use xrealloc; instead xfree and
5811 xmalloc anew.
5812
e061a11b
TZ
58132011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
5814
5815 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
5816 callbacks stage.
5817
5818 * gnutls.c: Renamed global_initialized to
5819 gnutls_global_initialized. Added internals for the
5820 :verify-hostname-error, :verify-error, and :verify-flags
5821 parameters of `gnutls-boot' and documented those parameters in the
5822 docstring. Start callback support.
9173deec
JB
5823 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
5824 unless a fatal error occurred. Call gnutls_alert_send_appropriate
5825 on error. Return error code.
e061a11b
TZ
5826 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
5827 (emacs_gnutls_read): Likewise.
5828 (Fgnutls_boot): Return handshake error code.
5829 (emacs_gnutls_handle_error): New function.
5830 (wsaerror_to_errno): Likewise.
5831
5832 * w32.h (emacs_gnutls_pull): Add prototype.
5833 (emacs_gnutls_push): Likewise.
5834
5835 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
5836 (emacs_gnutls_push): Likewise.
5837
58382011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
5839
5840 * process.c (wait_reading_process_output): Check if GnuTLS
5841 buffered some data internally if no FDs are set for TLS
5842 connections.
5843
5844 * makefile.w32-in (OBJ2): Add gnutls.$(O).
5845 (LIBS): Link to USER_LIBS.
5846 ($(BLD)/gnutls.$(0)): New target.
5847
fa6996bc
EZ
58482011-04-24 Eli Zaretskii <eliz@gnu.org>
5849
eb35682e
EZ
5850 * xdisp.c (handle_single_display_spec): Rename the
5851 display_replaced_before_p argument into display_replaced_p, to
5852 make it consistent with the commentary. Fix typos in the
5853 commentary.
5854
e2ad650c
EZ
5855 * textprop.c (syms_of_textprop): Remove dead code.
5856 (copy_text_properties): Delete obsolete commentary about an
5857 interface that was deleted long ago. Fix typos in the description
5858 of arguments.
5859
1b2de274
EZ
5860 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
5861 to changes in oldXMenu/XMenu.h from 2011-04-16.
5862 <menu_help_message, prev_menu_help_message>: Constify.
5863 (IT_menu_make_room): menu->help_text is now `const char **';
5864 adjust.
5865
5866 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
5867 to changes in oldXMenu/XMenu.h from 2011-04-16.
5868 (struct XMenu): Declare `help_text' `const char **'.
5869
5870 * xfaces.c <Qunspecified>: Make extern again.
5871
5872 * syntax.c: Include sys/types.h before including regex.h, as
5873 required by Posix.
5874
762b15be
EZ
5875 * doc.c (get_doc_string): Improve the format passed to `error'.
5876
5877 * doprnt.c (doprnt): Improve commentary.
5878
5879 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
5880
5881 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
5882 them with etags.
5883
f1052e5d
EZ
5884 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
5885 changes in globals.h immediately force recompilation.
762b15be
EZ
5886 (TAGS): Depend on $(CURDIR)/m/intel386.h and
5887 $(CURDIR)/s/ms-w32.h.
5888 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 5889
fa6996bc
EZ
5890 * character.c (Fchar_direction): Function deleted.
5891 (syms_of_character): Don't defsubr it.
5892 <char-direction-table>: Deleted.
5893
e6c3da20
EZ
58942011-04-23 Eli Zaretskii <eliz@gnu.org>
5895
5896 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
5897 * doprnt.c: Include limits.h.
5898 (SIZE_MAX): New macro.
04f2d78b
CB
5899 (doprnt): Return a size_t value. 2nd arg is now size_t.
5900 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
5901 Improve overflow protection. Support `l' modifier for integer
5902 conversions. Support %l conversion. Don't assume an EMACS_INT
5903 argument for integer conversions and for %c.
5904
5905 * lisp.h (doprnt): Restore prototype.
5906
5907 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
5908 $(SRC)/character.h.
5909
5910 * Makefile.in (base_obj): Add back doprnt.o.
5911
5912 * deps.mk (doprnt.o): Add back prerequisites.
5913 (callint.o): Depend on character.h.
5914
5915 * eval.c (internal_lisp_condition_case): Include the handler
5916 representation in the error message.
5917 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
5918 when breaking from the loop.
5919
5920 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
5921
5922 * callint.c (Fcall_interactively): When displaying error message
5923 about invalid control letter, pass the character's codepoint, not
5924 a pointer to its multibyte form. Improve display of the character
5925 in octal and display also its hex code.
5926
5927 * character.c (char_string): Use %x to display the (unsigned)
5928 codepoint of an invalid character, to avoid displaying a bogus
5929 negative value.
5930
5931 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
5932 `error', not SYMBOL_NAME itself.
5933
5934 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
5935 character arguments to `error'.
5936
5937 * charset.c (check_iso_charset_parameter): Fix incorrect argument
5938 to `error' in error message about FINAL_CHAR argument. Make sure
5939 FINAL_CHAR is a character, and use %c when it is passed as
5940 argument to `error'.
5941
4ffd0d6b 59422011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
5943
5944 * s/ms-w32.h (localtime): Redirect to sys_localtime.
5945
5946 * w32.c: Include <time.h>.
5947 (sys_localtime): New function.
5948
4ffd0d6b 59492011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
5950
5951 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
5952
4ffd0d6b 5953 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 5954
4ffd0d6b 59552011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 5956
4ffd0d6b
GM
5957 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
5958 zombies (Bug#8467).
aac0c6e3 5959
04c56954
EZ
59602011-04-19 Eli Zaretskii <eliz@gnu.org>
5961
5962 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
5963 gl_state.e_property when gl_state.object is Qt.
5964
5965 * insdel.c (make_gap_larger): Remove limitation of buffer size
5966 to <= INT_MAX.
5967
16a43933
CY
59682011-04-18 Chong Yidong <cyd@stupidchicken.com>
5969
5970 * xdisp.c (lookup_glyphless_char_display)
5971 (produce_glyphless_glyph): Handle cons cell entry in
5972 glyphless-char-display.
5973 (Vglyphless_char_display): Document it.
5974
5975 * term.c (produce_glyphless_glyph): Handle cons cell entry in
5976 glyphless-char-display.
5977
4581706e
CY
59782011-04-17 Chong Yidong <cyd@stupidchicken.com>
5979
5980 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
5981
5982 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
5983
5984 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
5985 definition for no-X builds.
5986
4887c6e2 59872011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 5988
fd35b6f9
PE
5989 Static checks with GCC 4.6.0 and non-default toolkits.
5990
5c1ccb01
PE
5991 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
5992
006c5daa
PE
5993 * process.c (keyboard_bit_set): Define only if SIGIO.
5994 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
5995 (send_process): Repair possible setjmp clobbering.
5996
efc736d3
PE
5997 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
5998
4e2fe2e6
PE
5999 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
6000
f97334a2
PE
6001 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
6002
4e75f29d
PE
6003 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
6004 Define only if needed.
6005
90efadd1
PE
6006 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
6007 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 6008 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 6009
3c647824
PE
6010 * dispextern.h (struct redisplay_interface): Rename param
6011 to avoid shadowing.
e264f262 6012 * termhooks.h (struct terminal): Likewise.
761383f4 6013 * xterm.c (xembed_send_message): Likewise.
3c647824 6014
b58c5c4a
PE
6015 * insdel.c (make_gap_smaller): Define only if
6016 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
6017
cad59032
PE
6018 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
6019 it.
6020
c339dc2e
PE
6021 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
6022 so that we aren't warned about unused symbols.
6023
91a3e27b
PE
6024 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
6025
399c71d3 6026 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 6027
8ffc96f5
PE
6028 * xfns.c (x_real_positions): Mark locals as initialized.
6029
eef9bc79
PE
6030 * xmenu.c (xmenu_show): Don't use uninitialized vars.
6031
098db9dd
PE
6032 * xterm.c: Fix problems found by static analysis with other toolkits.
6033 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
6034 (x_dispatch_event): Declare static if USE_GTK, and
6035 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 6036 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 6037 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
6038 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
6039 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 6040
eb18f6cc
PE
6041 * xmenu.c (menu_help_callback): Pointer type fixes.
6042 Use const pointers when pointing at readonly data. Avoid pointer
6043 signedness clashes.
6044 (FALSE): Remove unused macro.
6045 (update_frame_menubar): Remove unused decl.
6046
1fe72bf8
PE
6047 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
6048
60d9e1db
PE
6049 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
6050 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
6051 (single_menu_item): Rename local to avoid shadowing.
6052
39261c26
PE
6053 * keyboard.c (make_lispy_event): Remove unused local var.
6054
018c5e19
PE
6055 * frame.c, frame.h (x_get_resource_string): Bring this back, but
6056 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
6057
63d2b86e
PE
6058 * bitmaps: Change bitmaps from unsigned char back to the X11
6059 compatible char. Avoid the old compiler warnings about
6060 out-of-range initializers by using, for example, '\xab' rather
6061 than 0xab.
6062
aefd87e1
PE
6063 * xgselect.c (xgselect_initialize): Check vs interface
6064 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
6065
bf501fb9
PE
6066 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
6067
e9829fdf
PE
6068 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
6069 to read-only memory.
6070
1086c095
PE
6071 * fns.c (vector): Remove; this old hack is no longer needed.
6072
2baccd04 6073 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 6074 Remove unused var.
dde42981 6075 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 6076
72391843 6077 * xrdb.c (x_load_resources): Omit unused local.
3565b346 6078
436c16df 6079 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 6080 (x_window): Rename locals to avoid shadowing.
dc5ddd85 6081 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 6082
92bb796d 6083 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 6084 (x_term_init): Remove local to avoid shadowing.
92bb796d 6085
764430a3 6086 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
6087
6088 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
6089 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
6090
d1dfb56c
EZ
60912011-04-16 Eli Zaretskii <eliz@gnu.org>
6092
c4354cb4
EZ
6093 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
6094
d1dfb56c
EZ
6095 Fix regex.c, syntax.c and friends for buffers > 2GB.
6096 * syntax.h (struct gl_state_s): Declare character position members
6097 EMACS_INT.
6098
6099 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
6100
04f2d78b
CB
6101 * textprop.c (verify_interval_modification, interval_of):
6102 Declare arguments EMACS_INT.
d1dfb56c
EZ
6103
6104 * intervals.c (adjust_intervals_for_insertion): Declare arguments
6105 EMACS_INT.
6106
6107 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
6108
6109 * indent.c (Fvertical_motion): Local variable it_start is now
6110 EMACS_INT.
6111
6112 * regex.c (re_match, re_match_2, re_match_2_internal)
6113 (bcmp_translate, regcomp, regexec, print_double_string)
6114 (group_in_compile_stack, re_search, re_search_2, regex_compile)
6115 (re_compile_pattern, re_exec): Declare arguments and local
6116 variables `size_t' and `ssize_t' and return values `regoff_t', as
6117 appropriate.
6118 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
6119 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
6120 <compile_stack_type>: `size' and `avail' are now `size_t'.
6121
6122 * regex.h <regoff_t>: Use ssize_t, not int.
6123 (re_search, re_search_2, re_match, re_match_2): Arguments that
6124 specify buffer/string position and length are now ssize_t and
6125 size_t. Return type is regoff_t.
6126
613052cd
BK
61272011-04-16 Ben Key <bkey76@gmail.com>
6128
6129 * nsfont.m: Fixed bugs in ns_get_family and
6130 ns_descriptor_to_entity that were caused by using free to
6131 deallocate memory blocks that were allocated by xmalloc (via
6132 xstrdup). This caused Emacs to crash when compiled with
6133 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
6134 --enable-checking=xmallocoverrun). xfree is now used to
6135 deallocate these memory blocks.
6136
4170f62f 61372011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 6138
71b41406
PE
6139 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
6140
9587a89d
PE
6141 emacs_write: Accept and return EMACS_INT for sizes.
6142 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
6143 et seq.
6144 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
6145 Accept and return EMACS_INT.
6146 (emacs_gnutls_write): Return the number of bytes written on
6147 partial writes.
6148 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
6149 (emacs_read, emacs_write): Remove check for negative size, as the
6150 Emacs source code has been audited now.
9587a89d
PE
6151 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
6152 (emacs_read, emacs_write): Use it.
273a5f82
PE
6153 * process.c (send_process): Adjust to the new signatures of
6154 emacs_write and emacs_gnutls_write. Do not attempt to store
6155 a byte offset into an 'int'; it might overflow.
9587a89d 6156 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 6157
3e047f51
PE
6158 * sound.c: Don't assume sizes fit in 'int'.
6159 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 6160 Return EMACS_INT, not int.
3e047f51 6161 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
6162 Accept EMACS_INT, not int.
6163 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
6164 record read return values.
6165
cc39a9db
BK
61662011-04-15 Ben Key <bkey76@gmail.com>
6167
c9d0ec6d
JB
6168 * keyboard.c (Qundefined): Don't declare static since it is used
6169 in nsfns.m.
6170 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
6171 static since they are used in nsfont.m.
cc39a9db 6172
6c60eb9f
SM
61732011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
6174
6175 * process.c (Qprocessp): Don't declare static.
6176 * lisp.h (Qprocessp): Declare again.
6177
7990b61a
JB
61782011-04-15 Juanma Barranquero <lekktu@gmail.com>
6179
6180 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
6181
5d4cb038
PE
61822011-04-14 Paul Eggert <eggert@cs.ucla.edu>
6183
8bd7b830 6184 Improve C-level modularity by making more things 'static'.
cd64ea1d 6185
e3b27b31
PE
6186 Don't publish debugger-only interfaces to other modules.
6187 * lisp.h (safe_debug_print, debug_output_compilation_hack):
6188 (verify_bytepos, count_markers): Move decls to the only modules
6189 that need them.
6190 * region-cache.h (pp_cache): Likewise.
6191 * window.h (check_all_windows): Likewise.
6192 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
6193
5d4cb038
PE
6194 * sysdep.c (croak): Now static, if
6195 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
6196 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
6197
6198 * alloc.c (refill_memory_reserve): Now static if
6199 !defined REL_ALLOC || defined SYSTEM_MALLOC.
6200 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 6201
e87b6180
PE
6202 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
6203 Define only if USE_LUCID.
6204
ac64929e
PE
6205 * xrdb.c (x_customization_string, x_rm_string): Now static.
6206
6f37259d
PE
6207 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
6208 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
6209
1683e3ab
PE
6210 * xdisp.c (draw_row_with_mouse_face): Now static.
6211 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
6212
de9c2632
PE
6213 * window.h (check_all_windows): Mark externally visible.
6214
2b96acb7
PE
6215 * window.c (window_deletion_count): Now static.
6216
6217 * undo.c: Make symbols static if they're not exported.
6218 (last_undo_buffer, last_boundary_position, pending_boundary):
6219 Now static.
6220
50436f33
PE
6221 * textprop.c (interval_insert_behind_hooks): Now static.
6222 (interval_insert_in_front_hooks): Likewise.
6223
64520e5c
PE
6224 * term.c: Make symbols static if they're not exported.
6225 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
6226 (max_frame_lines, tty_set_terminal_modes):
6227 (tty_reset_terminal_modes, tty_turn_off_highlight):
6228 (get_tty_terminal): Now static.
6229 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
6230 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 6231 HAVE_WINDOW_SYSTEM.
64520e5c
PE
6232 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
6233 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
6234
1fa53021
PE
6235 * sysdep.c: Make symbols static if they're not exported.
6236 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
6237 Now static.
6238 (sigprocmask_set, full_mask): Remove; unused.
6239 (wait_debugging): Mark as visible.
6240 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
6241 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
6242
d4b43b22
PE
6243 * syntax.c (syntax_temp): Define only if !__GNUC__.
6244
b7c513d0
PE
6245 * sound.c (current_sound_device, current_sound): Now static.
6246
989b29ad
PE
6247 * search.c (searchbufs, searchbuf_head): Now static.
6248
13a55a78
PE
6249 * scroll.c (scroll_cost): Remove; unused.
6250 * dispextern.h (scroll_cost): Remove decl.
6251
de68a1fc
PE
6252 * region-cache.h (pp_cache): Mark as externally visible.
6253
40ccffa6
PE
6254 * process.c: Make symbols static if they're not exported.
6255 (process_tick, update_tick, create_process, chan_process):
6256 (Vprocess_alist, proc_buffered_char, datagram_access):
6257 (fd_callback_data, send_process_frame, process_sent_to): Now static.
6258 (deactivate_process): Mark defn as static, as well as decl.
6259 * lisp.h (create_process): Remove decl.
6260 * process.h (chan_process, Vprocess_alist): Remove decls.
6261
ad64fc97
PE
6262 * print.c: Make symbols static if they're not exported.
6263 (print_depth, new_backquote_output, being_printed, print_buffer):
6264 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
6265 (print_interval, print_number_index, initial_stderr_stream):
6266 Now static.
6267 * lisp.h (Fprinc): Remove decl.
6268 (debug_output_compilation_hack): Mark as externally visible.
6269
adddb265
PE
6270 * sysdep.c (croak): Move decl from here to syssignal.h.
6271 * syssignal.h (croak): Put it here, so the API can be checked when
6272 'croak' is called from dissociate_if_controlling_tty.
6273
1717ede2
PE
6274 * minibuf.c: Make symbols static if they're not exported.
6275 (minibuf_save_list, choose_minibuf_frame): Now static.
6276 * lisp.h (choose_minibuf_frame): Remove decl.
6277
fa5fb2bc
PE
6278 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
6279
1e3890d1
PE
6280 * lread.c: Make symbols static if they're not exported.
6281 (read_objects, initial_obarray, oblookup_last_bucket_number):
6282 Now static.
6283 (make_symbol): Remove; unused.
6284 * lisp.h (initial_obarray, make_symbol): Remove decls.
6285
8a1414fa
PE
6286 * keyboard.c: Make symbols static if they're not exported.
6287 (single_kboard, recent_keys_index, total_keys, recent_keys):
6288 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
6289 (this_single_command_key_start, echoing, last_auto_save):
6290 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
6291 (command_loop, echo_now, keyboard_init_hook, help_char_p):
6292 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
6293 (Vlispy_mouse_stem, double_click_count):
6294 Now static.
6295 (force_auto_save_soon): Define only if SIGDANGER.
6296 (ignore_mouse_drag_p): Now static if
6297 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
6298 (print_help): Remove; unused.
6299 (stop_character, last_timer_event): Mark as externally visible.
6300 * keyboard.h (ignore_mouse_drag_p): Declare only if
6301 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
6302 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
6303 * lisp.h (echoing): Remove decl.
6304 (force_auto_save_soon): Declare only if SIGDANGER.
6305 * xdisp.c (redisplay_window): Simplify code, to make it more
6306 obvious that ignore_mouse_drag_p is not accessed if !defined
6307 USE_GTK && !defined HAVE_NS.
6308
93ea6e8f
PE
6309 * intervals.c: Make symbols static if they're not exported.
6310 (merge_properties_sticky, merge_interval_right, delete_interval):
6311 Now static.
6312 * intervals.h (merge_interval_right, delete_interval): Remove decls.
6313
77382fcc
PE
6314 * insdel.c: Make symbols static if they're not exported.
6315 However, leave prepare_to_modify_buffer alone. It's never
6316 called from outside this function, but that appears to be a bug.
6317 (combine_after_change_list, combine_after_change_buffer):
4889fc82 6318 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
6319 (adjust_after_replace_noundo): Remove; unused.
6320 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 6321 (signal_before_change): Remove decls.
77382fcc 6322
9306c32e
PE
6323 * indent.c (val_compute_motion, val_vmotion): Now static.
6324
cd44d2eb
PE
6325 * image.c: Make symbols static if they're not exported.
6326 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
6327 if USE_GTK.
6328 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
6329 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
6330
ad9a7a06
PE
6331 * fringe.c (standard_bitmaps): Now static.
6332 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
6333
81626931
PE
6334 * frame.c: Make symbols static if they're not exported.
6335 (x_report_frame_params, make_terminal_frame): Now static.
6336 (get_frame_param): Now static, unless HAVE_NS.
6337 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
6338 (x_get_resource_string): Remove; not used.
6339 * frame.h (make_terminal_frame, x_report_frame_params):
6340 (x_get_resource_string); Remove decls.
6341 (x_fullscreen_adjust): Declare only if WINDOWSNT.
6342 * lisp.h (get_frame_param): Declare only if HAVE_NS.
6343
239f9db9
PE
6344 * font.c, fontset.c: Make symbols static if they're not exported.
6345 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
6346 (FACE_SUITABLE_FOR_CHAR_P): Use it.
6347 * font.c (font_close_object): Now static.
6348 * font.h (font_close_object): Remove.
6349 * fontset.c (FONTSET_OBJLIST): Remove.
6350 (free_realized_fontset) #if-0 the body, which does nothing.
6351 (face_suitable_for_char_p): #if-0, as it's never called.
6352 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
6353 * xfaces.c (face_at_string_position):
6354 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
6355 since 0 is always ASCII.
6356
dfcf3579
PE
6357 * fns.c (weak_hash_tables): Now static.
6358
5045092b
PE
6359 * fileio.c: Make symbols static if they're not exported.
6360 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
6361 (Vwrite_region_annotation_buffers): Now static.
6362
57a96f5c
PE
6363 * eval.c: Make symbols static if they're not exported.
6364 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
6365 * lisp.h (backtrace_list): Remove decl.
6366
35f08c38
PE
6367 * emacs.c: Make symbols static if they're not exported.
6368 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
6369 (fatal_error_code, fatal_error_signal_hook, standard_args):
6370 Now static.
6371 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
6372 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
6373 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
6374 * lisp.h (fatal_error_signal_hook): Remove decl.
6375 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
6376
f44bd759
PE
6377 * editfns.c: Move a (normally-unused) function to its only use.
6378 * editfns.c, lisp.h (get_operating_system_release): Remove.
6379 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
6380 worth the hassle of breaking this out.
6381
b532497d
PE
6382 * xterm.c: Make symbols static if they're not exported.
6383 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
6384 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
6385 (x_destroy_window, x_delete_display):
6386 Now static.
6387 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
6388 (x_mouse_leave): Remove; unused.
6389 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
6390 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
6391 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
6392 Remove decls.
6393 (x_mouse_leave): Declare only if WINDOWSNT.
6394 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
6395 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
6396 USE_X_TOOLKIT.
6397
1675728f
PE
6398 * ftxfont.c: Make symbols static if they're not exported.
6399 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
6400 HAVE_FREETYPE.
6401 * font.h (ftxfont_driver): Likewise.
6402
e4cebfca
PE
6403 * xfns.c: Make symbols static if they're not exported.
6404 (x_last_font_name, x_display_info_for_name):
6405 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
6406 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
6407 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
6408 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
6409 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
6410 (last_show_tip_args): Now static.
6411 (xic_defaut_fontset, xic_create_fontsetname): Define only if
6412 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
6413 (x_screen_planes): Remove; unused.
6414 * dispextern.h (x_screen_planes): Remove decl.
6415
5bf46f05
PE
6416 * dispnew.c: Make symbols static if they're not exported.
6417 * dispextern.h (redraw_garbaged_frames, scrolling):
6418 (increment_row_positions): Remove.
6419 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
6420 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
6421 Now static.
6422 (redraw_garbaged_frames): Remove; unused.
6423
435f4c28
PE
6424 * xfaces.c: Make symbols static if they're not exported.
6425 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
6426 Remove decls.
6427 * xterm.h (defined_color): Remove decls.
6428 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
6429 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
6430 (menu_face_changed_default, defined_color, free_realized_face):
6431 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
6432 (ascii_face_of_lisp_face): Remove; unused.
6433
8524aef3
PE
6434 * xdisp.c: Make symbols static if they're not exported.
6435 * dispextern.h (scratch_glyph_row, window_box_edges):
6436 (glyph_to_pixel_coords, set_cursor_from_row):
6437 (get_next_display_element, set_iterator_to_next):
6438 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
6439 (show_mouse_face): Remove decls
6440 * frame.h (message_buf_print): Likewise.
6441 * lisp.h (pop_message, set_message, check_point_in_composition):
6442 Likewise.
6443 * xterm.h (set_vertical_scroll_bar): Likewise.
6444 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
6445 (message_buf_print, scratch_glyph_row, displayed_buffer):
6446 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
6447 (get_next_display_element, show_mouse_face, window_box_edges):
6448 (frame_to_window_pixel_xy, check_point_in_composition):
6449 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
6450 (glyph_to_pixel_coords): Remove; unused.
6451
16390cd2
PE
6452 * dired.c (file_name_completion): Now static.
6453
6454 * dbusbind.c (xd_in_read_queued_messages): Now static.
6455
a25f4dfa
PE
6456 * lisp.h (circular_list_error, FOREACH): Remove; unused.
6457 * data.c (circular_list_error): Remove.
6458
14a9c8df
PE
6459 * commands.h (last_point_position, last_point_position_buffer):
6460 (last_point_position_window): Remove decls.
6461 * keyboard.c: Make these variables static.
6462
04f2d78b
CB
6463 * coding.h (coding, code_convert_region, encode_coding_gap):
6464 Remove decls.
74ab6df5
PE
6465 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
6466 (iso_code_class, detect_coding, code_convert_region): Now static.
6467 (encode_coding_gap): Remove; unused.
6468
38dfbee1
PE
6469 * chartab.c (chartab_chars, chartab_bits): Now static.
6470
a2cb4e63
PE
6471 * charset.h (charset_iso_8859_1): Remove decl.
6472 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
6473 Now static.
6474
127198fd
PE
6475 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
6476 * ccl.c (Vccl_program_table): Now static.
6477 (check_ccl_update): Remove; unused.
6478
d85b608f
PE
6479 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
6480 * category.h: ... from here.
6481 * category.c (check_category_table, set_category_set): Now static.
6482
31cd66f3
PE
6483 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
6484 * lisp.h: Remove these decls.
6485
c358e587
PE
6486 * buffer.c (buffer_count): Remove unused var.
6487
e78aecca
PE
6488 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
6489 so that it's not optimized away.
6490 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
6491 * dispextern.h (bidi_dump_cached_states): Remove, since it's
6492 exported only to the debugger.
6493
e192d7d3 6494 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 6495 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 6496
92470028
PE
6497 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
6498 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
6499 was inaccessible from Lisp.
6500 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
6501 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
6502
244ed907
PE
6503 alloc.c: Import and export fewer symbols, and remove unused items.
6504 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
6505 is defined.
6506 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
6507 it's not optimized away by whole-program optimization.
6508 (message_enable_multibyte, free_misc): Remove.
6509 (catchlist, handlerlist, mark_backtrace):
6510 Declare only if BYTE_MARK_STACK.
6511 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
6512 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
6513 (message_enable_multibyte): Remove decl.
6514 (free_misc, interval_free_list, float_block, float_block_index):
6515 (n_float_blocks, float_free_list, cons_block, cons_block_index):
6516 (cons_free_list, last_marked_index):
6517 Now static.
6518 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
6519 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
6520 (mark_backtrace): Define only if BYTE_MARK_STACK.
6521 * xdisp.c (message_enable_multibyte): Now static.
6522
61c2b50e 6523 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
6524 This makes it easier for human readers (and static analyzers)
6525 to see whether these variables are used from other modules.
6526 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
6527 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
6528 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
6529 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
6530 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
6531 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
6532 * xmenu.c, xselect.c:
6533 Declare Q* vars static if they are not used in other modules.
6534 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
6535 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
6536 Remove decls of unexported vars.
6537 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
6538
95c82688
PE
6539 * lisp.h (DEFINE_FUNC): Make sname 'static'.
6540
16a97296
PE
6541 Make Emacs functions such as Fatom 'static' by default.
6542 This makes it easier for human readers (and static analyzers)
6543 to see whether these functions can be called from other modules.
6544 DEFUN now defines a static function. To make the function external
6545 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
6546 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
6547 (Finit_image_library):
16a97296
PE
6548 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
6549 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
6550 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
6551 Remove decls, since these functions are now static.
6552 (Funintern, Fget_internal_run_time): New decls, since these functions
6553 were already external.
95c82688 6554
16a97296
PE
6555 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
6556 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
6557 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
6558 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
6559 * keyboard.c, keymap.c, lread.c:
6560 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
6561 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
6562 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
6563 Mark functions with DEFUE instead of DEFUN,
6564 if they are used in other modules.
6565 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
6566 decls for now-static functions.
6567 * buffer.h (Fdelete_overlay): Remove decl.
6568 * callproc.c (Fgetenv_internal): Mark as internal.
6569 * composite.c (Fremove_list_of_text_properties): Remove decl.
6570 (Fcomposition_get_gstring): New forward static decl.
6571 * composite.h (Fcomposite_get_gstring): Remove decl.
6572 * dired.c (Ffile_attributes): New forward static decl.
6573 * doc.c (Fdocumntation_property): New forward static decl.
6574 * eval.c (Ffetch_bytecode): New forward static decl.
6575 (Funintern): Remove extern decl; now in .h file where it belongs.
6576 * fileio.c (Fmake_symbolic_link): New forward static decl.
6577 * image.c (Finit_image_library): New forward static decl.
6578 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
6579 * intervals.h (Fprevious_property_change):
6580 (Fremove_list_of_text_properties): Remove decls.
6581 * keyboard.c (Fthis_command_keys): Remove decl.
6582 (Fcommand_execute): New forward static decl.
6583 * keymap.c (Flookup_key): New forward static decl.
6584 (Fcopy_keymap): Now static.
6585 * keymap.h (Flookup_key): Remove decl.
6586 * process.c (Fget_process): New forward static decl.
6587 (Fprocess_datagram_address): Mark as internal.
6588 * syntax.c (Fsyntax_table_p): New forward static decl.
6589 (skip_chars): Remove duplicate decl.
6590 * textprop.c (Fprevious_property_change): New forward static decl.
6591 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
6592 Now internal.
6593 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
6594 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
6595
785bbd42
PE
6596 * editfns.c (Fformat): Remove unreachable code.
6597
8b913b57
AS
65982011-04-14 Andreas Schwab <schwab@linux-m68k.org>
6599
6600 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
6601 change. (Bug#8496)
6602
a6744a35
EZ
66032011-04-13 Eli Zaretskii <eliz@gnu.org>
6604
6605 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
6606 when at ZV. (Bug#8487)
6607
e7974947
AS
66082011-04-12 Andreas Schwab <schwab@linux-m68k.org>
6609
baad03f0
AS
6610 * charset.c (Fclear_charset_maps): Use xfree instead of free.
6611 (Bug#8437)
6612 * keyboard.c (parse_tool_bar_item): Likewise.
6613 * sound.c (sound_cleanup, alsa_close): Likewise.
6614 * termcap.c (tgetent): Likewise.
6615 * xfns.c (x_default_font_parameter): Likewise.
6616 * xsettings.c (read_and_apply_settings): Likewise.
6617
e7974947
AS
6618 * alloc.c (overrun_check_malloc, overrun_check_realloc)
6619 (overrun_check_free): Protoize.
6620
28272684
PE
66212011-04-12 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
6624 since callers should never pass a negative size.
6625 Change the signature to match that of plain 'read' and 'write'; see
6626 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
6627 * lisp.h: Update prototypes of emacs_write and emacs_read.
6628
11997c76
EZ
66292011-04-11 Eli Zaretskii <eliz@gnu.org>
6630
6631 * xdisp.c (redisplay_window): Don't try to determine the character
6632 position of the scroll margin if the window start point w->startp
e896f03c 6633 is outside the buffer's accessible region. (Bug#8468)
11997c76 6634
8a2cbd72
EZ
66352011-04-10 Eli Zaretskii <eliz@gnu.org>
6636
6637 Fix write-region and its subroutines for buffers > 2GB.
6638 * fileio.c (a_write, e_write): Modify declaration of arguments and
6639 local variables to support buffers larger than 2GB.
6640 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
6641
6642 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
6643 argument, local variables, and return value.
6644
6645 * lisp.h: Update prototypes of emacs_write and emacs_read.
6646
6647 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
6648
4073e537 66492011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 6650
1ebfdcb6
PE
6651 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
6652
b2ded58d
PE
6653 Fix more problems found by GCC 4.6.0's static checks.
6654
7d66342c
PE
6655 * xdisp.c (vmessage): Use a better test for character truncation.
6656
bbf47d44
PE
6657 * charset.c (load_charset_map): <, not <=, for optimization,
6658 and to avoid potential problems with integer overflow.
9248994d 6659 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 6660 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 6661 * editfns.c (Fformat): Likewise.
1e69125e 6662 * syntax.c (skip_chars): Likewise.
3befa583 6663
e3019616
PE
6664 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
6665 This also lets GCC 4.6.0 generate slightly better loop code.
6666
becfa255
PE
6667 * callint.c (Fcall_interactively): <, not <=, for optimization.
6668 (Fcall_interactively): Count the number of arguments produced,
6669 not the number of arguments given. This is simpler and lets GCC
6670 4.6.0 generate slightly better code.
6671
dae0cd48
PE
6672 * ftfont.c: Distingish more carefully between FcChar8 and char.
6673 The previous code passed unsigned char * to a functions like
6674 strlen and xstrcasecmp that expect char *, which does not
6675 conform to the C standard.
6676 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
6677 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
6678 char * when the C standard requires it.
6679
76032d70
PE
6680 * keyboard.c (read_char): Remove unused var.
6681
eb3f1cc8
PE
6682 * eval.c: Port to Windows vsnprintf (Bug#8435).
6683 Include <limits.h>.
6684 (SIZE_MAX): Define if the headers do not.
6685 (verror): Do not give up if vsnprintf returns a negative count.
6686 Instead, grow the buffer. This ports to Windows vsnprintf, which
6687 does not conform to C99. Problem reported by Eli Zaretskii.
6688 Also, simplify the allocation scheme, by avoiding the need for
6689 calling realloc, and removing the ALLOCATED variable.
6690
70476b54
PE
6691 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
6692
12020a9e
PE
6693 Remove invocations of doprnt, as Emacs now uses vsnprintf.
6694 But keep the doprint source code for now, as we might revamp it
6695 and use it again (Bug#8435).
ea6c7ae6
PE
6696 * lisp.h (doprnt): Remove.
6697 * Makefile.in (base_obj): Remove doprnt.o.
6698 * deps.mk (doprnt.o): Remove.
6699
5fdb398c
PE
6700 error: Print 32- and 64-bit integers portably (Bug#8435).
6701 Without this change, on typical 64-bit hosts error ("...%d...", N)
6702 was used to print both 32- and 64-bit integers N, which relied on
6703 undefined behavior.
6704 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
6705 New macro.
6706 * lisp.h (error, verror): Mark as printf-like functions.
6707 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
6708 Report overflow in size calculations when allocating printf buffer.
6709 Do not truncate output string at its first null byte.
6710 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
6711 Truncate the output at a character boundary, since vsnprintf does not
6712 do that.
6713 * charset.c (check_iso_charset_parameter): Convert internal
6714 character to string before calling 'error', since %c now has the
6715 printf meaning.
6716 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
6717 overflow when computing char to be passed to 'error'. Do not
6718 pass Lisp_Object to 'error'; pass the integer instead.
6719 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
6720 formatted with plain %d.
6721
b189fa66
PE
6722 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
6723
bff87ef0
PE
6724 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
6725
7e2cac20
PE
6726 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
6727
ce4d90b5
PE
6728 * xterm.c (x_catch_errors): Remove duplicate declaration.
6729
266c9547
PE
6730 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
6731
79c49ad2
PE
6732 * xdisp.c, lisp.h (message_nolog): Remove; unused.
6733
368f4090
JM
67342011-04-10 Jim Meyering <meyering@redhat.com>
6735
6736 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
6737 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
6738 return ssize_t not "int", and use size_t as the buffer length.
6739 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
6740 * gnutls.h: Update declarations.
6741 * process.c (read_process_output): Use ssize_t, to match.
6742 (send_process): Likewise.
6743
a32d4040
CY
67442011-04-09 Chong Yidong <cyd@stupidchicken.com>
6745
6746 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
6747
8546720e 67482011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 6749
04f2d78b
CB
6750 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
6751 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 6752
8546720e
GM
6753 * xterm.c (handle_one_xevent):
6754 * xmenu.c (create_and_show_popup_menu):
6755 * xselect.c (x_decline_selection_request)
6756 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 6757
0a2f5c1a 67582011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
6759
6760 Fix some uses of `int' instead of EMACS_INT.
6761 * search.c (string_match_1, fast_string_match)
6762 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
6763 (scan_buffer, find_next_newline_no_quit)
6764 (find_before_next_newline, search_command, Freplace_match)
6765 (Fmatch_data): Make some `int' variables be EMACS_INT.
6766
6767 * xdisp.c (display_count_lines): 3rd argument and return value now
6768 EMACS_INT. All callers changed.
6769 (pint2hrstr): Last argument is now EMACS_INT.
6770
6771 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
6772 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6773 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
6774 (decode_coding_utf_16, decode_coding_emacs_mule)
6775 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
6776 (decode_coding_ccl, decode_coding_charset)
6777 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
6778 (decode_coding_iso_2022, decode_coding_emacs_mule)
6779 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
6780 <char_offset, last_offset>: Declare EMACS_INT.
6781 (encode_coding_utf_8, encode_coding_utf_16)
6782 (encode_coding_emacs_mule, encode_invocation_designation)
6783 (encode_designation_at_bol, encode_coding_iso_2022)
6784 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
6785 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
6786 Declare EMACS_INT.
6787 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
6788 (encode_invocation_designation): Last argument P_NCHARS is now
6789 EMACS_INT.
6790 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
6791 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
6792
6793 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
6794 All users changed.
6795
6796 * ccl.c (Fccl_execute_on_string): Declare some variables
6797 EMACS_INT.
6798
8546720e 67992011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
6800
6801 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
6802
4e19a977
CS
68032011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
6804
6805 * process.c (Fformat_network_address): Doc fix.
6806
87302331
R
68072011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
6808
6809 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
6810
cbb59342
CY
68112011-04-08 Chong Yidong <cyd@stupidchicken.com>
6812
6813 * keyboard.c (read_char): Call Lisp function help-form-show,
6814 instead of using internal_with_output_to_temp_buffer.
6815 (Qhelp_form_show): New var.
e0d38eeb 6816 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
6817
6818 * print.c (internal_with_output_to_temp_buffer): Function deleted.
6819
6820 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
6821
e67a13ab
CY
68222011-04-06 Chong Yidong <cyd@stupidchicken.com>
6823
04f2d78b
CB
6824 * process.c (Flist_processes): Remove to Lisp.
6825 (list_processes_1): Delete.
e67a13ab 6826
973f782d
EZ
68272011-04-06 Eli Zaretskii <eliz@gnu.org>
6828
7c106b1e
EZ
6829 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
6830
973f782d
EZ
6831 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
6832
41cf7d1a 68332011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 6834
ca23cc88
PE
6835 Fix more problems found by GCC 4.6.0's static checks.
6836
f390e2d5
PE
6837 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
6838
42eea0d0
PE
6839 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
6840
b69769da 6841 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 6842
f9541e84
PE
6843 * xdisp.c (vmessage): Mark as a printf-like function.
6844
13841b55
PE
6845 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
6846
c136c10f
PE
6847 * sound.c (sound_warning): Don't crash if arg contains a printf format.
6848
5e2d4a30
PE
6849 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
6850 printf-like functions.
6851 (tiff_load): Add casts to remove these marks before passing them
6852 to system-supplied API.
6853
583f48b9
PE
6854 * eval.c (Fsignal): Remove excess argument to 'fatal'.
6855
b25d760e
PE
6856 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
6857 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
6858 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
6859 directly, rather than having caller test rule sign. This avoids
6860 some unnecessary tests.
6861 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
6862 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
6863 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 6864
bc7b6697 6865 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 6866 (xfont_open): Avoid unnecessary tests.
bc7b6697 6867
27ccc379
PE
6868 * composite.c (composition_gstring_put_cache): Use unsigned integer.
6869
dcd5c89a
PE
6870 * composite.h, composite.c (composition_gstring_put_cache):
6871 Use EMACS_INT, not int, for length.
6872
b13a45c6
PE
6873 * composite.h (COMPOSITION_DECODE_REFS): New macro,
6874 breaking out part of COMPOSITION_DECODE_RULE.
6875 (COMPOSITION_DECODE_RULE): Use it.
6876 * composite.c (get_composition_id): Remove unused local vars,
6877 by using the new macro.
6878
1e792e4d
PE
6879 * textprop.c (set_text_properties_1): Change while to do-while,
6880 since the condition is always true at first.
6881
dc6c6455 6882 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
6883 (interval_deletion_adjustment): Return unsigned value.
6884 All uses changed.
dc6c6455 6885
aba7731a
PE
6886 * process.c (list_processes_1, create_pty, read_process_output):
6887 (exec_sentinel): Remove vars that were set but not used.
afd4052b 6888 (create_pty): Remove unnecessary "volatile"s.
bc57d757 6889 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 6890 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 6891 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 6892
fdfc4bf3
PE
6893 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
6894
fca8fe46 6895 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 6896 (update_syntax_table): Use unsigned instead of int.
fca8fe46 6897
06a0259a 6898 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 6899 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 6900 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 6901
e7b9e80f
PE
6902 * print.c (print_error_message): Avoid int overflow.
6903
56201685
PE
6904 * font.c (font_list_entities): Redo for clarity,
6905 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
6906
78834453 6907 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 6908 (font_score): Avoid potential overflow in diff calculation.
78834453 6909
0bc0b309 6910 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 6911 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 6912
e610eaca
PE
6913 * eval.c (funcall_lambda): Rename local to avoid shadowing.
6914
b895abce
PE
6915 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
6916 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
6917 can always succeed if overflow has undefined behavior.
6918
1f1d9321 6919 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 6920 (wordify): Omit three unnecessary tests.
1f1d9321 6921
c59478bc
PE
6922 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
6923 All callers changed. This avoids the need for an unused var.
6924
79b73827
PE
6925 * casefiddle.c (casify_region): Remove var that is set but not used.
6926
a4db5dfe
PE
6927 * dired.c (file_name_completion): Remove var that is set but not used.
6928
43aae36e
PE
6929 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
6930
2a47c44d 6931 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 6932 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 6933
a37c69bf
PE
6934 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
6935 Check for integer overflow on size calculations.
6936
328ab8e7
PE
6937 * buffer.c (Fprevious_overlay_change): Remove var that is set
6938 but not used.
6939
e5a2a5cb
PE
6940 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
6941 Remove vars that are set but not used.
8d84a6eb 6942 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 6943 (timer_check_2): Mark vars as initialized.
e5a2a5cb 6944
a60e5f68
PE
6945 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
6946
f661cb61 6947 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 6948 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 6949
f0397f5a
PE
6950 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
6951 that are set but not used.
6952
8664db06 6953 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 6954 if XCreateBitmapFromData fails (Bug#8410).
8664db06 6955
6abdaa4a
PE
6956 * xselect.c (x_get_local_selection, x_handle_property_notify):
6957 Remove vars that are set but not used.
6958
0ce7538d 6959 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 6960 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 6961
9ae848fc
PE
6962 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
6963 Remove var that is set but not used.
0b918413
PE
6964 (scroll_bar_windows_size): Now size_t, not int.
6965 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
6966 Check for overflow.
9ae848fc 6967
a5a62657
PE
6968 * xfaces.c (realize_named_face): Remove vars that are set but not used.
6969 (map_tty_color) [!defined MSDOS]: Likewise.
6970
5c5cdd39
PE
6971 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
6972
66ebf983
PE
6973 * coding.c: Remove vars that are set but not used.
6974 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
6975 All callers changed.
6976 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
6977 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
6978 (decode_coding_charset): Remove vars that are set but not used.
6979
1be4d761
PE
6980 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
6981 that is set but not used.
6982
47553fa8
PE
6983 * print.c (print_object): Remove var that is set but not used.
6984
1f7196bf 6985 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
6986 The gnulib version avoids calling malloc in the usual case,
6987 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
6988 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
6989 * filelock.c (current_lock_owner): Likewise.
6990 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
6991 * sysdep.c: Include allocator.h, careadlinkat.h.
6992 (emacs_no_realloc_allocator): New static constant.
6993 (emacs_readlink): New function.
fdb61804
PE
6994 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
6995 ../lib/careadlinkat.h.
d1fdcab7 6996
f84c17c7
SM
69972011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
6998
6999 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
7000 first non-nil return value).
7001
ef3862ad
JD
70022011-04-03 Jan Djärv <jan.h.d@swipnet.se>
7003
7004 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
7005 if not defined (Bug#8403).
7006
376a7006
JB
70072011-04-02 Juanma Barranquero <lekktu@gmail.com>
7008
7009 * xdisp.c (display_count_lines): Remove parameter `start',
7010 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
7011 (get_char_face_and_encoding): Remove parameter `multibyte_p',
7012 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
7013 (fill_stretch_glyph_string): Remove parameters `row' and `area',
7014 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
7015 and thereabouts. All callers changed.
7016 (get_per_char_metric): Remove parameter `f', unused since
7017 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
7018
6ca3801d
JM
70192011-04-02 Jim Meyering <meyering@redhat.com>
7020
7021 do not dereference NULL upon failed strdup
7022 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
7023 (ns_get_family): Likewise.
7024
d8e2b5ba
JB
70252011-04-02 Juanma Barranquero <lekktu@gmail.com>
7026
7027 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
7028
8c74fcbd
JD
70292011-04-02 Jan Djärv <jan.h.d@swipnet.se>
7030
7031 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
7032 later (Bug#8403).
7033
7200d79c
SM
70342011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
7035
03408648 7036 Add lexical binding.
7200d79c 7037
03408648
SM
7038 * window.c (Ftemp_output_buffer_show): New fun.
7039 (Fsave_window_excursion):
7040 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
7041
7042 * lread.c (lisp_file_lexically_bound_p): New function.
7043 (Fload): Bind Qlexical_binding.
7044 (readevalloop): Remove `evalfun' arg.
7045 Bind Qinternal_interpreter_environment.
7046 (Feval_buffer): Bind Qlexical_binding.
7047 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
7048 Mark as dynamic.
7049 (syms_of_lread): Declare `lexical-binding'.
7050
7051 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
7052
7053 * keyboard.c (eval_dyn): New fun.
7054 (menu_item_eval_property): Use it.
ca105506
SM
7055
7056 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 7057
03408648
SM
7058 * fns.c (concat, mapcar1): Accept byte-code-functions.
7059
7060 * eval.c (Fsetq): Handle lexical vars.
7061 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
7062 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
7063 (FletX, Flet): Obey lexical binding.
7064 (Fcommandp): Handle closures.
7065 (Feval): New `lexical' arg.
7066 (eval_sub): New function extracted from Feval. Use it almost
7067 everywhere where Feval was used. Look up vars in lexical env.
7068 Handle closures.
7069 (Ffunctionp): Move from subr.el.
7070 (Ffuncall): Handle closures.
7071 (apply_lambda): Remove `eval_flags'.
7072 (funcall_lambda): Handle closures and new byte-code-functions.
7073 (Fspecial_variable_p): New function.
7074 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
7075 but without exporting it to Lisp.
23aba0ea 7076
23aba0ea 7077 * doc.c (Fdocumentation, store_function_docstring):
03408648 7078 * data.c (Finteractive_form): Handle closures.
23aba0ea 7079
03408648
SM
7080 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
7081 interactive spec.
ba83908c 7082
04f2d78b
CB
7083 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
7084 New byte-codes.
03408648
SM
7085 (exec_byte_code): New function extracted from Fbyte_code to handle new
7086 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 7087
03408648 7088 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 7089
03408648 7090 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 7091
e2abce01
JB
70922011-03-31 Juanma Barranquero <lekktu@gmail.com>
7093
7094 * xdisp.c (redisplay_internal): Fix prototype.
7095
63696a73 70962011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 7097
63696a73 7098 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
7099 (try_scrolling): Use it when setting scroll_limit.
7100 Limit scrolling to 100 screen lines.
63696a73
EZ
7101 (redisplay_window): Even when falling back on "recentering",
7102 position point in the window according to scroll-conservatively,
7103 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
7104
7105 (try_scrolling): When point is above the window, allow searching
7106 as far as scroll_max, or one screenful, to compute vertical
7107 distance from PT to the scroll margin position. This prevents
7108 try_scrolling from unnecessarily failing when
7109 scroll-conservatively is set to a value slightly larger than the
7110 window height. Clean up the case of PT below the margin at bottom
7111 of window: scroll_max can no longer be INT_MAX. When aggressive
7112 scrolling is in use, don't let point enter the opposite scroll
7113 margin as result of the scroll.
7114 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
7115 threshold of 100 lines for never-recentering scrolling.
7116
e4cc2dfc
JB
71172011-03-31 Juanma Barranquero <lekktu@gmail.com>
7118
7119 * dispextern.h (move_it_by_lines):
7120 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
7121 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
7122 (message_log_check_duplicate): Remove parameters `prev_bol' and
7123 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
7124 (redisplay_internal): Remove parameter `preserve_echo_area',
7125 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
7126
7127 * indent.c (Fvertical_motion):
7128 * window.c (window_scroll_pixel_based, Frecenter):
7129 Don't pass `need_y_p' to `move_it_by_lines'.
7130
1c470562
SM
71312011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
7132
44f230aa
SM
7133 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
7134 steal a few bits to be more compact.
7135 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
7136 Remove unneeded casts.
7137
1c470562
SM
7138 * bytecode.c (Fbyte_code): CAR and CDR can GC.
7139
888adce9
ZK
71402011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
7141
7142 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
7143 binding" message (bug#7967).
7144
f838ed7b
PE
71452011-03-30 Paul Eggert <eggert@cs.ucla.edu>
7146
77861b95
PE
7147 Fix more problems found by GCC 4.6.0's static checks.
7148
de6dbc14
PE
7149 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
7150 Remove unused local var.
7151
f838ed7b
PE
7152 * editfns.c (Fmessage_box): Remove unused local var.
7153
792c7b2b
PE
7154 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
7155 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7156 Omit unused local vars.
c499e557 7157 * window.c (shrink_windows): Omit unused local var.
b01a1c29 7158 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
7159 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
7160 Omit unused local var.
7161
ba0165e1
PE
7162 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
7163 Don't assume string length fits in int.
32ad8845 7164 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 7165 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 7166
3c59b4c9
PE
7167 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
7168 instead of alloca (Bug#8344).
7169
a3eed478 7170 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 7171 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 7172
eb4d412d
PE
7173 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
7174
1658b401
PE
7175 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
7176 concerns.
7177
7178 * term.c (produce_glyphless_glyph): Remove unnecessary test.
7179
7180 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 7181
9a2c6e05
PE
7182 * keyboard.c (syms_of_keyboard): Use the same style as later
7183 in this function when indexing through an array. This also
7184 works around GCC bug 48267.
7185
03d0a109
PE
7186 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
7187
44f730c8
PE
7188 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
7189
fe75f926
PE
7190 * chartab.c (sub_char_table_ref_and_range): Redo for slight
7191 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
7192
ffa8c828
PE
7193 * keyboard.c, keyboard.h (num_input_events): Now size_t.
7194 This avoids undefined behavior on integer overflow, and is a bit
7195 more convenient anyway since it is compared to a size_t variable.
7196
c5101a77
PE
7197 Variadic C functions now count arguments with size_t, not int.
7198 This avoids an unnecessary limitation on 64-bit machines, which
7199 caused (substring ...) to crash on large vectors (Bug#8344).
7200 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
7201 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 7202 All variadic functions and their callers changed accordingly.
c5101a77
PE
7203 (struct gcpro.nvars): Now size_t, not int. All uses changed.
7204 * data.c (arith_driver, float_arith_driver): Likewise.
7205 * editfns.c (general_insert_function): Likewise.
7206 * eval.c (struct backtrace.nargs, interactive_p)
7207 (internal_condition_case_n, run_hook_with_args, apply_lambda)
7208 (funcall_lambda, mark_backtrace): Likewise.
7209 * fns.c (concat): Likewise.
7210 * frame.c (x_set_frame_parameters): Likewise.
7211 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
7212 0 if not found, not -1. All callers changed.
7213
dd3f25f7
PE
7214 * alloc.c (garbage_collect): Don't assume stack size fits in int.
7215 (stack_copy_size): Now size_t, not int.
7216 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
7217
461c2ab9
JB
72182011-03-28 Juanma Barranquero <lekktu@gmail.com>
7219
7220 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
7221 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
7222 All callers changed.
7223
7224 * lisp.h (multibyte_char_to_unibyte):
7225 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
7226 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
7227 * character.h (CHAR_TO_BYTE8):
7228 * cmds.c (internal_self_insert):
7229 * editfns.c (general_insert_function):
7230 * keymap.c (push_key_description):
7231 * search.c (Freplace_match):
7232 * xdisp.c (message_dolog, set_message_1): All callers changed.
7233
f6d62986
SM
72342011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7235
7236 * keyboard.c (safe_run_hook_funcall): New function.
7237 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
7238 don't set the hook to nil, but remove the offending function instead.
7239 (Qcommand_hook_internal): Remove, unused.
7240 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
7241 Vcommand_hook_internal.
7242
7243 * eval.c (enum run_hooks_condition): Remove.
7244 (funcall_nil, funcall_not): New functions.
7245 (run_hook_with_args): Call each function through a `funcall' argument.
7246 Remove `cond' argument, now redundant.
7247 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
7248 (Frun_hook_with_args_until_failure): Adjust accordingly.
7249 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
7250
1db5b1ad
JB
72512011-03-28 Juanma Barranquero <lekktu@gmail.com>
7252
7253 * dispextern.h (string_buffer_position): Remove declaration.
7254
7255 * print.c (strout): Remove parameter `multibyte', unused since
7256 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
7257
7258 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
7259 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
7260 All callers changed.
7261
7262 * w32.c (_wsa_errlist): Use braces for struct initializers.
7263
7264 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
7265 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
7266 All callers changed.
7267 (string_buffer_position): Likewise. Also, make static (it's never
7268 used outside xdisp.c).
7269 (cursor_row_p): Remove parameter `w', unused since
7270 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
7271 (decode_mode_spec): Remove parameter `precision', introduced during
7272 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
7273 All callers changed.
7274
5ffb62aa
JD
72752011-03-27 Jan Djärv <jan.h.d@swipnet.se>
7276
7277 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
7278
461c2ab9 72792011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
7280
7281 * nsterm.m (ns_menu_bar_is_hidden): New variable.
7282 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
7283 (ns_update_auto_hide_menu_bar): New functions.
7284 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
7285 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
7286 ns_constrain_all_frames.
7287 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
7288 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
7289
5c380ffb
JD
72902011-03-27 Jan Djärv <jan.h.d@swipnet.se>
7291
7292 * nsmenu.m (runDialogAt): Remove argument to timer_check.
7293
9af30bdf
GM
72942011-03-27 Glenn Morris <rgm@gnu.org>
7295
7296 * syssignal.h: Replace RETSIGTYPE with void.
7297 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
7298 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
7299 Replace SIGTYPE with void everywhere.
7300 * s/usg5-4-common.h (SIGTYPE): Remove definition.
7301 * s/template.h (SIGTYPE): Remove commented out definition.
7302
e2abce01
JB
73032011-03-26 Eli Zaretskii <eliz@gnu.org>
7304
7305 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
7306 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
7307
f868cd8a
JB
73082011-03-26 Juanma Barranquero <lekktu@gmail.com>
7309
59eb0929
JB
7310 * w32.c (read_unc_volume): Use parameter `henum', instead of
7311 global variable `wget_enum_handle'.
7312
7313 * keymap.c (describe_vector): Remove parameters `indices' and
7314 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
7315 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
7316
f868cd8a
JB
7317 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
7318
7319 * keyboard.c (timer_check): Remove parameter `do_it_now',
7320 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
7321 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
7322 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
7323
7324 * keyboard.c (read_char):
7325 * w32menu.c (w32_menu_display_help):
7326 * xmenu.c (show_help_event, menu_help_callback):
7327 Adjust calls to `show_help_echo'.
7328
7329 * gtkutil.c (xg_maybe_add_timer):
7330 * keyboard.c (readable_events):
7331 * process.c (wait_reading_process_output):
7332 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
7333
7334 * insdel.c (adjust_markers_gap_motion):
7335 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
7336 (gap_left, gap_right): Don't call it.
7337
2ecf6fdb
CY
73382011-03-25 Chong Yidong <cyd@stupidchicken.com>
7339
7340 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
7341 incurred during fontification.
7342
6b1f9ba4
JB
73432011-03-25 Juanma Barranquero <lekktu@gmail.com>
7344
7345 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
7346 (DEFVAR_PER_BUFFER): Don't pass it.
7347
7348 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
7349 (scrolling_window): Don't pass it.
7350
0f4a96b5
JB
73512011-03-25 Juanma Barranquero <lekktu@gmail.com>
7352
7353 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
7354
7355 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
7356 and `suffix'.
7357 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
7358 of variables specific to SELinux and computation of `encoded_absname'.
7359
7360 * image.c (XPutPixel): Remove unused variable `height'.
7361
7362 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
7363
7364 * unexw32.c (get_section_info): Remove unused variable `section'.
7365
7366 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
7367 (system_process_attributes): Remove unused variable `sess'.
7368 (sys_read): Remove unused variable `err'.
7369
7370 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
7371 (w32_wnd_proc): Remove unused variable `isdead'.
7372 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
7373 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
7374 (x_create_tip_frame): Remove unused variable `tem'.
7375
7376 * w32inevt.c (w32_console_read_socket):
7377 Remove unused variable `no_events'.
7378
7379 * w32term.c (x_draw_composite_glyph_string_foreground):
7380 Remove unused variable `width'.
7381
1149507c
JB
73822011-03-24 Juanma Barranquero <lekktu@gmail.com>
7383
7384 * w32term.c (x_set_glyph_string_clipping):
7385 Don't pass uninitialized region to CombineRgn.
7386
9c88f339
JB
73872011-03-23 Juanma Barranquero <lekktu@gmail.com>
7388
7389 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
7390 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
7391 (Fx_close_connection): Remove unused variable `i'.
7392
7393 * w32font.c (w32font_draw): Return number of glyphs.
7394 (w32font_open_internal): Remove unused variable `i'.
7395 (w32font_driver): Add missing initializer.
7396
7397 * w32menu.c (utf8to16): Remove unused variable `utf16'.
7398 (fill_in_menu): Remove unused variable `items_added'.
7399
7400 * w32term.c (last_mouse_press_frame): Remove static global variable.
7401 (w32_clip_to_row): Remove unused variable `f'.
7402 (x_delete_terminal): Remove unused variable `i'.
7403
7404 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
7405 (NOTHING): Remove unused static global variable.
7406 (uniscribe_check_otf): Remove unused variable `table'.
7407 (uniscribe_font_driver): Add missing initializers.
7408
dee091a3
JD
74092011-03-23 Julien Danjou <julien@danjou.info>
7410
7411 * term.c (Fsuspend_tty, Fresume_tty):
7412 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
7413 * window.c (temp_output_buffer_show):
7414 * insdel.c (signal_before_change):
7415 * frame.c (Fhandle_switch_frame):
7416 * fileio.c (Fdo_auto_save):
7417 * emacs.c (Fkill_emacs):
7418 * editfns.c (save_excursion_restore):
7419 * cmds.c (internal_self_insert):
7420 * callint.c (Fcall_interactively):
7421 * buffer.c (Fkill_all_local_variables):
7422 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
7423 Use Frun_hooks.
0f4a96b5 7424 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
dee091a3
JD
7425 unconditionnaly since it does the check itself.
7426
2c520ab5 74272011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 7428
c9c49752
PE
7429 Fix more problems found by GCC 4.5.2's static checks.
7430
8abc3f12
PE
7431 * coding.c (encode_coding_raw_text): Avoid unnecessary test
7432 the first time through the loop, since we know p0 < p1 then.
7433 This also avoids a gcc -Wstrict-overflow warning.
7434
a2d26660
PE
7435 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
7436 leading to a memory leak, possible in functions like
7437 load_charset_map_from_file that can allocate an unbounded number
b12ef411 7438 of objects (Bug#8318).
a2d26660 7439
916c72e9
PE
7440 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
7441 that could (at least in theory) be that large.
7442
19ab8a18
PE
7443 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
7444 This is less likely to overflow, and avoids undefined behavior if
7445 overflow does occur. All callers changed. Use strtoul to scan
7446 for the unsigned long integer.
b7cbbd6f
PE
7447 (pint2hrstr): Simplify and tune code slightly.
7448 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 7449
f0641eff
PE
7450 * scroll.c (do_scrolling): Work around GCC bug 48228.
7451 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
7452
7f650bb9
PE
7453 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
7454 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
7455 (validate_x_resource_name): Simplify count usage.
7456 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 7457
37dd57d1
PE
7458 * fileio.c (Fcopy_file): Report error if fchown or fchmod
7459 fail (Bug#8306).
81e56e61 7460
699979fc 7461 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 7462
401bf9b4
PE
7463 * process.c (Fmake_network_process): Use socklen_t, not int,
7464 where POSIX says socklen_t is required in portable programs.
7465 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 7466 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
7467 (Fmake_network_process, server_accept_connection):
7468 (wait_reading_process_output, read_process_output):
7469 Likewise.
7470
b93aacde
PE
7471 * process.c: Rename or move locals to avoid shadowing.
7472 (list_processes_1, Fmake_network_process):
7473 (read_process_output_error_handler, exec_sentinel_error_handler):
7474 Rename or move locals.
4dc343ee 7475 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 7476 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 7477 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 7478 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 7479 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 7480
af8a867c 7481 Make tparam.h and terminfo.c consistent.
44f230aa
SM
7482 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
7483 Include tparam.h instead, since it declares them.
af8a867c
PE
7484 * cm.h (PC): Remove extern decl; tparam.h now does this.
7485 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
7486 * terminfo.c: Include tparam.h, to check interfaces.
7487 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
7488 (tparam): Adjust signature to match interface in tparam.h;
7489 this removes some undefined behavior. Check that outstring and len
7490 are zero, which they always are with Emacs.
7491 * tparam.h (PC, BC, UP): New extern decls.
7492
0248044d 7493 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 7494 (xftfont_open): Rename locals to avoid shadowing.
0248044d 7495
8ff096c1 7496 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
7497 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
7498 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 7499 (ftfont_list): Remove unused local.
49eaafba
PE
7500 (get_adstyle_property, ftfont_pattern_entity):
7501 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
7502 Rename locals to avoid shadowing.
8ff096c1 7503
e2be39f6
PE
7504 * xfont.c (xfont_list_family): Mark var as initialized.
7505
c9735e30
PE
7506 * xml.c (make_dom): Now static.
7507
8f5201ae
PE
7508 * composite.c (composition_compute_stop_pos): Rename local to
7509 avoid shadowing.
b246f932
PE
7510 (composition_reseat_it): Remove unused locals.
7511 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 7512 (composition_update_it): Mark var as initialized.
11b61122
PE
7513 (find_automatic_composition): Mark vars as initialized,
7514 with a FIXME (Bug#8290).
8f5201ae 7515
760fbc2c
PE
7516 character.h: Rename locals to avoid shadowing.
7517 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
7518 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
7519 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
7520 (BUF_DEC_POS): Be more systematic about renaming local temporaries
7521 to avoid shadowing.
7522
ff08eb85
PE
7523 * textprop.c (property_change_between_p): Remove; unused.
7524
fc7bf025
PE
7525 * intervals.c (interval_start_pos): Now static.
7526
235d7abc
PE
7527 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
7528
44f230aa
SM
7529 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
7530 Rename locals to avoid shadowing.
3e7d6594 7531
50060332
PE
7532 * sound.c (wav_play, au_play, Fplay_sound_internal):
7533 Fix pointer signedness.
d01f234b 7534 (alsa_choose_format): Remove unused local var.
c83b8872
PE
7535 (wav_play): Initialize a variable to 0, to prevent undefined
7536 behavior (Bug#8278).
50060332 7537
c4fc4e30
PE
7538 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
7539
918436ed
PE
7540 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
7541
c939f91b
PE
7542 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
7543 clobbering (Bug#8298).
b9c7f648
PE
7544 * sysdep.c (sys_subshell): Likewise.
7545 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 7546
6bd8c144
PE
7547 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
7548 This should get cleaned up, so that child_setup has the
7549 same signature on all platforms.
7550
7710357c 7551 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 7552 (relocate_fd): Rename locals to avoid shadowing.
7710357c 7553
c59da222
CY
75542011-03-22 Chong Yidong <cyd@stupidchicken.com>
7555
7556 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
7557 not to be necessary, and produces flickering.
7558
66b87493
GM
75592011-03-20 Glenn Morris <rgm@gnu.org>
7560
7561 * config.in: Remove file.
7562
45b6f6d5
JB
75632011-03-20 Juanma Barranquero <lekktu@gmail.com>
7564
7565 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
7566 are now in src/globals.h.
7567 (syms_of_minibuf): Remove spurious & from previous change.
7568
3ec03f7e
LL
75692011-03-20 Leo <sdl.web@gmail.com>
7570
7571 * minibuf.c (completing-read-function): New variable.
7572 (completing-read-default): Rename from completing-read.
7573 (completing-read): Call completing-read-function.
7574
b14e3e21
CY
75752011-03-19 Juanma Barranquero <lekktu@gmail.com>
7576
7577 * xfaces.c (Fx_load_color_file):
7578 Read color file from absolute filename (bug#8250).
7579
f2b726e6
JB
75802011-03-19 Juanma Barranquero <lekktu@gmail.com>
7581
7582 * makefile.w32-in: Update dependencies.
7583
09f6ff02
EZ
75842011-03-17 Eli Zaretskii <eliz@gnu.org>
7585
7586 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
7587
29a6015a
PE
75882011-03-17 Paul Eggert <eggert@cs.ucla.edu>
7589
a3a6c54e
PE
7590 Fix more problems found by GCC 4.5.2's static checks.
7591
b766f867
PE
7592 * process.c (make_serial_process_unwind, send_process_trap):
7593 (sigchld_handler): Now static.
7594
be02381c
PE
7595 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
7596 That way, the code declares only the vars that it needs.
7597 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
7598 * s/cygwin.h (PTY_ITERATION): Likewise.
7599 * s/darwin.h (PTY_ITERATION): Likewise.
7600 * s/gnu-linux.h (PTY_ITERATION): Likewise.
7601
57048744
PE
7602 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
7603 * process.c (allocate_pty): Don't declare stb unless it's needed.
7604
7914961c 7605 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
7606 (CONSTANTLIM): Remove; unused.
7607 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
7608 Define only if needed.
7914961c 7609
b3967b18
PE
7610 * unexelf.c (unexec): Name an expression,
7611 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
7612 Use a different way to cause a compilation error if anyone uses
7613 n rather than nn, a way that does not involve shadowing.
73366a00 7614 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 7615
29a6015a
PE
7616 * deps.mk (unexalpha.o): Remove; unused.
7617
43cfc33e 7618 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 7619 * unexec.h: New file.
ce701a33
PE
7620 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
7621 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
7622 Depend on unexec.h.
7623 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
7624 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
7625 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 7626 Change as necessary to match prototype in unexec.h.
ce701a33 7627
01f44d5a
PE
7628 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
7629 shadowing.
4f63c6bb 7630 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 7631
a6670b0b
PE
7632 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
7633 Rename locals to avoid shadowing.
7634
cef2010d 7635 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 7636 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 7637
d4d7173a
PE
7638 * print.c (Fredirect_debugging_output): Fix pointer signedess.
7639
f08b802a
PE
7640 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
7641 warning when compiling print.c.
7642
3ddb0639
PE
7643 * font.c (font_unparse_fcname): Abort in an "impossible" situation
7644 instead of using an uninitialized var.
5ad03b97 7645 (font_sort_entities): Mark var as initialized.
3ddb0639 7646
170a2692
PE
7647 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
7648
e663c700
PE
7649 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
7650 pointers to constants.
89bc529a 7651 (font_parse_fcname): Remove unused vars.
7b81e2d0 7652 (font_delete_unmatched): Now static.
ea838e10 7653 (font_get_spec): Remove; unused.
13a547c6
PE
7654 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
7655 (font_update_drivers, Ffont_get_glyphs, font_add_log):
7656 Rename or move locals to avoid shadowing.
e663c700 7657
2a80c887 7658 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 7659 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 7660
1384fa33 7661 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 7662 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 7663
8b2c52e9
PE
7664 * alloc.c (mark_backtrace): Move decl from here ...
7665 * lisp.h: ... to here, so that it can be checked.
7666
475545b5 7667 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 7668 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
7669 (lisp_indirect_variable): Name an expression,
7670 to avoid gcc -Wbad-function-cast warning.
1faed8ae 7671 (Fdefvar): Rename locals to avoid shadowing.
475545b5 7672
b1349114 7673 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 7674 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 7675 Use const pointer when appropriate.
b1349114 7676
a2928364
PE
7677 * lisp.h (get_system_name, get_operating_system_release):
7678 Move decls here, to check interfaces.
7679 * process.c (get_operating_system_release): Move decl to lisp.h.
7680 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
7681 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
7682 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
7683 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
7684 (Fformat_time_string, Fencode_time, Finsert_char):
7685 (Ftranslate_region_internal, Fformat):
7686 Rename or remove local vars to avoid shadowing.
9710023e 7687 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 7688
a415e694
PE
7689 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
7690 avoid shadowing.
7691
8ef4622d
PE
7692 * lisp.h (eassert): Check that the argument compiles, even if
7693 ENABLE_CHECKING is not defined.
7694
946f9a5b
PE
7695 * data.c (Findirect_variable): Name an expression, to avoid
7696 gcc -Wbad-function-cast warning.
112396d6 7697 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 7698 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
7699 (Fmake_variable_buffer_local, Fmake_local_variable):
7700 Mark variables as initialized.
52746918 7701 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 7702
e5aab7e7 7703 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
7704 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
7705 Rename locals to avoid shadowing.
dff45157
PE
7706 (mark_stack): Move local variables into the #ifdef region where
7707 they're used.
7bc26fdb
PE
7708 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
7709 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
7710 needed otherwise.
7711 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
7712 (GC_STRING_CHARS): Remove; not used.
d40d4be1 7713 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 7714
e5aab7e7
PE
7715 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
7716 avoids undefined behavior in theory.
7717
4da60324
PE
7718 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
7719
88043301
PE
7720 Use functions, not macros, for up- and down-casing (Bug#8254).
7721 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
7722 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
7723 to use the following functions instead of these macros.
7724 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
7725 EMACS_INT, since callers assume the returned value fits in int.
7726 (upcase1): Likewise, for UPCASE_TABLE.
7727 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 7728 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 7729 the race-condition problem in the old DOWNCASE.
88043301 7730
19ed5445
PE
7731 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
7732 Rename locals to avoid shadowing.
7733 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
7734 (regex_compile, re_search_2, re_match_2_internal):
7735 Remove unused local vars.
952db0d7
PE
7736 (FREE_VAR): Rewrite so as not to use empty "else",
7737 which gcc can warn about.
da053e48 7738 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
7739 (RETALLOC_IF): Define only if needed.
7740 (WORDCHAR_P): Likewise. This one is never needed, but is used
7741 only in a comment talking about a compiler bug, so put inside
7742 the #if 0 of that comment.
7743 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
7744 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
7745 Remove; unused.
19ed5445 7746
1f3561e4 7747 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
7748 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
7749 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 7750
ded6f8f7
PE
7751 * search.c (simple_search): Remove unused var.
7752
dbd37a95
PE
7753 * dired.c (compile_pattern): Move decl from here ...
7754 * lisp.h: ... to here, so that it can be checked.
7755 (struct re_registers): New forward decl.
7756
7e47afad
PE
7757 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
7758
85f24f61
PE
7759 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
7760 All uses changed.
7761 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
7762 Rename locals to avoid shadowing.
5671df8f 7763 (Fvertical_motion): Mark locals as initialized.
85f24f61 7764
181aa2be 7765 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 7766 (casify_region): Mark local as initialized.
181aa2be 7767
930d429c
PE
7768 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
7769
7082eac6
PE
7770 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
7771 New macros, so that the caller can use some names other than
7772 gcpro1, gcpro2, etc.
7773 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
7774 of the new macros.
7775 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
7776 argument, for consistency with GCPRO2_VAR, etc: it is now the
7777 prefix of the variable, not the variable itself. All uses
7778 changed.
38b2c076
PE
7779 * dired.c (directory_files_internal, file_name_completion):
7780 Rename locals to avoid shadowing.
7781
15206ed9
PE
7782 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
7783 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
7784 dired.c's scmp function, had undefined behavior.
7785 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
7786 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
7787 * buffer.h: ... to here, because these macros use current_buffer,
7788 and the new implementation with inline functions needs to have
7789 current_buffer in scope now, rather than later when the macros
7790 are used.
7791 (downcase, upcase1): New static inline functions.
7792 (DOWNCASE, UPCASE1): Reimplement using these functions.
7793 This avoids undefined behavior in expressions like
7794 DOWNCASE (x) == DOWNCASE (y), which previously suffered
7795 from race conditions in accessing the global variables
7796 case_temp1 and case_temp2.
7797 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
7798 * lisp.h (case_temp1, case_temp2): Remove their decls.
7799 * character.h (ASCII_CHAR_P): Move from here ...
7800 * lisp.h: ... to here, so that the inline functions mentioned
7801 above can use them.
7802
4a6bea26
PE
7803 * dired.c (directory_files_internal_unwind): Now static.
7804
f14b7e14
PE
7805 * fileio.c (file_name_as_directory, directory_file_name):
7806 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
7807 Now static.
2893f146
PE
7808 (file_name_as_directory): Use const pointers when appropriate.
7809 (Fexpand_file_name): Likewise. In particular, newdir might
7810 point at constant storage, so make it a const pointer.
fd4ead52 7811 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
7812 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
7813 signedness issues.
f839df0c
PE
7814 (Fset_file_times, Finsert_file_contents, auto_save_error):
7815 Rename locals to avoid shadowing.
f14b7e14 7816
5716756e 7817 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
7818 (Ftry_completion, Fall_completions): Rename or remove locals
7819 to avoid shadowing.
5716756e 7820
b4c3046a
PE
7821 * marker.c (bytepos_to_charpos): Remove; unused.
7822
b45db522
PE
7823 * lisp.h (verify_bytepos, count_markers): New decls,
7824 so that gcc does not warn that these functions aren't declared.
7825
85876d07
PE
7826 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
7827 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 7828 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 7829 (copy_text): Remove unused local var.
85876d07 7830
03d78a21 7831 * filelock.c (within_one_second): Now static.
b3dd38ab 7832 (lock_file_1): Rename local to avoid shadowing.
03d78a21 7833
5df8f01b
PE
7834 * buffer.c (fix_overlays_before): Mark locals as initialized.
7835 (fix_start_end_in_overlays): Likewise. This function should be
7836 simplified by using pointers-to-pointers, but that's a different
7837 matter.
b1d876f1 7838 (switch_to_buffer_1): Now static.
8f54f30a
PE
7839 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
7840 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 7841
a70072c9 7842 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 7843 Fix pointer signedness issue.
edced198
PE
7844 (sys_subshell): Mark local as volatile if checking for lint,
7845 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 7846 (MAXPATHLEN): Define only if needed.
a70072c9 7847
a0977c44
PE
7848 * process.c (serial_open, serial_configure): Move decls from here ...
7849 * systty.h: ... to here, so that they can be checked.
7850
a884fdcc
PE
7851 * fns.c (get_random, seed_random): Move extern decls from here ...
7852 * lisp.h: ... to here, so that they can be checked.
7853
604efe86 7854 * sysdep.c (reset_io): Now static.
b8950c94 7855 (wait_for_termination_signal): Remove; unused.
604efe86 7856
38fc62d9
PE
7857 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
7858 (copy_keymap_item, append_key, push_text_char_description):
7859 Now static.
1004a21a 7860 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 7861 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
7862 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
7863 (describe_map_tree):
7864 Rename locals to avoid shadowing.
38fc62d9 7865
2f2650da
PE
7866 * keyboard.c: Declare functions static if they are not used elsewhere.
7867 (echo_char, echo_dash, cmd_error, top_level_2):
7868 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
7869 (read_char, kbd_buffer_get_event, make_lispy_position):
7870 (make_lispy_event, make_lispy_movement, apply_modifiers):
7871 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
7872 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
7873 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 7874 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 7875 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 7876
a053e86c 7877 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
7878 (mark_kboards): Move decl here ...
7879 * alloc.c (mark_kboards): ... from here.
a053e86c 7880
4752793e
PE
7881 * lisp.h (force_auto_save_soon): New decl.
7882
74f10ca7 7883 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
7884 (DEFINE_DUMMY_FUNCTION): New macro.
7885 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
7886 Use it.
c03cd23f
PE
7887 (main): Add casts to avoid warnings
7888 if GCC considers string literals to be constants.
74f10ca7 7889
022e70d4
PE
7890 * lisp.h (fatal_error_signal): Add decl, since it's exported.
7891
59d6fe83
PE
7892 * dbusbind.c: Pointer signedness fixes.
7893 (xd_signature, xd_append_arg, xd_initialize):
7894 (Fdbus_call_method, Fdbus_call_method_asynchronously):
7895 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7896 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
7897 (Fdbus_register_signal): Use SSDATA when the context wants char *.
7898
78320123
PE
7899 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
7900 if GCC considers string literals to be constants.
49cebcca 7901 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 7902
35ac2a97
SM
79032011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
7904
fb103ca9
SM
7905 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
7906 (print_preprocess, print_object): New macro to fix last change.
7907
35ac2a97
SM
7908 * print.c (print_preprocess): Don't forget font objects.
7909
62973b41
JB
79102011-03-16 Juanma Barranquero <lekktu@gmail.com>
7911
7912 * emacs.c (USAGE3): Doc fixes.
7913
0e48bb22
AS
79142011-03-15 Andreas Schwab <schwab@linux-m68k.org>
7915
7916 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
7917 structure.
7918
7684e57b
JB
79192011-03-14 Juanma Barranquero <lekktu@gmail.com>
7920
7921 * lisp.h (VWindow_system, Qfile_name_history):
7922 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
7923 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
7924 (w32_system_caret_x, w32_system_caret_y): Declare extern.
7925
7926 * w32select.c: Don't #include "keyboard.h".
c96bbc66 7927 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
7928
7929 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
7930 * w32console.c (detect_input_pending, read_input_pending)
7931 (encode_terminal_code):
7932 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
7933 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
7934 (w32_system_caret_y, Qfile_name_history):
7935 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
7936 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
7937 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
7938 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
7939 * w32proc.c (Qlocal, report_file_error):
7940 * w32term.c (Vwindow_system, updating_frame):
7941 * w32uniscribe.c (initialized, uniscribe_font_driver):
7942 Remove unneeded extern declarations.
7943
2aa46d6c
CY
79442011-03-14 Chong Yidong <cyd@stupidchicken.com>
7945
c96bbc66 7946 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 7947
cffc6f3b
CY
79482011-03-13 Chong Yidong <cyd@stupidchicken.com>
7949
7950 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
7951 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
7952 These macros can no longer be used for assignment.
7953
44f230aa
SM
7954 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7955 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
7956 (record_buffer_markers, fetch_buffer_markers): New functions for
7957 recording and fetching special buffer markers.
7958 (set_buffer_internal_1, set_buffer_temp): Use them.
7959
7960 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
7961
7962 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
7963
7964 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
7965 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
7966
7967 * xdisp.c (hscroll_window_tree):
7968 (reconsider_clip_changes): Use PT instead of BUF_PT.
7969
d251f04b
EZ
79702011-03-13 Eli Zaretskii <eliz@gnu.org>
7971
7972 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
7973 $(EMACS_ROOT)/lib/intprops.h.
7974
f0c77cd1
PE
79752011-03-13 Paul Eggert <eggert@cs.ucla.edu>
7976
3eca4629
PE
7977 Fix more problems found by GCC 4.5.2's static checks.
7978
7c86ee98
PE
7979 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
7980 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
7981 (xg_free_frame_widgets): Make it clear that a local variable is
7982 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
7983 (gdk_window_get_screen): Make it clear that this macro is needed
7984 only if USE_GTK_TOOLTIP.
1e5524e7
PE
7985 (int_gtk_range_get_value): New function, which avoids a diagnostic
7986 from gcc -Wbad-function-cast.
7987 (xg_set_toolkit_scroll_bar_thumb): Use it.
7988 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
7989 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
7990 (get_utf8_string, xg_get_file_with_chooser):
7991 Rename locals to avoid shadowing.
7992 (create_dialog): Move locals to avoid shadowing.
7c86ee98 7993
41729b81
PE
7994 * xgselect.c (xg_select): Remove unused var.
7995
f0c77cd1
PE
7996 * image.c (four_corners_best): Mark locals as initialized.
7997 (gif_load): Initialize transparent_p to zero (Bug#8238).
7998 Mark another local as initialized.
ec6cf4c6 7999 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 8000
ce0ad53d 8001 * image.c (clear_image_cache): Now static.
d5d5a617 8002 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 8003 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
8004 (x_edge_detection): Remove unnecessary cast that
8005 gcc -Wbad-function-cast diagnoses.
2037898d 8006 (gif_load): Fix pointer signedness.
6ae141d6
PE
8007 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
8008 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 8009
33383987 80102011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 8011
d32df629
PE
8012 Improve quality of tests for time stamp overflow.
8013 For example, without this patch (encode-time 0 0 0 1 1
8014 1152921504606846976) returns the obviously-bogus value (-948597
8015 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
8016 reports time overflow. See
8017 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
8018 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
8019 * editfns.c: Include limits.h and intprops.h.
8020 (TIME_T_MIN, TIME_T_MAX): New macros.
8021 (time_overflow): Move earlier, to before first use.
8022 (hi_time, lo_time): New functions, for an accurate test for
8023 out-of-range times.
8024 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
8025 (Fget_internal_run_time): Don't assume time_t fits in int.
8026 (make_time): Use list2 instead of Fcons twice.
8027 (Fdecode_time): More accurate test for out-of-range times.
8028 (check_tm_member): New function.
8029 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
8030 (lisp_time_argument): Don't rely on undefined left-shift and
8031 right-shift behavior when checking for time stamp overflow.
8be6f318 8032
fe31d94c
PE
8033 * editfns.c (time_overflow): New function, refactoring common code.
8034 (Fformat_time_string, Fdecode_time, Fencode_time):
8035 (Fcurrent_time_string): Use it.
8036
8be6f318
PE
8037 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
8038 * dired.c (make_time): Move to ...
8039 * editfns.c (make_time): ... here.
8040 * systime.h: Note the move.
8041
09d9db2c 80422011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 8043
126bc0dc
YM
8044 * fringe.c (update_window_fringes): Remove unused variables.
8045
c47cbdfd
YM
8046 * unexmacosx.c (copy_data_segment): Also copy __got section.
8047 (Bug#8223)
8048
7ac80be9
EZ
80492011-03-12 Eli Zaretskii <eliz@gnu.org>
8050
c96bbc66 8051 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
8052 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
8053 Constify `char *' arguments and their references according to
8054 prototypes in tparam.h.
8055
ecb0f94d 8056 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 8057
7ac80be9
EZ
8058 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
8059 Adapt all references accordingly.
8060
8061 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
8062
ef1fd07e
TT
80632011-03-11 Tom Tromey <tromey@redhat.com>
8064
8065 * buffer.c (syms_of_buffer): Remove obsolete comment.
8066
7ef4b50c
EZ
80672011-03-11 Eli Zaretskii <eliz@gnu.org>
8068
8069 * termhooks.h (encode_terminal_code): Declare prototype.
8070
8071 * msdos.c (encode_terminal_code): Don't declare prototype.
8072
8073 * term.c (encode_terminal_code): Now external again, used by
8074 w32console.c and msdos.c.
8075
44f230aa
SM
8076 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
8077 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 8078
4b1ec863 80792011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 8080
1714f52b 8081 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 8082
4b1ec863
PE
8083 * fringe.c (update_window_fringes): Mark locals as initialized
8084 (Bug#8227).
8085 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 8086
524c7aa6
PE
8087 * alloc.c (mark_fringe_data): Move decl from here ...
8088 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
8089 to check its interface.
8090 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
8091
a5c0af81 8092 * fontset.c (free_realized_fontset): Now static.
7519b8cd 8093 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 8094 (fontset_font): Mark local as initialized.
a9a06e0b 8095 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 8096
b4716021
PE
8097 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
8098
811e9bac 8099 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 8100 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
8101 (x_own_selection, Fx_disown_selection_internal): Rename locals
8102 to avoid shadowing.
8103 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 8104
7e3ab302
PE
8105 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
8106 so that the caller can use some name other than gcpro1.
8107 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
8108 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
8109 (Fx_backspace_delete_keys_p):
8110 Use them to avoid shadowing, and rename vars to avoid shadowing.
8111 (x_decode_color, x_set_name, x_window): Now static.
6b437900 8112 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 8113 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
8114 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
8115 Remove unused locals.
7e3ab302
PE
8116 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
8117 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
8118 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
8119 macros.
f78faa98 8120
e2b13473
PE
8121 * xterm.h (x_mouse_leave): New decl.
8122
77f23912
PE
8123 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
8124 Remove unused functions.
cdf4ba58
PE
8125 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
8126 (x_calc_absolute_position): Now static.
7411c686 8127 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 8128 Don't declare local "event" unless it's used.
ed7bf3a5
PE
8129 (x_iconify_frame, x_free_frame_resources): Don't declare locals
8130 unless they are used.
38d0b34a
PE
8131 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
8132 (x_fatal_error_signal): Remove; not used.
a6067996
PE
8133 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
8134 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
8135 (x_error_catcher, x_connection_closed, x_error_handler):
8136 (x_error_quitter, xembed_send_message, x_iconify_frame):
8137 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 8138 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 8139 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 8140
44f230aa
SM
8141 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
8142 Rename or move locals to avoid shadowing.
6b463e58 8143 (tty_defined_color, merge_face_heights): Now static.
5967d051 8144 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
8145 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
8146 does not deduce is never used uninitialized.
73719eba
PE
8147 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
8148 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 8149
426994c3 8150 * terminal.c (store_terminal_param): Now static.
5489860b 8151
032f1620 8152 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 8153 (set_frame_menubar): Remove unused local.
d4323972 8154 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
8155 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
8156 since they might point to immutable storage.
281585b0
PE
8157 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
8158 since it's unused otherwise.
032f1620 8159
367c19e5 8160 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 8161 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
8162 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
8163 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 8164 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
8165 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
8166 does not deduce are never used uninitialized.
70739cbe 8167
07b48fa9
PE
8168 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
8169
8868a238 8170 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
8171 * window.c (window_loop, size_window):
8172 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 8173
7e5cf297 8174 * window.c (display_buffer): Now static.
d6550a9f
PE
8175 (size_window): Mark variables that gcc -Wuninitialized
8176 does not deduce are never used uninitialized.
a586633d
PE
8177 * window.h (check_all_windows): New decl, to forestall
8178 gcc -Wmissing-prototypes diagnostic.
5b555da1 8179 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 8180
f6095868
PE
8181 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
8182 shadowing.
8183 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
8184 Include <limits.h>.
8185 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
8186 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
8187 (load_charset_map): Mark variables that gcc -Wuninitialized
8188 does not deduce are never used uninitialized.
53df7c11 8189 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 8190
f38b440c
PE
8191 * coding.c (coding_set_source, coding_set_destination):
8192 Use "else { /* comment */ }" rather than "else /* comment */;"
8193 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
8194 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
8195 a block, when the outer 'i' will do.
8196 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
8197 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
8198 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
8199 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
8200 (Fdecode_sjis_char, Fdefine_coding_system_internal):
8201 Rename locals to avoid shadowing.
8202 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
8203 * coding.c (emacs_mule_char, encode_invocation_designation):
8204 Now static, since they're not used elsewhere.
413bb2db 8205 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 8206 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
8207 (decode_coding_emacs_mule): Mark variables that gcc
8208 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
8209 (detect_coding_iso_2022): Initialize a local variable that might
8210 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 8211 this initialization is needed. (Bug#8211)
5f58e762
PE
8212 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
8213 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
8214 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
8215 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
8216 Remove unused macros.
f38b440c 8217
232b38b9 8218 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 8219 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 8220 * character.c (string_count_byte8): Likewise.
232b38b9 8221
fb90da1b
PE
8222 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
8223 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
8224
fb93dbc2
PE
8225 * chartab.c (copy_sub_char_table): Now static, since it's not used
8226 elsewhere.
5c156ace
PE
8227 (sub_char_table_ref_and_range, char_table_ref_and_range):
8228 Rename locals to avoid shadowing.
bbcd0949 8229 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 8230
7d3b3862 8231 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 8232 (BIDI_BOB): Remove unused macro.
7d3b3862 8233
6be7d3da
PE
8234 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
8235 deduce are never used uninitialized.
c2ed9c8b 8236 * term.c (encode_terminal_code): Likewise.
6be7d3da 8237
75f8807f 8238 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 8239
50938595
PE
8240 * tparam.h: New file.
8241 * term.c, tparam.h: Include it.
8242 * deps.mk (term.o, tparam.o): Depend on tparam.h.
8243 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
8244 Move these decls to tparam.h, and make them agree with what
8245 is actually in tparam.c. The previous trick of using incompatible
8246 decls in different modules does not conform to the C standard.
8247 All callers of tparam changed to use tparam's actual API.
8248 * tparam.c (tparam1, tparam, tgoto):
8249 Use const pointers where appropriate.
8250
fbceeba2
PE
8251 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
8252 * cm.h (struct cm): Likewise.
8253 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
8254 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
8255 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
8256 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
8257 (turn_on_face, init_tty): Likewise.
8258 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 8259
7f3f1250
PE
8260 * term.c (term_mouse_position): Rename local to avoid shadowing.
8261
e6ca6543
PE
8262 * alloc.c (mark_ttys): Move decl from here ...
8263 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
8264
c40f8d15
AS
82652011-03-11 Andreas Schwab <schwab@linux-m68k.org>
8266
8267 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
8268
cfe0661d
JB
82692011-03-09 Juanma Barranquero <lekktu@gmail.com>
8270
8271 * search.c (compile_pattern_1): Remove argument regp, unused since
8272 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
8273 (compile_pattern): Don't pass it.
8274
0afb4571
J
82752011-03-08 Jan Djärv <jan.h.d@swipnet.se>
8276
8277 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
8278 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
8279 for ! HAVE_GTK3.
8280 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
8281
8282 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
8283
8284 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
8285 gdk_window_get_screen, gdk_window_get_geometry,
8286 gdk_x11_window_lookup_for_display and GDK_KEY_g.
8287 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
8288 (xg_get_pixbuf_from_pixmap): New function.
8289 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
8290 to Pixmap, take frame as parameter, remove GdkColormap parameter.
8291 Call xg_get_pixbuf_from_pixmap instead of
8292 gdk_pixbuf_get_from_drawable.
8293 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
8294 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
8295 (xg_check_special_colors): Use GtkStyleContext and its functions
8296 for HAVE_GTK3.
8297 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
8298 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
8299 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
8300 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
8301 Call gtk_widget_get_preferred_size.
0afb4571
J
8302 (xg_frame_resized): gdk_window_get_geometry only takes 5
8303 parameters.
44f230aa
SM
8304 (xg_win_to_widget, xg_event_is_for_menubar):
8305 Call gdk_x11_window_lookup_for_display.
0afb4571
J
8306 (xg_set_widget_bg): New function.
8307 (delete_cb): New function.
895009e1 8308 (xg_create_frame_widgets): Connect delete-event to delete_cb.
0afb4571
J
8309 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
8310 (xg_set_background_color): Call xg_set_widget_bg.
8311 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
8312 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
8313 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
8314 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
8315 if ! HAVE_GTK3.
8316 (update_frame_tool_bar): Call gtk_widget_hide.
8317 (xg_initialize): Use GDK_KEY_g.
8318
8319 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
8320 if ! HAVE_GTK3
8321 (x_session_initialize): Call gdk_x11_set_sm_client_id.
8322
8323 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
8324 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
8325 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
8326
1c2cc4ef
JB
83272011-03-08 Juanma Barranquero <lekktu@gmail.com>
8328
8329 * w32xfns.c (select_palette): Check success of RealizePalette against
8330 GDI_ERROR, not zero.
8331
33383987 8332See ChangeLog.11 for earlier changes.
aac0c6e3
MR
8333
8334;; Local Variables:
8335;; coding: utf-8
aac0c6e3
MR
8336;; End:
8337
33383987 8338 Copyright (C) 2011 Free Software Foundation, Inc.
aac0c6e3
MR
8339
8340 This file is part of GNU Emacs.
8341
8342 GNU Emacs is free software: you can redistribute it and/or modify
8343 it under the terms of the GNU General Public License as published by
8344 the Free Software Foundation, either version 3 of the License, or
8345 (at your option) any later version.
8346
8347 GNU Emacs is distributed in the hope that it will be useful,
8348 but WITHOUT ANY WARRANTY; without even the implied warranty of
8349 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8350 GNU General Public License for more details.
8351
8352 You should have received a copy of the GNU General Public License
8353 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.