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