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