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