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