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