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