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