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