Sync with Tramp 2.2.7.
[bpt/emacs.git] / src / ChangeLog
1 2013-03-15 Eli Zaretskii <eliz@gnu.org>
2
3 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
4 FULLSCREEN_MAXIMIZED. (Bug#13935)
5
6 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
7
8 * region-cache.c (find_cache_boundary, move_cache_gap)
9 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
10 Simplify debugging check and convert to eassert. Adjust comment.
11 (pp_cache): Put under ENABLE_CHECKING.
12
13 2013-03-14 Eli Zaretskii <eliz@gnu.org>
14
15 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
16 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
17 and WM_ACTIVATEAPP.
18 (w32fullscreen_hook): If the frame is visible, reset
19 f->want_fullscreen flag after changing the frame size. If the
20 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
21 (Bug#13953)
22
23 2013-03-13 Daniel Colascione <dancol@dancol.org>
24
25 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
26 too so that these builds can use Cygwin's file conversion
27 functions. (We've been building and linking cygw32.o all along
28 and just not using it.)
29
30 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
31
32 File synchronization fixes (Bug#13944).
33 * Makefile.in (LIB_FDATASYNC): New macro.
34 (LIBES): Use it.
35 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
36 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
37 Don't worry about HAVE_FSYNC, since a substitute fsync is
38 available if the system lacks one.
39 (Fwrite_regin): Retry fsync if interrupted.
40
41 2013-03-13 Eli Zaretskii <eliz@gnu.org>
42
43 * w32term.c (w32_read_socket): If the Emacs frame is being
44 activated, call w32fullscreen_hook, to make sure the new frame
45 dimensions are in effect. (Bug#13937)
46
47 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
48
49 * xdisp.c (init_iterator): Simplify because both character and byte
50 positions are either specified or -1. Add eassert. Adjust comment.
51 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
52 character and byte positions can be obtained from marker.
53
54 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
55
56 Static checking by Sun C 5.12.
57 * alloc.c (buffer_memory_full) [REL_ALLOC]:
58 * bytecode.c (exec_byte_code):
59 * dispnew.c (init_display):
60 * eval.c (error):
61 * fileio.c (Fsubstitute_in_file_name):
62 * keyboard.c (Fevent_convert_list):
63 * keymap.c (Fsingle_key_description):
64 * term.c (maybe_fatal, fatal):
65 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
66 * xsmfns.c (Fhandle_save_session):
67 Omit unreachable code.
68 * keymap.c (map_keymap_char_table_item): Cast void * to
69 a function pointer type; the C Standard requires this.
70
71 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
72 Include <sys/param.h> unconditionally, as that works elsewhere and
73 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
74 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
75 and FreeBSD now.
76
77 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
78
79 * insdel.c (adjust_after_replace): Use bool for boolean.
80
81 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
82
83 * keyboard.c: Move keyboard decoding to read_key_sequence.
84 (decode_keyboard_code): Remove.
85 (tty_read_avail_input): Don't try to decode input.
86 (read_decoded_char): New function.
87 (read_key_sequence): Use it.
88
89 2013-03-10 Daniel Colascione <dancol@dancol.org>
90
91 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
92 (GUI_SDATA, guichar_t): Macros to abstract out differences between
93 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
94 w32fns.c.
95
96 * w32term.c (construct_drag_n_drop): Use the above macros to make
97 drag-and-drop work for non-ASCII filenames in cygw32 builds.
98
99 * w32fns.c (x_set_name, x_set_title): Use the above macros to
100 properly display non-ASCII frame titles in cygw32 builds.
101
102 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
103 call ShellExecute in cygw32 builds.
104
105 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
106 common file dialog code.
107
108 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
109 can just use du like other systems.
110
111 * coding.c (from_unicode_buffer): Declare.
112 * coding.c (from_unicode_buffer): Implement.
113
114 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
115
116 * lread.c: Minor cleanup.
117 (FROM_FILE_P): New macro.
118 (skip_dyn_bytes, unreadchar, read1): Use it.
119 (read_list): Consolidate duplicated code.
120
121 * bytecode.c (struct byte_stack): Remove `constants' when unused.
122
123 2013-03-10 Eli Zaretskii <eliz@gnu.org>
124
125 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
126 (redisplay_internal, set_cursor_from_row, try_window)
127 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
128 (display_line, notice_overwritten_cursor)
129 (mouse_face_from_buffer_pos, note_mouse_highlight):
130 Use MATRIX_ROW_DISPLAYS_TEXT_P.
131 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
132 (mouse_face_from_string_pos, fast_find_string_pos):
133 Use MATRIX_ROW_VPOS.
134
135 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
136
137 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
138
139 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
140 MATRIX_MODE_LINE_ROW.
141
142 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
143
144 2013-03-10 handa <handa@gnu.org>
145
146 * lisp.h (adjust_after_replace): Extern it.
147
148 * coding.c (detect_coding): Cound the heading ASCII bytes in the
149 case of detection for coding_category_utf_8_auto.
150 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
151 Skip decoding if all bytes are ASCII.
152
153 * insdel.c (adjust_after_replace): Make it public. New arg
154 text_at_gap_tail.
155 (adjust_after_insert): Call adjust_after_replace with the new arg
156 value 0.
157
158 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
159
160 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
161 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
162 from Elisp via unread-command-events.
163
164 * keyboard.c (access_keymap_keyremap): Accept nil return value from
165 functions to mean "no change".
166
167 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
168
169 region-cache.c, scroll.c, search.c: Use bool for booleans.
170 * lisp.h (compile_pattern):
171 * scroll.c (do_scrolling, do_direct_scrolling):
172 * search.c (struct regexp_cache, compile_pattern_1)
173 (compile_pattern, string_match_1, search_command)
174 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
175 (search_regs_saved, Fregexp_quote):
176 Use bool for boolean.
177 * region-cache.c (region_cache_forward, region_cache_backward):
178 Fix comments to match code: these functions return int, not boolean.
179
180 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
181
182 * search.c (find_newline): Accept start and end byte positions
183 as arguments and allow -1 if not known.
184 (find_newline_no_quit): Likewise for start position.
185 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
186 * bidi.c (bidi_find_paragraph_start): Pass byte position to
187 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
188 * editfns.c (Fconstrain_to_field): Break long line.
189 Adjust call to find_newline.
190 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
191 Use DEC_BOTH to start next search from the previous buffer
192 position, where appropriate.
193 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
194 (get_visually_first_element, move_it_vertically_backward): Likewise.
195 Obtain byte position from the display iterator, where appropriate.
196
197 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
198
199 print.c, process.c: Use bool for booleans.
200 * lisp.h (wait_reading_process_output):
201 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
202 (strout, debug_output_compilation_hack, float_to_string, print)
203 (print_object):
204 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
205 (decode_status, status_message, create_process, create_pty)
206 (Fmake_network_process, Fnetwork_interface_info)
207 (wait_reading_process_output, read_process_output)
208 (write_queue_push, write_queue_pop, process_send_signal)
209 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
210 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
211 Use bool for booleans.
212 * process.c (Fnetwork_interface_list): Remove unused local.
213 (connect_counter): Now EMACS_INT, not int.
214
215 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
216
217 * bidi.c (bidi_fetch_char): Swap first and second arguments
218 to match other functions accepting character and byte positions.
219 Adjust comment.
220 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
221 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
222 when you need just to move to the previous buffer position.
223 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
224
225 2013-03-07 Eli Zaretskii <eliz@gnu.org>
226
227 * .gdbinit (prowlims): Display the enabled_p flag of the row.
228
229 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
230
231 Avoid character to byte conversions in motion subroutines.
232 * indent.h (compute_motion, vmotion): Add byte position argument.
233 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
234 Add eassert.
235 (Fcompute_motion): Break long line. Adjust call to compute_motion.
236 Use list5 for return value.
237 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
238 Adjust comments, style and calls to compute_motion.
239 (Fvertical_motion): Adjust call to vmotion.
240 * window.c (Fdelete_other_windows_internal): Record window start
241 byte position and adjust call to vmotion.
242 (window_scroll_line_based): Likewise with call to compute_motion.
243 Use SET_PT_BOTH.
244 (Frecenter): Adjust calls to vmotion.
245
246 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
247
248 * lisp.h (list2i, list3i): New functions.
249 (list4i): Move from window.c and make LISP_INLINE.
250 * editfns.c (make_lisp_time):
251 * fns.c (Flocale_info):
252 * keyboard.c (parse_modifiers):
253 * xterm.c (x_ewmh_activate_frame): Use list2i.
254 * instel.c (signal_after_change):
255 * nsfns.m (Fx_server_version, Fxw_color_values):
256 * w32fns.c (Fxw_color_values, Fx_server_version):
257 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
258 * fileio.c (Fvisited_file_modtime):
259 * nsfns.m (Fns_display_usable_bounds):
260 * w32.c (ltime): Use list4i.
261
262 2013-03-06 Eli Zaretskii <eliz@gnu.org>
263
264 * search.c (find_newline_no_quit): Rename from find_next_newline.
265 Add commentary.
266
267 * lisp.h (find_newline_no_quit): Rename prototype.
268
269 * xdisp.c (back_to_previous_line_start)
270 (forward_to_next_line_start, get_visually_first_element)
271 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
272 * indent.c (vmotion): Callers of find_newline_no_quit changed.
273 * bidi.c (bidi_find_paragraph_start): Callers of
274 find_newline_no_quit changed.
275
276 * msdos.c: Change encoding to cp850. (Bug#13879)
277 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
278
279 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
280
281 Coding system support cleanup and minor refactoring.
282 * coding.h (enum coding_result_code): Remove
283 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
284 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
285 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
286 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
287 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
288 (decode_coding_region, encode_coding_region, decode_coding_string):
289 Remove unused compatibility macros.
290 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
291 (record_conversion_result): Adjust user.
292 (syms_of_coding): Likewise.
293 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
294 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
295 (decode_coding_object): Simplify since xrealloc never returns NULL.
296 Add eassert.
297
298 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
299
300 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
301 * sysdep.c (list_system_processes)
302 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
303 Make it a stub in this case; otherwise the build might fail,
304 and this code hasn't been tested on such hosts anyway.
305 Problem reported by Nelson H. F. Beebe in
306 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
307 and analyzed by Jérémie Courrèges-Anglas in
308 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
309
310 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
311
312 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
313 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
314 (get_visually_first_element, move_it_vertically_backward): Ajust users.
315 * bidi.c (bidi_find_paragraph_start): Likewise.
316 * indent.c (vmotion): Likewise.
317
318 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
319
320 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
321 * filelock.c: Include <c-ctype.h>.
322 (MAX_LFINFO): New top-level constant.
323 (lock_info_type): Remove members pid, boot_time. Add members at,
324 dot, colon. Change user member to be the entire buffer, not a
325 pointer. This allows us to handle the case where a foreign
326 pid or boot time exceeds the local range. All uses changed.
327 (LINKS_MIGHT_NOT_WORK): New constant.
328 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
329 (defined_WINDOWSNT): Remove.
330 (MAKE_LOCK_NAME, file_in_lock_file_name):
331 Always use .#FILE (not .#-FILE) for the file lock,
332 even if it is a regular file.
333 (rename_lock_file): New function.
334 (create_lock_file): Use it.
335 (create_lock_file, read_lock_data):
336 Prefer a symbolic link for the lock file, falling back on a
337 regular file if symlinks don't work. Do not try to create
338 symlinks on MS-Windows, due to security hassles. Stick with
339 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
340 link, rename, unlink, mkstemp) when creating locks, as a GNUish
341 host may be using a Windowsish file system, and cannot use
342 MS-Windows-only system calls. Fall back on mktemp if mkstemp
343 doesn't work. Don't fail merely because of a symlink-contents
344 length limit in the current file system; fall back on regular
345 files. Increase the symlink contents length limit to 8 KiB, this
346 should be big enough for any real use and doesn't crunch the
347 stack.
348 (create_lock_file, lock_file_1, read_lock_data):
349 Simplify allocation of lock file buffers now that they fit in 8 KiB.
350 (lock_file_1): Return error number, not bool. All callers changed.
351 (ELOOP): New macro, if not already defined.
352 (read_lock_data): Return size of lock file contents, not Lisp object.
353 All callers changed. Handle a race condition if some other process
354 replaces a regular-file lock with a symlink lock or vice versa,
355 while we're trying to read the lock.
356 (current_lock_owner): Parse contents more carefully, to help avoid
357 confusing a regular-file lock with some other application's use
358 of the file. Check for lock file contents being too long, or
359 not parsing correctly.
360 (current_lock_owner, lock_file):
361 Allow foreign pid and boot times that exceed the local range.
362 (current_lock_owner, lock_if_free, lock_file):
363 Simplify allocation of lock file contents.
364 * w32.c (sys_rename_replace): New function, containing most of
365 the contents of the old sys_rename.
366 (sys_rename): Use it.
367 (fchmod): New dummy function.
368 * w32.h (sys_rename_replace, fchmod): New decls.
369
370 2013-03-05 Eli Zaretskii <eliz@gnu.org>
371
372 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
373 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
374 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
375 <dmantipov@yandex.ru>.
376
377 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
378
379 * composite.c (get_composition_id, fill_gstring_header):
380 Use make_uninit_vector where appropriate.
381 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
382 * xselect.c (clean_local_selection_data): Likewise.
383
384 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
385
386 Fix misuse of ImageMagick that caused core dump (Bug#13846).
387 * image.c (imagemagick_load_image): Calculate height and width
388 after flattening the image, not before.
389
390 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
391
392 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
393 * ftfont.c (ftfont_shape_by_flt): Likewise.
394 * w32uniscribe.c (uniscribe_shape): Likewise.
395
396 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
397
398 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
399 The old approach, which fell back on DIR/.#FILE.0 through
400 DIR/.#FILE.9, had race conditions that could not be easily fixed.
401 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
402 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
403 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
404 because the locking mechanism was never reliable in that case).
405 This patch fixes this and other bugs discovered by a code
406 inspection that was prompted by
407 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
408 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
409 to avoid interoperability problems between the MS-Windows and
410 non-MS-Windows implementations. MS-Windows and non-MS-Windows
411 instances of Emacs now ignore each others' locks.
412 * filelock.c (defined_WINDOWSNT): New constant.
413 (MAKE_LOCK_NAME, fill_in_lock_file_name):
414 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
415 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
416 regular files on MS-Windows hosts.
417 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
418 Use SAFE_ALLOCA to avoid problems with long file names.
419 (MAX_LFINFO): Now a local constant, not a global macro.
420 (IS_LOCK_FILE): Remove.
421 (lock_file_1): Don't inspect errno if symlink call succeeds;
422 that's not portable.
423 (lock_file): Document that this function can return if lock
424 creation fails.
425 (lock_file): Don't access freed storage.
426
427 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
428
429 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
430
431 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
432
433 * textprop.c: Use bool for booleans.
434 (validate_interval_range, Fadd_text_properties)
435 (Fremove_text_properties): Prefer bool to int when either works.
436
437 2013-03-02 Eli Zaretskii <eliz@gnu.org>
438
439 * textprop.c (Fadd_text_properties, Fremove_text_properties):
440 If the interval tree changes as a side effect of calling
441 modify_region, re-do processing starting from the call to
442 validate_interval_range. (Bug#13743)
443
444 2013-02-28 Eli Zaretskii <eliz@gnu.org>
445
446 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
447 (Bug#13546).
448
449 2013-02-27 Eli Zaretskii <eliz@gnu.org>
450
451 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
452 _SH_DENYRW flag, instead of emacs_open, to deny any other process
453 access to the lock file until it is written and closed.
454 (Bug#13807)
455
456 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
457
458 * callint.c (Qcall_interactively):
459 * macros.c (Qexecute_kbd_macro):
460 Now static.
461
462 2013-02-26 Bastien Guerry <bzg@gnu.org>
463
464 * window.c (Frecenter): Tiny docstring enhancement.
465
466 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
467
468 Minor textprop integer cleanup.
469 * intervals.h, textprop.c (add_text_properties_from_list):
470 Return void, not int, since nobody uses the return value.
471 * textprop.c (validate_plist, add_properties, remove_properties)
472 (Fadd_text_properties):
473 Don't assume list length fits in int.
474 (interval_has_all_properties, interval_has_some_properties)
475 (interval_has_some_properties_list, add_properties, remove_properties)
476 (Fadd_text_properties, Fremove_text_properties)
477 (Fremove_list_of_text_properties, text_property_stickiness):
478 Use bool for booleans.
479 (Fadd_text_properties, Fremove_text_properties):
480 (Fremove_list_of_text_properties):
481 Reindent do-while as per GNU style.
482
483 2013-02-25 Eli Zaretskii <eliz@gnu.org>
484
485 Implement CLASH_DETECTION for MS-Windows.
486
487 * filelock.c [WINDOWSNT]: Include w32.h.
488 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
489 function of that name. Up-case the macro arguments.
490 (IS_LOCK_FILE): New macro.
491 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
492 (create_lock_file): New function, with body extracted from
493 lock_file_1.
494 [WINDOWSNT]: Implement lock files by writing a regular file with
495 the lock information as its contents.
496 (read_lock_data): New function, on Posix platforms just calls
497 emacs_readlinkat.
498 [WINDOWSNT]: Read the lock info from the file.
499 (current_lock_owner): Call read_lock_data instead of calling
500 emacs_readlinkat directly.
501 (lock_file) [WINDOWSNT]: Run the file name through
502 dostounix_filename.
503
504 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
505 just check if the process by that PID exists.
506
507 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
508 also present, as doing so will fail to error out if the file
509 already exists.
510
511 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
512
513 * textprop.c (Fadd_text_properties, Fremove_text_properties)
514 (Fremove_list_of_text_properties): Skip all of the intervals in
515 the region between START and END that already have resp. don't
516 have the requested properties, not just the first one.
517 Add assertions that the loop afterwards always modifies the
518 properties. (Bug#13743)
519
520 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
521
522 * callint.c (Fcall_interactively): Use the right lexical environment
523 for `interactive' specs (bug#13811).
524 * eval.c (Feval): Accept a lexical environment.
525
526 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
527
528 Simplify data_start configuration (Bug#13783).
529 This is a followon simplification to the fix for Bug#13650.
530 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
531 (START_FILES): Remove. All uses removed.
532 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
533 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
534 (buildobj.h): Use it.
535 ($(ALLOBJS)): Depend on globals.h.
536 (temacs$(EXEEXT)): Use $(ALLOBJS).
537 * autodeps.mk (ALLOBJS): Move to Makefile.in.
538 * deps.mk (vm-limit.o):
539 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
540 Do not depend on mem-limits.h.
541 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
542 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
543 [__GNUC__ && !ORDINARY_LINK]: Remove.
544 * mem-limits.h, pre-crt0.c: Remove.
545 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
546 * unexcoff.c (etext): New decl.
547 (make_hdr): Use DATA_START instead of start_of_data.
548 * vm-limit.c: Move most of mem-limits.h's contents here.
549 (data_start): New decl. It's OK if this is approximate,
550 so simplify-away some unnecessary exactness.
551 (POINTER): Remove; all uses removed.
552 (data_space_start): Now char *, to avoid casts.
553 (exceeds_lisp_ptr): New function, replacing the old
554 EXCEEDS_LISP_PTR macro. All uses changed.
555 (check_memory_limits): Simplify and remove casts.
556 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
557 (memory_warnings): Use data_start instead of start_of_data.
558
559 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
560
561 * xdisp.c (set_message): Only check for debug-on-message if STRING
562 is a string. (Bug#13797)
563
564 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
565
566 Fix regression introduced by July 10 filelock.c patch.
567 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
568 2012-07-10 patch to this file. Reported by Eli Zaretskii in
569 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
570 and diagnosed by Andreas Schwab in
571 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
572
573 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
574
575 Assume C89 or better.
576 * ralloc.c (SIZE, POINTER, NIL):
577 * vm-limit.c (POINTER):
578 Remove, replacing all uses with C89 equivalents. These old
579 symbols were present only for porting to pre-C89 platforms.
580
581 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
582
583 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
584 This avoids warning messages reported as part of Bug#13546.
585
586 2013-02-21 Ken Brown <kbrown@cornell.edu>
587
588 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
589
590 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
591
592 * sheap.c (report_sheap_usage): Prefer message1_nolog.
593
594 * keyboard.c (Qcommand_execute): New var.
595 (command_loop_1, read_char): Use it.
596 (Fcommand_execute): Remove, replace by an Elisp implementation.
597 (syms_of_keyboard): Adjust accordingly.
598
599 2013-02-19 Daniel Colascione <dancol@dancol.org>
600
601 * sheap.c (report_sheap_usage): Use message, not message1, so
602 that we don't try to create a buffer while we're in the middle
603 of dumping Emacs. Explain why.
604
605 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
606
607 * search.c (find_newline): Return byte position in bytepos.
608 Adjust comment.
609 (find_next_newline_no_quit, find_before_next_newline):
610 Add bytepos argument.
611 * lisp.h (find_newline, find_next_newline_no_quit)
612 (find_before_next_newline): Adjust prototypes.
613 * bidi.c (bidi_find_paragraph_start):
614 * editfns.c (Fconstrain_to_field, Fline_end_position):
615 * indent.c (compute_motion, vmotion):
616 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
617 (get_visually_first_element, move_it_vertically_backward):
618 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
619
620 2013-02-19 Eli Zaretskii <eliz@gnu.org>
621
622 * w32proc.c (new_child): Avoid leaking handles if the subprocess
623 resources were not orderly released.
624
625 2013-02-17 Eli Zaretskii <eliz@gnu.org>
626
627 * xdisp.c (x_draw_vertical_border): For a window that is neither
628 the leftmost nor the rightmost, redraw both the left and the right
629 vertical borders. (Bug#13723)
630
631 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
632
633 * xml.c (init_libxml2_functions):
634 * sound.c (sound_warning):
635 * sheap.c (report_sheap_usage):
636 * process.c (wait_reading_process_output):
637 * msdos.c (XMenuActivate):
638 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
639 * keyboard.c (top_level_1):
640 * editfns.c (Fmessage, Fmessage_box):
641 * callint.c (Fcall_interactively):
642 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
643
644 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
645
646 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
647 * frame.c (syms_of_frame): ... to here.
648
649 2013-02-16 Eli Zaretskii <eliz@gnu.org>
650
651 * w32.c (sys_chown): Remove unused function.
652
653 * w32term.c <input_signal_count>: Declare 'volatile'
654 unconditionally. (Bug#9066)
655
656 * w32.c (set_errno): Reset h_errno and don't set it to any other
657 value. Set errno instead.
658 (check_errno): Reset h_errno.
659 (sys_socket, socket_to_fd, sys_bind, sys_connect)
660 (sys_gethostname, sys_getservbyname, sys_getpeername)
661 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
662 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
663 h_errno.
664 (sys_gethostbyname): Set h_errno only errors detected.
665
666 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
667
668 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
669
670 2013-02-15 Eli Zaretskii <eliz@gnu.org>
671
672 * keyboard.c (read_char): Fix calculation of auto-save time out
673 when auto-save-timeout is less than 4. (Bug#13720)
674
675 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
676 time. Improve diagnostics in DebPrint. (Bug#13546)
677
678 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
679 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
680 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
681 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
682 make sure errno is set to an appropriate value. (Bug#13546)
683 (socket_to_fd): Add assertion against indexing fd_info[] with a
684 value that is out of bounds.
685 (sys_accept): If fd is negative, do not set up the child_process
686 structure for reading.
687
688 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
689
690 * composite.c (fill_gstring_header): Remove useless prototype.
691 Break long line.
692 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
693 * print.c (PRINTDECLARE, print_object):
694 * search.c (compile_pattern, fast_looking_at, search_buffer):
695 (simple_search, boyer_moore, Freplace_match):
696 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
697 (get_overlay_arrow_glyph_row, display_mode_element):
698 (decode_mode_spec_coding, message3):
699 * xfaces.c (face_at_string_position): Use bool for booleans.
700 Adjust comments.
701
702 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
703
704 Fix AIX port (Bug#13650).
705 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
706 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
707 was #undeffed earlier, so it cannot be used as a macro here.
708 Use the constant and not the macro.
709
710 2013-02-15 Eli Zaretskii <eliz@gnu.org>
711
712 * w32proc.c (new_child): If no vacant slots are found in
713 child_procs[], make another pass looking for slots whose process
714 has exited or died. (Bug#13546)
715
716 * w32.c (sys_pipe): When failing due to file descriptors above
717 MAXDESC, set errno to EMFILE.
718 (_sys_read_ahead): Update cp->status when failing to read serial
719 communications input, so that the status doesn't stay at
720 STATUS_READ_IN_PROGRESS. (Bug#13546)
721
722 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
723
724 * gtkutil.c (tb_size_cb): New function.
725 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
726
727 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
728
729 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
730 an event.
731
732 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
733
734 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
735
736 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
737
738 * font.c (font_range): Add pos_byte argument. Adjust comment
739 and break long line.
740 * font.h (font_range): Adjust prototype.
741 * composite.c (autocmp_chars): Pass byte position to font_range.
742 Break long line. Remove useless prototype and format comment.
743
744 2013-02-13 Glenn Morris <rgm@gnu.org>
745
746 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
747
748 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
749
750 Improve AIX port some more (Bug#13650).
751 With this, it should be as good as it was in 23.3, though it's
752 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
753 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
754 * unexaix.c (start_of_text): Remove.
755 (_data, _text): Declare as char[], not int, as AIX manual suggests.
756 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
757 (orig_load_scnptr, orig_data_scnptr):
758 Now off_t, not long, since they are file offsets.
759 (make_hdr): Use _data, not start_of_data ().
760 This is the key part of the fix.
761 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
762 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
763
764 * pre-crt0.c (data_start): Initialize to 1.
765 This ports to compilers that optimize the external declaration
766 'int x = 0;' as if it were 'int x;' to shrink the executable.
767
768 Improve AIX port (Bug#13650).
769 This doesn't fix the bug, but it makes progress: Emacs builds now.
770 * unexaix.c: Include inttypes.h, stdarg.h.
771 (report_error, report_error_1): Mark as _Noreturn.
772 (report_error): Don't report the wrong errno.
773 (report_error_1): Now varargs. All callers changed.
774 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
775 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
776 (write_ptr): Use %p to print address rather than %lx and a cast
777 to unsigned long. Grow buffer a bit, to be safer.
778
779 2013-02-13 Eli Zaretskii <eliz@gnu.org>
780
781 * bidi.c (bidi_resolve_neutral): After finding the next
782 non-neutral character, accept NEUTRAL_ON type as well, because
783 directional control characters, such as LRE and RLE, have their
784 type converted to that by bidi_resolve_weak. This avoids aborts
785 when LRE/RLE follows a run of neutrals.
786 (bidi_move_to_visually_next): Assert that return value of
787 bidi_peek_at_next_level is non-negative. Negative values will
788 cause an infloop.
789
790 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
791
792 Minor getenv-related fixes.
793 * callproc.c (Fcall_process_region) [!DOS_NT]:
794 Avoid unnecessary duplicate call to getenv.
795 * callproc.c (init_callproc):
796 * dispnew.c (init_display):
797 * sysdep.c (sys_subshell):
798 Omit unnecessary cast of getenv or egetenv.
799
800 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
801
802 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
803 Update dependencies.
804
805 2013-02-12 Eli Zaretskii <eliz@gnu.org>
806
807 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
808 marker's position.
809 (display_line): Set w->region_showing to the value of
810 it->region_beg_charpos, not to -1. This fixes redisplay
811 optimization when cursor is moved up after M->. (Bug#13623)
812 (Bug#13626)
813 (try_scrolling): Scroll text up more if point is too close to ZV
814 and inside the scroll margin. This makes sure point is moved
815 outside the scroll margin in these cases.
816
817 * window.h (struct window): region_showing can no longer be
818 negative.
819
820 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
821
822 Tune by using memchr and memrchr.
823 * doc.c (Fsnarf_documentation):
824 * fileio.c (Fsubstitute_in_file_name):
825 * search.c (find_newline, scan_newline):
826 * xdisp.c (pos_visible_p, display_count_lines):
827 Use memchr and memrchr rather than scanning byte-by-byte.
828 * search.c (find_newline): Rename from scan_buffer.
829 Omit first arg TARGET, as it's always '\n'. All callers changed.
830
831 Clean up read_key_sequence a tiny bit more.
832 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
833 (read_key_sequence): Remove unused locals.
834
835 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
836
837 Clean up read_key_sequence a bit; reread active keymaps after first event.
838 * keyboard.c (read_char, read_char_x_menu_prompt)
839 (read_char_minibuf_menu_prompt):
840 Replace nmaps+maps with a single `map' arg.
841 (follow_key): Operate on a single map.
842 (active_maps): New function.
843 (test_undefined): Also return true for nil bindings.
844 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
845 a single (composed) keymap. Remember `first_event' to choose the right
846 set of active keymaps. Recompute the set of keymaps after receiving
847 the first event. Remove GOBBLE_FIRST_EVENT.
848 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
849 * keyboard.h (read_char): Update declaration.
850 * lread.c (read_filtered_event): Adjust call to read_char.
851
852 2013-02-11 Eli Zaretskii <eliz@gnu.org>
853
854 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
855 Don't use the limitation on backwards movement when lines are truncated
856 in the window. (Bug#13675)
857
858 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
859
860 * marker.c (set_marker_internal): If desired position is passed
861 as a marker, avoid call to buf_charpos_to_bytepos.
862 * window.c (Fset_window_point): Omit redundant type checking.
863 (Fset_window_start): Likewise. Format comment.
864 (window_scroll_pixel_based): Use set_marker_restricted_both
865 with character and byte positions obtained from an iterator.
866 (Fset_window_configuration): Use set_marker_restricted_both.
867 * xdisp.c (message_dolog): Likewise.
868
869 2013-02-10 Eli Zaretskii <eliz@gnu.org>
870
871 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
872 When text lines are longer than window's screen lines, don't move back
873 too far. This speeds up some redisplay operations. (Bug#13675)
874
875 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
876
877 * syntax.c (scan_sexps_forward): Fix byte position calculation
878 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
879
880 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
881
882 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
883 that was not needed.
884
885 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
886
887 Minor hashing refactoring.
888 * fns.c (SXHASH_REDUCE): Move to lisp.h.
889 (sxhash_float): Return EMACS_UINT, for consistency with the other
890 hash functions.
891 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
892 non-static inline function and therefore can't use static vars.
893 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
894 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
895 with the other hash functions.
896
897 2013-02-09 Eli Zaretskii <eliz@gnu.org>
898
899 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
900 XXXXXX part of the temporary file pattern is not downcased even
901 when w32-downcase-file-names is non-nil. (Bug#13661)
902
903 * xdisp.c (decode_mode_spec): Remove handling of %t.
904
905 * msdos.c (careadlinkatcwd): Remove.
906
907 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
908
909 * lread.c (skip_dyn_bytes): New function (bug#12598).
910 (read1): Use it. Use getc instead of READCHAR to read bytes.
911 (load_each_byte): Remove. Update users.
912
913 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
914
915 * search.c (scan_buffer): Calculate end byte position just once.
916 (scan_newline): Do not recalculate start_byte.
917 (search_command): Use eassert.
918 * syntax.c (struct lisp_parse_state): New member location_byte.
919 (scan_sexps_forward): Record from_byte and avoid redundant
920 character to byte position calculation ...
921 (Fparse_partial_sexp): ... here. Break too long line.
922
923 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
924
925 * lisp.h (make_uninit_vector): New function.
926 * alloc.c (Fvector, Fmake_byte_code):
927 * ccl.c (Fregister_ccl_program):
928 * charset.c (Fdefine_charset_internal, define_charset_internal):
929 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
930 * composite.c (syms_of_composite):
931 * font.c (Fquery_font, Ffont_info, syms_of_font):
932 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
933 * ftfont.c (ftfont_shape_by_flt):
934 * indent.c (recompute_width_table):
935 * nsselect.m (clean_local_selection_data):
936 * syntax.c (init_syntax_once):
937 * w32unsubscribe.c (uniscribe_shape):
938 * window.c (Fcurrent_window_configuration):
939 * xfaces.c (Fx_family_fonts):
940 * xselect.c (selection_data_to_lisp_data): Use it.
941
942 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
943
944 * coding.c (Fdefine_coding_system_internal): Use AREF where
945 argument is known to be a vector.
946 * fns.c (Flocale_info): Likewise for ASET.
947 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
948 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
949
950 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
951
952 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
953 height.
954
955 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
956 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
957 updateCollectionBehaviour.
958
959 * nsterm.m (NEW_STYLE_FS): Remove.
960 (ns_last_use_native_fullscreen): New variable.
961 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
962 (x_set_window_size): Do not take title bar and tool bar into account
963 if isFullscreen returns YES.
964 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
965 (check_native_fs): New function.
966 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
967 (ns_term_init): Remove NEW_STYLE_FS.
968 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
969 and tool bar if isFullscreen returns NO.
970 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
971 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
972 with HAVE_NATIVE_FS.
973 (window:willUseFullScreenPresentationOptions:): New method.
974 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
975 Hide toolbar if not enabled (Bug#13444).
976 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
977 Restore tool bar if enabled, hide it otherwise (Bug#13444).
978 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
979 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
980 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
981 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
982 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
983 (syms_of_nsterm): Add ns-use-native-fullscreen.
984
985 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
986
987 * fileio.c (Qchoose_write_coding_system): Now static.
988
989 2013-02-04 Eli Zaretskii <eliz@gnu.org>
990
991 * xdisp.c (window_buffer_changed): region_showing can be negative,
992 which still means region is being displayed.
993 (redisplay_internal): Resurrect code that forced redisplay of the
994 whole window when showing region and the mark has changed.
995 Record the new mark position to allow redisplay optimizations.
996 (display_line): If it->region_beg_charpos is non-zero, set the
997 window's region_showing member to -1. (Bug#13623) (Bug#13626)
998
999 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1000 not bitfield of 1 bit.
1001
1002 2013-02-03 Daniel Colascione <dancol@dancol.org>
1003
1004 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1005 daemon mode works on cygw32 when Emacs is installed and not just
1006 during development.
1007
1008 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1009
1010 Avoid file time stamp bug on MS-Windows (Bug#13149).
1011 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1012 as FAT32 doesn't update time stamps when truncating them.
1013 Also, check that a file time stamp is not a multiple of 100 ns;
1014 this should catch all instances of the problem on MS-Windows,
1015 as its native file system resolution is 100 ns or worse, and
1016 checking for a non-multiple of 100 ns should impose only a small
1017 overhead on systems with ns resolution.
1018
1019 2013-02-02 Eli Zaretskii <eliz@gnu.org>
1020
1021 Avoid encoding file names on MS-Windows when they need to be run
1022 through dostounix_filename.
1023 * w32.c (normalize_filename): Accept an additional argument
1024 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1025 downcase it even if w32-downcase-file-names is non-nil.
1026 (dostounix_filename): Accept an additional argument MULTIBYTE and
1027 pass it to normalize_filename.
1028 (emacs_root_dir): Adjust.
1029
1030 * msdos.h (dostounix_filename): Adjust prototype.
1031
1032 * w32.h (dostounix_filename): Adjust prototype.
1033
1034 * msdos.c (dostounix_filename): Accept an additional argument and
1035 ignore it.
1036 (init_environment): Adjust callers of dostounix_filename.
1037
1038 * fileio.c (Ffile_name_directory, file_name_as_directory)
1039 (directory_file_name, Fexpand_file_name)
1040 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1041 dostounix_filename.
1042 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1043 non-nil.
1044 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1045 variables, as egetenv is case-insensitive for DOS_NT.
1046
1047 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1048 with an encoded file name.
1049
1050 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1051 Adjust calls to dostounix_filename.
1052
1053 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1054
1055 * unexw32.c (unexec): Adjust call to dostounix_filename.
1056
1057 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1058
1059 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1060 dostounix_filename.
1061
1062 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1063 dostounix_filename.
1064
1065 * callproc.c (Fcall_process): Make sure program name in PATH and
1066 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1067 is passed to exec/spawnve, which fails unless the file-name
1068 encoding is UTF-8.
1069
1070 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1071 even if w32-quote-process-args is nil.
1072
1073 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1074
1075 Fix timestamp bug when write-region appends nothing (Bug#13149).
1076 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1077 the file's time stamp doesn't change if Emacs happens to write nothing
1078 to the file, and on a buggy file system this could cause Emacs to
1079 incorrectly infer that the file system doesn't have the bug.
1080 Avoid this problem by inhibiting the inference in this case.
1081
1082 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1083
1084 * window.h (struct window): Convert base_line_number, base_line_pos
1085 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1086 Convert region_showing member from Lisp_Object to bitfield.
1087 Remove sequence_number member. Adjust comments.
1088 * window.c (sequence_number): Remove.
1089 (make_window): Initialize column_number_displayed.
1090 * print.c (print_object): Follow the printed representation of
1091 frames and print window pointer to distinguish between windows.
1092 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1093 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1094 (wset_column_number_displayed, wset_region_showing): Remove.
1095 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1096 (try_scrolling, try_cursor_movement, redisplay_window)
1097 (try_window_reusing_current_matrix, try_window_id, display_line)
1098 (display_mode_lines, decode_mode_spec): Adjust users.
1099 * .gdbinit (pwinx): Do not print sequence_number.
1100
1101 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1102
1103 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1104 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1105 * dired.c: Include <fcntl.h>.
1106 (open_directory): New function, which uses open and fdopendir
1107 rather than opendir. DOS_NT platforms still use opendir, though.
1108 (directory_files_internal, file_name_completion): Use it.
1109 (file_attributes): New function, with most of the old Ffile_attributes.
1110 (directory_files_internal, Ffile_attributes): Use it.
1111 (file_attributes, file_name_completion_stat): First arg is now fd,
1112 not dir name. All uses changed. Use fstatat rather than lstat +
1113 stat.
1114 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1115 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1116 (emacs_readlinkat): New function, with much of the old
1117 Ffile_symlink_p, but with an fd argument for speed.
1118 It uses readlinkat rather than careadlinkatcwd, so that it
1119 need not assume the working directory.
1120 (Ffile_symlink_p): Use it.
1121 * filelock.c (current_lock_owner): Use emacs_readlinkat
1122 rather than emacs_readlink.
1123 * lisp.h (emacs_readlinkat): New decl.
1124 (READLINK_BUFSIZE, emacs_readlink): Remove.
1125 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1126 (emacs_norealloc_allocator, emacs_readlink): Remove.
1127 This stuff is moved to fileio.c.
1128 * w32.c (fstatat, readlinkat): New functions.
1129 (careadlinkat): Don't check that fd == AT_FDCWD.
1130 (careadlinkatcwd): Remove; no longer needed.
1131
1132 2013-01-31 Glenn Morris <rgm@gnu.org>
1133
1134 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1135 (Fwrite_region): Update for new choose_write_coding_system args.
1136 Move the last piece of choose_write_coding_system here. (Bug#13522)
1137 (syms_of_fileio): Add choose-write-coding-system.
1138
1139 2013-01-30 Eli Zaretskii <eliz@gnu.org>
1140
1141 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1142 (sys_close): Zero out the flags for the file descriptor before
1143 closing it. (Bug#13546)
1144
1145 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1146 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1147 Use CharNextExA and CharPrevExA to iterate over file names encoded in
1148 DBCS. (Bug#13553)
1149
1150 * w32.c (w32_get_long_filename, init_environment, readlink):
1151 Support file names encoded in DBCS codepages.
1152 (readlink): Use the current file-name-coding-system, not the ANSI
1153 codepage, to decode and handle targets of symlinks.
1154
1155 2013-01-28 Eli Zaretskii <eliz@gnu.org>
1156
1157 * w32.c (opendir): Now accepts a 'const char *'.
1158
1159 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1160
1161 Remove obsolete redisplay code. See the discussion at
1162 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1163 * dispnew.c (preemption_period, preemption_next_check): Remove.
1164 (Vredisplay_preemption_period): Likewise.
1165 (update_frame, update_single_window, update_window, update_frame_1):
1166 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1167 used, following the 2012-06-22 change.
1168
1169 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1170
1171 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1172
1173 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1174
1175 * font.c (num_fonts): Remove the leftover from old
1176 debugging code. Adjust comment style here and there.
1177 * insdel.c (insert_1): Remove.
1178 * lisp.h (insert_1): Remove prototype.
1179 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
1180
1181 2013-01-25 Eli Zaretskii <eliz@gnu.org>
1182
1183 * w32.c (max_filename_mbslen): New function.
1184 (normalize_filename, readdir): Use it to detect locales where ANSI
1185 encoding of file names uses a double-byte character set (DBCS).
1186 If a DBCS encoding is used, advance by characters using
1187 CharNextExA, instead of incrementing a 'char *' pointer.
1188 Use _mbslwr instead of _strlwr. (Bug#13515)
1189
1190 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1191 request of memory reservation to 1.7GB. (Bug#13065)
1192
1193 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
1194
1195 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1196 at check_extra_latin label. (Bug#13505)
1197
1198 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1199
1200 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1201 Avoid redundant calls to strlen.
1202
1203 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1204
1205 Drop async_visible and async_iconified fields of struct frame.
1206 This is possible because async input is gone; for details, see
1207 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1208 * frame.h (struct frame): Remove async_visible and async_iconified
1209 members, convert garbaged to unsigned bitfield. Adjust comments.
1210 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1211 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1212 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1213 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1214 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1215 * w32term.c: Ditto.
1216 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1217 properly. Likewise for obscured.
1218 * xterm.c: Ditto.
1219 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1220 properly.
1221 * nsterm.m: Ditto.
1222 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1223
1224 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1225
1226 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1227 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1228
1229 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1230
1231 * xdisp.c (message2, message2_nolog): Remove functions.
1232 (message3, message3_nolog): Extract nbytes and multibyteness directly
1233 from the string. Change all callers.
1234 (message3_nolog): Don't set message_enable_multibyte since set_message
1235 will reset it anyway.
1236 (message1, message1_nolog): Use message3.
1237 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1238 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1239 (set_message): Drop all but the second arg, which has to be a string.
1240 (set_message_1): Simplify now that we know that a1 is NULL and the
1241 second arg is a string.
1242 * frame.h (struct frame): Remove `message_buf' field.
1243 Use glyphs_initialized_p instead.
1244 (FRAME_MESSAGE_BUF): Remove macro.
1245 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1246 * lisp.h (message2, message2_nolog): Remove declarations.
1247 (message3, message3_nolog): Update declarations.
1248 * keyboard.c (read_char_minibuf_menu_text)
1249 (read_char_minibuf_menu_width): Remove vars.
1250 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1251 to correctly handle multibyte strings.
1252 * frame.c (delete_frame): Don't free message_buf any more.
1253 * editfns.c (message_text, message_length): Remove vars.
1254 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1255 * fileio.c (auto_save_error): Use message3 instead of message2.
1256 * dispnew.c (adjust_frame_message_buffer): Remove function.
1257
1258 2013-01-23 Eli Zaretskii <eliz@gnu.org>
1259
1260 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1261 real estate used for the tool bar and the menu bar.
1262
1263 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1264
1265 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1266 hidden buffer is prepared to modification (Bug#13164).
1267
1268 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1269
1270 * window.h (struct window): Change window_end_valid member from
1271 Lisp_Object to a bitfield. Adjust comments.
1272 (wset_window_end_valid): Remove.
1273 * window.c (adjust_window_count): Clear window_end_valid.
1274 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1275 (Fwindow_line_height, set_window_buffer, Frecenter)
1276 (Fsplit_window_internal, Fdelete_other_windows_internal)
1277 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1278 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1279 * xdisp.c (check_window_end, reconsider_clip_changes)
1280 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1281 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1282 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1283
1284 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1285
1286 * xdisp.c (mark_window_display_accurate): Simplify the loop
1287 assuming that the only one of vchild, hchild or buffer window
1288 slots is non-nil. Call mark_window_display_accurate_1 for
1289 the leaf windows only.
1290 (mark_window_display_accurate_1): Always assume leaf window.
1291 Adjust comment.
1292
1293 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1294
1295 * emacs.c (Qkill_emacs_hook): Now static.
1296
1297 * fileio.c (Finsert_file_contents): Simplify.
1298 Remove unnecessary assignments and tests.
1299
1300 2013-01-21 Eli Zaretskii <eliz@gnu.org>
1301
1302 * w32.c (acl_set_file): Don't test for errors unless
1303 set_file_security returns FALSE. Avoids spurious errors when
1304 saving files.
1305
1306 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1307
1308 * fileio.c (Finsert_file_contents): Revert code introduced at
1309 2013-01-18 in favor of the simpler and generally better fix.
1310 Save stack space by removing 'buffer' and reusing 'read_buf'
1311 where appropriate.
1312
1313 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1314
1315 * lisp.h (eabs): Define unconditionally (Bug#13419).
1316 The old "#if !defined (eabs)" was an unnecessary revenant of back
1317 when this macro was called "abs". Document 'eabs' better.
1318
1319 2013-01-19 Glenn Morris <rgm@gnu.org>
1320
1321 * fns.c (Frandom): Doc fix.
1322
1323 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1324
1325 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1326 segfault when there are lots of overlays.
1327
1328 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
1329 when there are lots of overlays.
1330 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
1331 for the details and a way to reproduce.
1332
1333 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1334
1335 * fileio.c: Use O_APPEND to append.
1336 This corresponds better to the natural interpretation of "append",
1337 and avoids the need to open the output file twice, or to invoke
1338 lseek when APPEND is neither nil nor a number.
1339 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1340 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1341 file possibly twice, and lseeking to its end; this avoids the
1342 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1343 at the same time: the combination is never needed and apparently
1344 it doesn't work with DOS_NT.
1345
1346 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1347 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1348
1349 Allow floating-point file offsets.
1350 Problem reported by Vitalie Spinu in
1351 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1352 * fileio.c (emacs_lseek): Remove.
1353 (file_offset): New function.
1354 (Finsert_file_contents, Fwrite_region): Use it.
1355
1356 2013-01-19 Chong Yidong <cyd@gnu.org>
1357
1358 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1359 aborting on Fsignal (Bug#13289).
1360
1361 2013-01-19 Eli Zaretskii <eliz@gnu.org>
1362
1363 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1364 set_file_security as failure due to insufficient privileges.
1365 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1366 (fstat): Return owner and group like 'stat' and 'lstat' do.
1367
1368 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1369
1370 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1371 The bug was observed on Ubuntu operating inside a virtual machine,
1372 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1373 The workaround introduces a race condition on non-buggy hosts,
1374 but it's an unlikely race and anyway there's a nearly identical
1375 nearby race that can't be fixed.
1376 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1377 New static vars.
1378 (Fwrite_region): Test for file system time stamp bug.
1379 (init_fileio): New function.
1380 * lisp.h (init_fileio): Declare it.
1381 * emacs.c (main): Call it.
1382
1383 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1384 and make it more consistent with other stat-failure diagnostics.
1385
1386 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1387
1388 Fix crash when inserting data from non-regular files.
1389 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
1390 for the error description produced by valgrind.
1391 * fileio.c (read_non_regular): Rename to read_contents.
1392 Free Lisp_Save_Value object used to pass parameters.
1393 (read_non_regular_quit): Rename to read_contents_quit.
1394 (Finsert_file_contents): Redesign internal file reading loop to adjust
1395 gap and end positions after each read and so help make_gap to work
1396 properly. Do not signal an I/O error too early and so do not leave
1397 not yet decoded characters in a buffer, which was the reason of
1398 redisplay crash. Use list2 to build return value. Adjust comments.
1399
1400 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1401
1402 Close a race when statting and reading files (Bug#13149).
1403 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1404 This avoids a race if the file is renamed between stat and open.
1405 This race is not the problem originally noted in Bug#13149;
1406 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1407
1408 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1409
1410 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1411 objects, related functions and macros.
1412 (make_save_value): Adjust prototype.
1413 (make_save_pointer): New prototype.
1414 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1415 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1416 * alloc.c (format_save_value): Rename to make_save_value.
1417 (make_save_pointer): New function.
1418 (record_xmalloc): Use make_save_pointer.
1419 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1420 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1421 Change users of make_save_value to make_save_pointer.
1422 Likewise for format_save_value and make_save_value.
1423
1424 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1425
1426 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1427 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1428 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1429 debugging stubs.
1430
1431 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1432
1433 * alloc.c (free_save_value): Now static.
1434
1435 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1436
1437 * keymap.c (map_keymap_internal): Use format_save_value.
1438 (map_keymap_char_table_item): Adjust accordingly.
1439 * fileio.c (non_regular_fd, non_regular_inserted)
1440 (non_regular_nbytes): Remove.
1441 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1442 Use format_save_value to pass parameters to read_non_regular.
1443 (read_non_regular): Use XSAVE_ macros to extract parameters.
1444 Adjust comment.
1445 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1446 format_save_value.
1447 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1448
1449 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1450
1451 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1452 extraction from any Lisp_Save_Value slot. Add type checking.
1453 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1454 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1455 * xselect.c: All users changed.
1456
1457 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1458
1459 Some convenient bits to deal with Lisp_Save_Values.
1460 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1461 (allocate_misc): Remove prototype.
1462 (format_save_value): New prototype.
1463 * alloc.c (allocate_misc): Revert back to static.
1464 (format_save_value): New function to build Lisp_Save_Value
1465 object with the specified internal structure.
1466 (make_save_value): Reimplement using format_save_value.
1467 * editfns.c (save_excursion_save): Use format_save_value.
1468 (save_excursion_restore): Use XSAVE_OBJECT.
1469
1470 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1471
1472 Avoid needless casts with XSAVE_POINTER.
1473 * alloc.c (mark_object) [GC_MARK_STACK]:
1474 * dired.c (directory_files_internal_unwind):
1475 * fileio.c (do_auto_save_unwind):
1476 * gtkutil.c (pop_down_dialog):
1477 * keymap.c (map_keymap_char_table_item):
1478 * lread.c (load_unwind):
1479 * nsmenu.m (pop_down_menu):
1480 * print.c (print_object) [GC_MARK_STACK]:
1481 * xfns.c (clean_up_file_dialog):
1482 * xmenu.c (cleanup_widget_value_tree):
1483 Omit casts between XSAVE_POINTER and a pointer type.
1484
1485 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1486
1487 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1488 * eval.c (eval_sub): Protect `form' from being GCed before its
1489 car and cdr becomes protected with the backtrace entry.
1490
1491 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1492
1493 Make Lisp_Save_Value more versatile storage for up to four objects.
1494 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1495 (struct Lisp_Save_Value): New layout. Adjust comments.
1496 (XSAVE_POINTER): New macro.
1497 (XSAVE_INTEGER): Likewise.
1498 (allocate_misc): Add prototype.
1499 (free_misc): Likewise.
1500 * alloc.c (allocate_misc): Now global.
1501 (free_misc): Likewise. Adjust comment.
1502 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1503 (free_save_value): Likewise.
1504 (mark_object): Likewise.
1505 * editfns.c (save_excursion_save): Pack everything within
1506 Lisp_Save_Value and so avoid xmalloc.
1507 (save_excursion_restore): Adjust to match new layout. Use free_misc
1508 because we do not allocate extra memory any more. Add eassert.
1509 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1510 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1511 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1512 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1513 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1514
1515 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1516
1517 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1518 (nsfont_draw): Remove disabling of LCD smoothing.
1519 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
1520 Bug#11484 with LCD smoothing on.
1521
1522 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
1523
1524 Fix SIGDANGER handlers, for AIX (Bug#13408).
1525 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1526 Move handlers here from emacs.c; they were out of place.
1527
1528 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1529
1530 * xterm.c (syms_of_xterm): Adjust documentation for
1531 scroll-bar-adjust-thumb-portion.
1532
1533 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
1534
1535 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1536 determine whether scroll bar thumb size should be adjusted or
1537 not. Use variable for MOTIF.
1538
1539 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1540 GTK.
1541
1542 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1543
1544 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1545 event is generated.
1546 (doCommandBySelector:): Set processingCompose to NO.
1547
1548 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1549 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1550 (nsfont_list_family): Add block/unblock_input calls.
1551 (nsfont_open): Move block_input earlier. Add unblock_input before early
1552 return.
1553 (nsfont_draw): Add block/unblock_input calls.
1554
1555 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1556
1557 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1558 for old_charpos and old_bytepos.
1559
1560 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1561
1562 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1563 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1564 Clear tzvalbuf_in_environ if this workaround is in effect.
1565 Problem and fix reported by Kazuhiro Ito.
1566
1567 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1568
1569 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1570 Fix ambiguous doc string cross-reference(s).
1571
1572 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1573 doc string cross-reference(s).
1574
1575 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1576 string cross-reference(s).
1577
1578 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1579
1580 Avoid unnecessary byte position calculation for the gap movement.
1581 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1582 anyway, all of them should use move_gap_both instead.
1583 * lisp.h (move_gap): Remove prototype.
1584 * insdel.c (move_gap): Remove.
1585 (move_gap_both): Add eassert.
1586 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1587 * xml.c (parse_region): Likewise.
1588
1589 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1590
1591 emacsclient -t should not suspend Emacs server (Bug#13387)
1592 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1593 New functions.
1594 * term.c (init_tty): Use them instead of rolling our own code.
1595 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1596 switches from 'signal' to 'pthread_sigmask', which is safer in
1597 multithreaded applications.
1598 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1599 which has already arranged for that.
1600 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1601 This is the main part of the bug fix.
1602
1603 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
1604
1605 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1606 x_last_font_name (Bug#13403).
1607
1608 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1609
1610 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1611 the type of per-buffer values where appropriate.
1612 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1613 predicate, which is how it's really used now. Adjust comment.
1614 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1615 * buffer.c (buffer_slot_type_mismatch): Remove.
1616 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1617 predicate. Adjust comment.
1618 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1619 fill-column, left-margin, tab-width, buffer-saved-size,
1620 left-margin-width, right-margin-width, left-fringe-width,
1621 right-fringe-width, scroll-bar-width and buffer-display-count.
1622 Use Qstringp for default-directory, buffer-file-name,
1623 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1624 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1625 line-spacing.
1626 * data.c (store_symval_forwarding): Adjust to call the predicate.
1627
1628 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
1629
1630 * w32.c (get_name_and_id, acl_set_file):
1631 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1632
1633 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1634
1635 * lisp.h (make_gap_1): New prototype.
1636 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1637 gap size values.
1638 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1639 naming convention.
1640 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
1641 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
1642 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1643 (make_gap_1): New function to adjust the gap of any buffer.
1644 * coding.c (coding_alloc_by_making_gap): Use it.
1645 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1646 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1647
1648 2013-01-08 Juri Linkov <juri@jurta.org>
1649
1650 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1651 of (supports :underline (:style wave)). (Bug#13000)
1652
1653 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1654
1655 * undo.c (Fprimitive_undo): Move to simple.el.
1656 (syms_of_undo): Remove declarations for Sprimitive_undo.
1657
1658 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1659
1660 * keyboard.c (echo_add_key): Rename from echo_add_char.
1661
1662 2013-01-06 Chong Yidong <cyd@gnu.org>
1663
1664 * keyboard.c (echo_add_char): New function, factored out from
1665 echo_char. Don't add a space if the previous echo string was
1666 empty (Bug#13255).
1667 (echo_char): Use it.
1668 (read_key_sequence): When echoing mock input, ensure that the
1669 trailing dash is properly added.
1670
1671 2013-01-05 Eli Zaretskii <eliz@gnu.org>
1672
1673 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1674 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
1675 digits for buffer positions, before misalignment starts.
1676 Display "0" for integer "object" field.
1677 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1678 Display the newline glyph more unambiguously.
1679
1680 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1681
1682 * nsterm.m (ns_draw_underwave):
1683 * w32term.c (w32_draw_underwave):
1684 * xterm.c (x_draw_underwave): Make underwave look more triangular
1685 and also degrade gracefully for small fonts. (Bug#13000)
1686
1687 * nsterm.m (ns_draw_text_decoration):
1688 * w32term.c (x_draw_glyph_string):
1689 * xterm.c (x_draw_glyph_string): Don't use previous underline
1690 thickness and position if previous underline type is underwave.
1691
1692 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1693
1694 * fileio.c (Ffile_acl): Undocument return format.
1695
1696 2013-01-02 Glenn Morris <rgm@gnu.org>
1697
1698 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1699
1700 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1701
1702 Simplify via eabs.
1703 * dired.c (file_name_completion):
1704 * doc.c (get_doc_string):
1705 * floatfns.c (round2):
1706 * font.c (font_score, font_delete_unmatched):
1707 * fringe.c (compute_fringe_widths):
1708 * lread.c (read_list):
1709 * minibuf.c (Ftry_completion):
1710 * term.c (tty_ins_del_lines):
1711 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1712 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1713
1714 2012-12-31 Eli Zaretskii <eliz@gnu.org>
1715
1716 * w32.c (unsetenv): Set up the string passed to _putenv
1717 correctly.
1718 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
1719 for the bug this caused.
1720
1721 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1722
1723 * coding.c (Qmac): Now static.
1724
1725 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1726
1727 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1728 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1729 handlebox_widget. Set toolbar_in_hbox to false/true, set
1730 toolbar_is_packed to true.
1731 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1732 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1733 Show all on TOOLBAR_TOP_WIDGET.
1734 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1735 by TOOLBAR_TOP_WIDGET.
1736 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1737 Check toolbar_is_packed.
1738 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1739 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1740 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1741 false.
1742 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1743 (xg_update_menubar): Update title only if
1744 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1745 (xg_update_submenu): Skip tearoff only if
1746 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1747 (xg_initialize): Initialize xg_detached_menus only if
1748 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1749
1750 * xterm.h (struct x_output): Surround handlebox_widget with
1751 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1752 toolbar_in_hbox is bool.
1753
1754 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
1755
1756 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1757 (LIBS_GNUSTEP): Define.
1758 (LIBES): Add $(LIBS_GNUSTEP).
1759 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1760
1761 2012-12-30 Eli Zaretskii <eliz@gnu.org>
1762
1763 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1764 continuation glyph on a TTY with an indication of an empty line.
1765 (Bug#13277)
1766
1767 2012-12-29 Eli Zaretskii <eliz@gnu.org>
1768
1769 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1770 file's SELinux context or ACLs successfully set, nil otherwise.
1771 (Bug#13298)
1772 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
1773
1774 * w32proc.c (reader_thread): Avoid passing NULL handles to
1775 SetEvent and WaitForSingleObject.
1776
1777 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1778
1779 Port EXTERNALLY_VISIBLE to Clang 3.2.
1780 * conf_post.h (__has_attribute): New macro.
1781 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1782
1783 2012-12-27 Glenn Morris <rgm@gnu.org>
1784
1785 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1786 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1787
1788 2012-12-27 Eli Zaretskii <eliz@gnu.org>
1789
1790 * fileio.c (file_name_as_directory, directory_file_name):
1791 Accept an additional argument MULTIBYTE to indicate whether the input C
1792 came from a multibyte or a unibyte Lisp string; all callers
1793 adjusted. Don't assume the input string is always multibyte.
1794 (Bug#13262)
1795 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1796 don't ENCODE_FILE them, and return a unibyte string if the input
1797 was unibyte.
1798 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1799 don't assume the input strings will always be multibyte. If the
1800 input strings are multibyte, decode strings obtained from C
1801 library functions.
1802
1803 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1804
1805 * lisp.h (toplevel): Add two notices to the comment about
1806 defining a new Lisp data type.
1807 * print.c (print_object): If Lisp_Save_Value object's pointer
1808 is the address of a memory area containing Lisp_Objects, try
1809 to print them.
1810 * alloc.c (valid_lisp_object_p): Adjust comment.
1811
1812 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
1813
1814 * keyboard.c (record_asynch_buffer_change): Initialize an event
1815 only if it's really needed.
1816 * frame.h (enum output_method): Remove output_mac member since
1817 it's a leftover from the deleted code.
1818 * frame.c (Fframep): Adjust user here ...
1819 * terminal.c (Fterminal_live_p): ... and here.
1820 * coding.c (Qmac): Now here because it's only used to denote
1821 end-of-line encoding type.
1822 (syms_of_coding): DEFSYM it.
1823 * frame.h (Qmac): Remove duplicated declaration.
1824
1825 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
1826
1827 * window.c (select_window_1): Now static, since it's used only here.
1828
1829 2012-12-25 Eli Zaretskii <eliz@gnu.org>
1830
1831 * window.c (window_body_cols): Subtract display margins from the
1832 window body width on TTYs as well. See
1833 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1834 for the original report.
1835
1836 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
1837
1838 * xdisp.c (redisplay_window): Remove inner local variable
1839 because the outer shadowed one has the same meaning.
1840 * xterm.h (struct x_output): Remove toolbar_detached member since it's
1841 set but never used.
1842 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1843 (xg_create_tool_bar): Adjust users.
1844
1845 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
1846
1847 * buffer.h (BUF_COMPACT): New macro to follow the common style.
1848 * buffer.c (Fget_buffer_create): Use it to set compact field of
1849 struct buffer_text to avoid accessing an uninitialized value
1850 when compact_buffer is called for the first time.
1851 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
1852 (Fset_buffer_modified_p): Use buffer_window_count to check
1853 whether the buffer is displayed in some window.
1854 * xdisp.c (message_dolog): Likewise.
1855
1856 2012-12-23 Eli Zaretskii <eliz@gnu.org>
1857
1858 * w32.c (acl_set_file): If setting the file security descriptor
1859 fails, and the new DACL is identical to the existing one, silently
1860 return success. This fixes problems for users backing up their
1861 own files without having the necessary privileges for setting
1862 security descriptors.
1863
1864 * w32proc.c (reader_thread): Do not index fd_info[] with negative
1865 values.
1866 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1867 after WaitForSingleObject returns normally. This expedites reader
1868 thread shutdown when delete_child triggers it.
1869 (reap_subprocess): More accurate commentary for why we call
1870 delete_child only when cp->fd is negative.
1871
1872 * w32.c (sys_close): Do not call delete_child on a subprocess
1873 whose handle is not yet closed. Instead, set its file descriptor
1874 to a negative value, so that reap_subprocess will call
1875 delete_child on that subprocess when its SIGCHLD arrives.
1876 This avoids closing handles used for communications between sys_select
1877 and reader_thread, which doesn't give sys_select a chance to
1878 notice that the process exited and invoke the SIGCHLD handler for
1879 it.
1880
1881 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
1882
1883 * nsfns.m (Fns_do_applescript): Run event loop until script has
1884 been executed (Bug#12969).
1885 (ns_run_ascript): Chech as_script for nil, set to nil after
1886 executing script.
1887
1888 2012-12-22 Martin Rudalics <rudalics@gmx.at>
1889
1890 * window.c (Fselect_window): Reword doc-string (Bug#13248).
1891
1892 2012-12-22 Eli Zaretskii <eliz@gnu.org>
1893
1894 * w32term.c (w32fullscreen_hook): New function.
1895 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1896
1897 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1898
1899 * fileio.c (Finsert_file_contents): Doc fix.
1900
1901 * w32proc.c (new_child, delete_child, find_child_pid): For a
1902 subprocess, consider its slot being in use as long as its process
1903 handle (procinfo.hProcess) is not NULL. This avoids reusing the
1904 slot when a new process is started immediately after killing
1905 another one, without waiting enough time for the first process to
1906 be reaped and resources allocated for it be orderly freed.
1907 (Bug#13086)
1908 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1909
1910 2012-12-21 Chong Yidong <cyd@gnu.org>
1911
1912 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1913
1914 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1915
1916 2012-12-21 Eli Zaretskii <eliz@gnu.org>
1917
1918 * w32.c (get_name_and_id): Always pass NULL as the first argument
1919 of lookup_account_sid. Avoids crashes with UNC file names that
1920 refer to DFS domains, not to specific machine names. (Bug#12621)
1921 Remove now unused argument FNAME; all callers changed.
1922 (get_file_owner_and_group): Remove now unused argument FNAME; all
1923 callers changed.
1924
1925 2012-12-21 Chong Yidong <cyd@gnu.org>
1926
1927 * editfns.c (Finsert_char): Since read-char-by-name now signals an
1928 error for invalid chars, don't check for a nil return value.
1929
1930 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1931
1932 Avoid calls to CHAR_TO_BYTE if byte position is known.
1933 * editfns.c (make_buffer_string_both): Use move_gap_both.
1934 (Fbuffer_string): Use make_buffer_string_both.
1935 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
1936 Adjust comment.
1937 (buf_bytepos_to_charpos): Likewise.
1938 (charpos_to_bytepos): Remove.
1939 * fileio.c (Finsert_file_contents): Use move_gap_both.
1940 * search.c (Freplace_match): Likewise.
1941 * process.c (process_send_region): Likewise. Use convenient
1942 names for byte positions.
1943 * lisp.h (charpos_to_bytepos): Remove prototype.
1944 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
1945 * insdel.c (move_gap): Likewise.
1946
1947 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
1948
1949 * xdisp.c (redisplay_internal): Remove now-unused local.
1950
1951 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
1952
1953 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
1954 (redisplay_internal): Don't bother selecting the frame to get the
1955 proper value of frame-local variables (bug#13225).
1956
1957 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
1958
1959 * textprop.c (set_text_properties_1): Do not allow NULL interval.
1960 Rename 4th argument since it may be buffer or string. Adjust comment.
1961 * intervals.c (graft_intervals_info_buffer): Find an interval here.
1962
1963 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
1964
1965 * coding.c (Fdetect_coding_region): Do not check start and end with
1966 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
1967 (code_convert_region): Likewise.
1968
1969 2012-12-18 Eli Zaretskii <eliz@gnu.org>
1970
1971 * w32.c (acl_get_file, acl_set_file): Run the file name through
1972 map_w32_filename, and resolve any symlinks in the file name, like
1973 Posix platforms do.
1974 (acl_set_file): Call revert_to_self, if any privileges were
1975 enabled.
1976
1977 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
1978
1979 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
1980 ($(BLD)/w32.$(O)): Update dependencies.
1981
1982 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
1983
1984 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
1985 propagate redisplay's scrolling (if any) to the right window.
1986 (redisplay_internal): Use ensure_selected_frame.
1987 (display_mode_lines): Complete last fix.
1988 * window.c (select_window_1): New func, extracted from select_window.
1989 (select_window): Use it.
1990 * window.h (select_window_1): Declare.
1991
1992 2012-12-17 Eli Zaretskii <eliz@gnu.org>
1993
1994 Emulate Posix ACL APIs on MS-Windows.
1995 * w32.c: Include sddl.h and sys/acl.h.
1996 (SDDL_REVISION_1): Define if not already defined.
1997 (g_b_init_get_security_descriptor_dacl)
1998 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
1999 (g_b_init_is_valid_security_descriptor)
2000 (g_b_init_set_file_security): New static flags.
2001 (globals_of_w32): Initialize them to zero.
2002 (SetFileSecurity_Name): New string constant.
2003 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2004 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2005 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2006 (IsValidSecurityDescriptor_Proc): New typedefs.
2007 (get_file_security, get_security_descriptor_owner)
2008 (get_security_descriptor_group): Set errno to ENOTSUP.
2009 (set_file_security, get_security_descriptor_dacl)
2010 (is_valid_security_descriptor, convert_sd_to_sddl)
2011 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2012 (acl_free, acl_get_file, acl_set_file): New functions.
2013
2014 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2015
2016 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2017
2018 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2019 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2020 for some of that bug's symptoms can now cause Emacs to abort.
2021 Remove the workaround.
2022 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2023 The bug that caused SIGCHLD to get lost has been fixed, and the
2024 workaround for it can now cause Emacs to abort.
2025
2026 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2027
2028 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2029 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2030 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2031
2032 2012-12-16 Romain Francoise <romain@orebokech.com>
2033
2034 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2035 (Fcopy_file): Change last arg to `preserve_extended_attributes'
2036 and copy ACL entries of file in addition to SELinux context if set.
2037 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2038
2039 * Makefile.in (LIBACL_LIBS): New macro.
2040 (LIBES): Use it.
2041
2042 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2043
2044 * fileio.c (internal_delete_file): Use bool for boolean.
2045
2046 2012-12-15 Eli Zaretskii <eliz@gnu.org>
2047
2048 Fix bug #13079 on MS-Windows with temp files not being deleted.
2049 * w32.h (_child_process): New members input_file and
2050 pending_deletion.
2051 (register_child): First argument is now pid_t.
2052 (record_infile, record_pending_deletion): New prototypes.
2053
2054 * w32proc.c (new_child): Initialize input_file and
2055 pending_deletion members of the child.
2056 (delete_child): Delete the child's temporary input file, if any,
2057 that is pending deletion.
2058 (register_child): First argument is now pid_t.
2059 (record_infile, record_pending_deletion): New functions.
2060 (reap_subprocess): Fix a typo in DebPrint string.
2061 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2062
2063 * fileio.c (internal_delete_file): Return an int again: non-zero
2064 if delete-file succeeds, zero otherwise.
2065
2066 * lisp.h (internal_delete_file): Adjust prototype.
2067
2068 * callproc.c (Fcall_process): Don't overwrite infile with result
2069 of DECODE_FILE.
2070 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2071 asynchronous subprocess, record the name of the input file name,
2072 if any.
2073 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2074 delete the file, record it as pending deletion when the subprocess
2075 exits.
2076
2077 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2078
2079 * editfns.c [HAVE_PWD_H]: Include grp.h.
2080
2081 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2082
2083 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2084
2085 Fix permissions bugs with setgid directories etc. (Bug#13125)
2086 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2087 to mark it as a placeholder. The old value was often wrong.
2088 The only user of this attribute has been changed to use
2089 file-ownership-preserved-p instead, with its new group arg.
2090 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2091
2092 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2093
2094 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2095 Keep selected_window and selected_frame in sync.
2096
2097 2012-12-14 Eli Zaretskii <eliz@gnu.org>
2098
2099 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2100 try to get accurate owner and group information from NT file
2101 security APIs. This is to make most callers of 'stat' and
2102 'lstat', which don't need that information, much faster.
2103
2104 * dired.c (Ffile_attributes) [WINDOWSNT]:
2105 Set w32_stat_get_owner_group to a non-zero value, to request accurate
2106 owner and group information from 'lstat'.
2107
2108 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2109
2110 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2111 as that confuses set-auto-coding, so insist on the head-read
2112 returning the full 1024 bytes. Let lseek compute the tail offset;
2113 less work for us. Do not ignore I/O errors when reading the tail.
2114
2115 * xdisp.c: Minor style fixes.
2116 (init_iterator): Hoist assignment out of if-expression.
2117 (markpos_of_region): Callers now test for sign, not for -1.
2118
2119 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2120
2121 Minor redisplay optimization when the region length is zero.
2122 * xdisp.c (markpos_of_region): New function.
2123 (init_iterator): Do not highlight the region of zero length.
2124 (redisplay_window): Check whether the region is of non-zero length.
2125 (try_cursor_movement): Allow if the region length is zero.
2126 (try_window_reusing_current_matrix, try_window_id): Likewise.
2127
2128 2012-12-13 Eli Zaretskii <eliz@gnu.org>
2129
2130 * search.c (search_buffer): Check the inverse translations of each
2131 character in pattern when the buffer being searched is unibyte.
2132 (Bug#13084)
2133
2134 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2135
2136 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2137 files, fixing a regression from 24.2.
2138 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2139
2140 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2141
2142 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2143 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2144 Remove unnecessary S_ISLNK test, as (contra the comments) this
2145 function can't copy symlinks. Improve quality of error message
2146 when attempting to copy files that are neither regular files nor
2147 directories.
2148
2149 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2150
2151 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2152 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2153 * window.c (Frecenter):
2154 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2155 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2156
2157 2012-12-12 Daniel Colascione <dancol@dancol.org>
2158
2159 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2160 the dumped Emacs is not a sparse file, greatly improving Cygwin
2161 "make bootstrap" performance.
2162
2163 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
2164
2165 * inotify.c (inotify_callback): Generate an Emacs event for every
2166 incoming inotify event.
2167
2168 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2169
2170 * xdisp.c (handle_face_prop): Fix logic of computing
2171 it->start_of_box_run_p.
2172 (append_space_for_newline): If the glyph row is R2L, reset the
2173 iterator's end_of_box_run_p flag before prepending the space glyph.
2174 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2175 iterator's start_of_box_run_p flag before prepending the stretch.
2176 (append_glyph, produce_image_glyph, append_composite_glyph)
2177 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2178 left_box_line_p and right_box_line_p flags of the glyph for R2L
2179 glyph rows. (Bug#13011)
2180
2181 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2182
2183 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2184 if changed buffer is not shown in a window.
2185 * insdel.c (prepare_to_modify_buffer): Likewise.
2186 * window.c (replace_buffer_in_windows_safely): Do nothing
2187 if buffer is not shown in a window.
2188 (Fforce_window_update): Likewise if string or buffer argument
2189 is passed.
2190
2191 2012-12-11 Eli Zaretskii <eliz@gnu.org>
2192
2193 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2194 encoded_file_name, which is what it is.
2195
2196 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2197
2198 Consistently use marker_position and marker_byte_position.
2199 * fringe.c (Ffringe_bitmaps_at_pos):
2200 * indent.c (Fvertical_motion):
2201 * insdel.c (prepare_to_modify_buffer):
2202 * keyboard.c (make_lispy_position):
2203 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2204 (window_scroll_pixel_based, displayed_window_lines)
2205 (Fset_window_configuration):
2206 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2207 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2208 Replace direct access to marker fields with calls
2209 to marker_position and/or marker_byte_position.
2210
2211 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
2212
2213 * makefile.w32-in (SIG2STR_H): New macro.
2214 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2215 ($(BLD)/w32notify.$(O)): Update dependencies.
2216
2217 2012-12-10 Daniel Colascione <dancol@dancol.org>
2218
2219 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2220 Windows file notification functionality unless WINDOWSNT.
2221
2222 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2223 declarations.
2224
2225 * w32fns.c (cache_system_info): Initialize the global hinst
2226 variable here so various initialization calls DTRT.
2227
2228 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2229 (hinst): Remove unneeded extern declaration.
2230 (_start): Remove initialization of above variables; remove
2231 initialization of hinst, as cache_system_info now does that.
2232
2233 * emacs.c (main): Call cache_system_info early in startup; we
2234 previously weren't calling it in Cygwin builds.
2235
2236 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2237 Teach the autoconf build system how to compile a Windows resource file
2238 and link it to Emacs.
2239
2240 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2241
2242 Per-buffer window counters.
2243 * buffer.h (struct buffer): New member window_count.
2244 (buffer_window_count): New function.
2245 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2246 Initialize window_count.
2247 (Fkill_buffer): Verify window_count for the buffer being killed.
2248 (modify_overlay): Do not force redisplay if buffer is not shown
2249 in any window.
2250 (init_buffer_once): Initialize window_count for buffer_defaults
2251 and buffer_local_symbols.
2252 * window.h (buffer_shared): Remove declaration.
2253 (wset_buffer): Convert from inline ...
2254 * window.c (wset_buffer): ... to an ordinary function.
2255 (adjust_window_count): New function.
2256 (make_parent_window): Use it.
2257 * xdisp.c (buffer_shared): Remove.
2258 (redisplay_internal, redisplay_window): Adjust users.
2259 (buffer_shared_and_changed): Use per-buffer window counter.
2260
2261 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2262
2263 Support for filesystem notifications on MS-Windows.
2264 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2265 and this is a TTY frame, signal the caller that keyboard input is
2266 available.
2267
2268 * w32xfns.c (drain_message_queue): Now returns an int: an
2269 indication whether any WM_EMACS_FILENOTIFY messages were found in
2270 the queue.
2271
2272 * w32inevt.c (handle_file_notifications): New function.
2273 (w32_console_read_socket): Call it to process file notifications.
2274
2275 * w32console.c (initialize_w32_display): Record the main thread ID
2276 in dwMainThreadId.
2277
2278 * deps.mk (inotify.o): New dependency list.
2279
2280 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2281
2282 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2283 (WM_EMACS_END): Bump value by 1.
2284 (notification_buffer_in_use, file_notifications)
2285 (notifications_size, notifications_desc): Declare.
2286 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2287 Add prototypes.
2288
2289 * w32term.c (lispy_file_action, queue_notifications): New functions.
2290 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2291 <Qrenamed_to>: New symbols.
2292 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2293
2294 * w32notify.c: New file, implements file event notifications for
2295 MS-Windows.
2296
2297 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2298 by posting it to the w32_read_socket queue.
2299
2300 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2301
2302 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2303 (GLOBAL_SOURCES): Add w32notify.c
2304 ($(BLD)/w32notify.$(O)): New set of dependencies.
2305
2306 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2307
2308 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2309 Handle FILE_NOTIFY_EVENT.
2310 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2311 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2312 w32notify-handle-event by default.
2313
2314 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2315 syms_of_w32notify.
2316
2317 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2318
2319 Support for filesystem notifications on GNU/Linux via inotify.
2320 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
2321
2322 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2323
2324 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2325 (syms_of_keyboard): DEFSYM it.
2326 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2327 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2328 Qfile_inotify events.
2329 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2330 special-event-map to inotify-handle-event.
2331
2332 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2333
2334 * Makefile.in (base_obj): Add inotify.o.
2335
2336 * inotify.c: New file.
2337
2338 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
2339
2340 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2341
2342 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
2343
2344 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2345 DWORD_PTR, for compatibility with 64-bit builds.
2346
2347 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
2348 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2349 (system_process_attributes): Use SIZE_T rather than DWORD, for
2350 compatibility with 64-bit builds.
2351
2352 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
2353
2354 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2355
2356 2012-12-10 Eli Zaretskii <eliz@gnu.org>
2357
2358 * indent.c (Fvertical_motion): If a display string will be
2359 displayed on the left or the right margin, don't consider it as a
2360 factor in cursor positioning. (Bug#13108)
2361
2362 2012-12-10 Martin Rudalics <rudalics@gmx.at>
2363
2364 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2365
2366 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2367
2368 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2369 for string length.
2370
2371 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2372
2373 * w32.c (unsetenv): Return 0 if the input string is too long.
2374
2375 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2376
2377 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2378 * alloc.c (xputenv): New function.
2379 * dbusbind.c (Fdbus_init_bus):
2380 * emacs.c (main):
2381 * xterm.c (x_term_init):
2382 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2383 * editfns.c (initial_tz): Move static var decl up.
2384 (tzvalbuf_in_environ): New static var.
2385 (init_editfns): Initialize these two static vars.
2386 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2387 Save old TZ value on stack, if it's small.
2388 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2389 instead, use xputenv+unsetenv to set and restore TZ.
2390 (environbuf): Remove static var. All uses removed.
2391 (Fset_time_zone_rule): Do not save TZ and environ;
2392 no longer needed here.
2393 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2394 Move to inside set_time_zone_rule; they don't need file scope any more.
2395 (set_time_zone_rule): Maintain the TZ=value string separately.
2396 (syms_of_editfns): Don't initialize initial_tz;
2397 init_editfns now does it.
2398 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2399 * lisp.h (xputenv): New decl.
2400
2401 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2402
2403 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2404
2405 2012-12-08 Eli Zaretskii <eliz@gnu.org>
2406
2407 * w32.c (unsetenv, sys_putenv): New functions.
2408
2409 2012-12-08 Chong Yidong <cyd@gnu.org>
2410
2411 * editfns.c (Finsert_char): Make the error message more
2412 informative (Bug#12992).
2413
2414 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2415
2416 Simplify get_lim_data.
2417 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2418 Remove USG and vlimit methods; no longer used these days.
2419 Add #error catchall just in case.
2420
2421 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2422 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2423 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2424 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2425 (deleted_pid_list, Fdelete_process, create_process)
2426 (record_child_status_change, handle_child_signal, deliver_child_signal)
2427 (init_process_emacs, syms_of_process):
2428 Assume SIGCHLD is defined.
2429 (parse_signal): Remove. All uses removed.
2430 (abbr_to_signal): New static function.
2431 (Fsignal_process): Use it to convert signal names to ints.
2432 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2433 kill (getpgrp (), ...).
2434 (emacs_sigaction_init): Assume SIGCHLD is defined.
2435 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2436 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2437 * syssignal.h (EMACS_KILLPG): Remove.
2438 All uses replaced by 'kill' with a negative pid.
2439 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2440 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2441
2442 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2443
2444 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2445 This will cause a production Emacs to dump core instead of
2446 infinite-looping.
2447
2448 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2449
2450 * frame.c (make_frame): Do not set window's buffer to t.
2451 * window.c (Fsplit_window_internal): Likewise. Previously it was
2452 used to indicate that the window is being set up. Now we use
2453 set_window_buffer for all new windows, so the condition in ...
2454 (Fset_window_buffer): ... is always true and can be removed.
2455
2456 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2457
2458 Convenient macro to check whether the buffer is hidden.
2459 * buffer.h (BUFFER_HIDDEN_P): New macro.
2460 * frame.c (make_frame): Use it. Adjust comment.
2461 * buffer.c (candidate_buffer): New function.
2462 (Fother_buffer, other_buffer_safely): Use it.
2463
2464 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2465
2466 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2467 if the child process is still running. Instead, exit the wait
2468 loop and return zero. (Bug#13086)
2469
2470 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2471
2472 * frame.h (x_char_width, x_char_height): Remove prototypes.
2473 * w32term.h (x_char_width, x_char_height): Likewise.
2474 * xfns.c (x_char_width, x_char_height): Remove.
2475 * w32fns.c (x_char_width, x_char_height): Likewise.
2476 * nsfns.c (x_char_width, x_char_height): Likewise.
2477 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2478 all window frames.
2479 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2480 * keyboard.c (command_loop_1): Remove prototype.
2481 (command_loop_2, top_level_1): Add static to match prototype.
2482
2483 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 Fix a recently-introduced delete-process race condition.
2486 * callproc.c, process.h (record_kill_process):
2487 New function, containing part of the old call_process_kill.
2488 (call_process_kill): Use it.
2489 This does not change call_process_kill's behavior.
2490 * process.c (Fdelete_process): Use record_kill_process to fix a
2491 race condition that could cause Emacs to lose track of a child.
2492
2493 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2494
2495 Avoid code duplication between prev_frame and next_frame.
2496 * frame.c (candidate_frame): New function. Add comment.
2497 (prev_frame, next_frame): Use it. Adjust comment.
2498
2499 2012-12-06 Eli Zaretskii <eliz@gnu.org>
2500
2501 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2502 fails, signal an error instead of continuing with an empty
2503 string. (Bug#13079)
2504 Encode expanded temp file pattern before passing it to mkstemp or
2505 mktemp.
2506
2507 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2508 Encode the file name before passing it to dostounix_filename, in
2509 case it will downcase it (under w32-downcase-file-names).
2510 (Bug#12933)
2511
2512 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2513
2514 Minor call-process cleanups.
2515 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2516 at the same time as other platforms, to simplify analysis.
2517 No need for fd0_volatile since we have synch_process_fd.
2518 Avoid needless emacs_close; arg is always negative.
2519
2520 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2521
2522 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2523 processes.
2524
2525 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2526
2527 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2528 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2529 and mouse_face_hidden members to a bitfields.
2530 * frame.h (struct frame): Remove set-but-not-used space_width member.
2531 (FRAME_SPACE_WIDTH): Remove.
2532 * nsterm.m, w32term.c, xterm.c: Adjust users.
2533 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2534 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2535 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2536 members to a bitfields.
2537
2538 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2539
2540 Don't let call-process be a zombie factory (Bug#12980).
2541 Fixing this bug required some cleanup of the signal-handling code.
2542 As a side effect, this change also fixes a longstanding rare race
2543 condition whereby Emacs could mistakenly kill unrelated processes,
2544 and it fixes a bug where a second C-g does not kill a recalcitrant
2545 synchronous process in GNU/Linux and similar platforms.
2546 The patch should also fix the last vestiges of Bug#9488,
2547 a bug which has mostly been fixed on the trunk by other changes.
2548 * callproc.c, process.h (synch_process_alive, synch_process_death)
2549 (synch_process_termsig, sync_process_retcode):
2550 Remove. All uses removed, to simplify analysis and so that
2551 less consing is done inside critical sections.
2552 * callproc.c (call_process_exited): Remove. All uses replaced
2553 with !synch_process_pid.
2554 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2555 These take the role of what used to be in unwind-protect arg.
2556 All uses changed.
2557 (block_child_signal, unblock_child_signal):
2558 New functions, to avoid races that could kill innocent-victim processes.
2559 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2560 (call_process_kill): Record killed processes as deleted, so that
2561 zombies do not clutter up the system. Do this inside a critical
2562 section, to avoid a race that would allow the clutter.
2563 (call_process_cleanup): Fix code so that the second C-g works again
2564 on common platforms such as GNU/Linux.
2565 (Fcall_process): Create the child process in a critical section,
2566 to fix a race condition. If creating an asynchronous process,
2567 record it as deleted so that zombies do not clutter up the system.
2568 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2569 light of these changes. Omit unnecessary call to emacs_close
2570 before failure, as the unwind-protect code does that.
2571 * callproc.c (call_process_cleanup):
2572 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2573 * process.c (record_deleted_pid): New function, containing
2574 code refactored out of Fdelete_process.
2575 (Fdelete_process): Use it.
2576 (process_status_retrieved): Remove. All callers changed to use
2577 child_status_change.
2578 (record_child_status_change): Remove, folding its contents into ...
2579 (handle_child_signal): ... this signal handler. Now, this
2580 function is purely a handler for SIGCHLD, and is not called after
2581 a synchronous waitpid returns; the synchronous code is moved to
2582 wait_for_termination. There is no need to worry about reaping
2583 more than one child now.
2584 * sysdep.c (get_child_status, child_status_changed): New functions.
2585 (wait_for_termination): Now takes int * status and bool
2586 interruptible arguments, too. Do not record child status change;
2587 that's now the caller's responsibility. All callers changed.
2588 Reimplement in terms of get_child_status.
2589 (wait_for_termination_1, interruptible_wait_for_termination):
2590 Remove. All callers changed to use wait_for_termination.
2591 * syswait.h: Include <stdbool.h>, for bool.
2592 (record_child_status_change, interruptible_wait_for_termination):
2593 Remove decls.
2594 (record_deleted_pid, child_status_changed): New decls.
2595 (wait_for_termination): Adjust to API changes noted above.
2596
2597 * bytecode.c, lisp.h (Qbytecode): Remove.
2598 No longer needed after 2012-11-20 interactive-p changes.
2599
2600 2012-12-03 Eli Zaretskii <eliz@gnu.org>
2601
2602 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2603 the scroll margin, move point outside the margin. (Bug#13055)
2604
2605 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2606
2607 * gtkutil.c (my_log_handler): New function.
2608 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2609
2610 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2611
2612 * lisp.h (modify_region): Rename to...
2613 (modify_region_1): ...new prototype.
2614 * textprop.c (modify_region): Now static. Adjust users.
2615 * insdel.c (modify_region): Rename to...
2616 (modify_region_1): ...new function to work with current buffer.
2617 Adjust comment and users. Use true and false for booleans.
2618
2619 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2620
2621 * alloc.c (free_save_value): New function.
2622 (safe_alloca_unwind): Use it.
2623 * lisp.h (free_save_value): New prototype.
2624 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2625 Add comment.
2626 (save_excursion_restore): Adjust to match saved data structure.
2627 Use free_save_value to offload some work from GC. Drop obsolete
2628 #if 0 code.
2629
2630 2012-12-03 Chong Yidong <cyd@gnu.org>
2631
2632 * fileio.c (Vauto_save_list_file_name): Doc fix.
2633
2634 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
2635
2636 * w32fns.c: Remove prototype of atof.
2637 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
2638 builds.
2639 (file_dialog_callback): Make it UINT_PTR.
2640
2641 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2642 with 64-bit builds.
2643
2644 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2645 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2646 defined.
2647
2648 2012-12-03 Glenn Morris <rgm@gnu.org>
2649
2650 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
2651
2652 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2653
2654 Fix xpalloc confusion after memory is exhausted.
2655 * alloc.c (xpalloc): Comment fix.
2656 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2657 and signals an error, do not clear charset_table_size, as
2658 charset_table is still valid.
2659 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2660
2661 Use execve to avoid need to munge environ (Bug#13054).
2662 * callproc.c (Fcall_process):
2663 * process.c (create_process):
2664 Don't save and restore environ; no longer needed.
2665 * callproc.c (child_setup):
2666 Use execve, not execvp, to preserve environ.
2667
2668 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2669
2670 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2671
2672 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2673
2674 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2675 display for sliced images (Bug#10500).
2676
2677 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2678
2679 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
2680
2681 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2682 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2683
2684 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2685
2686 * xdisp.c (window_outdated): Remove eassert since it hits
2687 some suspicious corner cases (see Bug#13007 and Bug#13012).
2688 (mode_line_update_needed): New function.
2689 (redisplay_internal, redisplay_window): Use it.
2690 (ensure_selected_frame): New function.
2691 (redisplay_internal, unwind_redisplay): Use it.
2692 (redisplay_internal): Move comment about buffer_shared...
2693 (buffer_shared_and_changed): ...near to its real use.
2694
2695 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2696
2697 * callproc.c (Fcall_process): Don't misreport vfork failure.
2698
2699 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2700
2701 * callproc.c (Fcall_process): Fix vfork portability problems.
2702 Do not assume that fd[0], count, filefd, and save_environ survive
2703 vfork. Fix bug whereby wrong errno value could be reported for
2704 pipe failure. Some minor cleanups, too, as follows. Move buf and
2705 bufsize to the context where they're needed. Change new_argv to
2706 be of type char **, as this is more convenient and avoids casts.
2707 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2708 Now local constants, not macros.
2709
2710 2012-11-18 Kenichi Handa <handa@gnu.org>
2711
2712 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2713 for the variable "f".
2714
2715 2012-11-13 Kenichi Handa <handa@gnu.org>
2716
2717 * font.c (font_unparse_xlfd): Exclude special characters from the
2718 generating XLFD name.
2719
2720 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2721
2722 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2723 * dired.c (stat_uname, stat_gname):
2724 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2725
2726 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2727 * dired.c (directory_files_internal, file_name_completion):
2728 Assume EAGAIN and EINTR are defined.
2729
2730 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2731 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2732 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2733 * lread.c (readbyte_from_file): Assume EINTR is defined.
2734 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2735 Assume EIO and EAGAIN are defined.
2736 * unexcoff.c (write_segment): Assume EFAULT is defined.
2737
2738 2012-11-27 Eli Zaretskii <eliz@gnu.org>
2739
2740 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2741 (Bug#11964)
2742
2743 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2744 highlighting on the frame was cleared. Prevents assertion
2745 violations when repeatedly clicking on the "Top" link of the
2746 "bread-crumbs" in Info buffers.
2747
2748 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2749
2750 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2751
2752 2012-11-24 Ken Brown <kbrown@cornell.edu>
2753
2754 * keyboard.c (HAVE_MOUSE):
2755 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2756 were always defined.
2757
2758 2012-11-24 Eli Zaretskii <eliz@gnu.org>
2759
2760 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2761 between bpos_covered and bpos_max. This fixes cursor display when
2762 several display strings follow each other.
2763
2764 * .gdbinit (pgx): If the glyph's object is a string, display the
2765 pointer to string data, rather than the value of the string object
2766 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2767
2768 * indent.c (Fvertical_motion): If the starting position is covered
2769 by a display string, return to one position before that, to avoid
2770 overshooting it inside move_it_to. (Bug#12930)
2771
2772 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2773
2774 * frame.h (struct frame): Remove display_preempted member
2775 since all users are dead long ago.
2776 * nsterm.h (struct x_output): Use the only dummy member.
2777 * w32menu.c (pending_menu_activation): Remove since not
2778 really used.
2779 (set_frame_menubar): Adjust user.
2780 * w32term.h (struct x_output): Drop outdated #if 0 code.
2781 (struct w32_output): Use bitfields for explicit_parent,
2782 asked_for_visible and menubar_active members.
2783 Drop unused pending_menu_activation member.
2784 * xterm.h (struct x_output): Drop outdated #if 0 code.
2785 Use bitfields for explicit_parent, asked_for_visible,
2786 has_been_visible and net_wm_state_hidden_seen members.
2787
2788 2012-11-23 Eli Zaretskii <eliz@gnu.org>
2789
2790 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2791 of a literal "/". (Bug#12955)
2792 (gl-stamp): Invoke fc.exe directly, not through cmd.
2793
2794 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2795
2796 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2797 * dired.c: Assume HAVE_DIRENT_H.
2798 (NAMLEN): Remove, replacing with ...
2799 (dirent_namelen): New function. All uses changed. Use the GNU macro
2800 _D_EXACT_NAMELEN if available, as it's faster than strlen.
2801 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2802 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
2803 * makefile.w32-in (DIR_H): Remove. All uses replaced with
2804 $(NT_INC)/dirent.h.
2805 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2806 * ndir.h: Rename to ../nt/inc/dirent.h.
2807 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2808 Do not include <dirent.h>; no longer needed.
2809 * w32.c: Include <dirent.h> rather than "ndir.h".
2810
2811 2012-11-23 Chong Yidong <cyd@gnu.org>
2812
2813 * xftfont.c (xftfont_open): Remove duplicate assignment.
2814
2815 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2816
2817 * alloc.c (Fgarbage_collect): Unblock input after clearing
2818 gc_in_progress to avoid note_mouse_highlight glitch with GC.
2819 * frame.h (FRAME_MOUSE_UPDATE): New macro.
2820 * msdos.c (IT_frame_up_to_date): Use it here...
2821 * w32term.c (w32_frame_up_to_date): ...here...
2822 * xterm.c (XTframe_up_to_date): ...and here...
2823 * nsterm.m (ns_frame_up_to_date): ...but not here.
2824 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2825 Adjust users.
2826 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2827 Do not check whether GC is in progress.
2828
2829 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
2830
2831 * xdisp.c (window_buffer_changed): New function.
2832 (update_menu_bar, update_tool_bar): Use it to
2833 simplify large 'if' statements.
2834 (redisplay_internal): Generalize commonly used
2835 'tail' and 'frame' local variables.
2836
2837 2012-11-22 Eli Zaretskii <eliz@gnu.org>
2838
2839 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2840 with Windows system header.
2841
2842 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
2843
2844 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2845 * alloc.c: Assume unistd.h exists.
2846 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2847 * sysdep.c (get_current_dir_name): Assume getcwd exists.
2848 (getwd) [USG]: Remove; no longer needed.
2849 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2850 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2851 * w32.h (getcwd): Remove decl.
2852
2853 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
2854
2855 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2856 Make it set selected_window as well.
2857 (update_tool_bar): Use it.
2858
2859 2012-11-21 Ken Brown <kbrown@cornell.edu>
2860
2861 * emacs.c (main): Set the G_SLICE environment variable for all
2862 Cygwin builds, not just GTK builds. See
2863 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2864
2865 2012-11-21 Eli Zaretskii <eliz@gnu.org>
2866
2867 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2868 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2869 Define for the MSVC compiler.
2870
2871 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
2872
2873 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2874 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2875 dostounix_filename. Prevents crashes down the road, because
2876 dostounix_filename assumes it gets a unibyte string.
2877 Reported by Michel de Ruiter <michel@sentient.nl>, see
2878 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2879
2880 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2881
2882 Conflate Qnil and Qunbound for `symbol-function'.
2883 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2884 * lread.c (init_obarray): Set `function' fields to Qnil.
2885 * eval.c (Fcommandp): Ignore Qunbound.
2886 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2887 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2888 Test NILP rather than Qunbound.
2889 (Ffmakunbound): Set to Qnil.
2890 (Fsymbol_function): Never signal an error.
2891 (Finteractive_form): Ignore Qunbound.
2892
2893 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
2894
2895 * eval.c (interactive_p): Remove no-longer-used decl.
2896
2897 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
2898
2899 * xdisp.c (buffer_shared): Adjust comment.
2900 (buffer_shared_and_changed): New function.
2901 (prepare_menu_bars, redisplay_internal): Use it to
2902 decide whether all windows or frames should be updated.
2903 (window_outdated): New function.
2904 (text_outside_line_unchanged_p, redisplay_window): Use it.
2905 (redisplay_internal): Likewise. Fix indentation.
2906
2907 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2908
2909 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2910 (syms_of_eval): Remove corresponding defsubr.
2911 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2912
2913 2012-11-19 Daniel Colascione <dancol@dancol.org>
2914
2915 * w32fns.c (Fx_file_dialog):
2916 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2917 cygwin_convert_file_name*.
2918
2919 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2920 Rename cygwin_convert_path* to cygwin_convert_file_name*.
2921
2922 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2923
2924 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2925
2926 2012-11-18 Eli Zaretskii <eliz@gnu.org>
2927
2928 * w32select.c: Include w32common.h before w32term.h, so that
2929 windows.h gets included before w32term.h uses some of its
2930 features, see below.
2931
2932 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2933 New typedefs.
2934 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
2935 New prototypes.
2936 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
2937
2938 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
2939
2940 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
2941 (ns_select): Return at once if events are held (Bug#12834).
2942
2943 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
2944
2945 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
2946 Needed following 2012-10-20 change. (Bug#12902)
2947
2948 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
2949
2950 * w32proc.c (waitpid): Remove unused label get_result.
2951
2952 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
2953
2954 * makefile.w32-in (SYSWAIT_H): New macro.
2955 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
2956 ($(BLD)/sysdep.$(O)): Update dependencies.
2957
2958 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
2959
2960 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
2961 * callproc.c (relocate_fd): Assume F_DUPFD.
2962 * emacs.c, term.c (O_RDWR): Remove.
2963 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
2964 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
2965 * nsterm.m: Assume <fcntl.h> exists.
2966 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
2967 (create_pty, Fmake_network_process, server_accept_connection)
2968 (wait_reading_process_output, init_process_emacs):
2969 Assume O_NONBLOCK.
2970 (wait_reading_process_output): Put in a special case for WINDOWSNT
2971 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
2972 It's not clear this is needed, but it's a more-conservative change.
2973 (create_process): Assume FD_CLOEXEC.
2974 (create_process, create_pty): Assume O_NOCTTY.
2975 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
2976 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
2977 Omit if not DOS_NT, since F_GETFL is not defined there.
2978 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
2979 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
2980 (O_NOCTTY): Remove.
2981 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
2982 lack it, since gnulib guarantees this.
2983 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
2984
2985 2012-11-17 Eli Zaretskii <eliz@gnu.org>
2986
2987 * w32.c (faccessat): Pretend that directories have the execute bit
2988 set. Emacs expects that, e.g., in files.el:cd-absolute.
2989
2990 * w32proc.c (create_child): Don't clip the PID of the child
2991 process to fit into an Emacs integer, as this is no longer a
2992 restriction.
2993 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
2994 reaping only the process specified by PID argument, if that is
2995 positive. Use PID instead of dead_child to know which process to
2996 reap. Wait for the child to die only if WNOHANG is not in
2997 OPTIONS.
2998 (sys_select): Don't set dead_child.
2999
3000 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3001 as it is no longer needed.
3002
3003 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3004 no longer needed.
3005 (record_child_status_change): Remove the setting of
3006 record_at_most_one_child for the !WNOHANG case.
3007
3008 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3009
3010 Fix problems in ns port found by static checking.
3011 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3012 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3013 not to process group.
3014 (ns_select): Use emacs_write, not write, as that's more robust
3015 in the presence of signals.
3016 (fd_handler:): Check for read errors.
3017
3018 2012-11-16 Glenn Morris <rgm@gnu.org>
3019
3020 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3021
3022 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
3023
3024 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3025
3026 2012-11-16 Eli Zaretskii <eliz@gnu.org>
3027
3028 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3029 use the same value of thread handle.
3030 (start_timer_thread): If the timer thread exited (due to error),
3031 clean up by closing the two handles it used. Duplicate the caller
3032 thread's handle here, so it gets duplicated only once, when
3033 launching the timer thread. Set priority of the timer thread, not
3034 the caller thread.
3035 (getitimer): Don't duplicate the caller thread's handle here.
3036 (Bug#12832)
3037
3038 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
3039
3040 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3041 called (Bug#12834).
3042
3043 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3044
3045 Remove no-longer-used pty_max_bytes variable.
3046 * process.c (pty_max_bytes): Remove; unused.
3047 (send_process): Do not set it.
3048
3049 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
3050
3051 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3052 Update dependencies.
3053
3054 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3055
3056 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3057 This follows up on the 2012-09-29 patch that removed indirection
3058 for the 'function' field. Reported by Sergey Vinokurov in
3059 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3060
3061 2012-11-14 Eli Zaretskii <eliz@gnu.org>
3062
3063 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3064 different name, as the MS runtime does not have such a function,
3065 and probably never will.) All callers changed. Ignore DIRFD
3066 value if PATH is an absolute file name, to match Posix spec
3067 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3068 symlinks.
3069
3070 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3071
3072 * xdisp.c (echo_area_display, redisplay_internal):
3073 Omit redundant check whether frame_garbaged is set.
3074
3075 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3076
3077 Use faccessat, not access, when checking file permissions (Bug#12632).
3078 This fixes a bug that has been present in Emacs since its creation.
3079 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3080 which must set some sort of record. (Torek's bug report was against
3081 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3082 same common flaw.) See Torek's Usenet posting
3083 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3084 Posted: Fri Apr 8 14:18:56 1983.
3085 * Makefile.in (LIB_EACCESS): New macro.
3086 (LIBES): Use it.
3087 * callproc.c (init_callproc):
3088 * charset.c (init_charset):
3089 * fileio.c (check_existing, check_executable, check_writable)
3090 (Ffile_readable_p):
3091 * lread.c (openp, load_path_check):
3092 * process.c (allocate_pty):
3093 * xrdb.c (file_p):
3094 Use effective UID when checking permissions, not real UID.
3095 * callproc.c (init_callproc):
3096 * charset.c (init_charset):
3097 * lread.c (load_path_check, init_lread):
3098 Test whether directories are accessible, not merely whether they exist.
3099 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3100 * fileio.c (check_existing, check_executable, check_writable)
3101 (Ffile_readable_p):
3102 Use symbolic names instead of integers for the flags, as they're
3103 portable now.
3104 (check_writable): New arg AMODE. All uses changed.
3105 Set errno on failure.
3106 (Ffile_readable_p): Use faccessat, not stat + open + close.
3107 (Ffile_writable_p): No need to call check_existing + check_writable.
3108 Just call check_writable and then look at errno. This saves a syscall.
3109 dir should never be nil; replace an unnecessary runtime check
3110 with an eassert. When checking the parent directory of a nonexistent
3111 file, check that the directory is searchable as well as writable, as
3112 we can't create files in unsearchable directories.
3113 (file_directory_p): New function, which uses 'stat' on most platforms
3114 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3115 (Ffile_directory_p, Fset_file_times): Use it.
3116 (file_accessible_directory_p): New function, which uses a single
3117 syscall for efficiency.
3118 (Ffile_accessible_directory_p): Use it.
3119 * xrdb.c (file_p): Use file_directory_p.
3120 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3121 * lread.c (openp): When opening a file, use fstat rather than
3122 stat, as that avoids a permissions race. When not opening a file,
3123 use file_directory_p rather than stat.
3124 (dir_warning): First arg is now a usage string, not a format.
3125 Use errno. All uses changed.
3126 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3127 that merely introduced a race.
3128 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3129 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3130 and similarly for the other O_* flags.
3131 * w32.c (sys_faccessat): Rename from sys_access and switch to
3132 faccessat's API. All uses changed.
3133 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3134 (magic_db): Rename from magic_file_p.
3135 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3136 char *, so that we don't have to test for file existence
3137 separately from opening the file for reading. This removes a race
3138 fixes a permission-checking problem, and simplifies the code.
3139 All uses changed.
3140 (file_p): Remove; no longer needed.
3141
3142 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3143
3144 Omit glyphs initialization at startup.
3145 * dispnew.c (glyphs_initialized_initially_p): Remove.
3146 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3147 (Fredraw_frame): Move actual code from here...
3148 (redraw_frame): ...to here. Add eassert. Adjust comment.
3149 (Fredraw_display): Use redraw_frame.
3150 * xdisp.c (clear_garbaged_frames): Likewise.
3151
3152 2012-11-13 Eli Zaretskii <eliz@gnu.org>
3153
3154 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3155 passed to pint2str and pint2hrstr to be at most the size of the
3156 frame's decode_mode_spec_buffer. This avoids crashes with very
3157 large values of FIELD_WIDTH argument to decode_mode_spec.
3158 (Bug#12867)
3159
3160 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3161
3162 Fix a race with verify-visited-file-modtime (Bug#12863).
3163 Since at least 1991 Emacs has ignored an mtime difference of no
3164 more than one second, but my guess is that this was to work around
3165 file system bugs that were fixed long ago. Since the race is
3166 causing problems now, let's remove that code.
3167 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3168 whose time stamp is off by no more than a second. Insist that the
3169 file time stamps match exactly.
3170
3171 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3172
3173 * frame.h (struct frame): Convert external_tool_bar member to
3174 1-bit unsigned bitfield.
3175 * termhooks.h (struct terminal): Remove mouse_moved member since
3176 all users are long dead. Adjust comment on mouse_position_hook.
3177
3178 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3179
3180 Simplify by using FOR_EACH_FRAME here and there.
3181 * frame.c (next_frame, prev_frame, other_visible_frames)
3182 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3183 * w32term.c (x_window_to_scroll_bar): Likewise.
3184 * window.c (window_list): Likewise.
3185 * xdisp.c (x_consider_frame_title): Likewise.
3186 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3187 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3188 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3189 * xmenu.c (menubar_id_to_frame): Likewise.
3190 * xselect.c (frame_for_x_selection): Likewise.
3191 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3192 (x_window_to_menu_bar): Likewise.
3193 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3194
3195 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3196
3197 * data.c (Qdefalias_fset_function): Now static.
3198
3199 Another tweak to vectorlike_header change.
3200 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3201 Remove, and replace all uses with ...
3202 (next_in_free_list, set_next_in_free_list):
3203 New functions, which respect C's aliasing rules better.
3204
3205 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3206
3207 * window.c (list4i): Rename from 'quad'. All uses changed.
3208 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3209
3210 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
3211
3212 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3213 warning about mixing declarations and code in ISO C90.
3214
3215 2012-11-10 Martin Rudalics <rudalics@gmx.at>
3216
3217 * window.c (Fsplit_window_internal): Set combination limit of
3218 new parent window to t iff Vwindow_combination_limit is t;
3219 fixing a regression introduced with the change from 2012-09-22.
3220 (Fset_window_combination_limit): Fix doc-string.
3221
3222 2012-11-10 Eli Zaretskii <eliz@gnu.org>
3223
3224 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3225 amount when the scroll margins are too large. When scrolling
3226 backwards in the buffer, give up if cannot reach point or the
3227 scroll margin within a reasonable number of screen lines.
3228 Fixes point position in window under scroll-up/down-aggressively when
3229 point is positioned many lines beyond the window top/bottom.
3230 (Bug#12811)
3231
3232 * ralloc.c (relinquish): If real_morecore fails to return memory
3233 to the system, don't crash; instead, leave the last heap
3234 unchanged and return. (Bug#12774)
3235
3236 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3237
3238 * lisp.h (AUTOLOADP): New macro.
3239 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3240 * data.c (Ffset): Remove special ad-advice-info handling.
3241 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3242 (Fsubr_arity): CSE.
3243 (Finteractive_form): Simplify.
3244 (Fquo): Don't insist on having at least 2 arguments.
3245 (Qdefalias_fset_function): New var.
3246
3247 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3248
3249 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3250
3251 * nsfont.m (Qcondensed, Qexpanded): New variables.
3252 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3253 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3254
3255 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3256
3257 Fix recently introduced crash on MS-Windows (Bug#12839).
3258 * w32term.h (struct scroll_bar): Use convenient header.
3259 (SCROLL_BAR_VEC_SIZE): Remove.
3260 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3261
3262 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3263
3264 Tweak last vectorlike_header change.
3265 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3266 vectorlike object on the free list. This is introduced to avoid
3267 some (but not all) pointer casting and aliasing problems, see
3268 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3269 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3270 objects.
3271 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3272
3273 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3274
3275 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
3276 been removed, so remove them here also.
3277
3278 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3279
3280 * doc.c (Fdocumentation): Handle new property
3281 dynamic-docstring-function to replace the old ad-advice-info.
3282
3283 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3284
3285 * fns.c (Qeql, hashtest_eq): Now static.
3286
3287 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3288
3289 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3290 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3291 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3292 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3293
3294 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3295
3296 Use same hash function for hashfn_profiler as for hash_string etc.
3297 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3298 * lisp.h (sxhash_combine): New inline function, with the contents
3299 of the old SXHASH_COMBINE.
3300 * profiler.c (hashfn_profiler): Use it, instead of having a
3301 special hash function containing a comparison that always yields 1.
3302
3303 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3304
3305 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3306 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3307 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3308 Remove unused vars.
3309
3310 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3311
3312 * image.c (xpm_make_color_table_h): Fix compiler error because
3313 make_hash_table changed.
3314
3315 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
3316
3317 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3318
3319 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3320
3321 Use ad-hoc comparison function for the profiler's hash-tables.
3322 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3323 (make_log): Use them.
3324 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3325 call Fequal any more.
3326 (Ffunction_equal): New function.
3327 (cmpfn_profiler, hashfn_profiler): New functions.
3328 (syms_of_profiler): Initialize them.
3329 * lisp.h (struct hash_table_test): New struct.
3330 (struct Lisp_Hash_Table): Use it.
3331 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3332 * fns.c (make_hash_table): Take a struct to describe the test.
3333 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3334 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3335 (hash_lookup, hash_remove_from_table): Move assertion checking of
3336 hashfn result here. Check hash-equality before calling cmpfn.
3337 (Fmake_hash_table): Adjust call to make_hash_table.
3338 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3339 (syms_of_fns): Initialize them.
3340 * emacs.c (main): Move syms_of_fns earlier.
3341 * xterm.c (syms_of_xterm):
3342 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3343 * print.c (print_object): Adjust to new hash-table struct.
3344 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3345
3346 2012-11-08 Eli Zaretskii <eliz@gnu.org>
3347
3348 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3349 value of w32-scroll-lock-modifier is neither nil nor one of the
3350 known key modifiers. (Bug#12806)
3351
3352 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3353
3354 Shrink struct vectorlike_header to the only size field.
3355 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3356 Adjust comment.
3357 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3358 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3359 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3360 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3361 information from the vector header. Adjust comment.
3362 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3363 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3364 layout.
3365 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3366 (struct vectorlike_header): Remove next member. Adjust comment.
3367 (struct Lisp_Subr): Add convenient header. Adjust comment.
3368 (allocate_pseudovector): Adjust prototype.
3369 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3370 (sweep_string, lisp_malloc): Remove useless prototypes.
3371 (enum mem_type): Adjust comment.
3372 (NEXT_IN_FREE_LIST): New macro.
3373 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3374 (Fmake_bool_vector): Likewise.
3375 (struct large_vector): New type to represent allocation unit for
3376 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3377 (large_vectors): Change type to struct large_vector.
3378 (allocate_vector_from_block): Simplify.
3379 (PSEUDOVECTOR_NBYTES): Replace with...
3380 (vector_nbytes): ...new function. Adjust users.
3381 (sweep_vectors): Adjust processing of large vectors.
3382 (allocate_vectorlike): Likewise.
3383 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3384 Add easserts. Adjust XSETPVECTYPESIZE usage.
3385 (allocate_buffer): Use BUFFER_PVEC_INIT.
3386 (live_vector_p): Adjust to match large vector.
3387 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3388 * buffer.h (struct buffer): Add next member.
3389 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3390 New macros.
3391 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3392 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3393 (copy_hash_table): Adjust to match vector header change.
3394 * lread.c (defsubr): Use XSETPVECTYPE.
3395 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3396 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3397 (xvecsize): New command.
3398
3399 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3400
3401 * keyboard.c (event_to_kboard): Do not dereference
3402 frame_or_window field of SELECTION_REQUEST_EVENT
3403 and SELECTION_CLEAR_EVENT events (Bug#12814).
3404 * xterm.h (struct selection_input_event): Adjust comment.
3405
3406 2012-11-07 Eli Zaretskii <eliz@gnu.org>
3407
3408 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3409 such as Scroll Lock, if the respective keys are treated as
3410 function keys, not as modifiers. This avoids destroying non-ASCII
3411 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
3412
3413 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3414
3415 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3416
3417 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3418
3419 Restore some duplicate definitions (Bug#12814).
3420 This undoes part of the 2012-11-03 changes. Some people build
3421 with plain -g rather than with -g3, and they need the duplicate
3422 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3423 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3424 Define as macros, as well as as enums or as constants.
3425
3426 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3427
3428 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3429 to keypad keys (Bug#12816).
3430
3431 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3432
3433 Minor adjustments of recently-changed frame functions.
3434 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3435 known to be a frame (we're in the FRAMEP branch).
3436 * lisp.h (Qframep): Remove decl. frame.h declares this.
3437 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3438 since they're meant for Lisp fixnum values.
3439
3440 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3441
3442 * window.c (Fwindow_combination_limit): Revert to the only
3443 required argument and adjust docstring as suggested in
3444 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3445 by Martin Rudalics <rudalics@gmx.at>.
3446
3447 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3448
3449 Widely used frame validity and checking functions.
3450 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3451 * frame.c (decode_live_frame, decode_any_frame): New functions.
3452 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3453 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3454 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3455 (Fframe_pointer_visible_p): Use decode_any_frame.
3456 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3457 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3458 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3459 (Fframe_focus): Likewise. Allow zero number of arguments.
3460 Adjust docstring.
3461 (frame_buffer_list, frame_buffer_predicate): Remove.
3462 * lisp.h (frame_buffer_predicate): Remove prototype.
3463 * buffer.c (Fother_buffer): Use decode_any_frame.
3464 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3465 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3466 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3467 (Fclose_font, Ffont_info): Use decode_live_frame.
3468 * fontset.c (check_fontset_name): Likewise.
3469 * terminal.c (Fframe_terminal): Likewise.
3470 * w32fns.c (check_x_frame): Likewise.
3471 * window.c (Fminibuffer_window, Fwindow_at)
3472 (Fcurrent_window_configuration): Likewise.
3473 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3474 Likewise. Allow zero number of arguments. Adjust docstring.
3475 * dispnew.c (Fredraw_frame): Likewise.
3476 * xfaces.c (frame_or_selected_frame): Remove.
3477 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3478 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3479 (Fframe_face_alist): Use decode_live_frame.
3480 * xfns.c (check_x_frame): Likewise.
3481
3482 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3483
3484 * window.c (quad): New function.
3485 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3486 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3487 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3488 (Fwindow_line_height): Use it.
3489 (Fwindow_fringes): Use list3.
3490 (Fwindow_scroll_bars): Use list4.
3491 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3492 (Fwindow_combination_limit): Allow zero number of arguments.
3493
3494 2012-11-05 Eli Zaretskii <eliz@gnu.org>
3495
3496 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3497
3498 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
3499 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
3500 file descriptor 2 for standard error. (Bug#12805)
3501
3502 2012-11-05 Chong Yidong <cyd@gnu.org>
3503
3504 * process.c (wait_reading_process_output): Revert previous change.
3505
3506 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3507
3508 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3509 This removes code that has been obsolete since around 1990.
3510 * callproc.c (Fcall_process):
3511 * emacs.c (main):
3512 * process.c (create_process):
3513 * term.c (dissociate_if_controlling_tty):
3514 Assume setsid exists.
3515 * callproc.c (child_setup): Assume setpgid exists and behaves as
3516 per POSIX.1-1988 or later.
3517 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3518 * emacs.c (shut_down_emacs):
3519 * sysdep.c (sys_suspend, init_foreground_group):
3520 Assume getpgrp behaves as per POSIX.1-1998 or later.
3521 * msdos.c (setpgrp): Remove.
3522 (tcgetpgrp, setpgid, setsid): New functions.
3523 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3524 * term.c (no_controlling_tty): Remove; unused.
3525 * w32proc.c (setpgrp): Remove.
3526 (setsid, tcgetpgrp): New functions.
3527
3528 Simplify by assuming __fpending.
3529 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3530 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3531 Do not assume that __fpending's result fits in int.
3532
3533 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3534
3535 Remove EMACS_OUTQSIZE+sleep hack.
3536 * dispnew.c (update_frame_1): Remove hack for terminals slower
3537 than 2400 bps, which throttled Emacs by having it sleep.
3538 This code hasn't worked since at least 2007, when the multi-tty stuff
3539 was added, and anyway those old terminals are long dead.
3540 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3541 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3542
3543 Fix data-loss with --version (Bug#9574).
3544 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3545 as we can't assume that emacs_strerror is initialized, and strerror
3546 is good enough here.
3547 (main): Invoke atexit earlier, to catch earlier instances of
3548 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3549
3550 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3551
3552 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3553 (keyDown): Remap keypad keys to X11 virtual key codes.
3554
3555 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3556
3557 Fix data-loss with --batch (Bug#9574).
3558 * emacs.c: Include <close-stream.h>.
3559 (close_output_streams): New function.
3560 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3561 and handles errors appropriately.
3562 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3563 does that now.
3564
3565 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3566 The symptom is a diagnostic "GLib-WARNING **: In call to
3567 g_spawn_sync(), exit status of a child process was requested but
3568 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3569 waitpid(), so exit status can't be returned." The diagnostic
3570 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3571 The real bug is a race condition between Emacs and glib: Emacs
3572 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3573 so that glib can't find it. Work around the bug by invoking
3574 waitpid only on subprocesses that Emacs itself creates.
3575 * process.c (create_process, record_child_status_change):
3576 Don't use special value -1 in pid field, as the caller now must
3577 know the pid rather than having the callee infer it.
3578 The inference was sometimes incorrect anyway, due to another race.
3579 (create_process): Set new 'alive' member if child is created.
3580 (process_status_retrieved): New function.
3581 (record_child_status_change): Use it.
3582 Accept negative 1st argument, which means to wait for the
3583 processes that Emacs already knows about. Move special-case code
3584 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3585 processes that have already been waited for, by testing and
3586 clearing new 'alive' member.
3587 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3588 now does this internally.
3589 (handle_child_signal): Let record_child_status_change do all
3590 the work, since we do not want to reap all exited child processes,
3591 only the child processes that Emacs itself created.
3592 * process.h (Lisp_Process): New boolean member 'alive'.
3593
3594 Omit duplicate definitions no longer needed with gcc -g3.
3595 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3596 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3597 Define only as macros. There's no longer any need to also define
3598 these symbols as enums or as constants, since we now assume
3599 gcc -g3 when debugging.
3600
3601 2012-11-03 Eli Zaretskii <eliz@gnu.org>
3602
3603 * lisp.mk: Adjust comments to the fact that term/internal is now
3604 loaded from loadup.el.
3605
3606 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3607 (msdos_fatal_signal): New function.
3608 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3609 its argument list.
3610
3611 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3612 for GCC versions before 4.
3613 (emacs_raise): Define to call msdos_fatal_signal.
3614
3615 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3616 iterator when starting in the middle of a display or overlay
3617 string. (Bug#12745)
3618
3619 2012-11-03 Chong Yidong <cyd@gnu.org>
3620
3621 * process.c (wait_reading_process_output): Clean up the last
3622 change.
3623
3624 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3625
3626 * process.c (wait_reading_process_output): Avoid a race condition
3627 with SIGIO delivery (Bug#11536).
3628
3629 2012-11-03 Chong Yidong <cyd@gnu.org>
3630
3631 * buffer.c (cursor_type): Untabify docstring.
3632
3633 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3634
3635 * frame.h (struct frame): Drop can_have_scroll_bars member
3636 which is meaningless for a long time. Adjust comments.
3637 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3638 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3639
3640 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3641
3642 * window.c (decode_next_window_args): Update window arg after
3643 calling decode_live_window and so fix crash reported at
3644 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3645 by Juanma Barranquero <lekktu@gmail.com>.
3646 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3647 * font.c (Ffont_at): Likewise.
3648
3649 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3650
3651 * widget.c (resize_cb): New function.
3652 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3653 (EmacsFrameResize): Check if all is up to date before changing frame
3654 size.
3655
3656 2012-11-02 Eli Zaretskii <eliz@gnu.org>
3657
3658 Implement backtrace output for fatal errors on MS-Windows.
3659 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3660 (BACKTRACE_LIMIT_MAX): New macro.
3661 (w32_backtrace): New function.
3662 (emacs_abort): Use w32_backtrace when the user chooses not to
3663 attach a debugger. Update the text of the abort dialog.
3664
3665 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3666
3667 Window-related stuff cleanup here and there.
3668 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3669 Use decode_any_window.
3670 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3671 * xdisp.c (Fformat_mode_line): Likewise.
3672 * font.c (Ffont_at): Use decode_live_window.
3673 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3674 * window.c (decode_next_window_args): Likewise.
3675 (decode_any_window): Remove static.
3676 * window.h (decode_any_window): Add prototype.
3677 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3678 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3679 respectively.
3680
3681 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3682
3683 Remove pad from struct input_event.
3684 * termhooks.h (struct input_event): Remove padding field.
3685 Adjust comment.
3686 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3687 member is never cons for a long time. Adjust comment.
3688 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3689 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3690 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3691 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3692
3693 2012-11-01 Eli Zaretskii <eliz@gnu.org>
3694
3695 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3696
3697 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3698
3699 Fix crash when using Emacs as commit editor for git (Bug#12697).
3700 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3701 and it is configured in conf_post.h.
3702 (Fcall_process): Don't invoke both setsid and setpgid; the former
3703 is enough, if it exists.
3704 * callproc.c (Fcall_process, child_setup):
3705 * process.c (create_process): Use setpgid.
3706 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3707 for the real thing.
3708 * dispnew.c (init_display): Initialize the foreground group
3709 if we are running a tty display.
3710 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3711 * lisp.h (init_foreground_group): New decl.
3712 * sysdep.c (inherited_pgroup): New static var.
3713 (init_foreground_group, tcsetpgrp_without_stopping)
3714 (narrow_foreground_group, widen_foreground_group): New functions.
3715 (init_sys_modes): Narrow foreground group.
3716 (reset_sys_modes): Widen foreground group.
3717
3718 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
3719
3720 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3721
3722 2012-10-31 Martin Rudalics <rudalics@gmx.at>
3723
3724 * minibuf.c (read_minibuf): Restore current buffer since
3725 choose_minibuf_frame calling Fset_frame_selected_window may
3726 change it (Bug#12766).
3727
3728 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3729
3730 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3731
3732 2012-10-30 Kenichi Handa <handa@gnu.org>
3733
3734 * font.c (Ffont_at): If WINDOW is specified and it is not
3735 displaying the current buffer, signal an error.
3736
3737 2012-10-29 Daniel Colascione <dancol@dancol.org>
3738
3739 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3740 In preparation for fixing bug#12739, move these functions from
3741 here...
3742
3743 * coding.h, coding.c: ... to here, and compile them only when
3744 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3745 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
3746
3747 2012-10-28 Eli Zaretskii <eliz@gnu.org>
3748
3749 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3750 (timer_loop, getitimer, setitimer): Use it instead of
3751 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3752 'clock'.
3753 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3754 literal 10000.
3755
3756 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3757
3758 * nsterm.m (NO_APPDEFINED_DATA): New define.
3759 (last_appdefined_event_data): New variable
3760 (last_appdefined_event): Remove.
3761 (ns_select): Initialize t from last_appdefined_event_data instead
3762 of [last_appdefined_event data1].
3763 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3764 remove last_appdefined_event (Bug#12698).
3765
3766 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3767
3768 * frame.c (x_set_font): Catch internal error.
3769
3770 2012-10-27 Eli Zaretskii <eliz@gnu.org>
3771
3772 Avoid overflow in w32 implementation of interval timers.
3773 When possible, for ITIMER_PROF count only times the main thread
3774 actually executes.
3775 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
3776 'volatile ULONGLONG' types. All the other data which was
3777 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
3778 (GetThreadTimes_Proc): New typedef.
3779 (w32_get_timer_time): New function, returns a suitable time value
3780 for the timer.
3781 (timer_loop): Enter critical section when accessing ULONGLONG
3782 values of the itimer_data struct, as these accesses are no longer
3783 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3784 Remove unused variable.
3785 (init_timers): Initialize s_pfn_Get_Thread_Times.
3786 (start_timer_thread): Don't assign itimer->caller_thread here.
3787 (getitimer): Assign itimer->caller_thread here.
3788 (setitimer): Always call getitimer to get the value of ticks_now.
3789 (sys_spawnve): Avoid compiler warning about format mismatch.
3790
3791 2012-10-26 Eli Zaretskii <eliz@gnu.org>
3792
3793 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3794 mouse movement events if the menu bar is active. This avoids
3795 producing a busy "hour-glass" cursor by Windows if the mouse
3796 pointer is positioned over a tooltip shown for some menu item.
3797
3798 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
3799
3800 Don't assume process IDs fit in int.
3801 * emacs.c (shut_down_emacs) [!DOS_NT]:
3802 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3803 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3804 Use pid_t, not int, to store process IDs, as 'int'
3805 is not wide enough on a few platforms (e.g., AIX and IRIX).
3806
3807 2012-10-23 Kenichi Handa <handa@gnu.org>
3808
3809 The following change is to make face-font-rescale-alist work
3810 correctly for non-ASCII fonts.
3811
3812 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3813 (font_open_for_lface): Handle Vface_font_rescale_alist.
3814
3815 2012-10-23 Chong Yidong <cyd@gnu.org>
3816
3817 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3818
3819 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
3820
3821 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3822 for screen font.
3823 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3824
3825 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3826 event (Bug#12681).
3827
3828 2012-10-21 Glenn Morris <rgm@gnu.org>
3829
3830 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3831
3832 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
3833
3834 Port to OpenBSD 5.1.
3835 * frame.c (Fmouse_position, Fmouse_pixel_position):
3836 * xdisp.c (produce_stretch_glyph):
3837 Declare local vars only when they're needed.
3838 This is clearer and avoids a warning on OpenBSD about unused vars.
3839 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3840 This is safer, and avoids OpenBSD warnings about unused vars.
3841 * keyboard.c (record_menu_key): Remove unnecessary decl.
3842 (poll_timer): Define only if POLL_FOR_INPUT is defined.
3843 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3844 as our definition clashes with OpenBSD's.
3845 * xfaces.c (load_face_colors, check_lface_attrs)
3846 (get_lface_attributes_no_remap, get_lface_attributes)
3847 (lface_fully_specified_p, x_supports_face_attributes_p)
3848 (tty_supports_face_attributes_p, face_fontset, realize_face)
3849 (realize_x_face, realize_tty_face):
3850 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3851 merely Lisp_Object *. This is more informative and avoids
3852 a warning on OpenBSD about accessing beyond an object's size.
3853
3854 2012-10-20 Chong Yidong <cyd@gnu.org>
3855
3856 * lread.c (Fload): Doc fix (Bug#12592).
3857
3858 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3859
3860 * font.c (Ffont_at): Fix previous change.
3861
3862 2012-10-19 Eli Zaretskii <eliz@gnu.org>
3863
3864 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3865 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
3866 for the reasons.
3867
3868 * alloc.c (NSTATICS): Decrease to 0x800.
3869
3870 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
3871
3872 * fns.c (Fnreverse): Include the problem element when signaling an
3873 error (bug#12677).
3874
3875 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
3876
3877 * nsterm.m (ns_select): Check writefds before call to
3878 FD_ISSET (Bug#12668).
3879
3880 2012-10-18 Daniel Colascione <dancol@dancol.org>
3881
3882 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3883 (staticpro): If we run out of staticpro slots, die with an
3884 informative error instead of just calling emacs_abort.
3885
3886 2012-10-18 Martin Rudalics <rudalics@gmx.at>
3887
3888 Fix two flaws reported by Dmitry Antipov.
3889 * window.c (Ftemp_output_buffer_show): Remove.
3890 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3891 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3892
3893 2012-10-17 Eli Zaretskii <eliz@gnu.org>
3894
3895 * makefile.w32-in ($(BLD)/w32.$(O)):
3896 ($(BLD)/vm-limit.$(O)):
3897 ($(BLD)/term.$(O)):
3898 ($(BLD)/unexw32.$(O)):
3899 ($(BLD)/fileio.$(O)):
3900 ($(BLD)/dispnew.$(O)): Update dependencies.
3901
3902 * w32term.h (w32_initialize_display_info, initialize_w32_display):
3903 Add prototypes.
3904
3905 * w32proc.c: Include ctype.h.
3906
3907 * w32.h (init_environment, check_windows_init_file)
3908 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3909 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3910 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3911 (sys_link): Add prototypes.
3912
3913 * w32.c: Include w32select.h.
3914 (sys_access, e_malloc, sys_select): Add prototypes.
3915 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3916
3917 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3918
3919 * unexw32.c: Include lisp.h and w32.h.
3920
3921 * term.c [WINDOWSNT]: Include w32term.h.
3922
3923 * process.c [WINDOWSNT]: Add prototype of sys_select.
3924
3925 * fileio.c [WINDOWSNT]: Include w32.h.
3926
3927 * dispnew.c [WINDOWSNT]: Include w32.h.
3928
3929 * cygw32.c (Fcygwin_convert_path_to_windows)
3930 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3931 Lisp_Object values. (Bug#12661)
3932
3933 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3934 to Lisp_Object. (Bug#12661)
3935
3936 2012-10-17 Kenichi Handa <handa@gnu.org>
3937
3938 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
3939 invalidate.
3940
3941 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3942
3943 * buffer.c (Fkill_buffer): When unchaining the marker,
3944 reset its buffer pointer to NULL (Bug#12652).
3945
3946 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
3947
3948 Do not verify indirection counters of killed buffers (Bug#12579).
3949 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
3950 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
3951
3952 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3953
3954 * alloc.c (Fmake_byte_code): Fix typo in comment.
3955 * print.c (print_interval): Define as static to match prototype.
3956 * indent.c (disptab_matches_widthtab, recompute_width_table):
3957 Convert to eassert.
3958
3959 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
3960
3961 * editfns.c (get_system_name): Remove.
3962 * lisp.h (get_system_name): Remove prototype.
3963 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
3964 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
3965
3966 2012-10-15 Daniel Colascione <dancol@dancol.org>
3967
3968 * dbusbind.c: Add comment explaining reason for previous change.
3969
3970 2012-10-15 Martin Rudalics <rudalics@gmx.at>
3971
3972 * window.c (Fwindow_end): Rewrite check whether cached position
3973 can be used (Bug#12600).
3974 (resize_frame_windows, grow_mini_window, shrink_mini_window):
3975 Set windows_or_buffers_changed.
3976
3977 2012-10-15 Daniel Colascione <dancol@dancol.org>
3978
3979 * dbusbind.c: Fix cygw32 build break when compiling with dbus
3980 enabled by undefining the symbol "interface", which the platform
3981 headers define to something incompatible.
3982
3983 2012-10-14 Daniel Colascione <dancol@dancol.org>
3984
3985 * image.c (init_tiff_functions, init_imagemagick_functions)
3986 (init_svg_functions): Fix cygw32 build break by using these
3987 functions only when WINDOWSNT _and_ HAVE_NTGUI.
3988
3989 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
3990
3991 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
3992
3993 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
3994
3995 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
3996
3997 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
3998
3999 * coding.c (detect_coding): Set coding->id before calling
4000 this->detector.
4001
4002 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4003
4004 * fileio.c: Formatting fixes.
4005
4006 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4007
4008 Fix some stat-related races.
4009 * fileio.c (Fwrite_region): Avoid race condition if a file is
4010 removed or renamed by some other process immediately after Emacs
4011 writes it but before Emacs stats it. Do not assume that stat (or
4012 fstat) succeeds.
4013 * image.c (slurp_file): Resolve the file name with fopen + fstat
4014 rather than stat + fopen.
4015 (pbm_read_file) [0]: Remove unused code with stat race.
4016 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4017 Remove ineffective code with stat race.
4018
4019 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4020
4021 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4022
4023 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4024
4025 * nsterm.m (hold_event_q): New static variable.
4026 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4027 ! q_event_ptr.
4028 (hold_event): New function.
4029 (ns_read_socket): If hold_event_q have events, store them and
4030 return (Bug#12384).
4031 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4032 is zero (Bug#12384).
4033
4034 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
4035
4036 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4037
4038 2012-10-12 Eli Zaretskii <eliz@gnu.org>
4039
4040 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4041
4042 * fileio.c (check_existing): New function.
4043 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4044 instead of calling 'stat', when what's needed is to check whether
4045 a file exists. This avoids expensive system calls on MS-Windows.
4046 (Bug#12587)
4047
4048 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4049
4050 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4051 determine whether a file exists and is not a directory.
4052
4053 * lisp.h (check_existing): Add prototype.
4054
4055 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4056
4057 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4058
4059 2012-10-12 Glenn Morris <rgm@gnu.org>
4060
4061 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4062
4063 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4064
4065 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4066
4067 * eval.c (Fautoload): Remember previous autoload status in load-history.
4068
4069 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4070
4071 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4072 * lread.c (load_each_byte, new_backquote_flag, readchar)
4073 (read_filtered_event, lisp_file_lexically_bound_p)
4074 (safe_to_load_version, Fload, complete_filename_p, openp)
4075 (build_load_history, readevalloop, read_escape, read1)
4076 (string_to_number, read_vector, read_list):
4077 * macros.c (Fstart_kbd_macro):
4078 * marker.c (CONSIDER):
4079 * menu.c (parse_single_submenu, digest_single_submenu)
4080 (find_and_return_menu_selection, Fx_popup_menu):
4081 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4082 (Ftry_completion):
4083 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4084 (ns_menu_show):
4085 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4086 (xmenu_show, xdialog_show):
4087 Use bool for booleans.
4088 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4089 as it's not a predicate. All uses changed. Omit unnecessary
4090 buffer termination.
4091
4092 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4093
4094 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4095 (save_excursion_restore): Do not restore mark if it was not saved.
4096
4097 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4098
4099 * marker.c (cached_modiff): EMACS_INT, not int.
4100
4101 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4102 instead of having a wrong decl.
4103 * nsmenu.m (waiting_for_input): Remove wrong decl.
4104
4105 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4106
4107 keyboard.c, keymap.c: Use bool for booleans.
4108 * dispnew.c (sit_for): Distinguish between 3-way display_option
4109 and boolean do_display.
4110 * keyboard.c (single_kboard, this_command_key_count_reset)
4111 (waiting_for_input, echoing, immediate_quit, input_pending)
4112 (interrupt_input, interrupts_deferred, pop_kboard)
4113 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4114 (command_loop_1, adjust_point_for_property)
4115 (safe_run_hooks_error, input_polling_used, read_char):
4116 (help_char_p, readable_events, kbd_buffer_events_waiting)
4117 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4118 (lucid_event_type_list_p, get_input_pending):
4119 (gobble_input, menu_separator_name_p, menu_bar_item)
4120 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4121 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4122 (keyremap_step, test_undefined, read_key_sequence)
4123 (detect_input_pending, detect_input_pending_ignore_squeezables)
4124 (detect_input_pending_run_timers, requeued_events_pending_p)
4125 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4126 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4127 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4128 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4129 (accessible_keymaps_1, Fkey_description, push_key_description):
4130 (shadow_lookup, struct where_is_internal_data)
4131 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4132 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4133 (describe_map, describe_vector):
4134 * menu.c (single_menu_item):
4135 * nsmenu.m (ns_update_menubar):
4136 * process.c (wait_reading_process_output):
4137 * search.c (scan_buffer, scan_newline):
4138 Use bool for boolean.
4139 * keyboard.c (timers_run, swallow_events)
4140 (detect_input_pending_run_timers):
4141 * process.c (wait_reading_process_output):
4142 Use unsigned for counter where wraparound-on-overflow is desired,
4143 since unsigned is guaranteed to have that behavior and signed is not.
4144 (read_char): Use ptrdiff_t for string length.
4145 (get_input_pending): Remove first argument, since it was always
4146 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4147 and behave as if it had that value. Return new value of
4148 input_pending. All callers changed.
4149 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4150 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4151 a string length.
4152 * keymap.c (push_key_description): Omit last arg, which was always 1.
4153 All callers changed.
4154
4155 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4156
4157 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
4158
4159 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4160 ($(BLD)/term.$(O)): Update dependencies.
4161
4162 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4163
4164 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4165 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4166 initializer for PVEC_NORMAL_VECTOR.
4167
4168 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4169
4170 Clean out old termopts cruft.
4171 * termopts.h (flow_control, meta_key): Remove unused decls.
4172 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4173 Don't include termopts.h.
4174
4175 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4176
4177 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4178
4179 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4180
4181 * commands.h (immediate_quit): Remove duplicate decl.
4182
4183 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4184
4185 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4186 caching.
4187 (nsfont_open): Remove setting of Vfonts_in_cache.
4188 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
4189
4190 2012-10-09 Eli Zaretskii <eliz@gnu.org>
4191
4192 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4193 match what GetLastError returns. Explain why the function is
4194 needed.
4195
4196 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4197 'is_tooltip_frame', to avoid confusion with its global namesake.
4198
4199 2012-10-08 Daniel Colascione <dancol@dancol.org>
4200
4201 * xdisp.c (start_hourglass): Call w32_note_current_window when
4202 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4203 build that caused Emacs to display the hourglass cursor forever.
4204
4205 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4206 which is broken under remote desktop, calculate the number of
4207 colors available for a display based on the display's number of
4208 planes and number of bits per pixel per plane. (bug#10397).
4209
4210 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
4211
4212 * nsfont.m (Vfonts_in_cache): New variable.
4213 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4214 are used. Add cached fonts to Vfonts_in_cache.
4215 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4216
4217 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
4218
4219 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4220 in nt/config.nt.
4221 (FONT_H): Define after FRAME_H.
4222 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4223 Update dependencies.
4224
4225 * w32term.c: Remove leftover declaration of keyboard_codepage.
4226
4227 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4228
4229 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4230 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4231 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4232 (GLOBAL_SOURCES): Add cygw32.c.
4233 ($(BLD)/unexw32.$(O)):
4234 ($(BLD)/w32.$(O)):
4235 ($(BLD)/w32console.$(O)):
4236 ($(BLD)/w32fns.$(O)):
4237 ($(BLD)/w32heap.$(O)):
4238 ($(BLD)/w32menu.$(O)):
4239 ($(BLD)/w32proc.$(O)): Add w32common.h.
4240
4241 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4242 'const char *'.
4243 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4244
4245 2012-10-08 Daniel Colascione <dancol@dancol.org>
4246
4247 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4248 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4249 accidental message numbering hole. Change other messages to
4250 match.
4251
4252 * w32select.h (HAVE_W32SELECT): Remove.
4253
4254 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4255 w32common.h instead of w32heap.h.
4256
4257 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4258 (get_allocation_unit, get_processor_type, get_w32_major_version)
4259 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4260 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4261 (OS_NT, os_subtype, cache_system_info): Move declarations to
4262 w32common.
4263
4264 * w32heap.c: Include w32common.h.
4265 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4266 (w32_minor_version, w32_build_number, w32_subtype):
4267 Remove duplicate definitions.
4268
4269 * w32fns.c: Include w32common.h; include w32heap.h only in
4270 WINDOWSNT.
4271
4272 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4273 Use `report_file_error' instead of `error' in order to better
4274 inform users of what went wrong. Increase NTGUI_UNICODE file
4275 dialog box file name length to 32k, the maximum allowed by the NT
4276 kernel.
4277
4278 * w32common.h: New file.
4279 (ROUND_UP, ROUND_DOWN, get_page_size)
4280 (get_allocation_unit, get_processor_type, get_w32_major_version)
4281 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4282 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4283 (OS_NT, os_subtype, cache_system_info): Move here.
4284
4285 * unexw32.c, unexcw.c: Include w32common.h.
4286
4287 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4288 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4289 to call syms_of_w32select.
4290
4291 * cygw32.h: Remove obsolete EXFUN declarations.
4292
4293 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4294
4295 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4296 of w32inevt.o from SOME_MACHINE_OBJECTS.
4297
4298 2012-10-08 Daniel Colascione <dancol@dancol.org>
4299
4300 * image.c: Permanent fix for JPEG compilation issue --- limit
4301 jpeglib `boolean' redefinition to Cygwin builds.
4302
4303 2012-10-08 Eli Zaretskii <eliz@gnu.org>
4304
4305 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4306
4307 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4308 Cygwin.
4309
4310 2012-10-08 Daniel Colascione <dancol@dancol.org>
4311
4312 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4313 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4314 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4315 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4316 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4317 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4318 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4319 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4320 now a supported configuration.
4321
4322 * Makefile.in: consolidate image variables into LIBIMAGE; add
4323 W32_OBJ and W32_LIBS. Compile new files.
4324
4325 * conf_post.h:
4326 (_DebPrint) declare tracing facility for W32 debugging. We need
4327 to unify tracing later.
4328
4329 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4330 unconditional use of W32 Unicode functions. Cygwin runs only on
4331 100% Unicode operating systems.
4332
4333 * cygw32.c: New file. Define Cygwin-specific facilities.
4334 (Fcygwin_convert_path_to_windows)
4335 (Fcygwin_convert_path_from_windows): New user functions for
4336 accessing Cygwin path-munging routines.
4337
4338 * cygw32.h: New file.
4339 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4340 UTF-16LE strings temporarily inside non-Lisp-visible string
4341 objects.
4342
4343 (w32_strerror): Just what it says on the tin.
4344
4345 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4346 also run for Cygwin; both systems have the same problem with using
4347 GUI facilities in a forked child. Also call syms_of_cygw32,
4348 syms_of_w32select in correct places.
4349
4350 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4351 needs fork-then-exec for daemon launching.
4352
4353 * font.h: Include frame.h.
4354
4355 * image.c: Use the image library cache machinery only when we're
4356 compiling for native WINDOWSNT; Cygwin can use shared libraries
4357 like any other Unixlike system.
4358
4359 * keyboard.c: Clarify a comment regarding the input loop.
4360
4361 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4362 functions directly instead of trying to detect at runtime that our
4363 host operating system supports them. We make this change for two
4364 reasons: Cygwin lacks support for the multibyte character
4365 conversion functions used by the legacy menu code, and Cygwin
4366 never needs to rely on non-Unicode APIs.
4367
4368 * unexw32.c (hinst): Declare extern.
4369
4370 * w32.c: Change header order;
4371 (w32_strerror): Move to w32fns.c because we need it for
4372 non-WINDOWSNT builds.
4373
4374 * w32.h: Add #error macro to make sure we don't include w32.h for
4375 Cygwin builds. Remove w32select declarations.
4376
4377 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
4378 w32fns.c. w32console.c is WINDOWSNT-only.
4379
4380 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4381 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4382 POSIXy alternative.
4383 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4384 (w32_major_version, w32_minor_version, w32_build_number)
4385 (os_subtype, sound_type): Define here
4386 (w32_defined_color): Make color parameter const for consistency
4387 with other _defined_color functions.
4388 (w32_createwindow): Unconditionally call w32_init_class instead of
4389 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4390 through the code is complex and unnecessary because class
4391 registration is practically free.
4392 (w32_name_of_message): New EMACSDEBUG-only function.
4393 (Fset_message_beep): Move here
4394 (Fx_open_connection): Require that the display name for Windows be
4395 "w32" for consistency, emacsclient disambiguation, and maybe, one
4396 day, multi-window-system support.
4397 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4398 Cygwin files for W32 GUI facilities, since these clearly don't
4399 expect Cygwin names.
4400 (_DebPrint): Define.
4401 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4402 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4403 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4404 (w32_last_error): Remove.
4405
4406 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4407
4408 * w32heap.c (syspage_mask): Declare here.
4409 (cache_system_info): Remove.
4410
4411 * w32inevt.c (faked_key): Define globally, not statically.
4412 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4413 (w32_console_toggle_lock_key): Move to w32fns.c.
4414
4415 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4416
4417 * w32proc.c (_DebPrint): Move to w32fns.c.
4418 * w32select.c: Include string.h, stdio.h for Cygwin.
4419 * w32select.h: New File.
4420
4421 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4422 get_osfhandle.
4423 (w32_message_fd): New variable. Under Cygwin, holds the file
4424 descriptor the system used to tell us about pending thread
4425 messages.
4426
4427 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4428 that prevented compilation under non-WINDOWSNT systems.
4429
4430 (w32_initialize): Open /dev/windows and assign it to
4431 w32_message_fd. Provide w32 feature.
4432
4433 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4434 (WM_EMACS_INPUT_READY): add.
4435 (prepend_msg, w32_message_fd): Declare globally.
4436
4437 * w32xfns.c:
4438 (keyboard_handle): Use only when WINDOWSNT.
4439 (notify_msg_ready): New function. Posts a message to the main
4440 thread's message queue under CYGWIN, which wakes up the main
4441 thread from select(2) by making the /dev/windows file descriptor
4442 ready. Under WINDOWSNT, it sets an event the same way the old
4443 code did.
4444
4445 (post, prepend_msg): Actually call notify_msg_ready instead of
4446 setting the input event directly.
4447
4448 2012-10-07 Eli Zaretskii <eliz@gnu.org>
4449
4450 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4451 but it still has blocs in it, don't return it to the system,
4452 instead of aborting. (Bug#12402)
4453
4454 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4455
4456 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
4457
4458 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4459 MAC_OS_X_VERSION_10_6.
4460 (syms_of_nsterm): Remove comment about Panther and above for
4461 ns-antialias-text.
4462 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4463 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4464 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4465
4466 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4467 MAC_OS_X_VERSION_10_4.
4468
4469 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4470 MAC_OS_X_VERSION_10_2.
4471
4472 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4473
4474 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4475 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4476
4477 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4478 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
4479 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4480 Remove ns_in_resize check.
4481 (ns_clear_frame_area): Remove resize handle code.
4482
4483 * nsfns.m (ns_in_resize): Remove.
4484 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4485 Remove ns_in_resize check.
4486
4487 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4488
4489 Improve sys_siglist detection.
4490 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4491 defined as a macro, as is done in Solaris.
4492 (sys_siglist_entries): New macro.
4493 (save_strsignal): Use it.
4494 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4495 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4496
4497 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4498
4499 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4500 fullscreen/Fullscreen.
4501
4502 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4503 tobar_height is new.
4504
4505 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4506 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4507 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4508 (windowDidResize:): Check for correct window if old style fullscreen.
4509 Capitalize word in comment. Remove incorrect comment.
4510 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4511 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4512 error in drawing background.
4513 (toggleFullScreen:): Remove comment. Rearrange calls.
4514 Set toolbar values to zero, save old height in tobar_height.
4515 Restore tool bar height when leaving fullscreen.
4516 (canBecomeMainWindow): New function.
4517
4518 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4519
4520 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4521
4522 2012-10-05 Eli Zaretskii <eliz@gnu.org>
4523
4524 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4525
4526 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4527 that time stamps of directories could also be changed.
4528 Don't request the too broad GENERIC_WRITE, only the more restrictive
4529 FILE_WRITE_ATTRIBUTES access rights.
4530
4531 * fileio.c (Fset_file_times): Special-case ignoring errors for
4532 directories only on MSDOS, not on MS-Windows.
4533
4534 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
4535
4536 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4537
4538 2012-10-04 Eli Zaretskii <eliz@gnu.org>
4539
4540 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4541 see whether CreateFile failed.
4542
4543 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4544
4545 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4546 to avoid similar races.
4547 * keyboard.c (pending_signals): Now bool, not int.
4548
4549 Port timers to OpenBSD, plus check for timer failures.
4550 OpenBSD problem reported by Han Boetes.
4551 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4552 and/or setitimer.
4553 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4554 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4555 like OpenBSD, which has timer_settime but does not declare it.
4556 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4557 whether to use itimerspec-related primitives. All uses of
4558 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4559
4560 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4561
4562 * profiler.c (handle_profiler_signal): Fix a malloc race
4563 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4564
4565 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4566
4567 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4568
4569 2012-10-02 Eli Zaretskii <eliz@gnu.org>
4570
4571 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4572 consistent with the change in return value of 'safe_strsignal'.
4573
4574 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4575
4576 Prefer plain 'static' to 'static inline' (Bug#12541).
4577 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4578 (bidi_set_sor_type, bidi_push_embedding_level)
4579 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4580 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4581 (bidi_cache_search, bidi_cache_ensure_space)
4582 (bidi_cache_iterator_state, bidi_cache_find)
4583 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4584 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4585 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4586 Now 'static', not 'static inline'.
4587
4588 Count overruns when profiling; change units to ns.
4589 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4590 Give extra weight to samples after overruns, to attempt to count
4591 the time more accurately.
4592 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4593 the underlying primitives nominally do ns.
4594 (Fprofiler_cpu_start): Document the change. Mention that
4595 the sampling intervals are only approximate.
4596
4597 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4598
4599 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4600
4601 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4602 case for the special 0 coding-system.
4603
4604 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4605 (Fmake_overlay): Remove redundant tests.
4606 (fix_start_end_in_overlays): Remove redundant recentering.
4607
4608 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
4609
4610 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4611 Update dependencies.
4612
4613 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4614
4615 Fix a malloc race condition involving strsignal.
4616 A signal can arrive in the middle of a malloc, and Emacs's signal
4617 handler can invoke strsignal, which can invoke malloc, which is
4618 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4619 Fix it by altering the signal handler so that it does not invoke
4620 strsignal.
4621 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4622 * process.c (status_message): Use const pointer, in case strsignal
4623 is #defined to safe_strsignal.
4624 * sysdep.c (sys_siglist, init_signals): Always define and
4625 initialize a substitute sys_siglist if the system does not define
4626 one, even if HAVE_STRSIGNAL.
4627 (safe_strsignal): Rename from strsignal. Always define,
4628 using sys_siglist. Return a const pointer.
4629 * syssignal.h (safe_strsignal): New decl.
4630 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4631
4632 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4633
4634 * w32proc.c (timer_loop): Fix code that waits for timer
4635 expiration, to avoid high CPU usage.
4636
4637 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4638
4639 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4640 (sweep_weak_table): Remove redundant prototypes.
4641
4642 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4643
4644 * emacs.c: Move the inclusion of TERM_HEADER after including
4645 windows.h on WINDOWSNT. This avoids compilation problems with
4646 MSVC.
4647
4648 2012-10-01 Eli Zaretskii <eliz@gnu.org>
4649
4650 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4651 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4652 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4653 as the previous version used 'void *'.
4654
4655 * ralloc.c (ROUNDUP): Fix last change.
4656 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4657 'size_t'.
4658
4659 * w32proc.c <disable_itimers>: New static flag.
4660 (init_timers): Initialize it to zero, after creating the critical
4661 sections used by the timer threads.
4662 (term_timers): Set to 1 before deleting the critical sections.
4663 (getitimer, setitimer): If disable_itimers is non-zero, return an
4664 error indication without doing anything. Reported by Fabrice
4665 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4666 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4667 return results.
4668 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4669 support timers.
4670
4671 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4672 term_ntproc after all the other bookkeeping, to get timers working
4673 as long as possible.
4674
4675 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4676
4677 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4678 Suggested by Juri Linkov in
4679 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4680
4681 Prefer plain 'static' to 'static inline' (Bug#12541).
4682 With static functions, modern compilers inline pretty well by
4683 themselves; advice from programmers often hurts as much as it helps.
4684 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4685 this change shrinks the text size of the Emacs executable by 1.1%
4686 without affecting CPU significantly in my benchmark.
4687 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4688 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4689 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4690 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4691 (bset_auto_fill_function, bset_auto_save_file_format)
4692 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4693 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4694 (bset_cache_long_line_scans, bset_case_fold_search)
4695 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4696 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4697 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4698 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4699 (bset_header_line_format, bset_indicate_buffer_boundaries)
4700 (bset_indicate_empty_lines, bset_invisibility_spec)
4701 (bset_left_fringe_width, bset_major_mode, bset_mark)
4702 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4703 (bset_name, bset_overwrite_mode, bset_pt_marker)
4704 (bset_right_fringe_width, bset_save_length)
4705 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4706 (bset_scroll_up_aggressively, bset_selective_display)
4707 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4708 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4709 (set_buffer_overlays_after):
4710 * category.c (bset_category_table):
4711 * charset.c (read_hex):
4712 * coding.c (produce_composition, produce_charset)
4713 (handle_composition_annotation, handle_charset_annotation)
4714 (char_encodable_p):
4715 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4716 (assign_row, set_frame_matrix_frame, make_current)
4717 (add_row_entry):
4718 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4719 * fns.c (maybe_resize_hash_table):
4720 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4721 * gmalloc.c (register_heapinfo):
4722 * image.c (lookup_image_type):
4723 * intervals.c (set_interval_object, set_interval_left)
4724 (set_interval_right, copy_interval_parent, rotate_right)
4725 (rotate_left, balance_possible_root_interval):
4726 * keyboard.c (kset_echo_string, kset_kbd_queue)
4727 (kset_keyboard_translate_table, kset_last_prefix_arg)
4728 (kset_last_repeatable_command, kset_local_function_key_map)
4729 (kset_overriding_terminal_local_map, kset_real_last_command)
4730 (kset_system_key_syms, clear_event, set_prop):
4731 * lread.c (digit_to_number):
4732 * marker.c (attach_marker, live_buffer, set_marker_internal):
4733 * nsterm.m (ns_compute_glyph_string_overhangs):
4734 * process.c (pset_buffer, pset_command)
4735 (pset_decode_coding_system, pset_decoding_buf)
4736 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4737 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4738 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4739 * syntax.c (bset_syntax_table, dec_bytepos):
4740 * terminal.c (tset_param_alist):
4741 * textprop.c (interval_has_some_properties)
4742 (interval_has_some_properties_list):
4743 * window.c (wset_combination_limit, wset_dedicated)
4744 (wset_display_table, wset_hchild, wset_left_fringe_width)
4745 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4746 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4747 (wset_right_fringe_width, wset_right_margin_cols)
4748 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4749 (wset_vertical_scroll_bar_type, wset_window_parameters):
4750 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4751 (wset_column_number_displayed, wset_region_showing)
4752 (window_box_edges, run_window_scroll_functions)
4753 (append_glyph_string_lists, prepend_glyph_string_lists)
4754 (append_glyph_string, set_glyph_string_background_width)
4755 (append_glyph, append_composite_glyph)
4756 (take_vertical_position_into_account):
4757 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4758 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4759 (lface_hash, lface_same_font_attributes_p, lookup_face):
4760 * xml.c (libxml2_loaded_p):
4761 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4762 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4763 Now 'static', not 'static inline'.
4764
4765 * bidi.c: Tune.
4766 (bidi_copy_it): Do the whole copy with a single memcpy.
4767 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4768
4769 Revert the FOLLOW-SYMLINKS change for file-attributes.
4770 Doing it right would require several changes to Tramp, and there's
4771 not enough time to get that tested before the freeze today.
4772 * dired.c (directory_files_internal, Ffile_attributes):
4773 Undo last change.
4774
4775 * frame.c (x_report_frame_params): Port better to wider ints.
4776 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4777 or that pointers can be printed in 15 decimal digits.
4778 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4779
4780 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4781
4782 Support x64 build on MS-Windows.
4783 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4784 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4785 compatibility with x64.
4786 (x_get_focus_frame): Add prototype.
4787
4788 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4789 defining an XRectangle structure.
4790
4791 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4792 arithmetics for compatibility with x64.
4793
4794 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4795 compatibility with x64.
4796
4797 * w32heap.h: Adjust prototypes and declarations.
4798
4799 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4800 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4801 DWORD, long, and unsigned long, for compatibility with x64.
4802 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4803 (sbrk): Argument is now of type ptrdiff_t.
4804
4805 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4806 less than 0x0500.
4807 (w32_msg_pump): Use WPARAM type for 'result'.
4808
4809 * w32.c (init_environment, get_emacs_configuration): Support AMD64
4810 architecture.
4811 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4812 compatibility with x64.
4813
4814 * vm-limit.c (lim_data): Now size_t.
4815 (check_memory_limits): Adjust prototypes of real_morecore and
4816 __morecore to receive argument of type ptrdiff_t. Use size_t for
4817 five_percent and data_size.
4818
4819 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4820 variables, for compatibility with x64.
4821 (rva_to_section, offset_to_section, relocate_offset)
4822 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4823 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4824 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4825 for compatibility with x64.
4826
4827 * sysdep.c (STDERR_FILENO): Define if not already defined.
4828
4829 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4830 (__morecore): Argument type is now ptrdiff_t.
4831 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4832 (relinquish): Use ptrdiff_t type for 'excess'.
4833 (r_alloc_sbrk): Argument type is now ptrdiff_t.
4834
4835 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4836 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4837 instead of a literal number.
4838
4839 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4840 (min): Define only if not already defined.
4841
4842 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4843 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4844 hosts.
4845
4846 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4847 'bitmaps' is a pointer.
4848
4849 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4850
4851 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4852
4853 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4854
4855 file-attributes has a new optional arg FOLLOW-SYMLINKS.
4856 * dired.c (directory_files_internal, Ffile_attributes):
4857 New arg follow_symlinks. All uses changed.
4858
4859 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
4860
4861 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4862
4863 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4864
4865 Support atimers and CPU profiler via profile.c on MS-Windows.
4866 * w32proc.c (sig_mask, crit_sig): New static variables.
4867 (sys_signal): Support SIGALRM and SIGPROF.
4868 (sigemptyset, sigaddset, sigfillset, sigprocmask)
4869 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
4870 sigfillset, and sigprocmask are no longer no-ops.
4871 (sigismember): New function.
4872 (struct itimer_data): New definition.
4873 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4874 (crit_prof): New static variables.
4875 (MAX_SINGLE_SLEEP): New definition.
4876 (timer_loop, stop_timer_thread, term_timers, init_timers)
4877 (start_timer_thread, getitimer, setitimer): New functions.
4878 (alarm): No longer a no-op, calls setitimer.
4879
4880 * w32.c (term_ntproc): Call term_timers.
4881 (init_ntproc): Make sure all signals are unblocked at startup, to
4882 erase any traces of dumping. Call init_timers.
4883
4884 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4885 Windows-specific code to display the hourglass mouse pointer is no
4886 longer used.
4887 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4888 to hourglass timer expiration.
4889 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4890 Remove, no longer used.
4891 (w32_note_current_window, show_hourglass, hide_hourglass):
4892 New functions, in support of hourglass cursor display similar to other
4893 window systems.
4894 (syms_of_w32fns): Don't initialize hourglass_timer.
4895
4896 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4897 WINDOWSNT as well.
4898 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4899
4900 * w32.h (init_timers, term_timers): Add prototypes.
4901
4902 2012-09-30 Kenichi Handa <handa@gnu.org>
4903
4904 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4905 to the buffer relocation which may be caused by ccl_driver.
4906
4907 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
4908
4909 * xfns.c (Fx_file_dialog): Update comment.
4910
4911 * w32fns.c (Fx_file_dialog): Update comment.
4912
4913 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4914 Initialize panel name field if OSX >= 10.6.
4915
4916 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4917
4918 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4919
4920 * nsterm.m (NEW_STYLE_FS): New define.
4921 (ns_fullscreen_hook, windowWillEnterFullScreen)
4922 (windowDidEnterFullScreen, windowWillExitFullScreen)
4923 (windowDidExitFullScreen, toggleFullScreen, handleFS)
4924 (setFSValue): New functions.
4925 (EmacsFSWindow): New implementation.
4926 (canBecomeKeyWindow): New function for EmacsFSWindow.
4927 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4928 (dealloc): Release nonfs_window if in fullscreen.
4929 (updateFrameSize:): Call windowDidMove to update top/left.
4930 (windowWillResize:toSize:): Check if frame is still maximized.
4931 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4932 next_maximized, maximized_width, maximized_height and nonfs_window.
4933 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
4934 tbar_height.
4935 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
4936 fullscreen. Set maximized_width/height. Act on next_maximized.
4937
4938 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
4939 (EmacsView): Add variables for fullscreen.
4940 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
4941 (EmacsFSWindow): New interface for fullscreen.
4942
4943 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
4944
4945 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
4946
4947 2012-09-30 Chong Yidong <cyd@gnu.org>
4948
4949 * fns.c (Frandom): Doc fix.
4950
4951 2012-09-30 Martin Rudalics <rudalics@gmx.at>
4952
4953 * window.c (Vwindow_combination_limit): New default value.
4954 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
4955
4956 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4957
4958 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
4959 Suggested by Eli Zaretskii in
4960 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
4961
4962 2012-09-30 Eli Zaretskii <eliz@gnu.org>
4963
4964 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
4965 HAVE_TIMER_SETTIME is defined.
4966
4967 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
4968
4969 Profiler improvements: more-accurate timers, overflow checks.
4970 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
4971 signal.h, setjmp.h. Include systime.h instead.
4972 (saturated_add): New function.
4973 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
4974 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
4975 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
4976 New static vars.
4977 (enum profiler_cpu_running): New enum.
4978 (profiler_cpu_running): Now of that enum type, not bool.
4979 All uses changed to store the new value.
4980 (handle_profiler_signal): Rename from sigprof_handler_1,
4981 for consistency with other handlers. Do not check whether
4982 cpu_log is a hash-table if garbage collecting, since it
4983 doesn't matter in that case.
4984 (deliver_profiler_signal): Rename from sigprof_handler,
4985 for consistency with other handlers.
4986 (setup_cpu_timer): New function, with much of what used to be in
4987 Fprofiler_cpu_start. Check for out-of-range argument.
4988 Prefer timer_settime if available, and prefer
4989 thread cputime clocks, then process cputime clocks, then
4990 monotonic clocks, to the old realtime clock. Use make_timeval
4991 to round more-correctly when falling back to setitimer.
4992 (Fprofiler_cpu_start): Use it.
4993 (Fprofiler_cpu_stop): Prefer timer_settime if available.
4994 Don't assume that passing NULL as the 2nd argument of setitimer
4995 is the same as passing a pointer to all-zero storage.
4996 Ignore SIGPROF afterwards.
4997 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
4998 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
4999 non-fatal signal handlers. Ignore SIGPROF on startup.
5000 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5001 in profiler.c, since sysdep.c now uses it.
5002
5003 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5004 Suggested by Eli Zaretskii in
5005 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5006
5007 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
5008
5009 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5010
5011 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5012
5013 * lisp.h (struct backtrace): Remove indirection for `function' field.
5014 * xdisp.c (redisplay_internal):
5015 * profiler.c (record_backtrace, sigprof_handler_1):
5016 * alloc.c (Fgarbage_collect):
5017 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5018 (Fbacktrace_frame): Adjust accordingly.
5019
5020 2012-09-28 Glenn Morris <rgm@gnu.org>
5021
5022 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5023 (Frun_hook_with_args_until_failure): Doc fixes.
5024
5025 2012-09-28 Eli Zaretskii <eliz@gnu.org>
5026
5027 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5028 Qautomatic_redisplay and change the symbol name. All users changed.
5029
5030 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5031
5032 * profiler.c (sigprof_handler): Fix race condition.
5033
5034 2012-09-28 Glenn Morris <rgm@gnu.org>
5035
5036 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5037
5038 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5039
5040 Check more robustly for timer_settime.
5041 * Makefile.in (LIB_TIMER_TIME): New macro.
5042 (LIBES): Add it.
5043 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5044 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5045 call timer_settime.
5046
5047 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5048
5049 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5050
5051 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
5052
5053 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5054
5055 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5056
5057 * character.h (MAYBE_UNIFY_CHAR): Remove.
5058 * charset.c, charset.h (maybe_unify_char): Now static.
5059 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5060 Since this stuff is now private to charset.c, there's no need for
5061 a public macro and no need to inline by hand.
5062
5063 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5064 Stefan Monnier <monnier@iro.umontreal.ca>
5065 Juanma Barranquero <lekktu@gmail.com>
5066
5067 * profiler.c: New file.
5068 * Makefile.in (base_obj): Add profiler.o.
5069 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5070 ($(BLD)/profiler.$(O)): New target.
5071 * emacs.c (main): Call syms_of_profiler.
5072 * alloc.c (Qautomatic_gc): New constant.
5073 (MALLOC_PROBE): New macro.
5074 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5075 (total_bytes_of_live_objects): New function.
5076 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5077 Call malloc_probe for the memory profiler.
5078 (syms_of_alloc): Define Qautomatic_gc.
5079 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5080 race condition.
5081 (struct backtrace): Move definition...
5082 * lisp.h (struct backtrace): ..here.
5083 (Qautomatic_gc, profiler_memory_running): Declare vars.
5084 (malloc_probe, syms_of_profiler): Declare functions.
5085 * xdisp.c (Qautomatic_redisplay): New constant.
5086 (redisplay_internal): Record itself in backtrace_list.
5087 (syms_of_xdisp): Define Qautomatic_redisplay.
5088
5089 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5090 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5091
5092 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5093
5094 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5095
5096 Prefer POSIX timers if available.
5097 They avoid a race if the timer is too close to the current time.
5098 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5099 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5100 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5101
5102 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5103
5104 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5105 CHAR_STRING_ADVANCE.
5106 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5107 STRING_CHAR_ADVANCE.
5108
5109 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
5110
5111 Move Vlibrary_cache to emacs.c and reset before dumping.
5112
5113 * lisp.h (reset_image_types): Declare.
5114 [WINDOWSNT] (Vlibrary_cache): Declare.
5115
5116 * image.c (reset_image_types): New function.
5117
5118 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5119 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5120 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5121
5122 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5123 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5124
5125 * w32.h (Vlibrary_cache): Do not declare.
5126
5127 2012-09-25 Eli Zaretskii <eliz@gnu.org>
5128
5129 * w32proc.c (sys_signal): Handle all signals defined by the
5130 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5131 handlers for signals supported by Windows. Don't override
5132 term_ntproc as the handler for SIGABRT.
5133 (sigaction): Rewrite to call sys_signal instead of duplicating its
5134 code.
5135 (sys_kill): Improve commentary.
5136
5137 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5138 consistency with a signature of a signal handler. All callers
5139 changed.
5140 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5141 install term_ntproc as a signal handler for SIGABRT, as that
5142 should be done by the dumped Emacs.
5143
5144 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5145
5146 * w32select.c (term_w32select): Protect against repeated
5147 invocation by setting clipboard_owner to NULL after calling
5148 DestroyWindow.
5149
5150 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5151 and term_ntproc to their modified signatures.
5152
5153 * character.c (char_string, string_char): Remove calls to
5154 MAYBE_UNIFY_CHAR. See the discussion starting at
5155 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5156 for the details.
5157
5158 2012-09-25 Chong Yidong <cyd@gnu.org>
5159
5160 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5161
5162 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5163
5164 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5165 when encountering an unknown bytecode.
5166
5167 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5168
5169 image.c, indent.c: Use bool for booleans.
5170 * dispextern.h (struct image_type): Members valid_p, load, init
5171 now return bool, not int. All uses changed.
5172 * image.c: Omit unnecessary static decls.
5173 (x_create_bitmap_mask, x_build_heuristic_mask):
5174 Return void, not int, since callers don't care about the return value.
5175 (x_create_bitmap_mask, define_image_type, valid_image_p)
5176 (struct image_keyword, parse_image_spec, image_spec_value)
5177 (check_image_size, image_background)
5178 (image_background_transparent, x_clear_image_1)
5179 (postprocess_image, lookup_image, x_check_image_size)
5180 (x_create_x_image_and_pixmap, xbm_image_p)
5181 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5182 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5183 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5184 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5185 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5186 (png_image_p, init_png_functions, png_load_body, png_load)
5187 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5188 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5189 (init_gif_functions, gif_load, imagemagick_image_p)
5190 (imagemagick_load_image, imagemagick_load, svg_image_p)
5191 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5192 (gs_load):
5193 * nsimage.m (ns_load_image):
5194 * nsterm.m (ns_defined_color):
5195 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5196 * xfns.c (x_defined_color):
5197 * xterm.c (x_alloc_lighter_color_for_widget)
5198 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5199 (x_alloc_lighter_color):
5200 * indent.c (disptab_matches_widthtab, current_column)
5201 (scan_for_column, string_display_width, indented_beyond_p)
5202 (compute_motion, vmotion, Fvertical_motion):
5203 Use bool for booleans.
5204
5205 2012-09-24 Chong Yidong <cyd@gnu.org>
5206
5207 * chartab.c (Fset_char_table_default): Obsolete function removed.
5208
5209 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5210
5211 Move pid_t related decls out of lisp.h.
5212 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5213 (interruptible_wait_for_termination):
5214 Move these decls from lisp.h to syswait.h, since they use pid_t.
5215 Needed on FreeBSD; see Herbert J. Skuhra in
5216 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5217 * callproc.c: Include syswait.h.
5218
5219 gnutls.c, gtkutil.c: Use bool for boolean.
5220 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5221 (emacs_gnutls_handle_error):
5222 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5223 (xg_hide_tooltip, xg_create_frame_widgets)
5224 (create_dialog, xg_uses_old_file_dialog)
5225 (xg_get_file_with_chooser, xg_get_file_with_selection)
5226 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5227 (xg_item_label_same_p, xg_update_menubar)
5228 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5229 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5230 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5231 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5232 (update_frame_tool_bar, free_frame_tool_bar):
5233 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5234 * nsmenu.m (ns_update_menubar):
5235 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5236 * xfns.c (Fx_show_tip) [USE_GTK]:
5237 Use bool for boolean.
5238 * gtkutil.c (xg_update_frame_menubar):
5239 * xmenu.c (update_frame_menubar):
5240 Return void, not int, since caller ignores return value.
5241 * gtkutil.c (xg_change_toolbar_position):
5242 Return void, not 1.
5243
5244 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5245
5246 * makefile.w32-in (BLOCKINPUT_H): Remove.
5247 (SYSSIGNAL_H): New macro.
5248 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5249 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5250 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5251 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5252 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5253 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5254 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5255 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5256 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5257 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5258 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5259 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5260 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5261 ($(BLD)/w32xfns.$(O)): Update dependencies.
5262
5263 2012-09-23 Eli Zaretskii <eliz@gnu.org>
5264
5265 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5266 fatal_error_backtrace.
5267
5268 * w32proc.c (sys_kill): Undo last change: don't do anything when
5269 invoked to deliver SIGABRT to our own process. This is now
5270 handled by emacs_raise.
5271
5272 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
5273
5274 * w32term.c (w32_read_socket): Remove leftover reference to
5275 interrupt_input_pending.
5276
5277 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5278
5279 Do not use SA_NODEFER.
5280 Problem reported by Dani Moncayo in
5281 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5282 * alloc.c (die):
5283 * sysdep.c (emacs_abort): Do not reset signal handler.
5284 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5285 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5286 wanted even on POSIXish hosts, and it doesn't work on Windows.
5287
5288 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5289
5290 * xterm.c (x_term_init): Call fixup_locale before and after calling
5291 gtk_init (Bug#12392).
5292
5293 2012-09-23 Chong Yidong <cyd@gnu.org>
5294
5295 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5296 Vdynamic_library_alist.
5297
5298 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5299 (Fgnutls_available_p): Caller changed.
5300
5301 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5302 (Flibxml_parse_xml_region): Likewise.
5303
5304 * dispextern.h (struct image_type): Remove arg from init function.
5305
5306 * image.c (Finit_image_library, lookup_image_type)
5307 (define_image_type): Remove now-unneeded second arg.
5308 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5309 (init_tiff_functions, init_gif_functions, init_svg_functions):
5310 Arglist and w32_delayed_load calling convention changed.
5311 (gs_type): Remove init_gs_functions; there is no such function.
5312 (valid_image_p, make_image): Fix caller to lookup_image_type.
5313
5314 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5315
5316 Simplify and avoid signal-handling races (Bug#12471).
5317 * alloc.c (die):
5318 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5319 Avoid recursive loop if there's a fatal error in the function itself.
5320 * atimer.c (pending_atimers):
5321 * blockinput.h: Don't include "atimer.h"; no longer needed.
5322 (interrupt_input_pending): Remove. All uses removed.
5323 pending_signals now counts both atimers and ordinary interrupts.
5324 This is less racy than having three separate pending-signal flags.
5325 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5326 (input_blocked_p):
5327 Rename from their upper-case counterparts BLOCK_INPUT,
5328 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5329 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5330 This makes it easier to access volatile variables more accurately.
5331 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5332 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5333 that's more reliable if the code is buggy and sets
5334 interrupt_input_blocked to a negative value. All uses changed.
5335 * atimer.c (deliver_alarm_signal):
5336 Remove. No need to deliver this to the parent; any thread can
5337 handle this signal now. All uses replaced by underlying handler.
5338 * atimer.c (turn_on_atimers):
5339 * dispnew.c (handle_window_change_signal):
5340 * emacs.c (handle_danger_signal):
5341 * keyboard.c (kbd_buffer_get_event):
5342 Don't reestablish signal handler; not needed with sigaction.
5343 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5344 (UNBLOCK_INPUT_TO):
5345 Rework to avoid unnecessary accesses to volatile variables.
5346 (UNBLOCK_INPUT_TO): Now a function.
5347 (totally_unblock_input, unblock_input): New decls.
5348 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5349 (init_data): Remove. Necessary stuff now done in init_signal.
5350 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5351 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5352 (fatal_error_code): Remove; no longer needed.
5353 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5354 it doesn't always backtrace. All uses changed. No need to reset
5355 signal to default, since sigaction and/or die does that for us now.
5356 Use emacs_raise (FOO), not kill (getpid (), FOO).
5357 (main): Check more-accurately whether we're dumping.
5358 Move fatal-error setup to sysdep.c
5359 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5360 * gtkutil.c (xg_get_file_name, xg_get_font):
5361 Remove no-longer-needed signal-mask manipulation.
5362 * keyboard.c, process.c (POLL_FOR_INPUT):
5363 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5364 * keyboard.c (read_avail_input): Remove.
5365 All uses replaced by gobble_input.
5366 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5367 (kbd_buffer_store_event_hold, gobble_input):
5368 (record_asynch_buffer_change) [USABLE_SIGIO]:
5369 (store_user_signal_events):
5370 No need to mess with signal mask.
5371 (gobble_input): If blocking input and there are terminals, simply
5372 set pending_signals to 1 and return. All hooks changed to not
5373 worry about whether input is blocked.
5374 (process_pending_signals): Clear pending_signals before processing
5375 them, in case a signal comes in while we're processing.
5376 By convention callers now test pending_signals before calling us.
5377 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5378 New functions, to support changes to blockinput.h.
5379 (handle_input_available_signal): Now extern.
5380 (reinvoke_input_signal): Remove. All uses replaced by
5381 handle_async_input.
5382 (quit_count): Now volatile, since a signal handler uses it.
5383 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5384 All callers changed. Block SIGINT only if not already blocked.
5385 Clear sigmask reliably, even if Fsignal returns, which it can.
5386 Omit unnecessary accesses to volatile var.
5387 (quit_throw_to_read_char): No need to restore sigmask.
5388 * keyboard.c (gobble_input, handle_user_signal):
5389 * process.c (wait_reading_process_output):
5390 Call signal-handling code rather than killing ourselves.
5391 * lisp.h: Include <float.h>, for...
5392 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5393 (pending_signals): Now volatile.
5394 (syms_of_data): Now const if IEEE floating point.
5395 (handle_input_available_signal) [USABLE_SIGIO]:
5396 (terminate_due_to_signal, record_child_status_change): New decls.
5397 * process.c (create_process): Avoid disaster if memory is exhausted
5398 while we're processing a vfork, by tightening the critical section
5399 around the vfork.
5400 (send_process_frame, process_sent_to, handle_pipe_signal)
5401 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5402 ignores SIGPIPE.
5403 (send_process): No need for setjmp/longjmp any more, since the
5404 SIGPIPE stuff is now gone. Instead, report an error if errno
5405 is EPIPE.
5406 (record_child_status_change): Now extern. PID and W are now args.
5407 Return void, not bool. All callers changed.
5408 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5409 Remove. All uses removed. This bug should be fixed now in a
5410 different way.
5411 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5412 and record the child status change directly. This avoids the
5413 need to futz with the signal mask.
5414 (process_fatal_action): Move here from emacs.c.
5415 (emacs_sigaction_flags): New function, containing
5416 much of what used to be in emacs_sigaction_init.
5417 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5418 caught by emacs, to make races less likely.
5419 (deliver_process_signal): Rename from handle_on_main_thread.
5420 All uses changed.
5421 (BACKTRACE_LIMIT_MAX): Now at top level.
5422 (thread_backtrace_buffer, threadback_backtrace_pointers):
5423 New static vars.
5424 (deliver_thread_signal, deliver_fatal_thread_signal):
5425 New functions, for more-accurate delivery of thread-specific signals.
5426 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5427 (deliver_arith_signal): Handle in this thread, not
5428 in the main thread, since it's triggered by this thread.
5429 (maybe_fatal_sig): New function.
5430 (init_signals): New arg DUMPING so that we can be more accurate
5431 about whether we're dumping. Caller changed.
5432 Treat thread-specific signals differently from process-general signals.
5433 Block all signals while handling fatal error; that's safer.
5434 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5435 on IEEE hosts.
5436 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5437 Ignore SIGPIPE unless batch.
5438 (emacs_backtrace): Output backtrace for the appropriate thread,
5439 which is not necessarily the main thread.
5440 * syssignal.h: Include <stdbool.h>.
5441 (emacs_raise): New macro.
5442 * xterm.c (x_connection_signal): Remove; no longer needed
5443 now that we use sigaction.
5444 (x_connection_closed): No need to mess with sigmask now.
5445 (x_initialize): No need to reset SIGPIPE handler here, since
5446 init_signals does this for us now.
5447
5448 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5449
5450 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
5451 background rect may be larger (Bug#12245).
5452
5453 2012-09-23 Chong Yidong <cyd@gnu.org>
5454
5455 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5456
5457 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5458
5459 * .gdbinit: Just stop at fatal_error_backtrace.
5460 See Stefan Monnier's request in
5461 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5462 Remove no-longer-used query of system type.
5463
5464 2012-09-22 Chong Yidong <cyd@gnu.org>
5465
5466 * search.c (Freplace_match): Doc fix (Bug#12325).
5467
5468 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5469
5470 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5471 (Fline_end_position): Doc fix.
5472
5473 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5474
5475 2012-09-22 Chong Yidong <cyd@gnu.org>
5476
5477 * dispextern.h (struct image_type): Add new slot, storing a type
5478 initialization function.
5479
5480 * image.c (define_image_type): Call the image initializer function
5481 if it is defined. Arguments and return value changed.
5482 (valid_image_p, make_image): Callers changed.
5483 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
5484 (gif_type, imagemagick_type, svg_type, gs_type):
5485 Add initialization functions.
5486 (Finit_image_library): Call lookup_image_type.
5487 (CHECK_LIB_AVAILABLE): Macro deleted.
5488 (lookup_image_type): Call define_image_type here, rather than via
5489 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5490 (syms_of_image): Move define_image_type calls for xbm_type and
5491 pbm_type to lookup_image_type.
5492
5493 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5494
5495 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5496 'idle_timers' from here ...
5497 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5498 lists, to avoid infloops when the timer does something stupid,
5499 like reinvoke itself with the same or smaller time-out.
5500 (Bug#12447)
5501
5502 2012-09-22 Martin Rudalics <rudalics@gmx.at>
5503
5504 * window.c (Fsplit_window_internal): Handle only Qt value of
5505 Vwindow_combination_limit separately.
5506 (Qtemp_buffer_resize): New symbol.
5507 (Vwindow_combination_limit): New default value.
5508 Rewrite doc-string.
5509
5510 2012-09-22 Eli Zaretskii <eliz@gnu.org>
5511
5512 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5513 the new overlay string. (Bug#10159)
5514
5515 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5516
5517 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5518 or that fprintf is async-signal-safe. POSIX doesn't require
5519 either assumption.
5520
5521 2012-09-22 Chong Yidong <cyd@gnu.org>
5522
5523 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5524 (Bug#8207).
5525
5526 2012-09-22 Kenichi Handa <handa@gnu.org>
5527
5528 * composite.c (composition_reseat_it): Handle the case that a
5529 grapheme cluster is not covered by a single font (Bug#12352).
5530
5531 2012-09-21 Chong Yidong <cyd@gnu.org>
5532
5533 * image.c (define_image_type): Avoid adding duplicate types to
5534 image_types (Bug#12463). Suggested by Jörg Walter.
5535
5536 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5537
5538 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5539 (print_load_command_name): Add case LC_DATA_IN_CODE.
5540 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5541
5542 2012-09-21 Glenn Morris <rgm@gnu.org>
5543
5544 * eval.c (Frun_hook_with_args_until_success)
5545 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5546
5547 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
5548
5549 * fileio.c (Ffile_selinux_context): Only call freecon when
5550 lgetfilecon succeeded.
5551 (Fset_file_selinux_context): Likewise. (Bug#12444)
5552
5553 2012-09-21 Eli Zaretskii <eliz@gnu.org>
5554
5555 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5556 reordering, locate the cursor by calling set_cursor_from_row; if
5557 that fails, clear the desired glyph matrix before returning a
5558 failure indication to the caller. Fixes leaving garbled display
5559 when fast scrolling with a down-key. (Bug#12403)
5560 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5561 scrolling through multibyte text.
5562
5563 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5564
5565 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5566 calling mark_vectorlike since that's the one that marks the window.
5567 (mark_discard_killed_buffers): Mark the final cdr.
5568 * window.h (struct window): Move prev/next_buffers to the
5569 non-standard fields.
5570 * window.c (make_window): Initialize prev/next_buffers manually.
5571
5572 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5573
5574 Omit unused arg EXPECTED from socket hooks.
5575 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5576 * nsterm.m (ns_term_init):
5577 * termhooks.h (struct terminal.read_socket_hook):
5578 * w32inevt.c (w32_console_read_socket):
5579 * w32term.c (w32_read_socket):
5580 * xterm.c (XTread_socket):
5581 Omit unused arg EXPECTED. All callers changed.
5582 (store_user_signal_events): Return void, not int, since callers no
5583 longer care about the return value. All uses changed.
5584
5585 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
5586
5587 * w32gui.h (XParseGeometry): Do not declare.
5588
5589 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5590
5591 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
5592 Ignore 'expected'. See Eli Zaretskii in
5593 <http://bugs.gnu.org/12471#8> (last line).
5594
5595 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5596 (XParseGeometry): Now static. Substitute extremal values for
5597 values that are out of range.
5598
5599 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5600
5601 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5602
5603 * nsfns.m (XParseGeometry): Remove.
5604 (Fx_create_frame): Call x_set_offset to correctly interpret
5605 top_pos in geometry.
5606
5607 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
5608 (Fx_parse_geometry): If there is a space in string, call
5609 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5610
5611 2012-09-17 Eli Zaretskii <eliz@gnu.org>
5612
5613 * search.c (scan_buffer): Use character positions in calls to
5614 region_cache_forward and region_cache_backward, not byte
5615 positions. (Bug#12196)
5616
5617 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5618 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5619
5620 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5621 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5622 emacs_blocked_malloc, now deleted.
5623
5624 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5625
5626 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5627 The workaround was for improving performance on Solaris 2.4, but
5628 is getting in the way now. Emacs will still work if someone is
5629 still running Solaris 2.4 in a museum somewhere; Sun dropped
5630 support for Solaris 2.4 in 2003.
5631 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5632 * process.c (create_process) [HAVE_WORKING_VFORK]:
5633 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5634 since Emacs no longer uses vfork on that platform.
5635
5636 2012-09-17 Glenn Morris <rgm@gnu.org>
5637
5638 * emacs.c: Use COPYRIGHT.
5639
5640 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5641
5642 Remove configure's --without-sync-input option (Bug#12450).
5643 When auditing signal-handling in preparation for cleaning it up,
5644 I found that SYNC_INPUT has race conditions and would be a real
5645 pain to fix. Since it's an undocumented and deprecated
5646 configure-time option, now seems like a good time to remove it.
5647 Also see <http://bugs.gnu.org/11080#16>.
5648 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5649 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5650 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5651 (malloc_hysteresis):
5652 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5653 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5654 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5655 (dont_register_blocks, bytes_used_when_reconsidered)
5656 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5657 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5658 [!SYSTEM_MALLOC && !SYNC_INPUT]:
5659 Remove. All uses removed.
5660 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5661 implementation, one that depends on whether the new macro
5662 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5663 is defined.
5664 * atimer.c (run_timers, handle_alarm_signal):
5665 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5666 (handle_async_input, process_pending_signals)
5667 (handle_input_available_signal, init_keyboard):
5668 * nsterm.m (ns_read_socket):
5669 * process.c (wait_reading_process_output):
5670 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5671 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5672 (emacs_write):
5673 * xterm.c (XTread_socket):
5674 Assume SYNC_INPUT.
5675 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5676 * eval.c (handling_signal): Remove. All uses removed.
5677 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5678 All uses replaced with the SYNC_INPUT version.
5679 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5680 Remove decls.
5681 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5682 Now static.
5683
5684 * font.c (Ffont_shape_gstring): Remove unused local.
5685
5686 2012-09-16 Glenn Morris <rgm@gnu.org>
5687
5688 * Makefile.in (clean): No longer run nextstep's clean.
5689
5690 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5691 (ns_frag): Remove.
5692 (ns-app): Move here from ns.mk, and simplify.
5693 (clean): Simplify nextstep entry.
5694 * ns.mk: Remove file.
5695
5696 2012-09-17 Kenichi Handa <handa@gnu.org>
5697
5698 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5699 not covert the last few charactes.
5700
5701 2012-09-16 Kenichi Handa <handa@gnu.org>
5702
5703 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5704 here, but just check the validity of glyphs in the glyph-string.
5705
5706 2012-09-16 Martin Rudalics <rudalics@gmx.at>
5707
5708 * window.c (Fwindow_parameter, Fset_window_parameter):
5709 Accept any window as argument (Bug#12452).
5710
5711 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5712
5713 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5714 to ns_term_init to avoid memory leak.
5715
5716 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5717 explicit retain/release.
5718 (ns_term_init): Only allow one display. Initialize outerpool and
5719 ns_*_types.
5720
5721 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5722
5723 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5724 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5725 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5726 the Microsoft problem in a different way, by altering ../nt/config.nt.
5727
5728 2012-09-15 Eli Zaretskii <eliz@gnu.org>
5729
5730 * w32xfns.c:
5731 * w32uniscribe.c:
5732 * w32term.c:
5733 * w32select.c:
5734 * w32reg.c:
5735 * w32proc.c:
5736 * w32menu.c:
5737 * w32inevt.c:
5738 * w32heap.c:
5739 * w32font.c:
5740 * w32fns.c:
5741 * w32console.c:
5742 * w32.c:
5743 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5744 by lisp.h. This completes removal of setjmp.h inclusion
5745 erroneously announced in the previous commit. (Bug#12446)
5746
5747 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5748 more accurate.
5749
5750 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5751 not defined as a macro. The latter happens on MS-Windows.
5752 (Bug#12446)
5753
5754 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5755
5756 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5757 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
5758 Some instances of '#include <setjmp.h>' removed, if the
5759 only reason for the instance was because "lisp.h" was included.
5760 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5761 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5762 and _longjmp with the new symbols. Emacs already uses _setjmp if
5763 available, so this change affects only POSIXish hosts that have
5764 sigsetjmp but not _setjmp, such as some versions of Solaris and
5765 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5766 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5767 (png_load_body) [HAVE_PNG]:
5768 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5769 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5770 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5771 since PNG requires jmp_buf. This is the only exception to the
5772 general rule that we now use sys_setjmp and sys_longjmp.
5773 This exception is OK since this code does not change the signal
5774 mask or longjmp out of a signal handler.
5775
5776 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5777
5778 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5779 Include "syssignal.h", for 'main_thread'.
5780
5781 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5782
5783 Avoid out-of-range marker position (Bug#12426).
5784 * insdel.c (replace_range, replace_range_2):
5785 Adjust markers before overlays, as suggested by comments.
5786 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5787 Remove redundant check before calling offset_intervals.
5788
5789 2012-09-14 Martin Rudalics <rudalics@gmx.at>
5790
5791 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5792 current buffer (Bug#12387).
5793
5794 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
5795
5796 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5797
5798 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5799
5800 Use a more backwards-compatible timer format (Bug#12430).
5801 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5802 vector element, not from the 4th, since PSECS is now at the end.
5803 (Fcurrent_idle_time): Doc fix.
5804
5805 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
5806
5807 Function to mark objects and remove killed buffers at once.
5808 * alloc.c (discard_killed_buffers): Rename to ...
5809 (mark_discard_killed buffers) ... new name. Add marking
5810 of remaining objects. Fix comment. Adjust users.
5811 (mark_object): Do not touch frame buffer lists here.
5812 * frame.c (delete_frame): Reset frame buffer lists here.
5813
5814 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
5815
5816 Better workaround for GNOME bug when --enable-gcc-warnings.
5817 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5818 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
5819 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5820
5821 Simplify SIGIO usage (Bug#12408).
5822 The code that dealt with SIGIO was crufty and confusing, e.g., it
5823 played tricks like "#undef SIGIO" but these tricks were not used
5824 consistently. Simplify mostly by not #undeffing standard symbols,
5825 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5826 or not as we please) rather than "defined SIGIO" (standard symbol
5827 that we probably shouldn't #undef).
5828 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5829 Modules that need it can include it.
5830 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5831 * dispextern.h (ignore_sigio): New decl.
5832 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5833 unconditionally, since it's now a no-op if !USABLE_SIGIO.
5834 * emacs.c (shut_down_emacs):
5835 * keyboard.c (kbd_buffer_store_event_hold):
5836 Use ignore_sigio rather than invoking 'signal' directly.
5837 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5838 for FIONREAD.
5839 (FIONREAD, SIGIO): Do not #undef.
5840 (tty_read_avail_input): Use #error rather than a syntax error.
5841 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5842 for I_PIPE, used by SETUP_SLAVE_PTY.
5843 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5844 * sysdep.c (croak): Remove; no longer needed. This bit of
5845 temporary code, with Fred N. Fish's comment that it's temporary,
5846 has been in Emacs since at least 1992!
5847 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5848 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5849 * syssignal.h (croak): Remove decl.
5850 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5851 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5852 now that we're termios-only.
5853 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5854 * term.c (dissociate_if_controlling_tty): Use #error rather than
5855 a run-time error.
5856
5857 Work around GCC and GNOME bugs when --enable-gcc-warnings.
5858 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5859 to work around GNOME bug 683906.
5860 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5861 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5862 This works around GCC bug 54561.
5863
5864 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5865
5866 More fixes for 'volatile' and setjmp/longjmp.
5867 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5868 * image.c (struct png_load_context) [HAVE_PNG]: New type.
5869 (png_load_body) [HAVE_PNG]:
5870 (jpeg_load_body) [HAVE_JPEG]:
5871 New function, with most of the old parent function's body.
5872 (png_load) [HAVE_PNG]:
5873 (jpeg_load) [HAVE_JPEG]:
5874 Invoke the new function, to avoid longjmp munging our locals.
5875 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5876 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5877 longjmp is passed 2, as the C standard doesn't guarantee this.
5878 Instead, store the failure code into mgr->failure_code.
5879
5880 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5881
5882 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5883 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5884 (syms_of_keyboard): Remove support for unread-command-char.
5885
5886 2012-09-12 Eli Zaretskii <eliz@gnu.org>
5887
5888 * w32proc.c (sys_kill): If PID is our process ID and the signal is
5889 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
5890 violation. (Bug#12426)
5891
5892 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
5893
5894 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5895
5896 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5897
5898 * eval.c: Add `inhibit-debugger'.
5899 (Qinhibit_debugger): New symbol.
5900 (call_debugger): Bind it instead of Qdebug_on_error.
5901 (maybe_call_debugger): Test Vinhibit_debugger.
5902 (syms_of_eval): Define inhibit-debugger.
5903 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5904 (syms_of_xdisp): Remove inhibit-debug-on-message.
5905
5906 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5907
5908 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5909 If a nonvolatile local variable is written before a _longjmp to
5910 the frame containing the variable, and is read after the _longjmp,
5911 the value read is indeterminate. Some local variables of type
5912 'struct handler' and 'struct catchtag' are used in this way, so
5913 mark each of their slots as volatile if the slot can be set before
5914 _longjmp and read afterwards.
5915 * lisp.h (struct handler): var and chosen_clause are now volatile.
5916 (struct catchtag): val, next, and pdlcount are now volatile.
5917
5918 * bidi.c (bidi_push_it, bidi_pop_it):
5919 * fns.c (copy_hash_table):
5920 * image.c (define_image_type):
5921 * keyboard.c (kbd_buffer_store_event_hold):
5922 * process.c (Fprocess_send_eof):
5923 * xfaces.c (x_create_gc) [HAVE_NS]:
5924 * xgselect.c (xg_select):
5925 Prefer assignment to memcpy when either will do.
5926
5927 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5928 Use pointer-to-a-pointer to simplify and avoid a NILP check each
5929 time an item is removed. No need to mark this function 'inline';
5930 the compiler knows better than we do.
5931
5932 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
5933
5934 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
5935 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
5936 to change_frame_size (Bug#12388).
5937 (windowDidResize:): Pass YES to updateFrameSize.
5938
5939 * nsterm.h: Add delay parameter to updateFrameSize.
5940
5941 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5942
5943 Discard killed buffers from deleted window and frame objects.
5944 This reduces an amount of references to killed buffers and
5945 helps GC to reclaim them faster.
5946 * alloc.c (discard_killed_buffers): New function.
5947 (mark_object): Use it for deleted windows and frames.
5948 (mark_object): If symbol's value is set up for a killed buffer
5949 or deleted frame, restore its global binding.
5950 * data.c (swap_in_global_binding): Add GC notice.
5951 (swap_in_symval_forwarding): Use convenient set_blv_where.
5952 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
5953 * window.h: ... to here.
5954
5955 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
5956
5957 Convenient macro to check whether the buffer is live.
5958 * buffer.h (BUFFER_LIVE_P): New macro.
5959 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
5960 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
5961
5962 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5963
5964 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
5965 composition cases (Bug#12364).
5966
5967 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
5968 overhang of succeeding glyphs overlapping box cursor.
5969
5970 * w32term.c (x_draw_glyph_string): Likewise.
5971
5972 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
5973
5974 Simplify, document, and port floating-point (Bug#12381).
5975 The porting part of this patch fixes bugs on non-IEEE platforms
5976 with frexp, ldexp, logb.
5977 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
5978 Now static.
5979 * floatfns.c: Simplify discussion of functions that Emacs doesn't
5980 support, by removing commented-out code and briefly listing the
5981 C89 functions excluded. The commented-out stuff was confusing
5982 maintenance, e.g., we thought we needed cbrt but it was commented out.
5983 (logb): Remove decl; no longer needed.
5984 (isfinite): New macro, if not already supplied.
5985 (isnan): Don't replace any existing macro.
5986 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
5987 are present on all C89 platforms.
5988 (Ffrexp): Do not special-case zero, as frexp does the right thing
5989 for that case.
5990 (Flogb): Do not use logb, as it doesn't have the desired meaning
5991 on hosts that use non-base-2 floating point. Instead, stick with
5992 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
5993 frexp, to avoid getting an unspecified result.
5994
5995 * xdisp.c (Qinhibit_debug_on_message): Now static.
5996
5997 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
5998
5999 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6000 NSBezierPath (Bug#12131).
6001
6002 2012-09-10 Chong Yidong <cyd@gnu.org>
6003
6004 * fns.c (Fdelq, Fdelete): Doc fix.
6005
6006 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6007
6008 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6009 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6010
6011 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6012
6013 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6014 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6015 Use it.
6016
6017 2012-09-09 Eli Zaretskii <eliz@gnu.org>
6018
6019 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6020 left fringe if the window has a left margin. This avoids leaving
6021 traces of the cursor because its leftmost pixel is not drawn over.
6022
6023 * dispnew.c (update_window_line): When the left margin area of a
6024 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6025 that screen line. (Bug#12277)
6026
6027 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6028
6029 Assume C89 or later for math functions (Bug#12381).
6030 This simplifies the code, and makes it a bit smaller and faster,
6031 and (most important) makes it easier to clean up signal handling
6032 since we can stop worring about floating-point exceptions in
6033 library code. That was a problem before C89, but the problem
6034 went away many years ago on all practical Emacs targets.
6035 * data.c, image.c, lread.c, print.c:
6036 Don't include <math.h>; no longer needed.
6037 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6038 might be autoconfigured, as that never happens.
6039 * data.c (fmod):
6040 * doprnt.c (DBL_MAX_10_EXP):
6041 * print.c (DBL_DIG):
6042 Remove. C89 or later always defines these.
6043 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6044 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6045 (arith_error, domain_error, domain_error2):
6046 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6047 no longer needed -- we simply return what C returns. All uses removed.
6048 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6049 the wrapped code.
6050 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6051 Remove. All uses expanded, as these macros are no longer used
6052 more than once and are now more trouble than they're worth.
6053 (Ftan): Use tan, not sin / cos.
6054 (Flogb): Assume C89 frexp.
6055 (fmod_float): Assume C89 fmod.
6056 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6057 (init_floatfns): Remove. All uses removed.
6058
6059 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6060
6061 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6062 compositeToPoint for OSX < 10.6 (Bug#12390).
6063
6064 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6065
6066 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6067 This produces more-accurate results.
6068
6069 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6070
6071 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6072 changes (Bug#12088).
6073
6074 2012-09-08 Chong Yidong <cyd@gnu.org>
6075
6076 * syntax.c (Fstring_to_syntax): Doc fix.
6077
6078 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6079
6080 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6081 in the internal border.
6082 (x_set_window_size): Remove static variables and their usage.
6083 (ns_redraw_scroll_bars): Fix NSTRACE arg.
6084 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6085 Remove fringe/internal border adjustment (Bug#11052).
6086 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6087 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6088 (ns_fix_rect_ibw): Remove.
6089 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6090 (ns_dumpglyphs_box_or_relief): Ditto.
6091 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6092 adjustment.
6093 (ns_dumpglyphs_image): Ditto.
6094 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
6095 border adjustment.
6096 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6097 their usage. Add fringe_extended_p and its use as in other terms.
6098 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6099 scroll bar was removed.
6100 (updateFrameSize): New function.
6101 (windowDidResize): Move code to updateFrameSize and call it.
6102
6103 * nsterm.h (EmacsView): Add updateFrameSize.
6104
6105 2012-09-07 Chong Yidong <cyd@gnu.org>
6106
6107 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6108
6109 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6110
6111 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6112
6113 More signal-handler cleanup (Bug#12327).
6114 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6115 Problem introduced when merging patches. Noted by Eli Zaretskii in
6116 <http://bugs.gnu.org/12327#67>.
6117 * floatfns.c: Comment fix.
6118 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6119 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6120 and anyway the declaration is harmless even if SIGDANGER is not defined.
6121 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6122 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6123 source files not surprisingly expected syssignal.h to define, or
6124 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6125 Include <sys/ioctl.h>, for FIONREAD.
6126 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6127 This eliminates a problem whereby other files mysteriously had
6128 to include "syssignal.h" before including "systty.h" if they
6129 wanted to use "#ifdef SIGIO".
6130
6131 2012-09-07 Eli Zaretskii <eliz@gnu.org>
6132
6133 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6134
6135 * w32.c (sigemptyset): Empty the set.
6136 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6137
6138 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6139
6140 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6141
6142 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6143 (mark_object): Likewise for frame objects.
6144
6145 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6146
6147 * syssignal.h (handle_on_main_thread): Always declare,
6148 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6149 This ports to platforms without HAVE_PTHREAD.
6150
6151 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6152
6153 Signal-handler cleanup (Bug#12327).
6154 Emacs's signal handlers were written in the old 4.2BSD style with
6155 sigblock and sigmask and so forth, and this led to some
6156 inefficiencies and confusion. Rewrite these to use
6157 pthread_sigmask etc. without copying signal sets around. Also,
6158 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6159 'signal', and instead use functions that do not attempt to take
6160 over the system name space. This patch causes Emacs's text
6161 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6162 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6163 Do not include <signal.h> or "syssignal.h", as these
6164 modules do not use signals.
6165 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6166 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6167 Do not include <signal.h>, as "syssignal.h" does that for us now.
6168 * atimer.c (sigmask_atimers): New function.
6169 (block_atimers, unblock_atimers): New functions,
6170 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6171 All uses replaced.
6172 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6173 no longer needed here.
6174 * emacs.c (main): Inspect existing signal handler with sigaction,
6175 so that there's no need to block and unblock SIGHUP.
6176 * sysdep.c (struct save_signal): New member 'action', replacing
6177 old member 'handler'.
6178 (save_signal_handlers, restore_signal_handlers):
6179 Use sigaction instead of 'signal' to save and restore.
6180 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6181 New function. All users of 'signal' modified to use set_sighandler
6182 if they're writeonly, and to use sys_signal if they're read+write.
6183 (emacs_sigaction_init, forwarded_signal): New functions.
6184 (sys_signal): Remove. All uses replaced by calls to sigaction
6185 and emacs_sigaction_init, or by direct calls to 'signal'.
6186 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6187 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6188 all uses replaced by pthread_sigmask etc. calls.
6189 * syssignal.h: Include <signal.h>.
6190 (emacs_sigaction_init, forwarded_signal): New decls.
6191 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6192 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6193 (sigmask, sys_sigmask): Remove; no longer needed.
6194 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6195 (sigblock, sigunblock, sigfree):
6196 (sigsetmask) [!defined sigsetmask]:
6197 Remove. All uses replaced by pthread_sigmask.
6198 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6199 no longer need to be replaced, and its typical old uses
6200 are now done via emacs_sigaction_init and sigaction.
6201 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6202 (sys_sigdel): Remove; unused.
6203 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6204
6205 2012-09-06 Eli Zaretskii <eliz@gnu.org>
6206
6207 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6208 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6209
6210 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6211
6212 Explicitly mark buffer_defaults and buffer_local_symbols.
6213 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6214 mark_local_symbols here.
6215 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6216 since special buffers aren't marked here any more.
6217 (allocate_buffer): Chain new buffer with all_buffers here...
6218 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6219 not here.
6220 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6221 (syms_of_buffer): Remove staticpro of the above.
6222 (init_buffer_once): Set names for buffer_defaults and
6223 buffer_local_symbols.
6224
6225 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6226
6227 Use bool for booleans in font-related modules.
6228 * font.c (font_intern_prop, font_style_to_value)
6229 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6230 (generate_otf_features, font_check_otf_features, font_check_otf)
6231 (font_match_p, font_list_entities, font_at):
6232 * fontset.c (fontset_id_valid_p, reorder_font_vector
6233 (fontset_find_font, Fset_fontset_font)
6234 (face_suitable_for_char_p) [0]:
6235 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6236 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6237 (m17n_flt_initialized, ftfont_shape_by_flt):
6238 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6239 * nsfont.m (nsfont_draw):
6240 * w32font.c (w32font_draw):
6241 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6242 Use bool for booleans.
6243 * font.h: Adjust to above API changes.
6244 (struct font, struct font_driver, struct font_driver_list):
6245 Use bool for booleans.
6246 (struct font): Remove useless member encoding_type.
6247 All users removed.
6248 * fontset.c, xftfont.c: Omit unnecessary static decls.
6249
6250 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6251
6252 * alloc.c (mark_object): Revert window marking code
6253 since it's unsafe for the Fset_window_configuration.
6254
6255 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6256
6257 Fix race conditions with signal handlers and errno (Bug#12327).
6258 Be more systematic about preserving errno whenever a signal
6259 handler returns, even if it's not in the main thread. Do this by
6260 renaming signal handlers to distinguish between signal delivery
6261 and signal handling. All uses changed.
6262 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6263 * data.c (deliver_arith_signal): Rename from arith_error.
6264 * dispnew.c (deliver_window_change_signal): Rename from
6265 window_change_signal.
6266 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6267 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6268 * keyboard.c (deliver_input_available_signal): Rename from
6269 input_available_signal.
6270 (deliver_user_signal): Rename from handle_user_signal.
6271 (deliver_interrupt_signal): Rename from interrupt_signal.
6272 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6273 (deliver_child_signal): Rename from sigchld_handler.
6274 * atimer.c (handle_alarm_signal):
6275 * data.c (handle_arith_signal):
6276 * dispnew.c (handle_window_change_signal):
6277 * emacs.c (handle_fatal_signal, handle_danger_signal):
6278 * keyboard.c (handle_input_available_signal):
6279 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6280 * process.c (handle_pipe_signal, handle_child_signal):
6281 New functions, with the actual signal-handling code taken from the
6282 original respective signal handlers, sans the sporadic attempts to
6283 preserve errno, since that's now done by handle_on_main_thread.
6284 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6285 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6286 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6287 Move to sysdep.c.
6288 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6289 Move initialization of main_thread to sysdep.c's init_signals.
6290 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6291 our usage, and simplifies the mainline code.
6292 (record_child_status_change): New static function, as a helper
6293 for handle_child_signal, and with most of the old child handler's
6294 contents.
6295 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6296 (handle_child_signal): Use the above.
6297 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6298 Moved here from emacs.c.
6299 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6300 code moved here from emacs.c's main function.
6301 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
6302 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6303 This lets callers save and restore errno properly.
6304
6305 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6306
6307 Remove redundant or unused things here and there.
6308 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6309 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6310 * editfns.c (Fcompare_buffer_substrings): Likewise.
6311 * frame.h (struct terminal, struct font_driver_list):
6312 Remove redundant declarations.
6313 * window.h (Qleft, Qright): Likewise.
6314
6315 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6316
6317 Do not mark objects from deleted buffers, windows and frames.
6318 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6319 (mark_object): Likewise for windows and frames.
6320
6321 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6322
6323 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6324 buffer_defaults and buffer_local_symbols as valid objects.
6325 Return special value to denote them.
6326
6327 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6328
6329 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6330 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6331 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6332 (file_name_absolute_p, Fsubstitute_in_file_name):
6333 (check_executable, check_writable, Ffile_accessible_directory_p)
6334 (Fset_file_selinux_context, Fdefault_file_modes)
6335 (Finsert_file_contents, choose_write_coding_system)
6336 (Fwrite_region, build_annotations, a_write, e_write)
6337 (Fdo_auto_save):
6338 * filelock.c (boot_time_initialized, get_boot_time)
6339 (get_boot_time_1, lock_file_1, within_one_second):
6340 * floatfns.c (in_float):
6341 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6342 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6343 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6344 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6345 * window.c (compare_window_configurations):
6346 Use bool for booleans.
6347 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6348 (Fdefault_file_modes): Now mode_t, not int, for modes.
6349 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6350 (internal_delete_file): Now returns void, not a (boolean) int,
6351 since nobody was looking at the return value.
6352 * lisp.h, window.h: Adjust to above API changes.
6353
6354 * xdisp.c (set_message): Simplify and reindent last change.
6355
6356 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
6357
6358 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6359
6360 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6361
6362 * eval.c (call_debugger): Make the function non-static so that we
6363 can call it from set_message.
6364
6365 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6366 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6367
6368 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6369
6370 Give more-useful info on a fatal error (Bug#12328).
6371 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6372 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6373 of doing the work ourselves.
6374 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6375 do most of the work.
6376 (fatal_error_backtrace): New function, taken from the guts
6377 of the old fatal_error_signal, but with a new option to output
6378 a backtrace.
6379 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6380 info about the signal than just its number.
6381 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6382 * sysdep.c: Include <execinfo.h>
6383 (emacs_backtrace): New function, taken partly from the previous
6384 code of the 'die' function.
6385 (emacs_abort): Call fatal_error_backtrace rather than abort.
6386
6387 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6388
6389 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6390 eager (load-time) macro-expansion.
6391 * lisp.mk (lisp): Add macroexp.
6392
6393 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6394
6395 Simplify redefinition of 'abort' (Bug#12316).
6396 Do not try to redefine the 'abort' function. Instead, redo
6397 the code so that it calls 'emacs_abort' rather than 'abort'.
6398 This removes the need for the NO_ABORT configure-time macro
6399 and makes it easier to change the abort code to do a backtrace.
6400 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6401 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6402 Remove; sysdep.c's emacs_abort now takes its place.
6403 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6404 'abort' changed to use 'emacs_abort'.
6405 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6406 (abort) [!defined abort]: Rename to ...
6407 (emacs_abort): ... new name.
6408 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6409 the place of the old 'abort' in emacs.c.
6410 * w32.c, w32fns.c (abort): Do not #undef.
6411 * w32.c (emacs_abort): Rename from w32_abort.
6412
6413 2012-09-04 Eli Zaretskii <eliz@gnu.org>
6414
6415 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6416 offsets[j].dv, since the y axis of the screen coordinates points
6417 down, while the y axis of the font definition coordinates points
6418 up. This fixes display of Arabic diacritics such as KASRA and
6419 KASRATAN. (Bug#11860)
6420
6421 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6422
6423 Be more systematic about _setjmp vs setjmp.
6424 * alloc.c (test_setjmp, mark_stack):
6425 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6426 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6427 (png_load, my_error_exit, jpeg_load):
6428 * process.c (send_process_trap, send_process):
6429 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6430 The underscored versions are up to 30x faster on some hosts.
6431 Formerly, the code used setjmp+longjmp sometimes and
6432 _setjmp+_longjmp at other times, with no particular reason to
6433 prefer setjmp+longjmp.
6434
6435 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6436
6437 Fix minor problem found by static checking.
6438 * buffer.c (Fdelete_all_overlays): Return nil.
6439
6440 2012-09-03 Martin Rudalics <rudalics@gmx.at>
6441
6442 * buffer.c (Fdelete_all_overlays): New function.
6443
6444 2012-09-03 Chong Yidong <cyd@gnu.org>
6445
6446 * gtkutil.c: Add extern decl for Qxft.
6447
6448 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6449
6450 * emacs.c, eval.c: Use bool for boolean.
6451 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6452 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6453 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6454 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6455 (main, decode_env_path, Fdaemon_initialized):
6456 * eval.c (call_debugger, Finteractive_p, interactive_p):
6457 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6458 (maybe_call_debugger, Fbacktrace):
6459 * process.c (read_process_output, exec_sentinel):
6460 Use bool for booleans.
6461 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6462 All callers changed.
6463 * eval.c (interactive_p): Omit always-true boolean argument
6464 EXCLUDE_SUBRS_P. All callers changed.
6465 * dispextern.h, lisp.h: Reflect above API changes.
6466 * firstfile.c (dummy): Use the address of 'main', whose signature
6467 won't change, instead of the address of 'initialize', whose
6468 signature just changed from int to bool.
6469 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6470 * msdos.c (fatal_error_in_progress): ... from here.
6471 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6472 of incrementing it.
6473 (redisplay_internal, unwind_redisplay): Simply clear
6474 REDISPLAYING_P when unwinding, instead of saving its previous,
6475 always-false value and then restoring it.
6476
6477 Clean up some extern decls.
6478 Mostly, this hoists extern decls out of .c files and into .h files.
6479 That way, we're more likely to catch errors if the interfaces change.
6480 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6481 declare xg_mark_data.
6482 * dispextern.h (x_frame_parm_handlers):
6483 * font.h (Qxft):
6484 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6485 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6486 (Qultra_bold, Qoblique, Qitalic):
6487 Move extern decl here from .c file.
6488 * alloc.c (xg_mark_data) [USE_GTK]:
6489 * doc.c (Qclosure):
6490 * eval.c (Qlexical_binding):
6491 * fns.c (time) [!HAVE_UNISTD_H]:
6492 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6493 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6494 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6495 * lread.c (Qinternal_interpreter_environment):
6496 * minibuf.c (Qbuffer):
6497 * process.c (QCfamily, QCfilter):
6498 * widget.c (free_frame_faces):
6499 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6500 * xfont.c (x_clear_errors):
6501 * xterm.c (x_frame_parm_handlers):
6502 Remove now-redundant extern decls.
6503 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6504 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6505 Now static.
6506 * xfaces.c: Remove unnecessary static decls.
6507 * xterm.c (updating_frame): Remove decl of nonexistent object.
6508
6509 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6510 when building globals.h, as the objects that are not built on
6511 this host are not needed to compile C files on this host.
6512
6513 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6514
6515 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6516
6517 * frame.h: Add missing prototype for x_wm_set_size_hint.
6518
6519 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6520
6521 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6522 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6523 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6524 (Fsubstitute_command_keys):
6525 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6526 (save_excursion_save, save_excursion_restore)
6527 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6528 (format_time_string, general_insert_function)
6529 (make_buffer_string, make_buffer_string_both)
6530 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6531 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6532 (copy_text, insert_1, insert_1_both, insert_from_string)
6533 (insert_from_string_before_markers, insert_from_string_1)
6534 (insert_from_buffer, insert_from_buffer_1, replace_range)
6535 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6536 (del_range_2, modify_region):
6537 * intervals.c (intervals_equal, balance_possible_root_interval)
6538 (adjust_intervals_for_insertion, merge_properties_sticky)
6539 (graft_intervals_into_buffer, lookup_char_property)
6540 (adjust_for_invis_intang, set_point_both)
6541 (get_property_and_range, compare_string_intervals)
6542 (set_intervals_multibyte_1, set_intervals_multibyte):
6543 * keyboard.c (decode_timer):
6544 Use bool for boolean.
6545 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6546 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6547
6548 2012-09-02 Chong Yidong <cyd@gnu.org>
6549
6550 * keymap.c (push_key_description): Print M-TAB as C-M-i
6551 (Bug#11758).
6552
6553 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
6554
6555 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6556 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6557 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6558 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6559 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6560 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6561 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6562
6563 2012-09-01 Eli Zaretskii <eliz@gnu.org>
6564
6565 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6566 more than one grapheme cluster passed to the shaper: compute the
6567 offset adjustment values separately for each cluster. (Bug#11860)
6568
6569 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6570 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6571 about implicit conversions from integer to pointer.
6572
6573 2012-09-01 Daniel Colascione <dancol@dancol.org>
6574
6575 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6576 system used too early.
6577
6578 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6579
6580 Better seed support for (random).
6581 * emacs.c (main): Call init_random.
6582 * fns.c (Frandom): Set the seed from a string argument, if given.
6583 Remove long-obsolete Gentzel cruft.
6584 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6585 (init_random): New function.
6586
6587 2012-09-01 Daniel Colascione <dancol@dancol.org>
6588
6589 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6590 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6591 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6592 x_wm_set_size_hint, x_query_colors, x_real_positions,
6593 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6594 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6595 all of which have been moved to common code.
6596
6597 * xfaces.c: Include TERM_HEADER instead of listing all possible
6598 window-system headers.
6599
6600 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6601 to match header.
6602
6603 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6604 directly accessing frame internals.
6605
6606 * w32font.h: Include font.h. Define syms_of_w32font and
6607 globals_of_w32font.
6608
6609 * process.c: Include TERM_HEADER instead of listing all possible
6610 window-system headers.
6611
6612 * nsterm.h: Remove declarations now in frame.h.
6613 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
6614
6615 * menu.c: Include TERM_HEADER instead of listing all possible
6616 window-system headers.
6617
6618 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6619 window system.
6620
6621 * keyboard.c: Include TERM_HEADER instead of listing all possible
6622 window-system headers.
6623
6624 * image.c: Include TERM_HEADER instead of listing all possible
6625 window-system headers. Declare Vlibrary_cache when compiling for
6626 Windows.
6627
6628 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6629 window system declarations.
6630
6631 * frame.h: Move common functions here: set_frame_menubar,
6632 x_set_window_size, x_sync, x_get_focus_frame,
6633 x_set_mouse_position, x_set_mouse_pixel_position,
6634 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6635 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6636 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6637 x_activate_menubar, x_real_positions, x_bitmap_icon,
6638 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6639 and x_query_colors.
6640
6641 * frame.c: Include TERM_HEADER instead of listing all possible
6642 window-system headers.
6643
6644 * font.c: Include TERM_HEADER instead of listing all possible
6645 window-system headers.
6646
6647 * emacs.c: Include TERM_HEADER.
6648
6649 * dispnew.c: Include TERM_HEADER instead of listing all possible
6650 window-system headers.
6651
6652 * ccl.h: Include character.h.
6653
6654 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6655 the current window system; include in list of objects to link into
6656 Emacs.
6657
6658 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6659
6660 Remove mark_ttys function and fix tty_display_info initialization.
6661 * lisp.h (mark_ttys): Remove prototype.
6662 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6663 to mark_ttys because all possible values of 'top_frame' slot are
6664 the frames which are reachable from Vframe_list.
6665 * term.c (mark_ttys): Remove.
6666 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6667
6668 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6669
6670 Change struct frame bitfields from unsigned char to unsigned.
6671 * frame.h (struct frame): Change type of 'display_preempted',
6672 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6673 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6674 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6675 bitfields from unsigned char to unsigned.
6676
6677 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6678
6679 Remove unused member of struct x_output and struct w32_output.
6680 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6681 * w32term.h (struct w32_output): Likewise.
6682
6683 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6684
6685 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6686 does not become zero (Bug#12234).
6687
6688 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6689
6690 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6691 for GCC 4.7.1 x86-64.
6692
6693 2012-08-30 Glenn Morris <rgm@gnu.org>
6694
6695 * lread.c (init_lread): For out-of-tree builds, only add the
6696 source directory's site-lisp dir to the load-path if it exists,
6697 consistent with in-tree builds. (Bug#12302)
6698
6699 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6700
6701 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
6702 button_values to NULL. Call setStykeMask so dialogs get a close button.
6703 (windowShouldClose:): Set window_closed.
6704 (dealloc): New member, free button_values.
6705 (process_dialog:): Make member function. Remove window argument,
6706 replace window with self. Count buttons and allocate and store values
6707 in button_values.
6708 (addButton:value:row:): value is int with the name tag. Call setTag
6709 with tag. Remove return self, declare return value as void.
6710 (addString:row:): Remove return self, declare return value as void.
6711 (addSplit): Remove return self, declare return value as void.
6712 (clicked:): Remove return self, declare return value as void.
6713 Set dialog_return to button_values[seltag]. Code formatting change.
6714 (initFromContents:isQuestion:): Adjust call to process_dialog.
6715 Code formatting change.
6716 (timeout_handler:): Set timer_fired to YES.
6717 (runDialogAt:): Set timer_fired to NO.
6718 Handle click on close button as quit.
6719
6720 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6721 Add window_closed and button_values. Add void as return value for
6722 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6723 Add process_dialog as new member.
6724
6725 2012-08-28 Eli Zaretskii <eliz@gnu.org>
6726
6727 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6728 is not one of the heaps we manage. (Bug#12242)
6729
6730 2012-08-28 Glenn Morris <rgm@gnu.org>
6731
6732 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6733
6734 2012-08-28 Martin Rudalics <rudalics@gmx.at>
6735
6736 * window.c (Fset_window_configuration): Remove handling of
6737 auto-buffer-name window parameter. Install revision of reverted
6738 fix.
6739
6740 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6741
6742 Do not allow to set major mode for a dead buffer.
6743 * buffer.c (Fset_buffer_major_mode): Signal an error
6744 if the buffer is dead.
6745 (Fother_buffer, other_buffer_safely): Remove redundant
6746 nested declaration.
6747
6748 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6749
6750 Always use set_buffer_if_live to restore original buffer at unwind.
6751 * buffer.h (record_unwind_current_buffer): New function.
6752 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6753 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6754 * undo.c, window.c: Adjust users.
6755 * buffer.c (set_buffer_if_live): Fix comment.
6756
6757 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6758
6759 Fix usage of set_buffer_internal.
6760 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6761 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6762 * coding.c (decode_coding): Omit redundant test.
6763 * fileio.c (decide_coding_unwind): Likewise.
6764 * fns.c (secure_hash): Likewise.
6765 * insdel.c (modify_region): Likewise.
6766 * keyboard.c (command_loop_1): Likewise.
6767 * print.c (PRINTFINISH): Likewise.
6768 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6769
6770 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6771
6772 * dispnew.c: Use bool for boolean.
6773 (frame_garbaged, display_completed, delayed_size_change)
6774 (fonts_changed_p, add_window_display_history)
6775 (add_frame_display_history, verify_row_hash)
6776 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6777 (row_equal_p, realloc_glyph_pool)
6778 (allocate_matrices_for_frame_redisplay)
6779 (showing_window_margins_p)
6780 (adjust_frame_glyphs_for_frame_redisplay)
6781 (build_frame_matrix_from_leaf_window, make_current)
6782 (mirrored_line_dance, mirror_line_dance, update_frame)
6783 (update_window_tree, update_single_window)
6784 (check_current_matrix_flags, update_window, update_text_area)
6785 (update_window_line, set_window_update_flags, scrolling_window)
6786 (update_frame_1, scrolling, buffer_posn_from_coords)
6787 (do_pending_window_change, change_frame_size)
6788 (change_frame_size_1, sit_for):
6789 Use bool for boolean.
6790 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6791 and remove last int (actually boolean) argument, which was always 0.
6792 All callers changed.
6793 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6794 * dispextern.h (struct composition_it): Use bool for boolean.
6795 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6796 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6797 * dired.c (file_name_completion):
6798 Use bool for boolean. (This was missed in an earlier change.)
6799
6800 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6801
6802 * window.c (Fset_window_configuration): Revert first part of
6803 last change.
6804
6805 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
6806
6807 * nsterm.h (NSPanel): New class variable dialog_return.
6808
6809 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6810 Initialize dialog_return.
6811 (windowShouldClose:): Use stop instead of stopModalWithCode.
6812 (clicked:): Ditto, and also set dialog_return (Bug#12258).
6813 (timeout_handler:): Use stop instead of abortModal. Send a dummy
6814 event.
6815 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
6816 modal loop returns.
6817
6818 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6819
6820 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6821 * composite.c (find_composition, composition_gstring_p)
6822 (composition_reseat_it, find_automatic_composition):
6823 * data.c (let_shadows_buffer_binding_p)
6824 (let_shadows_global_binding_p, set_internal, make_blv)
6825 (Fmake_variable_buffer_local, Fmake_local_variable)
6826 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6827 (cons_to_signed, arith_driver):
6828 * dbusbind.c (xd_in_read_queued_messages):
6829 * dired.c (directory_files_internal, file_name_completion):
6830 Use bool for booleans.
6831 * dired.c (file_name_completion):
6832 * process.h (fd_callback):
6833 Omit int (actually boolean) argument. It wasn't being used.
6834 All uses changed.
6835 * composite.h, lisp.h: Reflect above API changes.
6836
6837 * cmds.c, coding.c: Use bool for booleans.
6838 * cmds.c (move_point, Fself_insert_command):
6839 * coding.h (struct composition status, struct coding_system):
6840 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6841 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6842 (emacs_mule_char, decode_coding_emacs_mule)
6843 (encode_coding_emacs_mule, detect_coding_iso_2022)
6844 (decode_coding_iso_2022, encode_invocation_designation)
6845 (encode_designation_at_bol, encode_coding_iso_2022)
6846 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6847 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6848 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6849 (encode_coding_raw_text, detect_coding_charset)
6850 (decode_coding_charset, encode_coding_charset, detect_eol)
6851 (detect_coding, get_translation_table, produce_chars)
6852 (consume_chars, reused_workbuf_in_use)
6853 (make_conversion_work_buffer, code_conversion_save)
6854 (decode_coding_object, encode_coding_object)
6855 (detect_coding_system, char_encodable_p)
6856 (Funencodable_char_position, code_convert_region)
6857 (code_convert_string, code_convert_string_norecord)
6858 (Fset_coding_system_priority):
6859 * fileio.c (Finsert_file_contents):
6860 Use bool for booleans.
6861 * coding.h, lisp.h: Reflect above API changes.
6862 * coding.c: Remove unnecessary static function decls.
6863 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6864 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6865 not a boolean 'int', since callers never look at the return value.
6866 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6867 * coding.h (decoding_buffer_size, encoding_buffer_size)
6868 (emacs_mule_string_char): Remove unused extern decls.
6869 (struct iso_2022_spec, struct coding_system):
6870 Use 'unsigned int : 1' for boolean fields, since there's more than one.
6871 (struct emacs_mule_spec): Remove unused field 'full_support'.
6872 All initializations removed.
6873 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6874
6875 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6876
6877 Fix spare memory change (Bug#12286).
6878 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6879 (valid_lisp_object_p): Likewise.
6880
6881 2012-08-27 Martin Rudalics <rudalics@gmx.at>
6882
6883 * window.c (Fset_window_configuration): Record any window's old
6884 buffer if it's replaced (see Bug#8789). If the new current
6885 buffer doesn't appear in the selected window, go to its old
6886 point (Bug#12208).
6887
6888 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
6889
6890 Special MEM_TYPE_SPARE to denote reserved memory.
6891 * alloc.c (enum mem_type): New memory type.
6892 (refill_memory_reserve): Use new type for spare memory.
6893 This prevents live_cons_p and live_string_p from incorrect
6894 detection of uninitialized objects from spare memory as live.
6895
6896 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
6897
6898 Spelling fixes.
6899 * Makefile.in (.PHONY): versioclean -> versionclean.
6900
6901 Remove unused external symbols.
6902 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6903 * window.c (Qwindow_valid_p, decode_valid_window):
6904 Now static, not extern.
6905 * data.c (Qinterval): Remove; unused.
6906 (syms_of_data): Do not define 'interval'.
6907 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6908 * window.h (decode_valid_window):
6909 Remove decls.
6910
6911 * character.c, charset.c, chartab.c: Use bool for booleans.
6912 * character.c (lisp_string_width, string_count_byte8)
6913 (string_escape_byte8):
6914 * charset.c (charset_map_loaded, load_charset_map, read_hex):
6915 (load_charset_map_from_file, map_charset_chars)
6916 (Fdefine_charset_internal, define_charset_internal)
6917 (Fdeclare_equiv_charset, find_charsets_in_text)
6918 (Ffind_charset_region, char_charset, Fiso_charset):
6919 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6920 (sub_char_table_set, sub_char_table_set_range)
6921 (char_table_set_range, optimize_sub_char_table)
6922 (map_sub_char_table):
6923 Use bool for boolean.
6924 * character.c (str_to_unibyte): Omit last boolean argument; it was
6925 always 0. All callers changed.
6926 * character.h, charset.h: Adjust to match previous changes.
6927 * character.h (char_printable_p): Remove decl of nonexistent function.
6928 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6929 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6930 are all boolean, so make them single-bit bitfields.
6931
6932 * lisp.h (ASET): Remove attempt to detect side effects.
6933 It was meant to be temporary and it often doesn't work,
6934 because when IDX has side effects the behavior of IDX==IDX
6935 is undefined. See Stefan Monnier in
6936 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
6937
6938 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
6939
6940 * lisp.h (functionp): New function (extracted from Ffunctionp).
6941 (FUNCTIONP): Use it.
6942 * eval.c (Ffunctionp): Use it.
6943
6944 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6945
6946 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
6947 as that's faster and simpler than static storage. Don't bother
6948 with the g_main_context_query overhead if g_main_context_pending
6949 says no events are pending.
6950 (gfds, gfds_size): Remove these static vars.
6951 (xgselect_initialize): Remove; no longer needed.
6952 All uses and decls removed.
6953
6954 * emacs.c (fatal_error_signal_hook): Remove.
6955 All uses removed. This leftover from old code was always 0.
6956
6957 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
6958 * casefiddle.c (casify_object, casify_region):
6959 * casetab.c (set_case_table):
6960 * category.c, category.h (word_boundary_p):
6961 * category.h (CHAR_HAS_CATEGORY):
6962 Use bool for booleans, instead of int.
6963
6964 2012-08-25 Eli Zaretskii <eliz@gnu.org>
6965
6966 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
6967
6968 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
6969
6970 On assertion failure, print backtrace if available.
6971 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
6972 (die) [ENABLE_CHECKING]: Print a backtrace if available.
6973 * Makefile.in (LIB_EXECINFO): New macro.
6974 (LIBES): Use it.
6975
6976 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
6977 * bytecode.c (exec_byte_code):
6978 * callint.c (check_mark, Fcall_interactively):
6979 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
6980 (getenv_internal, sync_process_alive, call_process_exited):
6981 * lisp.h (USE_SAFE_ALLOCA):
6982 Use bool for booleans, instead of int.
6983 * lisp.h, process.h: Adjust prototypes to match above changes.
6984 * callint.c (Fcall_interactively): Don't assume the mark's
6985 offset fits in 'int'.
6986
6987 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
6988
6989 * buffer.c, buffer.h: Use bool for boolean.
6990 * buffer.c (reset_buffer_local_variables)
6991 (buffer_lisp_local_variables, Fset_buffer_modified_p)
6992 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
6993 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
6994 (overlay_touches_p, overlay_strings, Foverlay_put)
6995 (report_overlay_modification, call_overlay_mod_hooks):
6996 (mmap_enlarge, mmap_set_vars):
6997 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
6998 Use bool for booleans, instead of int.
6999 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7000 since the 1-or-0 return value is always ignored anyway.
7001 (mmap_initialized_p):
7002 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7003 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7004
7005 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7006
7007 * bidi.c: Use bool for boolean.
7008 This is a bit more readable, and makes the text segment of bidi.o
7009 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7010 Presumably it's faster too.
7011 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7012 Now bool.
7013 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7014 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7015 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7016 (bidi_explicit_dir_char, bidi_level_of_next_char)
7017 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7018 Use bool for booleans, instead of int.
7019 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7020 (bidi_unshelve_cache): Adjust decls to match code.
7021
7022 2012-08-23 Martin Rudalics <rudalics@gmx.at>
7023
7024 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7025 argument.
7026
7027 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7028
7029 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7030 * atimer.h: Include <stdbool.h>.
7031
7032 2012-08-22 Dan Nicolaescu <dann@gnu.org>
7033
7034 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7035 compile time tests instead of run time tests on systems that do
7036 not use them.
7037 (FRAME_MAC_P): Remove leftover from deleted code.
7038 * frame.c (syms_of_frame): Remove leftover from deleted code.
7039
7040 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7041
7042 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7043
7044 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7045
7046 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7047 Otherwise, the compiler complains about (A?B:C) where B is void
7048 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
7049 (fontset_add): Return void, for FONTSET_ADD.
7050
7051 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7052
7053 * alloc.c: Use bool for booleans.
7054 (gc_in_progress, abort_on_gc)
7055 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7056 (dont_register_blocks) [GC_MALLOC_CHECK]:
7057 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7058 (check_string_bytes, make_specified_string, memory_full)
7059 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7060 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7061 (mark_stack, valid_pointer_p, make_pure_string)
7062 (Fgarbage_collect, survives_gc_p, gc_sweep):
7063 Use bool for booleans, instead of int.
7064 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7065 Remove unused local.
7066 * alloc.c (PURE_POINTER_P):
7067 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7068 * editfns.c (Fformat):
7069 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7070 (Fdo_auto_save):
7071 * fns.c (sweep_weak_table):
7072 * lisp.h (suppress_checking, push_message, survives_gc_p)
7073 (make_pure_string, gc_in_progress, abort_on_gc):
7074 * lread.c (readchar, read1):
7075 * print.c (Fprin1_to_string):
7076 * xdisp.c (push_message):
7077 Use bool for booleans affected directly or indirectly by
7078 alloc.c's changes.
7079
7080 Make recently-introduced setters macros.
7081 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7082 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7083 (set_fontset_default, set_fontset_fallback): Rename from their
7084 upper-case counterparts, and make them functions rather than macros.
7085 This is more consistent with the other recently-introduced setters.
7086 These don't need to be inline, since they're local.
7087
7088 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7089
7090 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7091 the loop (Bug#12247).
7092
7093 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7094
7095 * lisp.h (vcopy): Use memcpy rather than our own loop.
7096 This fixes a performance regression introduced by the recent
7097 addition of vcopy. This means 'vcopy' will need to be modified
7098 for a copying collector, but that's OK. Also, tighten the
7099 checking in the assertion.
7100
7101 2012-08-21 Eli Zaretskii <eliz@gnu.org>
7102
7103 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7104 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7105 non-base glyph for the width of the base character, according to
7106 what x_draw_composite_glyph_string_foreground expects.
7107 Generate WADJUST value according to composition_gstring_width's
7108 expectations, to produce correct width of the composed character.
7109 Reverse the sign of the DU offset produced by ScriptPlace.
7110
7111 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7112
7113 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7114
7115 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7116
7117 Avoid direct writes to contents member of struct Lisp_Vector.
7118 * lisp.h (vcopy): New function to copy data into vector.
7119 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7120 * fns.c (Ffillarray): Use ASET.
7121 * keyboard.c (timer_check_2): Use AREF and ASET.
7122 (append_tool_bar_item, Frecent_keys): Use vcopy.
7123 * lread.c (read_vector): Use ASET.
7124 * msdos.c (Frecent_doskeys): Use vcopy.
7125 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7126 (Finternal_merge_in_global_face): Use ASET and vcopy.
7127 * xfont.c (xfont_list_pattern): Likewise.
7128
7129 2012-08-21 Martin Rudalics <rudalics@gmx.at>
7130
7131 * window.c (Fwindow_point): For the selected window always return
7132 the position of its buffer's point.
7133 (Fset_window_point): For the selected window always go in its
7134 buffer to the specified position.
7135
7136 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7137
7138 Setter macros for fontsets.
7139 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7140 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7141 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7142 Adjust users.
7143
7144 2012-08-20 Glenn Morris <rgm@gnu.org>
7145
7146 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7147 Don't assume that `ln -f' works.
7148
7149 2012-08-20 Eli Zaretskii <eliz@gnu.org>
7150
7151 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7152 and later about non-assignments with no effect. See discussion at
7153 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7154 details.
7155
7156 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7157
7158 Inline setter functions for Lisp_Objects slots of struct specbinding.
7159 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7160 Adjust users.
7161
7162 2012-08-20 Martin Rudalics <rudalics@gmx.at>
7163
7164 * window.c (select_window): Always make selected window's buffer
7165 current.
7166
7167 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7168
7169 Use AREF and ASET for docstrings of category tables.
7170 * category.h (CATEGORY_DOCSTRING): Use AREF.
7171 (SET_CATEGORY_DOCSTRING): Use ASET.
7172 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7173
7174 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7175
7176 Inline setter functions for hash table members.
7177 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7178 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7179 (set_hash_key_and_value, set_hash_index, set_hash_next)
7180 (set_hash_hash): New functions.
7181 * charset.c, fns.c: Adjust users.
7182
7183 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7184
7185 Inline getter and setter functions for per-buffer values.
7186 * buffer.h (per_buffer_default, set_per_buffer_default)
7187 (per_buffer_value, set_per_buffer_value): New functions.
7188 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7189 * buffer.c, data.c: Adjust users.
7190
7191 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
7192
7193 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7194
7195 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7196
7197 Rely on <config.h> + <unistd.h> to declare 'environ',
7198 as gnulib does this if the system doesn't.
7199 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7200 Remove declaration. MS-Windows declares it on stdlib.h which is
7201 included by conf_post.h.
7202 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7203 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7204 * vm-limit.c: Include <unistd.h>, for 'environ'.
7205
7206 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7207 (start_of_data): Remove decl; mem-limits.h provides it.
7208
7209 * xdisp.c (handle_invisible_prop): Make it a bit faster
7210 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7211
7212 2012-08-19 Chong Yidong <cyd@gnu.org>
7213
7214 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7215 ends (Bug#3874).
7216
7217 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7218
7219 * .gdbinit: Use call instead of set when calling a function in the
7220 inferior.
7221
7222 * data.c (set_internal): Don't use set_blv_found.
7223 (Fkill_local_variable): Likewise.
7224
7225 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7226
7227 * nsfont.m (ns_ascii_average_width): Ensure the string
7228 ascii_printable is initialized with a null-terminated character
7229 array. Otherwise, it can contain undesired extra characters.
7230
7231 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7232
7233 port new setting code to Sun C 5.8 2005/10/13
7234 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7235 Return void, not Lisp_Object. Otherwise, the compiler
7236 complains about (A?B:C) where B is void and C is Lisp_Object
7237 when compiling CHAR_TABLE_SET, due to the recent change to
7238 the API of sub_char_table_set_contents.
7239
7240 2012-08-18 Chong Yidong <cyd@gnu.org>
7241
7242 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7243 for the string case (Bug#3874).
7244
7245 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7246
7247 * buffer.h (BSET): Remove (Bug#12215).
7248 Replace all uses with calls to new setter functions.
7249 (bset_bidi_paragraph_direction, bset_case_canon_table)
7250 (bset_case_eqv_table, bset_directory, bset_display_count)
7251 (bset_display_time, bset_downcase_table)
7252 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7253 (bset_last_selected_window, bset_local_var_alist)
7254 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7255 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7256 (bset_width_table):
7257 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7258 (bset_auto_fill_function, bset_auto_save_file_format)
7259 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7260 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7261 (bset_cache_long_line_scans, bset_case_fold_search)
7262 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7263 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7264 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7265 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7266 (bset_header_line_format, bset_indicate_buffer_boundaries)
7267 (bset_indicate_empty_lines, bset_invisibility_spec)
7268 (bset_left_fringe_width, bset_major_mode, bset_mark)
7269 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7270 (bset_name, bset_overwrite_mode, bset_pt_marker)
7271 (bset_right_fringe_width, bset_save_length)
7272 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7273 (bset_scroll_up_aggressively, bset_selective_display)
7274 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7275 (bset_word_wrap, bset_zv_marker):
7276 * category.c (bset_category_table):
7277 * syntax.c (bset_syntax_table):
7278 New setter functions.
7279
7280 * process.h (PSET): Remove (Bug#12215).
7281 Replace all uses with calls to new setter functions.
7282 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7283 (PROCESS_INLINE): New macro.
7284 (pset_childp): New setter function.
7285 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7286 * process.c (PROCESS_INLINE):
7287 Define to EXTERN_INLINE, so that the corresponding functions
7288 are compiled into code.
7289 (pset_buffer, pset_command, pset_decode_coding_system)
7290 (pset_decoding_buf, pset_encode_coding_system)
7291 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7292 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7293 (pset_type, pset_write_queue): New setter functions.
7294
7295 * window.h (WSET): Remove (Bug#12215).
7296 Replace all uses with calls to new setter functions.
7297 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7298 (WINDOW_INLINE): New macro.
7299 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7300 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7301 (wset_total_lines, wset_vertical_scroll_bar)
7302 (wset_window_end_pos, wset_window_end_valid)
7303 (wset_window_end_vpos): New setter functions.
7304 * window.c (WINDOW_INLINE):
7305 Define to EXTERN_INLINE, so that the corresponding functions
7306 are compiled into code.
7307 (wset_combination_limit, wset_dedicated, wset_display_table)
7308 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7309 (wset_new_normal, wset_new_total, wset_next_buffers)
7310 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7311 (wset_prev_buffers, wset_right_fringe_width)
7312 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7313 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7314 (wset_window_parameters):
7315 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7316 (wset_column_number_displayed, wset_region_showing):
7317 New setter functions.
7318
7319 * termhooks.h (TSET): Remove (Bug#12215).
7320 Replace all uses with calls to new setter functions.
7321 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7322 (TERMHOOKS_INLINE): New macro.
7323 (tset_charset_list, tset_selection_alist): New setter functions.
7324 * terminal.c (TERMHOOKS_INLINE):
7325 Define to EXTERN_INLINE, so that the corresponding functions
7326 are compiled into code.
7327 (tset_param_alist): New setter function.
7328
7329 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7330
7331 * keyboard.h (KSET): Remove (Bug#12215).
7332 Replace all uses with calls to new setter functions.
7333 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7334 (KEYBOARD_INLINE): New macro.
7335 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7336 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7337 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7338 New setter functions.
7339 * keyboard.c (KEYBOARD_INLINE):
7340 Define to EXTERN_INLINE, so that the corresponding functions
7341 are compiled into code.
7342 (kset_echo_string, kset_kbd_queue)
7343 (kset_keyboard_translate_table, kset_last_prefix_arg)
7344 (kset_last_repeatable_command, kset_local_function_key_map)
7345 (kset_overriding_terminal_local_map, kset_real_last_command)
7346 (kset_system_key_syms): New setter functions.
7347
7348 * frame.h (FSET): Remove (Bug#12215).
7349 Replace all uses with calls to new setter functions.
7350 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7351 (FRAME_INLINE): New macro.
7352 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7353 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7354 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7355 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7356 (fset_param_alist, fset_root_window, fset_scroll_bars)
7357 (fset_selected_window, fset_title, fset_tool_bar_items)
7358 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7359 * frame.c (FRAME_INLINE):
7360 Define to EXTERN_INLINE, so that the corresponding functions
7361 are compiled into code.
7362 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7363
7364 A few more naming-convention fixes for getters and setters.
7365 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7366 and rename from buffer_overlays_set_before.
7367 (set_buffer_overlays_after): Move here from buffer.h, and rename
7368 from buffer_overlays_set_after.
7369 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7370 All uses changed.
7371 (set_buffer_intervals): Rename from buffer_set_intervals.
7372 * intervals.c (set_interval_object): Move here from intervals.h,
7373 and rename from interval_set_object.
7374 (set_interval_left): Move here from intervals.h, and rename from
7375 interval_set_left.
7376 (set_interval_right): Move here from intervals.h, and rename from
7377 interval_set_right.
7378 (copy_interval_parent): Move here from intervals.h, and rename from
7379 interval_copy_parent.
7380 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7381 (set_interval_plist): Rename from interval_set_plist.
7382 Return void, not Lisp_Object, since no caller uses the result.
7383 * lisp.h (string_intervals): Rename from string_get_intervals.
7384 (set_string_intervals): Rename from string_set_intervals.
7385
7386 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7387 (set_char_table_contents): Rename from char_table_set_contents.
7388 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
7389 All uses changed. See the end of
7390 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7391
7392 * lisp.h (CSET): Remove (Bug#12215).
7393 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7394 (set_char_table_purpose): New functions,
7395 replacing CSET. All uses changed. For example, replace
7396 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
7397 "set_char_table_parent (char_table, parent);".
7398 The old version was confusing because it used the same name
7399 'parent' for two different things.
7400
7401 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7402
7403 Functions to get and set Lisp_Object fields of buffer-local variables.
7404 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7405 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7406 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7407 * data.c, eval.c, frame.c: Adjust users.
7408
7409 2012-08-17 Chong Yidong <cyd@gnu.org>
7410
7411 * xfaces.c (merge_face_vectors): If the target font specfies a
7412 font spec, make the font's attributes take precedence over
7413 directly-specified attributes.
7414 (merge_face_ref): Recognize :font.
7415
7416 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7417
7418 Do not use memcpy for copying intervals.
7419 * intervals.c (reproduce_interval): New function.
7420 (reproduce_tree, reproduce_tree_obj): Use it.
7421 (reproduce_tree_obj): Remove prototype.
7422
7423 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7424
7425 * lisp.h (duration_to_sec_usec): Remove unused decl.
7426
7427 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7428
7429 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7430 to an allocated instance of NSString, not to the class itself.
7431
7432 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
7433
7434 * makefile.w32-in (C_CTYPE_H): New macro.
7435 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7436 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7437 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7438
7439 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7440
7441 Use ASCII tests for character types.
7442 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7443 * xfns.c, xterm.c:
7444 Don't include <ctype.h>; was not needed.
7445 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7446 * sysdep.c, xfaces.c:
7447 Include <c-ctype.h> instead of <ctype.h>.
7448 * nsterm.m: Include <c-ctype.h>.
7449 * charset.c (read_hex):
7450 * doc.c (Fsnarf_documentation):
7451 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7452 (DRIVE_LETTER) [DOS_NT]:
7453 (Ffile_name_directory, Fexpand_file_name)
7454 (Fsubstitute_in_file_name):
7455 * font.c (font_parse_xlfd, font_parse_fcname):
7456 * frame.c (x_set_font_backend):
7457 * gtkutil.c (xg_get_font):
7458 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7459 * nsimage.m (hexchar):
7460 * nsterm.m (ns_xlfd_to_fontname):
7461 * sysdep.c (system_process_attributes):
7462 * xfaces.c (hash_string_case_insensitive):
7463 Use C-locale tests instead of locale-specific tests for character
7464 types, since we want the ASCII interpretation here, not the
7465 interpretation suitable for whatever happens to be the current locale.
7466
7467 2012-08-16 Martin Rudalics <rudalics@gmx.at>
7468
7469 Consistently check windows for validity/liveness
7470 (Bug#11984, Bug#12025, Bug#12026).
7471 * lisp.h (CHECK_VALID_WINDOW): New macro.
7472 * window.c (decode_window): Rename to decode_live_window.
7473 (decode_valid_window, Fwindow_valid_p): New functions.
7474 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7475 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7476 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7477 (Fwindow_prev_sibling, Fwindow_combination_limit)
7478 (Fset_window_combination_limit, Fwindow_use_time)
7479 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7480 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7481 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7482 (Fwindow_hscroll, Fset_window_hscroll)
7483 (Fwindow_redisplay_end_trigger)
7484 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7485 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7486 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7487 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7488 (Fwindow_end, Fset_window_point, Fset_window_start)
7489 (Fpos_visible_in_window_p, Fwindow_line_height)
7490 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7491 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7492 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7493 (Fset_window_parameter, Fwindow_display_table)
7494 (Fset_window_display_table, Fdelete_other_windows_internal)
7495 (Fset_window_buffer, Fset_window_new_total)
7496 (Fset_window_new_normal, Fdelete_window_internal)
7497 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7498 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7499 (Fwindow_scroll_bars): Check whether argument window is a valid or
7500 live window. Update doc-strings.
7501 (syms_of_window): New symbol Qwindow_valid_p.
7502 * keyboard.c (Fposn_at_x_y): Check whether argument
7503 frame_or_window denotes a valid window.
7504
7505 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7506
7507 Fix previous char table change.
7508 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7509 * chartab.c (optimize_sub_char_table): Likewise.
7510
7511 2012-08-16 Chong Yidong <cyd@gnu.org>
7512
7513 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7514
7515 * xfont.c (xfont_open):
7516 * xftfont.c (xftfont_open): Set the font's max_width field.
7517
7518 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7519 min_width to space_width and average_width to the average over
7520 printable ASCII characters.
7521 (ns_char_width): Code cleanup.
7522 (ns_ascii_average_width): New utility function.
7523
7524 * font.h (struct font): Update comments.
7525
7526 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7527
7528 Simple interface to set Lisp_Object fields of character tables.
7529 * lisp.h (CSET): New macro.
7530 (char_table_set_extras, char_table_set_contents)
7531 (sub_char_table_set_contents): New function.
7532 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7533 * syntax.c: Adjust users.
7534
7535 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7536
7537 * eval.c (eval_sub): Bind lexical-binding.
7538 * lread.c (Qlexical_binding): Make non-static.
7539
7540 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7541
7542 * nsmenu.m (popupSession): Remove.
7543 (pop_down_menu): Remove endModalSession.
7544 (timeout_handler:): New method.
7545 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7546 Call runModalForWindow. Check timer_fired when it returns.
7547 If not set, cancel timer and break out of loop.
7548 Otherwise loop again, with a new timeout.
7549
7550 * nsterm.m: Include fcntl.h if present.
7551 (fd_entry, t_readfds, inNsSelect): Remove.
7552 (select_writefds, select_valid, select_timeout, selfds)
7553 (select_mutex, apploopnr): Add.
7554 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7555 Otherwise call kbd_buffer_store_event.
7556 (ns_send_appdefined): Remove release of fd_entry.
7557 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7558 Increment and decrement apploopnr.
7559 (ns_select): If no file descriptors, just do a NSTimer.
7560 Otherwise copy read/write masks and start select thread (fd_handler).
7561 Start main loop and wait for application defined event.
7562 Inform select thread to stop selecting after main loop is exited.
7563 (ns_term_init): Create selfds pipe and set non-blocking.
7564 Initialize select_mutex. Start the select thread (fd_handler).
7565 (fd_handler:): Loop forever, wait for info from the main thread
7566 to either start or stop selecting. When select returns, send
7567 and appdefined event.
7568 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7569 If not call kbd_buffer_store_event.
7570
7571 * nsterm.h (EmacsApp): fd_handler takes id argument.
7572 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7573
7574 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7575
7576 2012-08-15 Eli Zaretskii <eliz@gnu.org>
7577
7578 * region-cache.c (move_cache_gap): Update gap_len using the actual
7579 growth of the boundaries array. Do not change cache_len.
7580 (Bug#12196)
7581
7582 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7583
7584 Generalize and cleanup font subsystem checks.
7585 * font.h (FONT_DEBUG, font_assert): Remove.
7586 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7587 Change font_assert to eassert. Use eassert where appropriate.
7588
7589 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7590
7591 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7592
7593 2012-08-15 Chong Yidong <cyd@gnu.org>
7594
7595 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7596 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7597 extract the font descriptor instead of just the font name.
7598 In that case, return a font spec instead of a string.
7599 (x_last_font_name): Move to this file from xfns.c.
7600
7601 * xfns.c (Fx_select_font): The return value can also be a font
7602 spec. Move x_last_font_name management to gtkutil.c.
7603
7604 * xfaces.c: Make font weight and style symbols non-static.
7605
7606 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7607
7608 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7609 (bug#12117).
7610
7611 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7612
7613 * alloc.c (Fgarbage_collect): Use plural form consistently.
7614
7615 2012-08-14 Eli Zaretskii <eliz@gnu.org>
7616
7617 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7618 iteration through the command loop. Fixes a problem whereby mouse
7619 movements are ignored until the first mouse click.
7620
7621 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7622
7623 Use bool, not int, for Lisp booleans.
7624 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7625 makes Emacs a bit smaller and presumably a bit faster.
7626 * lisp.h: Include <stdbool.h>.
7627 (struct Lisp_Boolfwd, defvar_bool):
7628 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7629 * regex.c [!emacs]: Include <stdbool.h>.
7630 (false, true): Remove; <stdbool.h> does this for us now.
7631
7632 2012-08-14 Chong Yidong <cyd@gnu.org>
7633
7634 * character.c (Fcharacterp): Doc fix (Bug#12076).
7635
7636 * data.c (Findirect_variable): Doc fix (Bug#11040).
7637
7638 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7639
7640 * editfns.c (Fformat): Doc fix (Bug#12059).
7641 (Fsave_current_buffer): Doc fix (Bug#11542).
7642
7643 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7644
7645 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7646 (bug#12022).
7647
7648 2012-08-14 Martin Rudalics <rudalics@gmx.at>
7649
7650 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7651 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7652 * minibuf.c (choose_minibuf_frame, read_minibuf):
7653 * w32fns.c (x_create_tip_frame):
7654 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7655 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7656
7657 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7658
7659 * intervals.c (offset_intervals): Remove obsolete comment.
7660
7661 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7662
7663 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7664
7665 2012-08-14 Gergely Risko <gergely@risko.hu>
7666
7667 * coding.c (decode_coding): Record buffer modification before
7668 disabling undo_list (Bug#11773).
7669
7670 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7671
7672 Revert and cleanup some recent overlay changes.
7673 * buffer.h (enum overlay_type): Remove.
7674 (buffer_get_overlays, buffer_set_overlays): Likewise.
7675 (buffer_set_overlays_before, buffer_set_overlays_after):
7676 New function. Adjust users.
7677 (unchain_both): Add eassert.
7678
7679 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7680
7681 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7682
7683 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7684
7685 * gtkutil.c (xg_mark_data): Don't assume C99.
7686
7687 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7688
7689 * gtkutil.c (xg_frame_tb_info): New struct.
7690 (TB_INFO_KEY): New define.
7691 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7692 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7693 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7694 if not present.
7695 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
7696 is up to date. Otherwise store new data.
7697 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7698
7699 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7700
7701 Use KSET for write access to Lisp_Object members of struct kboard.
7702 * keyboard.h (KSET): New macro.
7703 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7704 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7705 * xterm.c: Adjust users.
7706
7707 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7708
7709 Use BSET for write access to Lisp_Object members of struct buffer.
7710 * buffer.h (BSET): New macro.
7711 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7712 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7713 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7714 * window.c, xdisp.c, xfns.c: Adjust users.
7715
7716 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7717
7718 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7719
7720 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7721
7722 * nsterm.m (not_in_argv): New function.
7723 (application:openFile, application:openTempFile:):
7724 (application:openFileWithoutUI:, application:openFiles:): Open file
7725 if not_in_argv returns non-zero (bug#12171).
7726
7727 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
7728 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7729 Define for Gtk+ versions less than 3.2.
7730 (xg_get_font_name): Use those functions/macros here.
7731 Reported by Frans Oilinki <moilinki@gmail.com>.
7732
7733 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7734
7735 * unexmacosx.c (copy_data_segment): Copy initialized data in
7736 statically linked libraries from input file rather than memory.
7737
7738 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7739 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7740 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7741
7742 2012-08-10 Glenn Morris <rgm@gnu.org>
7743
7744 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7745 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7746
7747 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7748
7749 Fix last change to allow compilation with low optimization levels.
7750 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7751 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7752
7753 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7754
7755 Use common inline syntax in intervals.h.
7756 * intervals.h (INTERVALS_INLINE): New macro.
7757 Change all users from LISP_INLINE.
7758
7759 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7760
7761 Define Qnone once for all platforms.
7762 * frame.c (Qnone): Define here.
7763 (syms_of_frame): DEFSYM it.
7764 * lisp.h (Qnone): New declaration.
7765 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7766 * xfns.c: Remove duplication. Adjust users.
7767
7768 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7769
7770 Remove unused macros from intervals.h.
7771 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7772 * intervals.c: Adjust comment.
7773
7774 2012-08-10 Eli Zaretskii <eliz@gnu.org>
7775
7776 * w32fns.c <w32_unicode_gui>: New static variable.
7777 (globals_of_w32fns): Initialize it according to os_subtype.
7778 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7779 testing os_subtype.
7780
7781 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
7782 Eli Zaretskii <eliz@gnu.org>
7783
7784 Fix bug #10299 with Unicode characters sent by customized
7785 keyboards created by MSKLC.
7786 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7787 (w32_init_class): Use it to initialize the Emacs class with either
7788 ANSI or Unicode API calls.
7789 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7790 later.
7791 (w32_wnd_proc): If the character code sent by WM_CHAR or
7792 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7793 original message. Call DefWindowProcW on NT and later.
7794
7795 2012-08-10 Glenn Morris <rgm@gnu.org>
7796
7797 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7798
7799 * lisp.h (DIRECTORY_SEP): Let configure set it.
7800
7801 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
7802
7803 Use TSET for write access to Lisp_Object slots of struct terminal.
7804 * termhooks.h (TSET): New macro.
7805 * coding.c, terminal.c, xselect.c: Adjust users.
7806
7807 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
7808
7809 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
7810 the failing expression, include them in the error message.
7811 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7812 * lisp.h (internal_condition_case_n): Update declaration.
7813
7814 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7815
7816 Inline functions to examine and change buffer overlays.
7817 * buffer.c (unchain_both): New function.
7818 * buffer.h (buffer_get_overlays, buffer_set_overlays):
7819 (buffer_has_overlays): New function.
7820 (enum overlay_type): New enum.
7821 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7822 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7823
7824 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7825
7826 Inline functions to examine and change buffer intervals.
7827 * alloc.c (mark_interval_tree): Remove.
7828 (MARK_INTERVAL_TREE): Simplify.
7829 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
7830 * intervals.c (buffer_balance_intervals): New function.
7831 (graft_intervals_into_buffer): Adjust indentation.
7832 (set_intervals_multibyte): Simplify.
7833 * buffer.h (BUF_INTERVALS): Remove.
7834 (buffer_get_intervals, buffer_set_intervals): New function.
7835 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7836 * intervals.c, textprop.c: Adjust users.
7837
7838 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7839
7840 Inline functions to examine and change string intervals.
7841 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7842 (string_get_intervals, string_set_intervals): New function.
7843 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7844 * lread.c, print.c, textprop.c: Adjust users.
7845
7846 2012-08-08 Glenn Morris <rgm@gnu.org>
7847
7848 * lisp.mk (lisp): Remove language/persian.elc.
7849
7850 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7851
7852 Cleanup intervals.
7853 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7854 (NULL_INTERVAL_P): Likewise. Adjust users.
7855 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7856 Adjust comment. Move under #if 0.
7857 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7858 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7859
7860 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
7861
7862 Check total length of intervals with eassert.
7863 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7864 * intervals.c: Change all users to eassert.
7865
7866 2012-08-07 Eli Zaretskii <eliz@gnu.org>
7867
7868 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7869 Rename fields to match removal of FGET and WGET and disuse of
7870 INTERNAL_FIELD in Lisp_Cons.
7871
7872 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7873
7874 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7875 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7876 name since all xname users are fixed long time ago. Do not
7877 use INTERNAL_FIELD.
7878 (set_symbol_name, set_symbol_function, set_symbol_plist):
7879 (set_symbol_next, set_overlay_plist): New function.
7880 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7881 (struct Lisp_Overlay): Likewise.
7882 (CVAR, MVAR, SVAR): Remove.
7883 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7884 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7885 * xterm.c: Adjust users.
7886 * .gdbinit: Change to use name field of struct Lisp_Symbol
7887 where appropriate.
7888
7889 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7890
7891 Basic functions to set Lisp_Object and pointer slots of intervals.
7892 * intervals.h (interval_set_parent, interval_set_object):
7893 (interval_set_left, interval_set_right, interval_set_plist):
7894 (interval_copy_parent): New function.
7895 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
7896 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7897 Adjust indentation.
7898 (INTERVAL_SIZE): Remove. Adjust users.
7899 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7900
7901 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7902
7903 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7904 * process.h (PGET): Remove.
7905 (struct Lisp_Process): Do not use INTERNAL_FIELD.
7906 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7907
7908 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7909
7910 Drop WGET and revert read access to Lisp_Objects slots of struct window.
7911 * window.h (WGET): Remove.
7912 (struct window): Do not use INTERNAL_FIELD.
7913 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7914 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7915 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7916 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7917 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7918 Adjust users.
7919
7920 2012-08-07 Chong Yidong <cyd@gnu.org>
7921
7922 * window.c (Fwindow_edges, Fwindow_pixel_edges)
7923 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7924 (Fdelete_window_internal): Signal an error if the window is not on
7925 a live frame (Bug#12025).
7926
7927 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
7928
7929 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7930 * frame.h (FGET): Remove.
7931 (struct frame): Do not use INTERNAL_FIELD.
7932 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7933 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7934 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
7935 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
7936
7937 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
7938
7939 * w32.c: Silence compiler warnings.
7940 (map_w32_filename): Remove unused variable `is_fat'.
7941 (chase_symlinks): Add parentheses around expression.
7942
7943 2012-08-06 Glenn Morris <rgm@gnu.org>
7944
7945 * sysdep.c: Respect BROKEN_GETWD.
7946
7947 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
7948 Let configure handle it.
7949 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
7950
7951 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7952
7953 Use GCALIGNMENT where appropriate.
7954 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
7955 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
7956 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
7957
7958 2012-08-06 Eli Zaretskii <eliz@gnu.org>
7959
7960 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
7961 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
7962
7963 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
7964
7965 * buffer.h (struct buffer): Revert `indirections' to a simple int;
7966 that should be sufficient for everyone.
7967
7968 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7969
7970 * keyboard.c (timer_check_2): Add break so timer_check returns next
7971 timeout.
7972
7973 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7974
7975 Fix Windows build errors introduced after converting to WGET and WSET.
7976 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
7977 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
7978
7979 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
7980
7981 * nsterm.m (ns_frame_rehighlight): Use FSET.
7982
7983 * nsmenu.m (ns_update_menubar): Use FSET.
7984
7985 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7986
7987 Separate read and write access to Lisp_Object slots of Lisp_Process.
7988 * process.h (PGET, PSET): New macros similar to AREF and ASET.
7989 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7990
7991 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
7992
7993 Separate read and write access to Lisp_Object slots of struct window.
7994 * window.h (WGET, WSET): New macros similar to AREF and ASET.
7995 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7996 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7997 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7998 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7999 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8000 Adjust users.
8001
8002 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8003
8004 Fix Windows build errors introduced after converting to FGET and FSET.
8005 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8006 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8007 (w32_judge_scroll_bars): Change to use FSET.
8008 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8009
8010 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8011
8012 Fix replacement typo.
8013 * window.c (replace_window): Set root_window instead of
8014 selected_window. This fixes a total window subsystem
8015 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8016
8017 2012-08-06 Glenn Morris <rgm@gnu.org>
8018
8019 * lisp.mk (lisp): Add language/persian.elc.
8020
8021 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8022
8023 Separate read and write access to Lisp_Object slots of struct frame.
8024 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8025 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8026 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8027 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8028 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8029
8030 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8031
8032 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8033
8034 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8035
8036 Generalize common compile-time constants.
8037 * lisp.h (header_size, bool_header_size, word_size): Now here.
8038 (struct Lisp_Vector): Add comment.
8039 (struct Lisp_Bool_Vector): Move up to define handy constants.
8040 (VECSIZE, PSEUDOVECSIZE): Simplify.
8041 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8042 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8043 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8044 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8045 * xfont.c, xmenu.c: Use word_size where appropriate.
8046
8047 2012-08-05 Lawrence Mitchell <wence@gmx.li>
8048
8049 * search.c (Freplace_match): Treat \? in the replacement text
8050 literally (Bug#8161).
8051
8052 2012-08-05 Chong Yidong <cyd@gnu.org>
8053
8054 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8055 * frame.c (Vdelete_frame_functions):
8056 * emacs.c (Vkill_emacs_hook): Doc fix.
8057
8058 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8059
8060 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8061 --with-x-toolkit=no builds.
8062 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8063
8064 2012-08-04 Chong Yidong <cyd@gnu.org>
8065
8066 * syntax.c (Fmodify_syntax_entry): Doc fix.
8067
8068 2012-08-04 Eli Zaretskii <eliz@gnu.org>
8069
8070 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8071 * w32.c (init_environment): Change the default values of many
8072 environment variables in dflt_envvars[] to NULL, to avoid pushing
8073 them into environment when they were not already defined.
8074 Remove the code that deletes site-lisp subdirectories from the default
8075 value of EMACSLOADPATH, as it is no longer needed.
8076 (check_windows_init_file): Now external, not static.
8077 Use Vload_path as is, without adding anything, as this function is now
8078 called when Vload_path is already set up.
8079
8080 * w32.h (check_windows_init_file): Add prototype.
8081
8082 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8083 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8084 compatibility with Posix platforms.
8085 (main): Move the call to check_windows_init_file to here from
8086 w32.c.
8087 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8088 any, in the DEFALT argument into the root of the Emacs build or
8089 installation tree, as appropriate.
8090
8091 * callproc.c (init_callproc_1): Call decode_env_path instead of
8092 doing its equivalent by hand.
8093 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8094 the code that sets Vexec_path run on MS-Windows.
8095
8096 * lread.c (init_lread): Add comments to #ifdef's.
8097
8098 * msdos.c (dos_set_window_size, IT_update_begin)
8099 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8100 instead of direct references.
8101
8102 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8103
8104 Export DEFAULT_REHASH_* to GDB.
8105 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8106 Now constants, not macros.
8107
8108 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8109
8110 Remove unnecessary casts involving pointers.
8111 These casts are no longer needed now that we assume C89 or later,
8112 since they involve casting to or from void *.
8113 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8114 (make_pure_float, make_pure_vector):
8115 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8116 * macros.c (Fstart_kbd_macro):
8117 * menu.c (find_and_return_menu_selection):
8118 * minibuf.c (read_minibuf_noninteractive):
8119 * sysdep.c (closedir):
8120 * xdisp.c (x_produce_glyphs):
8121 * xfaces.c (compare_fonts_by_sort_order):
8122 * xfns.c (x_real_positions, select_visual):
8123 * xselect.c (x_stop_queuing_selection_requests)
8124 (x_get_window_property, x_get_window_property_as_lisp_data):
8125 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8126 Remove unnecessary pointer casts.
8127 * alloc.c (record_xmalloc): New function.
8128 * lisp.h (record_xmalloc): New decl.
8129 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8130 more like a function. This is because the pointer cast is not
8131 needed. All uses changed.
8132 * print.c (print_string, print_error_message): Avoid length recalc.
8133
8134 Improve fix for macroexp crash with debugging (Bug#12118).
8135 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8136 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8137 not supposed to be invoked from the garbage collector.
8138 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8139 (gc_aset): New function, which is like ASET but can be
8140 used in the garbage collector.
8141 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8142 (set_hash_index): Use it instead of ASET.
8143
8144 2012-08-03 Eli Zaretskii <eliz@gnu.org>
8145
8146 Support symlinks on latest versions of MS-Windows.
8147 * w32.c: Include winioctl.h and aclapi.h.
8148 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8149 (revert_to_self): Forward declarations of static functions.
8150 <static BOOL g_b_init_get_security_info>:
8151 <g_b_init_create_symbolic_link>: New static flags.
8152 (globals_of_w32): Initialize them to zero.
8153 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8154 (map_w32_filename): Improve commentary. Simplify switch.
8155 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8156 headers (most versions of MinGW w32api don't).
8157 (get_security_info, create_symbolic_link)
8158 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8159 New functions.
8160 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8161 in the argument file name.
8162 (sys_access): Call unc_volume_file_attributes only if
8163 GetFileAttributes fails with network-related error codes.
8164 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8165 have the required privileges.
8166 (get_file_security_desc_by_name): Rename from
8167 get_file_security_desc.
8168 (stat_worker): New function, with most of the guts of 'stat', and
8169 with addition of handling of symlinks and support for 'lstat'.
8170 If possible, get file's attributes and security information by
8171 handle, not by name. Produce S_IFLNK bit for symlinks, when
8172 called from 'lstat'.
8173 (stat, lstat): New functions, call 'stat_worker'.
8174 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8175 symlinks when the underlying filesystem supports them.
8176
8177 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8178
8179 Fix macroexp crash on Windows with debugging (Bug#12118).
8180 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8181 checking subscripts; problem introduced with the recent
8182 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8183 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8184 since it's used in non-static inline functions now.
8185
8186 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8187 Don't assume buffer size fits in 'int'. Remove unused local.
8188
8189 Use C99-style 'extern inline' if available.
8190 * buffer.h (BUFFER_INLINE):
8191 * category.h (CATEGORY_INLINE):
8192 * character.h (CHARACTER_INLINE):
8193 * charset.h (CHARSET_INLINE):
8194 * composite.h (COMPOSITE_INLINE):
8195 * dispextern.h (DISPEXTERN_INLINE):
8196 * lisp.h (LISP_INLINE):
8197 * systime.h (SYSTIME_INLINE):
8198 New macro, replacing 'static inline' in this header.
8199 * buffer.h, category.h, character.h, charset.h, composite.h:
8200 * dispextern.h, lisp.h, systime.h:
8201 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8202 * alloc.c (LISP_INLINE):
8203 * buffer.c (BUFFER_INLINE):
8204 * category.c (CATEGORY_INLINE):
8205 * character.c (CHARACTER_INLINE):
8206 * charset.c (CHARSET_INLINE):
8207 * composite.c (COMPOSITE_INLINE):
8208 * dispnew.c (DISPEXTERN_INLINE):
8209 * sysdep.c (SYSTIME_INLINE):
8210 Define to EXTERN_INLINE, so that the corresponding functions
8211 are compiled into code.
8212 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8213 (INLINE_HEADER_END): New macros.
8214 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8215 since it's used in non-static inline functions now.
8216 (VALMASK) [!USE_LSB_TAG]: Likewise.
8217
8218 2012-08-02 Glenn Morris <rgm@gnu.org>
8219
8220 * s/: Remove empty directory.
8221
8222 * s/ms-w32.h: Move to ../nt/inc.
8223 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8224 Update for new ms-w32.h location.
8225
8226 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8227
8228 Port to Solaris 8.
8229 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8230
8231 2012-08-02 Glenn Morris <rgm@gnu.org>
8232
8233 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8234 hard-coding the path separator.
8235
8236 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8237
8238 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8239 This how ASET and AREF are supposed to work, and makes
8240 it easier to think about future improvements. See
8241 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8242 * charset.h (set_charset_attr): New function.
8243 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8244 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8245 (aref_addr): New function. All uses of &AREF(...) changed.
8246 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8247 (set_hash_index): New functions. All lvalue-style uses of
8248 HASH_KEY etc. changed.
8249 * keyboard.c (set_prop): New function. All lvalue-style uses
8250 of PROP changed.
8251
8252 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8253
8254 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8255 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8256 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
8257 * nsfns.m (ns_set_name_as_filename): Likewise.
8258 * nsmenu.m (ns_update_menubar): Likewise.
8259 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8260
8261 2012-08-01 Eli Zaretskii <eliz@gnu.org>
8262
8263 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8264 Adapt to latest changes in field names of the corresponding Lisp
8265 objects.
8266
8267 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8268
8269 2012-08-01 Glenn Morris <rgm@gnu.org>
8270
8271 * s/msdos.h: Remove file.
8272 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8273 * Makefile.in (S_FILE): Remove.
8274 (config_h): Remove S_FILE.
8275
8276 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8277
8278 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8279 Remove; moved to nt/config.nt.
8280
8281 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8282
8283 Use INTERNAL_FIELD for conses and overlays.
8284 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8285 Remove obsolete comment.
8286 (MVAR): New macro.
8287 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8288 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8289
8290 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8291
8292 Use INTERNAL_FIELD for symbols.
8293 * lisp.h (SVAR): New macro. Adjust users.
8294 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8295 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8296
8297 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8298
8299 Use INTERNAL_FIELD for processes.
8300 * process.h (PVAR): New macro. Adjust style.
8301 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8302 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8303
8304 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8305
8306 Use INTERNAL_FIELD for windows.
8307 * window.h (WVAR): New macro.
8308 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8309 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8310 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8311 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8312 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8313 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8314
8315 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8316
8317 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8318
8319 2012-08-01 Glenn Morris <rgm@gnu.org>
8320
8321 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8322 Move to configure.ac.
8323
8324 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
8325
8326 * makefile.w32-in (CONFIG_H): Update dependencies.
8327 (CONF_POST_H): New macro.
8328
8329 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8330
8331 2012-07-31 Glenn Morris <rgm@gnu.org>
8332
8333 * Makefile.in (S_FILE): No longer set by configure.
8334
8335 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8336 is available.
8337 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8338
8339 * process.h (NULL_DEVICE):
8340 * emacs.c (SEPCHAR):
8341 * editfns.c (USER_FULL_NAME): Let configure set them.
8342
8343 * s/README, s/template.h: Remove files.
8344
8345 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8346
8347 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8348 Move to configure.ac.
8349
8350 2012-07-31 Eli Zaretskii <eliz@gnu.org>
8351
8352 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8353 resulting renaming of 'struct frame' members.
8354
8355 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8356
8357 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8358 after introduction of FVAR.
8359
8360 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8361
8362 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8363
8364 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8365 instead of compositeToPoint.
8366 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8367
8368 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
8369
8370 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8371
8372 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8373 * lisp.h (INTERNAL_FIELD): New macro.
8374 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
8375 (BVAR): Change to use INTERNAL_FIELD.
8376 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8377 (KVAR): Change to use INTERNAL_FIELD.
8378 * frame.h (FVAR): New macro.
8379 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
8380 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8381 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8382 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8383 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8384
8385 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8386
8387 Miscellaneous fixes for non-default X toolkits.
8388 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8389 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8390 Move under #ifdef USE_LUCID.
8391 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8392 definition and usage to avoid warnings.
8393
8394 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8395
8396 * nsterm.m (openFiles): Fix previous checkin.
8397
8398 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8399
8400 * indent.c (compute_motion): Remove unused local.
8401
8402 2012-07-31 Glenn Morris <rgm@gnu.org>
8403
8404 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8405
8406 * conf_post.h [USG5_4]:
8407 Move remaining contents of s/usg5-4-common.h here.
8408 * s/usg5-4-common.h: Remove file.
8409
8410 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8411 * s/irix6-5.h: Remove file.
8412
8413 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8414 * s/darwin.h: Remove file.
8415
8416 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8417 * s/hpux10-20.h: Remove file, which is now empty.
8418
8419 2012-07-30 Glenn Morris <rgm@gnu.org>
8420
8421 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8422 * Makefile.in (config_h): Add conf_post.h.
8423 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8424
8425 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8426
8427 * nsterm.m (ns_do_open_file): New variable.
8428 (ns_term_init): Set ns_do_open_file to YES after run returns.
8429 (openFile, openTempFile, openFileWithoutUI, openFiles):
8430 Open files only if ns_do_open_file.
8431
8432 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8433
8434 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8435 This no-op macro hasn't been needed for many years.
8436 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8437
8438 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8439 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8440 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8441 gdb_make_enums_visible.
8442 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8443 (DIRECTORY_SEP): Now a constant, not a macro.
8444
8445 2012-07-30 Eli Zaretskii <eliz@gnu.org>
8446
8447 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8448 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8449
8450 * w32term.c <w32_keyboard_codepage>: Renamed from
8451 keyboard_codepage and now external. All users changed.
8452
8453 * w32term.h: Add declaration of w32_keyboard_codepage.
8454
8455 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8456 the codepage to translate keys to Unicode. If this argument is
8457 -1, use the value returned by GetConsoleCP. All callers changed.
8458
8459 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8460
8461 Update .PHONY listings in makefiles.
8462 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8463 bootstrap-clean, distclean, maintainer-clean, versioclean,
8464 extraclean, frc.
8465
8466 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8467 This is a bit clearer. Fix some commentary typos.
8468
8469 2012-07-30 Glenn Morris <rgm@gnu.org>
8470
8471 * s/netbsd.h: Let configure include signal.h if needed.
8472 Remove file, which is now empty.
8473
8474 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8475 Let configure set them.
8476 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8477 No more need to undefine.
8478
8479 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8480
8481 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8482 non-single-byte char when adding meta modifier. (Bug#12090)
8483
8484 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8485
8486 Convert safe_call to use variable number of arguments.
8487 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8488 (safe_call2): Fix comment.
8489 * lisp.h (safe_call): Adjust prototype.
8490 * coding.c (encode_coding_object): Change to use safe_call2.
8491 * xfaces.c (merge_face_heights): Change to use safe_call1.
8492
8493 2012-07-30 Glenn Morris <rgm@gnu.org>
8494
8495 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
8496 does that unconditionally. Remove file, which is now empty.
8497
8498 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8499 Remove empty files.
8500
8501 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8502
8503 Export to GDB most of lisp.h's remaining object-like macros.
8504 * lisp.h (min, max): Move earlier, because they're used earlier now.
8505 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8506 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8507 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8508 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8509 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8510 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8511 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8512 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8513 Now constants, for GDB. They need not be macros.
8514 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8515 Now constants, for GDB, as well as macros, for static initializers.
8516 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8517 Move to after the definition of struct Lisp_Char_Table,
8518 since the former now needs that type defined.
8519 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8520 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8521 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8522 New enums, for gdb_make_enums_visible.
8523 (GLYPH_MODE_LINE_FACE): Remove; unused.
8524 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
8525 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8526 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8527 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8528 enum maxargs, enum MAX_ALLOCA.
8529 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8530 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8531 no longer needed, now that they are done in lisp.h.
8532
8533 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8534
8535 Cleanup string bytes checking.
8536 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8537 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8538 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8539 (check_sblock, compact_small_strings): Simplify.
8540
8541 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8542
8543 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8544 These macros are confusing and no longer need to be defined, as
8545 the enum values now suffice. All uses replaced with definiens.
8546 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8547
8548 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
8549
8550 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8551 ($(BLD)/w32console.$(O)): Update dependencies.
8552
8553 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8554
8555 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8556 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8557 time. Adjust users.
8558 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8559
8560 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8561
8562 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8563 setting sitelisp (Bug#12010).
8564
8565 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8566
8567 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
8568
8569 * w32heap.c (cache_system_info):
8570 * w32.c (sys_rename):
8571 * w32proc.c (find_child_console, sys_kill): All users changed.
8572
8573 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8574
8575 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8576
8577 2012-07-29 Eli Zaretskii <eliz@gnu.org>
8578
8579 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8580
8581 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8582
8583 Cleanup statistics calculation in Fgarbage_collect.
8584 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8585 Fix zombies percentage calculation. Simplify elapsed time calculation.
8586
8587 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8588
8589 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8590 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8591 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8592 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8593 (replace_range, replace_range_2, del_range_2): Change to eassert.
8594 * marker.c (byte_char_debug_check): Adjust style.
8595
8596 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8597
8598 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8599 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8600 long-ago-commented-out code that talks about "WIN32".
8601 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8602 All uses changed.
8603
8604 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8605
8606 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8607 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8608 Simplify by using alignof.
8609 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8610 * lisp.h: Include <stdalign.h>.
8611 (GCALIGNMENT): New macro and constant.
8612 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8613 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8614 (stdalign): New macro, if not already defined.
8615
8616 2012-07-28 Eli Zaretskii <eliz@gnu.org>
8617
8618 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8619 * w32inevt.c: Include w32inevt.h.
8620 (w32_read_console_input): New inline function, calls either
8621 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8622 w32_console_unicode_input.
8623 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8624 (w32_kbd_patch_key, key_event): Use the codepage returned by
8625 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8626 (key_event): use uChar.UnicodeChar only if
8627 w32_console_unicode_input is non-zero.
8628
8629 * w32console.c: Include w32heap.h.
8630 <w32_console_unicode_input>: New global variable.
8631 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8632 family of Windows, zero otherwise.
8633
8634 * w32inevt.h: Declare w32_console_unicode_input.
8635
8636 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8637 --without-x. (Bug#11742)
8638
8639 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 Adjust GDB to reflect pvec_type changes (Bug#12036).
8642 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
8643 2012-07-04 changes to pseudovector representation.
8644 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
8645
8646 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
8647
8648 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8649 bus address.
8650 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8651
8652 2012-07-27 Eli Zaretskii <eliz@gnu.org>
8653
8654 * alloc.c (listn): Fix the order the arguments are consed onto the
8655 list.
8656
8657 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8658 enumeration constants, as PURE and HEAP are too general, and clash
8659 with other headers and sources, such as gmalloc.c and the
8660 MS-Windows system headers. All users changed.
8661
8662 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8663
8664 Revert last save_excursion_save and save_excursion_restore changes.
8665 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8666 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8667
8668 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8669
8670 Fix recently-introduced typos in Windows port.
8671 Reported by Martin Rudalics <rudalics@gmx.at>.
8672 * w32.c (init_environment): Replace comma with semicolon.
8673 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
8674
8675 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 Improve GDB symbol export (Bug#12036).
8678 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8679 arms of an 'if', not using conditional expressions; otherwise GDB
8680 complains about the types in the unevaluated arm when the argument
8681 is an integer literal.
8682 (xgetint): Simplify expression.
8683 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8684 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8685 Zaretskii in <http://bugs.gnu.org/12036#13>.
8686 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8687 needed now that we have gdb_make_enums_visible.
8688 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8689 (enum enum_USE_LSB_TAG):
8690 New enum types, packaging up enums that need to be exported to GDB.
8691
8692 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8693
8694 Utility function to make a list from specified amount of objects.
8695 * lisp.h (enum constype): New datatype.
8696 (listn): New prototype.
8697 * alloc.c (listn): New function.
8698 (Fmemory_use_count, syms_of_alloc): Use it.
8699 * buffer.c (syms_of_buffer): Likewise.
8700 * callint.c (syms_of_callint): Likewise.
8701 * charset.c (define_charset_internal): Likewise.
8702 * coding.c (syms_of_coding): Likewise.
8703 * keymap.c (syms_of_keymap): Likewise.
8704 * search.c (syms_of_search): Likewise.
8705 * syntax.c (syms_of_syntax): Likewise.
8706 * w32.c (init_environment): Likewise.
8707 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8708 * xdisp.c (syms_of_xdisp): Likewise.
8709 * xfns.c (syms_of_xfns): Likewise.
8710
8711 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8712
8713 Fast save_excursion_save and save_excursion_restore.
8714 * lisp.h (struct Lisp_Excursion): New data type.
8715 (PVEC_EXCURSION): New pseudovector type.
8716 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8717 to deal with it. Adjust comments.
8718 (init_marker, attach_marker): New prototype.
8719 (unchain_marker): Adjust prototype.
8720 * marker.c (attach_marker): Change to global.
8721 (init_marker): New function.
8722 * alloc.c (Fmake_marker, build_marker): Use it.
8723 (build_marker): More easserts.
8724 (mark_object): Handle struct Lisp_Excursion.
8725 * editfns.c (save_excursion_save, save_excursion_restore):
8726 Reimplement to use struct Lisp_Excursion. Add comments.
8727
8728 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8729
8730 Fix export of symbols to GDB (Bug#12036).
8731 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8732 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8733 emacs.c, as this is a more-suitable home. Had this been done earlier
8734 the fix for 12036 would have avoided some of the problems noted in
8735 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8736 would have been more obvious.
8737 * emacs.c: Do not include <verify.h>; no longer needed.
8738 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
8739 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8740 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8741 Remove; now done in lisp.h.
8742 * lisp.h (PUBLISH_TO_GDB): New macro.
8743 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8744 (DATA_SEG_BITS): Use it.
8745 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8746 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8747 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8748 not be usable in #if. This simplifies things.
8749
8750 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
8751
8752 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8753
8754 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8755
8756 Simplify export of symbols to GDB (Bug#12036).
8757 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8758 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8759 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8760 Adjust to changes in lisp.h and emacs.c, by using
8761 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8762 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8763 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8764 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8765 instead of gdb_valbits.
8766 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8767 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8768 instead of gdb_array_mark_flag.
8769 (xboolvector): Get size from $->size, not $->header.size.
8770 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8771 (xreload, hook-run, hookpost-run): Remove.
8772 * emacs.c: Include <verify.h>.
8773 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8774 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8775 Remove.
8776 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8777 (gdb_USE_LSB_TAG): New enum constants.
8778 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8779 Also define these as enum constants, so they're visible to GDB.
8780 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8781 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8782 as constants, so they're visible to GDB.
8783 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8784 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8785 Now enum constants, not macros, so they're visible to GDB.
8786 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8787 more convenient now. All uses changed.
8788 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8789 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8790
8791 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8792
8793 Explicitly free restriction data that are not needed anymore.
8794 * editfns.c (save_restriction_restore): Free restriction data.
8795
8796 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
8797
8798 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8799 add argument, tune behavior, and adjust all callers.
8800
8801 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
8802
8803 Use typedef for EMACS_INT, EMACS_UINT.
8804 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8805 than macros. This simplifies debugging in the usual case, since
8806 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8807 and it allows expressions involving EMACS_INT casts.
8808 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8809
8810 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
8811
8812 * nsterm.m (ns_read_socket): Return early if there is a modal
8813 window (Bug#12043).
8814
8815 2012-07-25 Martin Rudalics <rudalics@gmx.at>
8816
8817 * frame.c (Fredirect_frame_focus): In doc-string don't mention
8818 that FOCUS-FRAME can be omitted.
8819
8820 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
8821
8822 Adjust buffer text indirection counters at the end of Fkill_buffer.
8823 * buffer.c (Fkill_buffer): Adjust indirection counters when the
8824 buffer is definitely dead. This should really fix an issue reported
8825 by Christoph Scholtes again. (Bug#12007).
8826 (init_buffer_once): Initialize indirection counters of
8827 buffer_defaults and buffer_local_symbols (for sanity and safety).
8828
8829 2012-07-24 Eli Zaretskii <eliz@gnu.org>
8830
8831 * xdisp.c (init_iterator): Don't compute dimensions of truncation
8832 and continuation glyphs on tooltip frames, leave them at zero.
8833 Avoids continued lines in tooltips. (Bug#11832)
8834
8835 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
8836
8837 Simplify copy_overlay.
8838 * buffer.c (copy_overlay): Simplify. Use build_marker.
8839 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8840
8841 2012-07-23 Eli Zaretskii <eliz@gnu.org>
8842
8843 * print.c (print_object): Don't crash when a frame's name is nil
8844 or invalid. (Bug#12025)
8845
8846 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8847 it signals an error when a tooltip frame is being created.
8848
8849 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8850
8851 Cleanup miscellaneous objects allocation and initialization.
8852 * alloc.c (allocate_misc): Change to static. Add argument to
8853 specify the subtype. Adjust comment and users.
8854 (build_overlay): New function.
8855 * buffer.c (copy_overlays, Fmake_overlay): Use it.
8856 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8857 (allocate_misc): Remove prototype.
8858 (build_overlay): Add prototype.
8859
8860 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
8861
8862 Swap buffer text indirection counters in Fbuffer_swap_text.
8863 * buffer.c (Fbuffer_swap_text): Swap indirections too.
8864 This avoids crash reported by Christoph Scholtes at
8865 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8866
8867 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
8868
8869 * nsmenu.m (Popdown_data): New struct.
8870 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
8871 free Popdown_data.
8872 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8873 (initWithContentRect): Make imgView and contentView non-static
8874 and autorelease them. Also autorelease img and matrix (Bug#12005).
8875 (dealloc): Remove (Bug#12005).
8876
8877 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8878
8879 Adjust consing_since_gc when objects are explicitly freed.
8880 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8881 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
8882 (free_cons, free_misc): Subtract object size from consing_since_gc.
8883
8884 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
8885
8886 Simplify and cleanup markers positioning code.
8887 * marker.c (attach_marker): More useful eassert.
8888 (live_buffer, set_marker_internal): New function.
8889 (Fset_marker, set_marker_restricted): Use set_marker_internal.
8890 (set_marker_both, set_marker_restricted_both): Use live_buffer.
8891
8892 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
8893
8894 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8895 as it's limited by the amount of memory, not by INT_MAX.
8896
8897 2012-07-21 Eli Zaretskii <eliz@gnu.org>
8898
8899 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8900 in special-event-map. See the discussion at
8901 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8902 for the reasons.
8903
8904 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
8905 info.dwItemData. Fixes crashes on 64-bit Windows.
8906 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
8907
8908 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
8909
8910 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
8911 (conversationIdentifier): Return value is NSInteger.
8912 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
8913
8914 2012-07-21 Chong Yidong <cyd@gnu.org>
8915
8916 * window.c (decode_any_window): Signal an error if the window is
8917 on a dead frame (Bug#11984).
8918
8919 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8920
8921 Add indirection counting to speed up Fkill_buffer.
8922 * buffer.h (struct buffer): New member.
8923 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8924 (Fmake_indirect_buffer): Set indirection counter to -1, increment
8925 base buffer indirection counter.
8926 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8927 (Fkill_buffer): Adjust indirection counters as needed, don't walk
8928 through buffer list if indirection counter is 0.
8929
8930 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8931
8932 Extend the value returned by Fgarbage_collect with heap statistics.
8933 * alloc.c (Qheap): New symbol.
8934 (syms_of_alloc): DEFSYM it.
8935 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
8936 (Fmemory_free): Remove.
8937 (syms_of_alloc): Don't defsubr it.
8938 * buffer.c (Fcompact_buffer): Remove.
8939 (syms_of_buffer): Don't defsubr it.
8940
8941 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8942
8943 Make maybe_gc inline.
8944 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
8945 * lisp.h (consing_since_gc, gc_relative_threshold)
8946 (memory_full_cons_threshold): Revert declaration.
8947 (maybe_gc): Remove prototype, define as inline.
8948 * alloc.c: Remove old commented-out code.
8949 (consing_since_gc, gc_relative_threshold)
8950 (memory_full_cons_threshold): Revert to global.
8951 (maybe_gc): Remove.
8952
8953 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8954
8955 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
8956 * lisp.h (build_unibyte_string): New function.
8957 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
8958 * sysdep.c, w32fns.c, xfns.c: Use it.
8959 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
8960 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
8961 Adjust users accordingly.
8962 * font.h (font_open_by_name): Adjust prototype.
8963
8964 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
8965
8966 Cleanup calls to Fgarbage_collect.
8967 * lisp.h (maybe_gc): New prototype.
8968 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8969 Remove declarations.
8970 * alloc.c (maybe_gc): New function.
8971 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
8972 Make them static.
8973 * bytecode.c (MAYBE_GC): Use maybe_gc.
8974 * eval.c (eval_sub, Ffuncall): Likewise.
8975 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
8976 to avoid dependency from auto-save feature.
8977
8978 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
8979
8980 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
8981 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
8982 'for_each_per_buffer_object_at'.
8983 All uses changed. It's better to use upper-case for macros that
8984 cannot be implemented as functions, to give the reader a clue
8985 that they're special.
8986
8987 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
8988
8989 * alloc.c (Fgarbage_collect): Tweak docstring.
8990
8991 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
8992
8993 Tweak the value returned from Fgarbage_collect again.
8994 * alloc.c (Fgarbage_collect): New return value, as confirmed in
8995 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
8996 Adjust documentation.
8997 (total_vector_bytes): Rename to total_vector_slots, adjust
8998 accounting.
8999 (total_free_vector_bytes): Rename to total_free_vector_slots,
9000 adjust accounting.
9001 (Qstring_bytes, Qvector_slots): New symbols.
9002 (syms_of_alloc): DEFSYM them.
9003
9004 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9005
9006 Buffer compaction primitive which may be used from Lisp.
9007 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9008 (syms_of_buffer): Register Fcompact_buffer.
9009 * alloc.c (Fgarbage_collect): Use compact_buffer.
9010 * buffer.h (compact_buffer): New prototype.
9011 (struct buffer_text): New member.
9012
9013 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9014
9015 New macro to iterate over all buffers, miscellaneous cleanups.
9016 * lisp.h (all_buffers): Remove declaration.
9017 * buffer.h (all_buffers): Add declaration, with comment.
9018 (for_each_buffer): New macro.
9019 * alloc.c (Fgarbage_collect, mark_object): Use it.
9020 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9021 (init_buffer): Likewise.
9022 * data.c (Fset_default): Likewise.
9023 * coding.c (code_conversion_restore): Remove redundant check
9024 for dead buffer.
9025 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9026
9027 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9028
9029 Fix bug that created negative-length intervals.
9030 * intervals.c (merge_interval_right, merge_interval_left):
9031 Do not zero out this interval if it is absorbed by its children,
9032 as this interval's total length doesn't change in that case. See
9033 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9034
9035 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9036
9037 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9038 when invoking (make-bool-vector N t) and N is a positive
9039 multiple of 8 -- the last 8 bits were mistakenly cleared.
9040
9041 Remove some struct layout assumptions in bool vectors.
9042 * alloc.c (bool_header_size): New constant.
9043 (header_size, word_size): Move earlier, as they're now used earlier.
9044 Use 'word_size' in a few more places, where it's appropriate.
9045 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9046 padding before the data member of a bool vector.
9047 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9048 than doing the check by hand with an abort ().
9049
9050 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9051
9052 * eval.c (Fdefvar): Don't check constants since we only set the var if
9053 it's not yet defined anyway (bug#11904).
9054
9055 * lisp.h (last_undo_boundary): Declare new var.
9056 * keyboard.c (command_loop_1): Set it.
9057 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9058 were auto-added by the command loop (bug#11774).
9059
9060 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9061
9062 * w32font.c (Qsymbol): Remove local definition.
9063 (syms_of_w32font): Don't DEFSYM it.
9064
9065 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9066
9067 Fix sweep_vectors to handle large bool vectors correctly.
9068 * alloc.c (sweep_vectors): Account total_vector_bytes for
9069 bool vectors larger than VBLOCK_BYTES_MAX.
9070
9071 2012-07-18 Chong Yidong <cyd@gnu.org>
9072
9073 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9074 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9075
9076 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9077
9078 Return more descriptive data from Fgarbage_collect.
9079 Suggested by Stefan Monnier in
9080 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9081 * alloc.c (bounded_number): New function.
9082 (total_buffers, total_vectors): New variable.
9083 (total_string_size): Rename to total_string_bytes, adjust users.
9084 (total_vector_size): Rename to total_vector_bytes, adjust users.
9085 (sweep_vectors): Account total_vectors and total_vector_bytes.
9086 (Fgarbage_collect): New return value. Adjust documentation.
9087 (gc_sweep): Account total_buffers.
9088 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9089 (VECTOR_SIZE): Remove.
9090 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9091 (Qinterval, Qmisc): New symbols.
9092 (syms_of_data): Initialize them.
9093 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9094 (Qcons, Qbuffer): New declarations.
9095
9096 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9097
9098 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9099 Round up, not down. Improve doc.
9100
9101 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9102
9103 Restore old code in allocate_string_data to avoid Faset breakage.
9104 Reported by Julien Danjou <julien@danjou.info> in
9105 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9106 * alloc.c (allocate_string_data): Restore old code with minor
9107 adjustments, fix comment to explain this subtle issue.
9108
9109 2012-07-17 Eli Zaretskii <eliz@gnu.org>
9110
9111 Remove FILE_SYSTEM_CASE.
9112 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9113
9114 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9115 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9116 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9117 call-process-region passes it through expand-file-name.
9118
9119 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9120
9121 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9122
9123 Fix crash when creating indirect buffer (Bug#11917)
9124 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9125 Don't handle unbound variables specially if non-zero.
9126 (Fbuffer_local_variables): Pass zero.
9127 (clone_per_buffer_values): Pass non-zero.
9128
9129 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9130
9131 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9132 to make the loop interruptible.
9133
9134 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9135
9136 * gnutls.c (emacs_gnutls_handshake): Only retry if
9137 GNUTLS_E_INTERRUPTED.
9138
9139 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9140
9141 Cleanup and convert miscellaneous checks to eassert.
9142 * alloc.c (mark_interval): Fix comment, partially rephrase
9143 old comment from intervals.h (see below).
9144 * intervals.c (find_interval, adjust_intervals_for_insertion)
9145 (delete_interval, adjust_intervals_for_deletion)
9146 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9147 Convert to eassert.
9148 (adjust_intervals_for_insertion, make_new_interval):
9149 Remove obsolete and unused code.
9150 * intervals.h (struct interval): Remove obsolete comment.
9151 * textprotp.c (erase_properties): Remove unused code.
9152 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9153 (Fremove_list_of_text_properties): Convert to eassert.
9154
9155 2012-07-17 Chong Yidong <cyd@gnu.org>
9156
9157 * editfns.c (Finsert_char): Doc fix.
9158
9159 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9160
9161 Fix previous change to make Fmemory_free always accurate.
9162 * alloc.c (make_interval): Update total_free_intervals.
9163 (make_float): Likewise for total_free_floats.
9164 (free_cons, Fcons): Likewise for total_free_conses.
9165 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9166 Likewise for total_free_vector_bytes.
9167 (Fmake_symbol): Likewise for total_free_symbols.
9168 (bytes_free): Remove.
9169
9170 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9171
9172 Simple free memory accounting feature.
9173 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9174 (sweep_vectors): Accumulate size of free vectors.
9175 (Fgarbage_collect): Setup bytes_free.
9176 (Fmemory_free): New function.
9177 (syms_of_alloc): Register it.
9178
9179 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9180
9181 Cleanup overlays checking.
9182 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9183 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9184 eassert and OVERLAYP.
9185 (sort_overlays): Change to use OVERLAYP.
9186
9187 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9188
9189 * editfns.c (Finsert_char): Make it interactive, and make the
9190 second arg optional. Copy interactive spec and docstring from
9191 ucs-insert.
9192
9193 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9194
9195 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9196 Unlike the other wrapped functions, fabs has an unspecified
9197 effect on errno.
9198
9199 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9200
9201 * nsterm.m (keyDown): Interpret flags without left/right bits
9202 as the left key (Bug#11670).
9203
9204 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9205
9206 Remove empty and useless init functions.
9207 * lisp.h (init_character_once, init_fns, init_image)
9208 (init_filelock, init_sound): Remove prototype.
9209 * character.c (init_character_once): Remove.
9210 * filelock.c (init_filelock): Likewise.
9211 * fns.c (init_fns): Likewise.
9212 * image.c (init_image): Likewise.
9213 * sound.c (init_sound): Likewise.
9214 * emacs.c (main): Adjust accordingly.
9215
9216 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9217
9218 * gtkutil.h: Tiny cleanups.
9219 (use_old_gtk_file_dialog): Remove useless declaration.
9220 (xg_uses_old_file_dialog): Add suggested const attribute.
9221
9222 2012-07-15 Eli Zaretskii <eliz@gnu.org>
9223
9224 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9225 (bidi_paragraph_init): Use it to limit search forward for a strong
9226 directional character in abnormally large paragraphs full of
9227 neutral or weak characters. (Bug#11943)
9228
9229 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9230
9231 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9232 the toolbar (Bug#9451).
9233 (xg_make_tool_item): Give the widget event box a transparent
9234 background.
9235
9236 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9237
9238 Cleanup basic allocation variables and functions.
9239 * alloc.c (ignore_warnings, init_intervals, init_float)
9240 (init_cons, init_symbol, init_marker): Remove.
9241 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9242 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9243 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9244 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9245 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9246 (staticidx, init_alloc_once, init_strings, free_ablock):
9247 Remove redundant initialization.
9248 * fns.c (init_weak_hash_tables): Remove.
9249 * lisp.h (init_weak_hash_tables): Remove prototype.
9250
9251 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9252
9253 Use zero_vector where appropriate.
9254 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9255 accordingly.
9256 * lisp.h (zero_vector): New declaration.
9257 * font.c (null_vector): Remove.
9258 (syms_of_font): Remove initialization and staticpro.
9259 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9260 * keymap.c (Faccessible_keymaps): Likewise.
9261
9262 2012-07-15 Leo Liu <sdl.web@gmail.com>
9263
9264 * fringe.c: Fix typo in comments.
9265
9266 2012-07-14 Leo Liu <sdl.web@gmail.com>
9267
9268 * fringe.c: Add a new bitmap exclamation-mark.
9269
9270 2012-07-14 Eli Zaretskii <eliz@gnu.org>
9271
9272 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9273
9274 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9275 (HAVE_MENUS): Don't define, defined by editing config.in with
9276 msdos/sed2v2.inp.
9277 (GMALLOC_INHIBIT_VALLOC): Don't define.
9278 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9279
9280 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
9281
9282 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9283
9284 2012-07-14 Glenn Morris <rgm@gnu.org>
9285
9286 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9287 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9288 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9289
9290 2012-07-13 Glenn Morris <rgm@gnu.org>
9291
9292 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9293
9294 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9295 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9296
9297 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9298
9299 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9300 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9301 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9302 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9303 where appropriate.
9304 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9305 as boolean expression.
9306 (x_set_window_size): Remove unused variable toolbar.
9307 (ns_get_color_default, ns_mod_to_lisp): Remove.
9308 (ns_mouse_position): Remove unused variables xchar and ychar.
9309 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9310 (ns_set_vertical_scroll_bar): Remove unused variable count.
9311 (ns_delete_terminal): Remove unused variable i.
9312 (ns_term_init): Remove unused variables r, g and b.
9313 (mouseDown): Remove unused variable window.
9314 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9315 (initFrameFromEmacs): Remove unused variable vbextra.
9316 (mouseEntered): Remove unused variables p and dpyinfo.
9317 (mouseExited): Remove unused variables p and r.
9318 (ns_define_frame_cursor, ns_clear_frame_area)
9319 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9320 (menuDown): Assign [sender tag] to variable and cast the variable.
9321
9322 * nsterm.h (menuDown): Add id as type to argument sender.
9323 (ns_display_info_for_name): Add Lisp_Object argument.
9324 (ns_term_init): Add Lisp_Object argument.
9325 (ns_map_event_to_object): Add void argument.
9326 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9327 prototype with arguments and only declare if __OBJC__.
9328 (nxatoms_of_nsselect): Add void argument.
9329 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9330 (ns_alloc_autorelease_pool): Add void argument.
9331 (ns_release_autorelease_pool): Add void* argument.
9332 (ns_get_defaults_value): Add const char* argument.
9333
9334 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9335 (initFromContents): Use SSDATA where appropriate.
9336 (ns_update_menubar): Add braces to ambigous if-else.
9337 (initWithTitle): Put () around assignment in if statement.
9338 (ns_menu_show): Remove unused variables window and keymap.
9339 (update_frame_tool_bar): Remove unused variable selected_p.
9340 (initWithContentRect): Remove unused variable this_cmd_name.
9341
9342 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9343 appropriate.
9344 (setXBMColor): Remove unused variable len.
9345 (setPixmapData): Put () around assignment in loop statement.
9346
9347 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9348 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9349 where appropriate.
9350 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9351 around assignment in loop statement.
9352 (nsfont_open): Remove unused variable i.
9353 (nsfont_open): Remove unused variable len.
9354 (nsfont_draw): Remove unused variable cs.
9355
9356 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9357 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9358 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9359 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9360 (Fns_font_name, Fns_perform_service)
9361 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9362 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9363 (ns_set_name): Remove unused variable view.
9364 (x_set_menu_bar_lines): Remove unused variable olines.
9365 (x_set_tool_bar_lines): Remove unused variable root_window.
9366 (Fns_list_colors): Put () around assignment in while statement.
9367 (Fns_perform_service): Remove unused variable len.
9368 (Fns_display_usable_bounds): Remove unused variable top.
9369 (syms_of_nsfns): Remove unused variable i.
9370
9371 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9372 memcpy (Bug#11907).
9373
9374 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
9375
9376 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9377 and free it with DestroyExceptionInfo (Bug#11558).
9378
9379 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
9380
9381 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9382 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9383 Set here, not in nt/config.nt.
9384
9385 2012-07-13 Eli Zaretskii <eliz@gnu.org>
9386
9387 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9388 cursor overflow into the last glyph on display line when the right
9389 fringe is off. (Bug#11832)
9390
9391 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9392
9393 * xdisp.c (produce_special_glyphs): Now static.
9394 * dispextern.h (produce_special_glyphs): Remove decl.
9395
9396 2012-07-13 Glenn Morris <rgm@gnu.org>
9397
9398 * s/bsd-common.h, s/cygwin.h: Remove empty files.
9399 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9400
9401 * s/usg5-4-common.h (USG, USG5):
9402 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9403 * s/sol2-6.h (SOLARIS2):
9404 * s/irix6-5.h (IRIX6_5):
9405 * s/hpux10-20.h (USG, USG5, HPUX):
9406 * s/gnu-linux.h (USG, GNU_LINUX):
9407 * s/freebsd.h (BSD_SYSTEM):
9408 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9409 * s/cygwin.h (CYGWIN):
9410 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9411 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9412
9413 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
9414
9415 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
9416
9417 2012-07-13 Glenn Morris <rgm@gnu.org>
9418
9419 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9420
9421 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9422
9423 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9424 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9425
9426 2012-07-12 Glenn Morris <rgm@gnu.org>
9427
9428 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
9429
9430 * process.c (init_process_emacs): Rename from init_process.
9431 The old name is also the name of a Mach system call.
9432 * lisp.h, emacs.c: Update for this name change.
9433 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9434 longer needed.
9435
9436 2012-07-12 Eli Zaretskii <eliz@gnu.org>
9437
9438 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9439 memmove call that removes glyphs covered by the left truncation
9440 glyph. Improve commentary.
9441 (display_line): Fix display of continuation glyphs on GUI frames
9442 when the right fringe is turned off and variable-size fonts are
9443 used in the window. Move the code that appends a stretch glyph to
9444 produce_special_glyphs, so that it could be used for truncation
9445 and continuation glyphs alike.
9446 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9447 glyph of a suitably computed width, to align the special glyphs at
9448 the window margin. Code moved from display_line. (Bug#11832)
9449
9450 2012-07-12 Glenn Morris <rgm@gnu.org>
9451
9452 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9453
9454 * s/gnu-linux.h, s/hpux10-20.h:
9455 Do not unconditionally define HAVE_XRMSETDATABASE.
9456
9457 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9458
9459 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9460
9461 Fix typos that broke OS X build.
9462 Reported by Randal L. Schwartz in
9463 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9464 * nsterm.m (ns_timeout): Add missing local decl.
9465 (ns_get_color): snprintf -> sprintf, to fix typo.
9466
9467 2012-07-12 Glenn Morris <rgm@gnu.org>
9468
9469 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9470 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9471 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9472 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9473
9474 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9475 Move PTY_OPEN to configure.
9476
9477 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9478 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9479 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9480
9481 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9482
9483 Use empty_unibyte_string where applicable.
9484 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9485 * lread.c (read1): Likewise.
9486 * xsettings.c (syms_of_xsettings): Likewise.
9487
9488 2012-07-12 Glenn Morris <rgm@gnu.org>
9489
9490 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9491 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
9492 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9493 * s/hpux10-20.h (RUN_TIME_REMAP):
9494 * s/bsd-common.h (TABDLY): Move to configure.
9495
9496 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9497
9498 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9499
9500 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9501 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
9502
9503 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
9504
9505 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9506 * s/template.h: Move NARROWPROTO to configure.
9507
9508 2012-07-11 Glenn Morris <rgm@gnu.org>
9509
9510 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9511 unused since 2011-01-17 change to systty.h.
9512
9513 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9514 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9515 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9516
9517 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9518
9519 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9520
9521 2012-07-11 Glenn Morris <rgm@gnu.org>
9522
9523 * s/darwin.h, s/gnu-linux.h, s/template.h:
9524 Move INTERRUPT_INPUT to configure.
9525
9526 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9527
9528 Minor adjustments to interning code.
9529 * lisp.h (intern, intern_c_string): Redefine as static inline
9530 wrappers for intern_1 and intern_c_string_1, respectively.
9531 (intern_1, intern_c_string_1): Rename prototypes.
9532 * lread.c (intern_1, intern_c_string_1, oblookup):
9533 Simplify Vobarray checking.
9534 * font.c (font_intern_prop): Likewise. Adjust comment.
9535 * w32font.c (intern_font_name): Likewise.
9536
9537 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9538
9539 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9540
9541 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9542 of Fcar/Fcdr if possible.
9543 * font.c (check_otf_features): Likewise.
9544 * fontset.c (Fnew_fontset): Likewise.
9545 * gnutls.c (Fgnutls_boot): Likewise.
9546 * minibuf.c (read_minibuf): Likewise.
9547 * msdos.c (IT_set_frame_parameters): Likewise.
9548 * xmenu.c (Fx_popup_dialog): Likewise.
9549 * w32menu.c (Fx_popup_dialog): Likewise.
9550
9551 2012-07-11 Glenn Morris <rgm@gnu.org>
9552
9553 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9554 since nothing has defined it on these platforms.
9555
9556 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9557 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9558
9559 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9560 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9561 Move CLASH_DETECTION to configure.
9562
9563 * s/gnu.h: Remove file, which is now empty.
9564
9565 * s/gnu.h, s/gnu-linux.h:
9566 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9567
9568 2012-07-11 John Wiegley <johnw@newartisans.com>
9569
9570 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9571 function attribute, so we only use it if it exists in the
9572 compiler.
9573
9574 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9575
9576 Avoid call to strlen in fast_c_string_match_ignore_case.
9577 * search.c (fast_c_string_match_ignore_case): Change to use
9578 length argument. Adjust users accordingly.
9579 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9580
9581 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9582
9583 Assume mkdir, rmdir.
9584 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9585 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9586
9587 Assume rename.
9588 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9589
9590 Assume perror.
9591 * s/hpux10-20.h (HAVE_PERROR): Remove.
9592 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9593 Remove dummy definition, as this problem was obsolete long ago.
9594
9595 Assume strerror.
9596 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9597
9598 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9599
9600 Avoid calls to strlen in font processing functions.
9601 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
9602 (font_open_by_name): Change to use length argument.
9603 Adjust users accordingly.
9604 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9605 Adjust prototypes.
9606 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9607 Change to return ptrdiff_t.
9608 (xfont_list_pattern, xfont_match): Use length returned by
9609 xfont_decode_coding_xlfd.
9610 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9611
9612 2012-07-11 Glenn Morris <rgm@gnu.org>
9613
9614 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9615 Move DONT_REOPEN_PTY to configure.
9616
9617 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9618 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9619
9620 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9621
9622 Remove "#define unix" that is no longer needed (Bug#11905).
9623 * s/aix4-2.h (unix): Remove; no longer needed.
9624
9625 EMACS_TIME simplification (Bug#11875).
9626 This replaces macros (which typically do not work in GDB)
9627 with functions, typedefs and enums, making the code easier to debug.
9628 The functional style also makes code easier to read and maintain.
9629 * systime.h: Include <sys/time.h> on all hosts, not just if
9630 WINDOWSNT, since 'struct timeval' is needed in general.
9631 (EMACS_TIME): Now a typedef, not a macro.
9632 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9633 not macros.
9634 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9635 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9636 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9637 (EMACS_TIME_LE): Now functions, not macros.
9638 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9639 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9640 which are not functions. All uses rewritten to use:
9641 (make_emacs_time): New function.
9642 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9643 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9644 not functions. All uses rewritten to use the following, respectively:
9645 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9646 (add_emacs_time, sub_emacs_time): New functions.
9647 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
9648 * fileio.c (Fcopy_file):
9649 * xterm.c (XTflash): Get the current time closer to when it's used.
9650 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9651
9652 * bytecode.c (targets): Suppress -Woverride-init warnings.
9653
9654 Simplify by avoiding confusing use of strncpy etc.
9655 * doc.c (Fsnarf_documentation):
9656 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9657 * frame.c (Fmake_terminal_frame):
9658 * gtkutil.c (get_utf8_string):
9659 * lread.c (openp):
9660 * nsmenu.m (ns_update_menubar):
9661 * regex.c (regerror):
9662 Prefer memcpy to strncpy and strncat when either will do.
9663 * fileio.c (Fsubstitute_in_file_name):
9664 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9665 (menu_separator_name_p):
9666 * nsmenu.m (ns_update_menubar):
9667 Prefer memcmp to strncmp when either will do.
9668 * nsterm.m: Include <ftoastr.h>.
9669 (ns_get_color):
9670 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9671 Prefer snprintf to strncpy.
9672 * nsterm.m (ns_term_init):
9673 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9674 * nsterm.m (ns_term_init):
9675 Avoid the need for strncpy, by using build_string or
9676 make_unibyte_string directly. Use dtoastr, not snprintf.
9677 * process.c (Fmake_network_process): Diagnose service names that
9678 are too long, rather than silently truncating them or creating
9679 non-null-terminated names.
9680 (Fnetwork_interface_info): Likewise, for interface names.
9681 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9682 Prefer sprintf to strncat.
9683 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9684 Prefer vsnprintf to vsprintf + strncpy.
9685
9686 2012-07-10 Glenn Morris <rgm@gnu.org>
9687
9688 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9689 Clarify fallback case.
9690
9691 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9692
9693 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9694 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9695 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
9696 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
9697 where argument type is known to be a Lisp_Cons.
9698
9699 2012-07-10 Tom Tromey <tromey@redhat.com>
9700
9701 * bytecode.c (BYTE_CODE_THREADED): New macro.
9702 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9703 (enum byte_code_op): New type.
9704 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9705 (exec_byte_code): Use them. Use token threading when applicable.
9706
9707 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9708
9709 Optimize pure C strings initialization.
9710 * lisp.h (make_pure_string): Fix prototype.
9711 (build_pure_c_string): New function, defined as static inline. This
9712 provides a better opportunity to optimize away calls to strlen when
9713 the function is called with compile-time constant argument.
9714 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9715 argument, adjust users accordingly. Use build_pure_c_string where
9716 appropriate.
9717 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9718 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9719 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9720
9721 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9722
9723 Avoid calls to strlen in miscellaneous functions.
9724 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9725 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9726 * lread.c (openp): Likewise.
9727
9728 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9729
9730 Avoid calls to strlen in path processing functions.
9731 * fileio.c (file_name_as_directory): Add comment. Change to add
9732 srclen argument and return the length of result. Adjust users
9733 accordingly.
9734 (directory_file_name): Fix comment. Change to add srclen argument,
9735 swap 1st and 2nd arguments to obey the common convention.
9736 Adjust users accordingly.
9737 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9738
9739 2012-07-10 Glenn Morris <rgm@gnu.org>
9740
9741 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9742 Move PENDING_OUTPUT_COUNT definition to configure.
9743
9744 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9745 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9746 * s/gnu.h (DATA_START): Move definitions to configure.
9747
9748 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9749 We include usg5-4-common.h, which defines them both.
9750
9751 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9752 O_RDONLY already includes it).
9753
9754 Stop ns builds setting the EMACSLOADPATH environment variable.
9755 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9756 Now it does not set EMACSLOADPATH, just returns the load-path string.
9757 * nsterm.h: Update accordingly.
9758 * lread.c [HAVE_NS]: Include nsterm.h.
9759 (init_lread) [HAVE_NS]: Use ns_load_path.
9760 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9761
9762 2012-07-09 Glenn Morris <rgm@gnu.org>
9763
9764 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9765 since the included bsd-common.h does so.
9766
9767 Stop ns builds setting the EMACSPATH environment variable.
9768 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9769 (ns_init_paths): Do not set EMACSPATH.
9770 * nsterm.h (ns_exec_path): Add it.
9771 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9772 Use ns_exec_path.
9773
9774 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9775
9776 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9777
9778 * process.c (wait_reading_process_output): 'waitchannels' was unset
9779 when read_kbd || !NILP (wait_for_cell); fix this.
9780
9781 Add GCC-style 'const' attribute to functions that can use it.
9782 * character.h (char_resolve_modifier_mask):
9783 * keyboard.h (make_ctrl_char):
9784 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9785 (init_character_once, next_almost_prime, init_fns, init_image)
9786 (flush_pending_output, init_sound):
9787 * mem-limits.h (start_of_data):
9788 * menu.h (finish_menu_items):
9789 Add ATTRIBUTE_CONST.
9790 * emacs.c (DEFINE_DUMMY_FUNCTION):
9791 Declare the dummy function with ATTRIBUTE_CONST.
9792 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9793 Add decls with ATTRIBUTE_CONST.
9794
9795 Minor improvements to make_formatted_string.
9796 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9797 where int is good enough, as vsprintf returns an int.
9798 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9799
9800 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9801
9802 Use make_formatted_string to avoid double length calculation.
9803 * lisp.h (make_formatted_string): New prototype.
9804 * alloc.c (make_formatted_string): New function.
9805 * buffer.c (Fgenerate_new_buffer_name): Use it.
9806 * dbusbind.c (syms_of_dbusbind): Likewise.
9807 * editfns.c (Fcurrent_time_zone): Likewise.
9808 * filelock.c (get_boot_time): Likewise.
9809 * frame.c (make_terminal_frame, set_term_frame_name)
9810 (x_report_frame_params): Likewise.
9811 * image.c (gs_load): Likewise.
9812 * minibuf.c (get_minibuffer): Likewise.
9813 * msdos.c (dos_set_window_size): Likewise.
9814 * process.c (make_process): Likewise.
9815 * xdisp.c (ensure_echo_area_buffers): Likewise.
9816 * xsettings.c (apply_xft_settings): Likewise.
9817
9818 2012-07-09 Glenn Morris <rgm@gnu.org>
9819
9820 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9821 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9822 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9823 * nsterm.h (ns_etc_directory): Add it.
9824 * callproc.c [HAVE_NS]: Include nsterm.h.
9825 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9826
9827 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
9828
9829 Move marker debugging code under MARKER_DEBUG.
9830 * marker.c (MARKER_DEBUG): Move marker debugging code under
9831 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9832 for bootstrap with --enable-checking (~3x slowdown reported
9833 by Juanma Barranquero <lekktu@gmail.com>).
9834 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9835
9836 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
9837
9838 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9839 See <http://bugs.gnu.org/11825#29>.
9840
9841 2012-07-08 Eli Zaretskii <eliz@gnu.org>
9842
9843 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9844 has no font, use the frame's font. (Bug#11813)
9845 (display_line): Add commentary about displaying truncation glyphs
9846 on GUI frames.
9847 (produce_special_glyphs): Move here from term.c.
9848
9849 * term.c (produce_special_glyphs): Move to xdisp.c.
9850
9851 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9852 section.
9853
9854 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
9855
9856 * xdisp.c (display_line): Avoid warning about implicit declaration
9857 of FRAME_FONT.
9858
9859 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9860
9861 * lisp.h: Remove empty conditional.
9862
9863 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9864
9865 * lread.c (load_path_check): Now static.
9866
9867 Fix some minor --with-ns problems found by static checking.
9868 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9869 (x_set_font) [!HAVE_X_WINDOWS]:
9870 * image.c (xpm_load_image) [HAVE_NS]:
9871 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9872 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9873 Remove unused local.
9874 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9875 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9876 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9877 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9878 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9879 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9880 Fix pointer signedness problem.
9881 * xfaces.c (FRAME_X_FONT_TABLE):
9882 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9883
9884 2012-07-07 Glenn Morris <rgm@gnu.org>
9885
9886 * lread.c (load_path_check): New function, split from init_lread.
9887 (init_lread): Reorganize. Motivation:
9888 If EMACSLOADPATH is set, check/warn about that rather than the
9889 defaults, which we are not going to use. Hence we can remove
9890 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9891 Don't warn if site-lisp directories are missing.
9892 If not installed, start from a blank load-path, since
9893 PATH_LOADSEARCH refers to the eventual installation directories.
9894
9895 2012-07-07 Eli Zaretskii <eliz@gnu.org>
9896
9897 Support truncation and continuation glyphs on GUI frames, when
9898 fringes are disabled. (Bug#11832)
9899 * xdisp.c (init_iterator): Get dimensions of truncation and
9900 continuation glyphs even if on GUI frames.
9901 Adjust it->last_visible_x on GUI frames when the left or right fringes,
9902 or both, are absent.
9903 (start_display, move_it_in_display_line_to): Handle the case of a
9904 GUI frame without a fringe to display continuation or truncation
9905 glyphs.
9906 (insert_left_trunc_glyphs): Support GUI frames: make sure
9907 truncation glyphs overwrite enough glyphs from the current line to
9908 have sufficient space in pixels.
9909 (display_line): Support truncation and continuation glyphs on GUI
9910 frames. If some spare pixels are left on the line after inserting
9911 the truncation glyphs, fill that space with a stretch glyph of a
9912 suitably computed width.
9913
9914 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9915 produce_glyphs, to support GUI sessions.
9916
9917 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
9918
9919 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9920
9921 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9922
9923 Do not require float-time's arg to fit in time_t (Bug#11825).
9924 This works better on hosts where time_t is unsigned, and where
9925 float-time is applied to the (negative) difference between two times.
9926 * editfns.c (decode_time_components): Last arg is now double *,
9927 not int *, and means to store all the result as a double, without
9928 worrying about whether the seconds part fits in time_t.
9929 All callers changed.
9930 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9931 All callers changed.
9932 (Ffloat_time): Do not fail merely because the specified time falls
9933 outside of time_t range.
9934
9935 2012-07-07 Glenn Morris <rgm@gnu.org>
9936
9937 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
9938 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
9939 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
9940
9941 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
9942
9943 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
9944 Update dependencies.
9945
9946 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
9947
9948 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9949
9950 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
9951 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
9952 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
9953 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
9954 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
9955 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
9956
9957 * xfont.c (compare_font_names): Redo to omit the need for casts.
9958
9959 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
9960
9961 * xfns.c (Fx_change_window_property): Doc fix.
9962 * w32fns.c (Fx_change_window_property): Doc fix.
9963
9964 * w32fns.c (Fx_window_property): Accept the same arguments as the
9965 X Windows version. Doc fix.
9966 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
9967
9968 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
9969 Eli Zaretskii <eliz@gnu.org>
9970
9971 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
9972 Windows-specific code from nt/config.nt moved here.
9973 Obsolete settings removed.
9974
9975 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
9976
9977 * process.c: Avoid unnecessary calls to gettime.
9978 (wait_reading_process_output): Don't get the time of day
9979 when gobbling data immediately and not waiting, as there's no need
9980 for it in that case. This removes a FIXME.
9981
9982 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
9983
9984 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
9985 is defined (Bug#11768).
9986
9987 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9988
9989 Fix marker debugging code.
9990 * marker.c (byte_char_debug_check): Do not perform the check
9991 if buffer is not multibyte.
9992 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
9993 Call byte_char_debug_check with correct arguments.
9994
9995 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
9996
9997 Compile marker debugging code only if ENABLE_CHECKING is defined.
9998 * marker.c (byte_char_debug_check, count_markers):
9999 Use only if ENABLE_CHECKING is defined.
10000 (byte_debug_flag): Remove.
10001 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10002 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10003
10004 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10005
10006 Avoid code repetition in marker-related functions.
10007 * marker.c (attach_marker): New function.
10008 (Fset_marker, set_marker_restricted, set_marker_both)
10009 (set_marker_restricted_both): Use it.
10010 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10011 Consistently rename charno to charpos.
10012 (marker_position): Add eassert.
10013 (marker_byte_position): Convert to eassert.
10014
10015 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10016
10017 Simplify list operations in unchain_overlay and unchain_marker.
10018 * buffer.c (unchain_overlay): Simplify. Add comment.
10019 * marker.c (unchain_marker): Simplify. Fix comments.
10020
10021 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10022
10023 Introduce fast path for the widely used marker operation.
10024 * alloc.c (build_marker): New function.
10025 * lisp.h (build_marker): New prototype.
10026 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10027 * composite.c (autocmp_chars): Likewise.
10028 * editfns.c (buildmark): Remove.
10029 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10030 (save_restriction_save): Use build_marker.
10031 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10032 * window.c (save_window_save): Likewise.
10033
10034 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10035
10036 Do not use Fdelete_overlay in delete_all_overlays
10037 to avoid redundant calls to unchain_overlay.
10038 * buffer.c (drop_overlay): New function.
10039 (delete_all_overlays, Fdelete_overlay): Use it.
10040 * minibuf.c (get_minibuffer): Fix comment.
10041
10042 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10043
10044 Port to OpenBSD 5.1 amd64.
10045 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10046 This is needed for OpenBSD, and should be harmless on all BSD systems.
10047 Also, include <sys/sysctl.h>, as it should be available on all
10048 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10049 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10050 use p_pid member, not kp_proc.pid.
10051
10052 2012-07-06 Glenn Morris <rgm@gnu.org>
10053
10054 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10055
10056 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10057
10058 More xmalloc and related cleanup.
10059 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10060 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10061 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10062 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10063 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10064 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10065 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10066 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10067 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10068 * xterm.c:
10069 Omit needless casts involving void * pointers and allocation.
10070 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10071 as the former is more robust if P's type is changed.
10072 Prefer xzalloc to xmalloc + memset 0.
10073 Simplify malloc-or-realloc to realloc.
10074 Don't worry about xmalloc returning a null pointer.
10075 Prefer xstrdup to xmalloc + strcpy.
10076 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10077 growing it.
10078 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10079 alloca of a constant.
10080
10081 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10082
10083 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10084 hscroll is larger than the line width. Fixes long and futile
10085 looping inside extend_face_to_end_of_line (on a TTY) producing
10086 glyphs that are not needed and thrown away.
10087
10088 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10089
10090 * marker.c (set_marker_restricted_both): Simplify by using
10091 clip_to_bounds.
10092
10093 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10094
10095 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10096
10097 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10098
10099 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10100 not defined (Bug#11768).
10101 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10102 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10103 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10104 followed by gtk_box_set_homogeneous (Bug#11768).
10105 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10106 (update_theme_scrollbar_width, xg_create_scroll_bar):
10107 Use gtk_scrollbar_new (Bug#11768).
10108 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10109 (is_box_type): New function (Bug#11768).
10110 (xg_tool_item_stale_p): Call is_box_type.
10111 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10112 with default display (Bug#11768).
10113
10114 2012-07-05 Eli Zaretskii <eliz@gnu.org>
10115
10116 * xdisp.c (window_hscroll_limited): New function.
10117 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10118 coordinates when window's hscroll is set to insanely large
10119 values. (Bug#11857)
10120
10121 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
10122
10123 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10124 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10125
10126 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10127
10128 Cleanup xmalloc.
10129 * lisp.h (xzalloc): New prototype. Omit needless casts.
10130 * alloc.c (xzalloc): New function. Omit needless casts.
10131 * charset.c: Omit needless casts. Convert all calls to
10132 xmalloc with following memset to xzalloc.
10133 * dispnew.c: Likewise.
10134 * fringe.c: Likewise.
10135 * image.c: Likewise.
10136 * sound.c: Likewise.
10137 * term.c: Likewise.
10138 * w32fns.c: Likewise.
10139 * w32font.c: Likewise.
10140 * w32term.c: Likewise.
10141 * xfaces.c: Likewise.
10142 * xfns.c: Likewise.
10143 * xterm.c: Likewise.
10144 * atimer.c: Omit needless casts.
10145 * buffer.c: Likewise.
10146 * callproc.c: Likewise.
10147 * ccl.c: Likewise.
10148 * coding.c: Likewise.
10149 * composite.c: Likewise.
10150 * doc.c: Likewise.
10151 * doprnt.c: Likewise.
10152 * editfns.c: Likewise.
10153 * emacs.c: Likewise.
10154 * eval.c: Likewise.
10155 * filelock.c: Likewise.
10156 * fns.c: Likewise.
10157 * gtkutil.c: Likewise.
10158 * keyboard.c: Likewise.
10159 * lisp.h: Likewise.
10160 * lread.c: Likewise.
10161 * minibuf.c: Likewise.
10162 * msdos.c: Likewise.
10163 * print.c: Likewise.
10164 * process.c: Likewise.
10165 * region-cache.c: Likewise.
10166 * search.c: Likewise.
10167 * sysdep.c: Likewise.
10168 * termcap.c: Likewise.
10169 * terminal.c: Likewise.
10170 * tparam.c: Likewise.
10171 * w16select.c: Likewise.
10172 * w32.c: Likewise.
10173 * w32reg.c: Likewise.
10174 * w32select.c: Likewise.
10175 * w32uniscribe.c: Likewise.
10176 * widget.c: Likewise.
10177 * xdisp.c: Likewise.
10178 * xmenu.c: Likewise.
10179 * xrdb.c: Likewise.
10180 * xselect.c: Likewise.
10181
10182 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10183
10184 * fileio.c (time_error_value): Check the right error number.
10185 Problem reported by Troels Nielsen in
10186 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10187
10188 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10189
10190 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10191 This should be fixed in a better way; see Eli Zaretskii in
10192 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10193 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10194
10195 * fileio.c (time_error_value): Rename from special_mtime.
10196 The old name's problems were noted by Eli Zaretskii in
10197 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10198
10199 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10200 This variable's comment says Emacs needs at least one GDB-visible
10201 symbol of type enum pvec_type, to work around GDB problems.
10202 The symbol's value doesn't matter.
10203
10204 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10205 that causes compilation to fail on pre-C99 compilers.
10206
10207 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
10208
10209 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10210 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10211
10212 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10213
10214 * buffer.c (init_buffer_once): Fix initialization of
10215 headers for buffer_defaults and buffer_local_symbols.
10216 Reported by Juanma Barranquero <lekktu@gmail.com>.
10217
10218 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10219
10220 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10221 * lisp.h (enum pvec_type): Use fewer bits.
10222 (PSEUDOVECTOR_SIZE_BITS): New constant.
10223 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10224 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10225 change in pvec_type.
10226 (PSEUDOVECTOR_TYPEP): New macro.
10227 (TYPED_PSEUDOVECTORP): Use it.
10228 * fns.c (internal_equal): Adapt code to extract pvectype.
10229 * emacs.c (gdb_pvec_type): Update type.
10230 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10231 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10232 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10233 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10234 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10235 abusing vector->header.next.nbytes.
10236 (live_vector_p): Use PVEC_TYPE.
10237 (mark_object): Adapt code to extract pvectype. Use switch.
10238
10239 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10240
10241 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10242 Tighten new eassert a bit.
10243
10244 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10245
10246 Fix compilation with --enable-gcc-warnings and -O1
10247 optimization level.
10248 * doprnt.c (doprnt): Change type of tem to int, initialize
10249 to avoid compiler warning. Add eassert.
10250 * search.c (simple_search): Initialize match_byte to avoid
10251 compiler warning. Add eassert.
10252
10253 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10254
10255 Avoid weird behavior with large horizontal scrolls.
10256 Without this change, for example, large hscroll values would
10257 mess up Emacs's display on Fedora 15 x86, presumably due to
10258 overflows in int calculations in the display code.
10259 Also, if buffers had long lines, Emacs would freeze.
10260 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10261 (set_window_hscroll): New function, containing the old guts of
10262 Fset_window_hscroll. Return the clipped value.
10263 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10264 This avoids the need to check against PTRDIFF_MAX.
10265
10266 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10267
10268 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10269
10270 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10271
10272 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10273
10274 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10275 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10276 since GCC 4.4.6 issues a bogus warning for them.
10277
10278 Fix bugs in file timestamp newness comparisons.
10279 * fileio.c (Ffile_newer_than_file_p):
10280 * lread.c (Fload): Use full timestamp resolution of files,
10281 not just the 1-second resolution, so that files that are only
10282 slightly newer still count as newer.
10283 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10284 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10285
10286 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10287
10288 * fileio.c: Improve handling of file time marker. (Bug#11852)
10289 (special_mtime): New function.
10290 (Finsert_file_contents, Fverify_visited_file_modtime):
10291 Use it to set special mtime values consistently.
10292
10293 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10294
10295 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10296 marker for non-existing file. (Bug#11852)
10297
10298 2012-07-03 Glenn Morris <rgm@gnu.org>
10299
10300 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10301 and did not make it into globals.h).
10302
10303 2012-07-03 Tom Tromey <tromey@redhat.com>
10304
10305 * window.c (Fset_window_margins, Fset_window_fringes)
10306 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10307 * textprop.c (Fprevious_property_change): No longer static.
10308 * syntax.c (Fsyntax_table_p): No longer static.
10309 * process.c (Fget_process, Fprocess_datagram_address): No longer
10310 static.
10311 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10312 * keyboard.c (Fcommand_execute): No longer static.
10313 Remove EXFUN.
10314 * insdel.c (Fcombine_after_change_execute): No longer static.
10315 * image.c (Finit_image_library): No longer static.
10316 * fileio.c (Fmake_symbolic_link): No longer static.
10317 * eval.c (Ffetch_bytecode): No longer static.
10318 * editfns.c (Fuser_full_name): No longer static.
10319 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10320 No longer static.
10321 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10322 static.
10323 * dired.c (Ffile_attributes): No longer static.
10324 * composite.c (Fcomposition_get_gstring): No longer static.
10325 * callproc.c (Fgetenv_internal): No longer static.
10326
10327 * ccl.h: Remove EXFUNs.
10328 * buffer.h: Remove EXFUNs.
10329 * dispextern.h: Remove EXFUNs.
10330 * intervals.h: Remove EXFUNs.
10331 * fontset.h: Remove EXFUN.
10332 * font.h: Remove EXFUNs.
10333 * dosfns.c (system_process_attributes): Remove EXFUN.
10334 * keymap.h: Remove EXFUNs.
10335 * lisp.h: Remove EXFUNs.
10336 * w32term.h: Remove EXFUNs.
10337 * window.h: Remove EXFUNs.
10338 * xsettings.h: Remove EXFUN.
10339 * xterm.h: Remove EXFUN.
10340
10341 2012-07-03 Glenn Morris <rgm@gnu.org>
10342
10343 * lisp.h (Frandom): Make it visible to C.
10344 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10345 buffer for invisible buffers. (Bug#1229)
10346
10347 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10348
10349 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10350 values which aren't power of 2.
10351 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
10352 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
10353 accordingly.
10354
10355 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10356
10357 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10358
10359 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10360
10361 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10362
10363 * alloc.c (allocate_vector_block): Remove redundant
10364 calls to mallopt if DOUG_LEA_MALLOC is defined.
10365 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10366 avoid calls to mallopt if zero_vector is returned.
10367
10368 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10369
10370 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10371 is enabled, avoid dereferencing NULL current_sblock if
10372 running undumped.
10373
10374 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10375
10376 Cleanup basic buffer management.
10377 * buffer.h (struct buffer): Change layout to use generic vector
10378 marking code. Fix some comments. Change type of 'clip_changed'
10379 to bitfield. Remove unused #ifndef old.
10380 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10381 (GET_OVERLAYS_AT): Fix indentation.
10382 (for_each_per_buffer_object_at): New macro.
10383 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10384 (Fbuffer_local_variables): Use it.
10385 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10386 * alloc.c (allocate_buffer): Adjust to match new layout of
10387 struct buffer. Fix comment.
10388 (mark_overlay): New function.
10389 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10390 Lisp area of struct buffer.
10391 (mark_object): Use it. Adjust marking of misc objects
10392 and related comments.
10393
10394 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10395
10396 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10397 wrapper that is not needed because the wrapped code is a no-op (zero
10398 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10399 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10400
10401 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10402
10403 * alloc.c (mark_buffer): Simplify. Remove prototype.
10404 (mark_object): Add comment. Reorganize marking of vector-like
10405 objects. Use CHECK_LIVE for all vector-like objects except buffers
10406 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10407 Avoid redundant calls to mark_vectorlike for bool vectors.
10408
10409 2012-06-30 Glenn Morris <rgm@gnu.org>
10410
10411 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10412
10413 * epaths.in (PATH_SITELOADSEARCH): New.
10414 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10415 This is rather than relying on --enable-locallisppath elements
10416 having "site-lisp" in their names. (Bug#10208#25, 11658)
10417
10418 2012-06-30 Eli Zaretskii <eliz@gnu.org>
10419
10420 * w32proc.c (sys_select): Accept and ignore one more argument.
10421
10422 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10423
10424 * sysselect.h [DOS_NT]: Don't include sys/select.h.
10425 (pselect) [!MS_DOS]: Redirect to sys_select.
10426
10427 * sysdep.c: Don't include dos.h and dosfns.h.
10428
10429 * process.c (sys_select):
10430 * msdos.c (sys_select): Accept one more argument and ignore it.
10431
10432 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10433 adapt data types and code to that.
10434
10435 * dosfns.c:
10436 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10437 which clashes with the gnulib function of the same name.
10438
10439 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10440
10441 * font.c (font_style_to_value, font_style_symbolic)
10442 (font_prop_validate_style): Add type checks for values in
10443 font_style_table.
10444
10445 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10446 argument.
10447 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10448 uses.
10449
10450 2012-06-29 Eli Zaretskii <eliz@gnu.org>
10451
10452 * xdisp.c (try_window_id): Undo last change.
10453
10454 * w32.c (getwd): Adjust commentary about startup_dir.
10455 (init_environment): Always call sys_access, even in non-MSVC
10456 builds. Don't chdir to the directory of the Emacs executable.
10457 This undoes code from 1997 which was justified by the need to
10458 "avoid conflicts when removing and renaming directories". But its
10459 downside was that every relative file name was being interpreted
10460 relative to the directory of the Emacs executable, which can never
10461 be TRT. In particular, it broke sys_access when called with
10462 relative file names.
10463 (sys_access): Map GetLastError to errno.
10464
10465 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10466
10467 * window.h (struct window): Change type of 'fringes_outside_margins'
10468 to bitfield. Fix comment. Adjust users accordingly.
10469 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
10470 Adjust comment.
10471 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10472 to ptrdiff_t.
10473
10474 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
10475
10476 * gnutls.c (emacs_gnutls_handshake):
10477 Add QUIT to make the loop interruptible.
10478
10479 2012-06-29 Glenn Morris <rgm@gnu.org>
10480
10481 * charset.c (init_charset): Make lack of etc/charsets fatal.
10482
10483 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10484
10485 * editfns.c (region_limit): Fix type mismatch.
10486
10487 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10488
10489 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10490 undefined. Convert from xassert to eassert.
10491 * nsmenu.m: Convert from xassert to eassert.
10492 * nsterm.m: Likewise.
10493
10494 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10495
10496 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10497
10498 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10499
10500 Avoid integer overflow on scroll-left and scroll-right.
10501 * window.c (HSCROLL_MAX): New macro.
10502 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10503 overflow when requested scroll falls outside ptrdiff_t range.
10504
10505 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10506
10507 * window.h (struct window): Change type of 'hscroll',
10508 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10509 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10510 Adjust users accordingly.
10511 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10512 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10513 from EMACS_INT to ptrdiff_t.
10514 (make_window): Omit redundant initialization.
10515
10516 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
10517
10518 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10519
10520 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10521
10522 * window.h (struct window): Change type of 'use_time' and
10523 'sequence_number' from Lisp_Object to int.
10524 * frame.c (make_frame): Adjust users accordingly.
10525 * print.c (print_object): Likewise.
10526 * window.c (select_window, Fwindow_use_time, make_parent_window)
10527 (make_window): Likewise.
10528
10529 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10530
10531 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10532 enabled with --enable-checking=[all,glyphs] configure option.
10533 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10534 adjust comments accordingly.
10535 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10536 undefined, adjust comments accordingly.
10537 * image.c: Likewise.
10538 * scroll.c: Likewise.
10539 * w32fns.c: Likewise.
10540 * w32term.c: Likewise.
10541 * xdisp.c: Likewise.
10542 * xfaces.c: Likewise.
10543 * xfns.c: Likewise.
10544 * xterm.c: Likewise.
10545
10546 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10547
10548 Generalize run-time debugging checks.
10549 * dispextern.h (XASSERTS): Remove.
10550 * fontset.c (xassert): Remove.
10551 Convert from xassert to eassert.
10552 * alloc.c: Convert from xassert to eassert.
10553 * bidi.c: Likewise.
10554 * dispnew.c: Likewise.
10555 * fns.c: Likewise.
10556 * fringe.c: Likewise.
10557 * ftfont.c: Likewise.
10558 * gtkutil.c: Likewise.
10559 * image.c: Likewise.
10560 * keyboard.c: Likewise.
10561 * menu.c: Likewise.
10562 * process.c: Likewise.
10563 * scroll.c: Likewise.
10564 * sound.c: Likewise.
10565 * term.c: Likewise.
10566 * w32console.c: Likewise.
10567 * w32fns.c: Likewise.
10568 * w32term.c: Likewise.
10569 * window.c: Likewise.
10570 * xdisp.c: Likewise.
10571 * xfaces.c: Likewise.
10572 * xfns.c: Likewise.
10573 * xselect.c: Likewise.
10574 * xterm.c: Likewise.
10575
10576 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10577
10578 * fns.c (maybe_resize_hash_table): Output message when growing the
10579 purify-hashtable.
10580
10581 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10582
10583 * alloc.c (allocate_string_data): Remove dead code.
10584 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10585 avoid GCC warning about unused macro.
10586
10587 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10588
10589 * alloc.c (allocate_string): Omit intervals initialization.
10590 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10591 as in make_pure_string and make_pure_c_string.
10592
10593 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10594
10595 * alloc.c (allocate_string): Fix last change.
10596
10597 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10598
10599 * alloc.c (allocate_string): Remove two redundant calls
10600 to memset, add explicit initialization where appropriate.
10601
10602 2012-06-27 Glenn Morris <rgm@gnu.org>
10603
10604 * lisp.mk (lisp): Remove paths.elc.
10605
10606 2012-06-27 Chong Yidong <cyd@gnu.org>
10607
10608 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10609
10610 2012-06-26 John Wiegley <johnw@newartisans.com>
10611
10612 * unexmacosx.c (copy_data_segment): Add two section names used
10613 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10614
10615 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10616 when building with Clang.
10617
10618 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10619
10620 * eval.c (Fapply): Allow calling it with a single argument.
10621
10622 2012-06-26 Eli Zaretskii <eliz@gnu.org>
10623
10624 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10625 _stricmp and _strnicmp.
10626 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10627
10628 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10629
10630 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10631 allocated window.
10632 (allocate_process): Likewise for new process.
10633 (allocate_terminal): Change to use offsetof.
10634 (allocate_frame): Likewise.
10635 * frame.c (make_frame): Omit redundant initialization.
10636 * window.c (make_parent_window): Use memset.
10637 (make_window): Omit redundant initialization.
10638 * process.c (make_process): Omit redundant initialization.
10639 * terminal.c (create_terminal): Likewise.
10640
10641 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10642
10643 * term.c (delete_tty): Remove redundant call to memset.
10644
10645 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10646
10647 * alloc.c: Remove build_string.
10648 * lisp.h: Define build_string as static inline. This provides
10649 a better opportunity to optimize away calls to strlen when the
10650 function is called with compile-time constant argument.
10651 * image.c (imagemagick_error): Convert to build_string.
10652 * w32proc.c (sys_spawnve): Likewise.
10653 * xterm.c (x_term_init): Likewise.
10654
10655 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10656
10657 Use sprintf return value instead of invoking strlen on result.
10658 In the old days this wasn't portable, since some sprintf
10659 implementations returned char *. But they died out years ago and
10660 Emacs already assumes sprintf returns int.
10661 Similarly for float_to_string.
10662 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10663 * ccl.c (ccl_driver):
10664 * character.c (string_escape_byte8):
10665 * data.c (Fnumber_to_string):
10666 * doprnt.c (doprnt):
10667 * print.c (print_object):
10668 * xdisp.c (message_dolog):
10669 * xfns.c (syms_of_xfns):
10670 Use sprintf or float_to_string result to avoid need to call strlen.
10671 * data.c (Fnumber_to_string):
10672 Use make_unibyte_string, since the string must be ASCII.
10673 * lisp.h, print.c (float_to_string): Now returns int length.
10674 * term.c (produce_glyphless_glyph):
10675 Use sprintf result rather than recomputing it.
10676
10677 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10678 * Makefile.in (ALL_CFLAGS):
10679 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10680 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10681
10682 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10683
10684 * dispextern.h (xstrcasecmp): Define to library function
10685 strcasecmp if available.
10686 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10687
10688 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10689
10690 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10691 Avoid comma operator.
10692 * menu.c (push_submenu_start, push_submenu_end)
10693 (push_left_right_boundary, push_menu_pane): Likewise.
10694 * msdos.c (dos_rawgetc): Likewise.
10695
10696 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10697
10698 * xfns.c (xic_create_fontsetname): Remove redundant calls
10699 to memset.
10700
10701 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10702
10703 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10704 sprintf already null-terminates its output.
10705
10706 * xfns.c (x_window): Remove redundant cast.
10707
10708 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10709
10710 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10711 `const char *' to `char *' to avoid compiler warning.
10712
10713 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10714
10715 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10716 instead of truncating it to 63 (admittedly a generous limit).
10717
10718 * process.c: Fix spelling and caps in comments.
10719
10720 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10721
10722 * emacs.c (setpgrp): Remove definition, unused.
10723 * sysdep.c (setpgrp): Remove definition, not used in this file.
10724
10725 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
10726
10727 * makefile.w32-in: Update dependencies.
10728
10729 2012-06-24 Eli Zaretskii <eliz@gnu.org>
10730
10731 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10732 (SYSTIME_H): Add nt/inc/sys/time.h.
10733
10734 * systime.h [WINDOWSNT]: Include sys/time.h.
10735
10736 * s/ms-w32.h (struct timespec): Definition moved from
10737 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10738
10739 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10740
10741 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10742 * buffer.h (buffer_slot_type_mismatch):
10743 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10744 * eval.c (unwind_to_catch):
10745 * image.c (my_png_error, my_error_exit):
10746 * keyboard.c (quit_throw_to_read_char, user_error)
10747 (Fexit_recursive_edit, Fabort_recursive_edit):
10748 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10749 (wrong_type_argument, buffer_overflow, __executable_start)
10750 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10751 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10752 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10753 (fatal):
10754 (child_setup) [!DOS_NT]:
10755 * lread.c (end_of_file_error, invalid_syntax):
10756 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10757 * puresize.h (pure_write_error):
10758 * search.c (matcher_overflow):
10759 * sound.c (sound_perror, alsa_sound_perror):
10760 * sysdep.c, syssignal.h (croak):
10761 * term.c (maybe_fatal, vfatal):
10762 * textprop.c (text_read_only):
10763 * undo.c (user_error):
10764 * unexmacosx.c (unexec_error):
10765 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10766 Use _Noreturn rather than NO_RETURN.
10767 No need for separate decl merely because of _Noreturn.
10768 * sound.c (sound_warning, parse_sound):
10769 Remove unnecessary forward decls.
10770
10771 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10772
10773 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10774 * lisp.h (WAIT_READING_MAX): New macro.
10775 * dispnew.c (Fsleep_for, sit_for):
10776 * keyboard.c (kbd_buffer_get_event):
10777 * process.c (Faccept_process_output):
10778 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10779 This improves on the previous patch, which introduced a bug
10780 when time_t is unsigned and as wide as intmax_t.
10781 See <http://bugs.gnu.org/9000#51>.
10782
10783 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10784
10785 * dispnew.c (sit_for, Fsleep_for):
10786 * keyboard.c (kbd_buffer_get_event):
10787 * process.c (Faccept_process_output): Avoid compiler warnings when
10788 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10789
10790 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
10791
10792 * makefile.w32-in: Update dependencies.
10793
10794 * w32.c (ltime): Add return type and declare static.
10795 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10796
10797 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10798
10799 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10800 Privately reported by Herbert J. Skuhra.
10801 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10802 All uses changed.
10803 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10804 not make_lisp_timeval, when the argument is of type EMACS_TIME.
10805
10806 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10807
10808 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10809 last argument of make_unibyte_string.
10810
10811 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10812 language ID in the event parameters.
10813
10814 * w32term.c (w32_read_socket): Put the new keyboard codepage into
10815 event.code, not the obscure "character set ID".
10816
10817 2012-06-23 Chong Yidong <cyd@gnu.org>
10818
10819 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10820
10821 2012-06-23 Eli Zaretskii <eliz@gnu.org>
10822
10823 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
10824 * w32.c (fdutimens): New function.
10825
10826 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10827
10828 * s/ms-w32.h (pselect): Redirect to sys_select.
10829
10830 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10831
10832 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10833 in the logic of incrementing and decrementing the value of
10834 use_relocatable_buffers.
10835
10836 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
10837
10838 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10839 Privately reported by Herbert J. Skuhra.
10840 [__FreeBSD__]: Remove "*/" typo after "#include".
10841 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10842 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10843 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10844 Don't assume EMACS_TIME and struct timeval are the same type.
10845
10846 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
10847
10848 Support higher-resolution time stamps (Bug#9000).
10849 The time stamps are only nanosecond-resolution at the C level,
10850 since that's the best that any real-world system supports now.
10851 But they are picosecond-resolution at the Lisp level, as that's
10852 easy, and leaves room for future OS improvements.
10853
10854 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10855 (LIBES): Use it.
10856
10857 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10858 Don't get current time unless it's needed.
10859
10860 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10861 now provides it if it's absent.
10862 (start_atimer): Port to higher-res time stamps.
10863 Check for time stamp overflow. Don't get current time more
10864 often than is needed.
10865
10866 * buffer.h (struct buffer): Buffer modtime now has high resolution.
10867 Include systime.h, not time.h.
10868 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10869
10870 * dired.c: Include stat-time.h.
10871 (Ffile-attributes): File times now have higher resolution.
10872
10873 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10874 (struct image): Timestamp now has higher resolution.
10875
10876 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10877 has at least microseconds now. All uses removed.
10878 (update_frame, update_single_window, update_window, update_frame_1)
10879 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
10880 (duration_to_sec_usec): Remove; no longer needed.
10881
10882 * editfns.c (time_overflow): Now extern.
10883 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10884 (float-time, Fformat_time_string, Fcurrent_time_string)
10885 (Fcurrent_time_zone): Accept and generate higher-resolution
10886 time stamps.
10887 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10888 (decode_time_components, lisp_seconds_argument): New functions.
10889 (make_time): Now static.
10890 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
10891 Report an error if the time is invalid, rather than having the caller
10892 do that.
10893
10894 * fileio.c: Include <stat-time.h>
10895 (Fcopy_file): Copy higher-resolution time stamps.
10896 Prefer to set the time stamp via a file descriptor if that works.
10897 (Fset_file_times, Finsert_file_contents, Fwrite_region)
10898 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10899 (Fvisited_file_modtime, Fset_visited_file_modtime):
10900 Support higher-resolution time stamps.
10901
10902 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10903
10904 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10905
10906 * image.c (prepare_image_for_display, clear_image_cache)
10907 (lookup_image): Port to higer-resolution time stamps.
10908
10909 * keyboard.c (start_polling, bind_polling_period):
10910 Check for time stamp overflow.
10911 (read_char, kbd_buffer_get_event, timer_start_idle)
10912 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10913 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10914 Port to higher-resolution time stamps. Do not assume time_t is signed.
10915 (decode_timer): New function. Timers are now vectors of length 9,
10916 not 8, to accommodate the picosecond component.
10917 (timer_check_2): Use it.
10918
10919 * nsterm.m (select_timeout, timeval_subtract): Remove.
10920 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10921 as they're a bit more accurate and handle overflow better.
10922 (ns_select): Change prototype to be compatible with pselect.
10923 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10924 * nsterm.h (ns_select): Adjust prototype.
10925
10926 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10927 us-resolution time stamps.
10928 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10929
10930 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10931
10932 * lisp.h (time_overflow): New decl.
10933 (wait_reading_process_output): First arg is now intmax_t, not int,
10934 to accommodate larger waits.
10935
10936 * process.h (struct Lisp_Process.read_output_delay):
10937 Now counts nanoseconds, not microseconds.
10938 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
10939 EMACS_HAS_USECS.
10940 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
10941 (wait_reading_process_output):
10942 Port to ns-resolution time stamps.
10943 (Faccept_process_output, wait_reading_process_output):
10944 Check for time stamp overflow. Do not assume time_t is signed.
10945 (select_wrapper): Remove; we now use pselect.
10946 (Fprocess_attributes): Now generates ns-resolution time stamps.
10947
10948 * sysdep.c: Include utimens.h. Don't include utime.h
10949 or worry about struct utimbuf; gnulib does that for us now.
10950 (gettimeofday): Remove; gnulib provides a substitute.
10951 (make_timeval): New function.
10952 (set_file_times): Now sets ns-resolution time stamps.
10953 New arg FD; all uses changed.
10954 (time_from_jiffies, ltime_from_jiffies, get_up_time)
10955 (system_process_attributes):
10956 Now returns ns-resolution time stamp. All uses changed.
10957 Check for time stamp overflow.
10958
10959 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
10960 provides a substitute now.
10961
10962 * systime.h: Include timespec.h rather than sys/time.h and time.h,
10963 since it guarantees struct timespec.
10964 (EMACS_TIME): Now struct timespec, so that we can support
10965 ns-resolution time stamps.
10966 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
10967 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
10968 (EMACS_USECS): Remove.
10969 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
10970 so multiply the arg by 1000 before storing it.
10971 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
10972 New macros.
10973 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
10974 Port to ns-resolution time stamps.
10975 (EMACS_TIME_NEG_P): Remove; replaced by....
10976 (EMACS_TIME_SIGN): New macro.
10977 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
10978 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
10979 (set_file_times, make_time, lisp_time_argument): Adjust signature.
10980 (make_timeval, make_lisp_time, decode_time_components): New decls.
10981 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
10982 that it mishandled time_t overflow. You can't compare by subtracting!
10983 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
10984 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
10985
10986 * term.c: Include <sys/time.h>.
10987 (timeval_to_Time): New function, for proper overflow wraparound.
10988 (term_mouse_position, term_mouse_click): Use it.
10989
10990 * undo.c (record_first_change): Support higher-resolution time stamps
10991 in the undo buffer.
10992 (Fprimitive_undo): Use them when restoring time stamps.
10993
10994 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
10995 (w32_get_internal_run_time):
10996 Port to higher-resolution Emacs time stamps.
10997 (ltime): Now accepts single 64-bit integer, as that's more convenient
10998 for callers.
10999
11000 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11001
11002 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11003 for compatibility with pselect. Support ns-resolution time stamps.
11004
11005 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11006
11007 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11008 Check for time stamp overflow, and support ns-resolution time stamps.
11009
11010 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11011 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11012 (timeval_subtract): Remove; no longer needed.
11013 (XTflash, XTring_bell, x_wait_for_event):
11014 Port to ns-resolution time stamps. Don't assume time_t is signed.
11015
11016 2012-06-22 Chong Yidong <cyd@gnu.org>
11017
11018 * xdisp.c (x_consider_frame_title): Revert last change.
11019
11020 2012-06-22 Eli Zaretskii <eliz@gnu.org>
11021
11022 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11023 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11024 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11025 staticidx goes up to 1597 out of 1600 = 0x640.)
11026
11027 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11028
11029 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11030 Otherwise, the umask might be mistakenly 0 while handling input signals.
11031
11032 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11033
11034 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11035
11036 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11037
11038 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11039 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11040 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11041 access to `contents' member of Lisp_Vector objects with AREF and ASET
11042 where appropriate.
11043
11044 2012-06-19 Chong Yidong <cyd@gnu.org>
11045
11046 * frame.c (delete_frame): When selecting a frame on a different
11047 text terminal, do not alter the terminal's top-frame.
11048
11049 * xdisp.c (format_mode_line_unwind_data): Record the target
11050 frame's selected window and its terminal's top-frame.
11051 (unwind_format_mode_line): Restore them.
11052 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11053 Callers changed.
11054 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11055 since tty frames can be explicitly named.
11056 (prepare_menu_bars): Likewise.
11057
11058 * term.c (Ftty_top_frame): New function.
11059
11060 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11061
11062 Port byte-code-meter to modern targets.
11063 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11064 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
11065 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11066 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11067 (METER_1, METER_2): Simplify.
11068
11069 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11070
11071 * data.c (Fdefalias): Return `symbol' (bug#11686).
11072
11073 2012-06-18 Martin Rudalics <rudalics@gmx.at>
11074
11075 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11076 gets killed during executing of this function (Bug#11665).
11077 Try to always return Qt when the buffer has been actually killed.
11078 (Vkill_buffer_query_functions): In doc-string say that functions
11079 run by this hook should not change the current buffer.
11080
11081 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11082
11083 Fix recently-introduced process.c problems found by static checking.
11084 * process.c (write_queue_push, write_queue_pop, send_process):
11085 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11086 (write_queue_pop): Fix pointer signedness problem.
11087 (send_process): Remove unused local.
11088
11089 2012-06-17 Chong Yidong <cyd@gnu.org>
11090
11091 * xdisp.c (redisplay_internal): No need to redisplay terminal
11092 frames that are not on top.
11093
11094 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
11095
11096 * process.c (make_process): Initialize write_queue.
11097 (write_queue_push, write_queue_pop): New functions.
11098 (send_process): Use them to maintain correct ordering of process
11099 writes (Bug#10815).
11100
11101 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11102
11103 * lisp.h (eassert): Assume C89 or later.
11104 This removes the need for CHECK.
11105 (CHECK): Remove. Its comments about always evaluating its
11106 argument were confusing, as 'eassert' typically does not evaluate
11107 its argument.
11108
11109 * coding.c (produce_chars): Use ptrdiff_t, not int.
11110
11111 * xterm.c (x_draw_underwave): Check for integer overflow.
11112 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11113
11114 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
11115
11116 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11117 referenced (Bug#11583).
11118
11119 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11120
11121 Implement wave-style variant of underlining.
11122 * dispextern.h (face_underline_type): New enum.
11123 (face): Add field for underline type.
11124 * nsterm.m (ns_draw_underwave): New function.
11125 (ns_draw_text_decoration): Use it.
11126 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11127 New functions.
11128 (x_draw_glyph_string): Use them.
11129 * xfaces.c (Qline, Qwave): New Lisp objects.
11130 (check_lface_attrs, merge_face_ref)
11131 (Finternal_set_lisp_face_attribute, realize_x_face):
11132 Handle wave-style underline face attributes.
11133 * xterm.c (x_draw_underwave): New function.
11134 (x_draw_glyph_string): Use it.
11135
11136 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
11137
11138 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11139 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11140 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11141 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11142 ($(BLD)/w32select.$(O)): Update dependencies.
11143
11144 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11145
11146 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11147 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11148 * character.c (_fetch_multibyte_char_p): Remove.
11149 * alloc.c: Include "character.h" before "buffer.h".
11150 * bidi.c: Likewise.
11151 * buffer.c: Likewise.
11152 * bytecode.c: Likewise.
11153 * callint.c: Likewise.
11154 * callproc.c: Likewise.
11155 * casefiddle.c: Likewise.
11156 * casetab.c: Likewise.
11157 * category.c: Likewise.
11158 * cmds.c: Likewise.
11159 * coding.c: Likewise.
11160 * composite.c: Likewise.
11161 * dired.c: Likewise.
11162 * dispnew.c: Likewise.
11163 * doc.c: Likewise.
11164 * dosfns.c: Likewise.
11165 * editfns.c: Likewise.
11166 * emacs.c: Likewise.
11167 * fileio.c: Likewise.
11168 * filelock.c: Likewise.
11169 * font.c: Likewise.
11170 * fontset.c: Likewise.
11171 * fringe.c: Likewise.
11172 * indent.c: Likewise.
11173 * insdel.c: Likewise.
11174 * intervals.c: Likewise.
11175 * keyboard.c: Likewise.
11176 * keymap.c: Likewise.
11177 * lread.c: Likewise.
11178 * macros.c: Likewise.
11179 * marker.c: Likewise.
11180 * minibuf.c: Likewise.
11181 * nsfns.m: Likewise.
11182 * nsmenu.m: Likewise.
11183 * print.c: Likewise.
11184 * process.c: Likewise.
11185 * regex.c: Likewise.
11186 * region-cache.c: Likewise.
11187 * search.c: Likewise.
11188 * syntax.c: Likewise.
11189 * term.c: Likewise.
11190 * textprop.c: Likewise.
11191 * undo.c: Likewise.
11192 * unexsol.c: Likewise.
11193 * w16select.c: Likewise.
11194 * w32fns.c: Likewise.
11195 * w32menu.c: Likewise.
11196 * window.c: Likewise.
11197 * xdisp.c: Likewise.
11198 * xfns.c: Likewise.
11199 * xmenu.c: Likewise.
11200 * xml.c: Likewise.
11201 * xselect.c: Likewise.
11202
11203 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11204
11205 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11206 If all the glyphs of the glyph row came from strings, and we have no
11207 cursor positioning clues, put the cursor on the first glyph of the
11208 row.
11209 (handle_face_prop): Use chunk-relative overlay string index when
11210 indexing into it->string_overlays array. (Bug#11653)
11211 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11212 the rightmost. (Bug#11720)
11213
11214 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11215
11216 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11217 (CATEGORY_MEMBER): Enforce 1/0 value.
11218 * category.c (_temp_category_set): Remove.
11219
11220 2012-06-16 Eli Zaretskii <eliz@gnu.org>
11221
11222 * window.c (Fdelete_other_windows_internal)
11223 (Fdelete_window_internal): Don't access frame's mouse highlight
11224 info of the initial frame. (Bug#11677)
11225
11226 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11227
11228 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11229 Assume USE_2_TAGS_FOR_INTS.
11230 (xreload): Adjust $tagmask width to match recent lisp.h change.
11231
11232 Simplify lisp.h in minor ways that should not affect code.
11233 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11234 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11235 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11236 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11237 (INTTYPEBITS): New macro, for clarity.
11238 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11239 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11240 Simplify now that USE_LSB_TAG is always defined.
11241 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11242 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11243
11244 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
11245
11246 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11247
11248 2012-06-13 Glenn Morris <rgm@gnu.org>
11249
11250 * s/bsd-common.h (BSD4_3):
11251 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11252
11253 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11254
11255 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11256 instead of union.
11257 (XLI, XIL): Define.
11258 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11259 Use them.
11260 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11261 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11262 * alloc.c (widen_to_Lisp_Object): Remove.
11263 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11264 * frame.c (delete_frame): Remove outdated comment.
11265 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11266 USE_LISP_UNION_TYPE.
11267 (Fw32_unregister_hot_key): Likewise.
11268 (Fw32_toggle_lock_key): Likewise.
11269 * w32menu.c (add_menu_item): Likewise.
11270 (w32_menu_display_help): Use XIL instead of checking
11271 USE_LISP_UNION_TYPE.
11272 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11273 (init_heap): Likewise.
11274 * w32term.c (w32_read_socket): Update comment.
11275
11276 2012-06-13 Glenn Morris <rgm@gnu.org>
11277
11278 * s/usg5-4-common.h, src/s/unixware.h:
11279 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11280
11281 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11282
11283 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11284
11285 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11286 * alloc.c (make_number) [!defined make_number]:
11287 Remove, as lisp.h always defines this now.
11288 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11289 (roundup_size): Verify that it is a power of 2.
11290 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11291 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11292 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11293 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11294 USE_LSB_TAG now is always defined to be either 0 or 1.
11295 All uses changed.
11296 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11297 code works fine either way, and efficiency is not a concern here,
11298 as the union type is for debugging, not for production.
11299 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11300 Use an inline function on all platforms when using the union type,
11301 since this is simpler and 'static inline' can be used portably
11302 within Emacs now.
11303 (LISP_INITIALLY_ZERO): New macro.
11304 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11305 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11306
11307 2012-06-12 Glenn Morris <rgm@gnu.org>
11308
11309 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11310
11311 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
11312
11313 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11314 Move BROKEN_SIGIO to configure.
11315
11316 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11317 Move NO_TERMIO to configure.
11318
11319 2012-06-12 Chong Yidong <cyd@gnu.org>
11320
11321 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11322 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11323 MagickExportImagePixels is undefined.
11324
11325 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11326
11327 * image.c (imagemagick_load_image): Remove unused label.
11328
11329 2012-06-11 Glenn Morris <rgm@gnu.org>
11330
11331 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11332 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11333 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11334 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11335
11336 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11337
11338 * alloc.c (make_byte_code): New function.
11339 (Fmake_byte_code): Use it. Don't purify here.
11340 * lread.c (read1): Use it as well to avoid extra allocation.
11341
11342 2012-06-11 Chong Yidong <cyd@gnu.org>
11343
11344 * image.c (imagemagick_load_image): Implement transparency.
11345
11346 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11347
11348 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11349 account for preceding backslashes. (Bug#11663)
11350
11351 2012-06-09 Chong Yidong <cyd@gnu.org>
11352
11353 * term.c: Support italics in capable terminals (Bug#9652).
11354 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11355 (turn_on_face): Output using TS_enter_italic_mode if available.
11356 Don't handle unused blinking and alt-charset cases.
11357 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11358 and tty_alt_charset_p cases.
11359 (tty_capable_p, init_tty): Support italics.
11360
11361 * termchar.h (struct tty_display_info): Add field for italics.
11362 Remove unused blink field.
11363
11364 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11365 Handle slant.
11366
11367 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11368 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11369 tty_alt_charset_p. Add tty_italic_p.
11370
11371 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
11372
11373 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11374 dbus_type_is_basic if available.
11375 (xd_extract_signed, xd_extract_unsigned): Rename from
11376 extract_signed and extract_unsigned, respectively. Adapt callers.
11377
11378 2012-06-09 Chong Yidong <cyd@gnu.org>
11379
11380 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11381
11382 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11383 case (Bug#9752).
11384
11385 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11386
11387 * xdisp.c (vmessage): Treat frame message as multibyte.
11388 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11389 would generate the diagnostic "Making \302\247 buffer-local while
11390 let-bound!".
11391
11392 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11393
11394 * dispnew.c (showing_window_margins_p): Undo last change, which
11395 was done due to an inadvertent commit.
11396 (adjust_frame_glyphs_for_frame_redisplay): Do call
11397 showing_window_margins_p.
11398
11399 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11400
11401 * eval.c (Fmake_var_non_special): New primitive.
11402 (syms_of_eval): Defsubr it.
11403 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11404
11405 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
11406
11407 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11408 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11409
11410 2012-06-08 Eli Zaretskii <eliz@gnu.org>
11411
11412 * alloc.c (allocate_vectorlike): Fix last change.
11413
11414 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11415
11416 Block-based vector allocation of small vectors.
11417 * lisp.h (struct vectorlike_header): New field `nbytes',
11418 adjust comment accordingly.
11419 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
11420 to denote vector blocks. Adjust users (live_vector_p,
11421 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11422 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11423 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11424 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11425 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11426 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11427 (roundup_size): New constant.
11428 (struct vector_block): New data type.
11429 (vector_blocks, vector_free_lists, zero_vector): New variables.
11430 (all_vectors): Rename to `large_vectors'.
11431 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11432 (sweep_vectors): New functions.
11433 (allocate_vectorlike): Return `zero_vector' as the only vector of
11434 0 items. Allocate new vector from block if vector size is less than
11435 or equal to VBLOCK_BYTES_MAX.
11436 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11437 (init_alloc_once): Add call to init_vectors.
11438
11439 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11440
11441 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11442
11443 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11444
11445 * doprnt.c (doprnt): Truncate multibyte char correctly.
11446 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11447 would mishandle a string argument "Xc" if X was a multibyte
11448 character of length 2: it would truncate after X's first byte
11449 rather than including all of X.
11450
11451 2012-06-06 Chong Yidong <cyd@gnu.org>
11452
11453 * buffer.c (word_wrap): Doc fix.
11454
11455 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11456
11457 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11458
11459 2012-06-03 Glenn Morris <rgm@gnu.org>
11460
11461 * xdisp.c (tool-bar-style): Doc fix.
11462
11463 2012-06-03 Ulrich Müller <ulm@gentoo.org>
11464
11465 * Makefile.in (PAXCTL): Define.
11466 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11467 binary via PaX flags if the paxctl utility is available.
11468 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11469 Restore PaX flags to their default. (Bug#11398)
11470
11471 2012-06-03 Chong Yidong <cyd@gnu.org>
11472
11473 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11474 buffer (Bug#11226).
11475
11476 2012-06-03 Chong Yidong <cyd@gnu.org>
11477
11478 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11479 (note_mode_line_or_margin_highlight): If there is no help echo,
11480 use mode-line-default-help-echo. Handle the case where the mouse
11481 position is past the end of the mode line string.
11482
11483 * buffer.c (buffer_local_value_1): New function, split from
11484 Fbuffer_local_value; can return Qunbound.
11485 (Fbuffer_local_value): Use it.
11486 (Vmode_line_format): Docstring tweaks.
11487
11488 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11489
11490 * sysdep.c (system_process_attributes): Improve comment.
11491
11492 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11493
11494 * keyboard.c: Export real-this-command to Elisp.
11495 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11496 and DEFVAR it. Update all users.
11497
11498 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11499
11500 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11501
11502 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11503 Convert pctcpu and pctmem to Lisp float properly.
11504 Let the compiler fold better, as 100.0/0x8000 is exact.
11505
11506 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11507
11508 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11509 cons_block.
11510
11511 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11512
11513 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11514
11515 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11516
11517 For a 'struct window', replace some Lisp_Object fields to
11518 bitfields where appropriate, remove unused fields.
11519 * window.h (struct window): Remove unused 'last_mark_x' and
11520 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
11521 change its type from Lisp_Object to bitfield.
11522 Change type of 'force_start', 'optional_new_start',
11523 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
11524 fields from Lisp_Object to bitfield. Adjust users accordingly.
11525
11526 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11527
11528 Pacify gcc -Wdouble-precision when using Xaw.
11529 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11530 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11531 Use 'float' consistently, rather than 'float' in most places
11532 and 'double' in a couple of places.
11533
11534 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11535
11536 * xdisp.c (handle_stop): Detect whether we have overlay strings
11537 loaded by testing it->current.overlay_string_index to be
11538 non-negative, instead of checking whether n_overlay_strings is
11539 positive. (Bug#11587)
11540
11541 2012-05-31 Chong Yidong <cyd@gnu.org>
11542
11543 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11544
11545 * doc.c (Fsubstitute_command_keys): Doc fix.
11546
11547 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11548
11549 * search.c (search_buffer): Remove calls to
11550 r_alloc_inhibit_buffer_relocation, as it is now called by
11551 maybe_unify_char, which was the cause of relocation of buffer text
11552 in bug#11519.
11553
11554 2012-05-31 Eli Zaretskii <eliz@gnu.org>
11555
11556 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11557 for the duration of call to load_charset, to avoid problems with
11558 callers of maybe_unify_char that access buffer text through C
11559 pointers.
11560
11561 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11562 decrement the inhibition flag, instead of just setting or
11563 resetting it.
11564
11565 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11566
11567 Remove obsolete '#define static' cruft.
11568 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11569 This #undef was "temporary" in 2000; it is no longer needed
11570 now that '#define static' has gone away.
11571 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11572 (gray_bitmap_bits): Remove; no longer needed.
11573 All uses replaced with definiens.
11574 * xterm.c: Include "bitmaps/gray.xbm".
11575
11576 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11577
11578 Clean up __executable_start, monstartup when --enable-profiling.
11579 The following changes affect the code only when profiling.
11580 * dispnew.c (__executable_start): Rename from safe_bcopy.
11581 Define only on platforms that need it.
11582 * emacs.c: Include <sys/gmon.h> when profiling.
11583 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11584 (__executable_start): Remove decl, since lisp.h does it now.
11585 (safe_bcopy): Remove decl; no longer has that name.
11586 (main): Coalesce #if into single bit of code, for simplicity.
11587 Cast pointers to uintptr_t, since standard libraries want integers
11588 and not pointers.
11589 * lisp.h (__executable_start): New decl.
11590
11591 2012-05-31 Glenn Morris <rgm@gnu.org>
11592
11593 * image.c (Fimagemagick_types): Doc fix.
11594
11595 2012-05-30 Jim Meyering <meyering@redhat.com>
11596
11597 * callproc.c (Fcall_process_region): Include directory component
11598 in mkstemp error message (Bug#11586).
11599
11600 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11601
11602 * alloc.c, lisp.h (make_pure_vector): Now static.
11603
11604 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11605
11606 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11607 Move to byte-run.el.
11608 (Fautoload): Do the hash-doc more carefully.
11609 * data.c (Fdefalias): Purify definition, except for keymaps.
11610 (Qdefun): Move from eval.c.
11611 * lisp.h (Qdefun): Remove.
11612 * lread.c (read1): Tiny simplification.
11613
11614 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
11615
11616 Do not create empty overlays with the evaporate property (Bug#9642).
11617 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11618 Bug#9642, but explicitly check that the buffer the overlay would
11619 be moved to is live and rearrange lines to make sure that errors
11620 will not put the overlay in an inconsistent state.
11621 (Fdelete_overlay): Cosmetics.
11622
11623 2012-05-28 Eli Zaretskii <eliz@gnu.org>
11624
11625 * w32term.c (my_bring_window_to_top): New function.
11626 (x_raise_frame): Use handle returned by DeferWindowPos, which
11627 could be different from the original one.
11628 Call my_bring_window_to_top instead of my_set_foreground_window.
11629 (Bug#11513)
11630
11631 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11632 by calling BringWindowToTop.
11633
11634 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11635 (WM_EMACS_END): Increase by one.
11636
11637 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11638
11639 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11640 This avoids undefined behavior that might cause the eassert
11641 to not catch an out-of-range value.
11642
11643 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
11644
11645 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11646 Update dependencies.
11647
11648 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11649
11650 * bidi.c (bidi_mirror_char): Fix last change.
11651
11652 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11653
11654 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11655 when referring to sectname field in printf format.
11656
11657 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11658
11659 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11660 Only r_alloc_inhibit_buffer_relocation needed to be added;
11661 the others were already declared.
11662
11663 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11664 before checking whether it's out of range. Put the check inside
11665 eassert. See
11666 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11667
11668 2012-05-27 Ken Brown <kbrown@cornell.edu>
11669
11670 * callproc.c (Fcall_process): Restore a line that was accidentally
11671 commented out in the 2011-02-13 change (bug#11547).
11672
11673 2012-05-27 Eli Zaretskii <eliz@gnu.org>
11674
11675 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11676 defined on ralloc.c.
11677
11678 * buffer.c [REL_ALLOC]: Remove prototypes of
11679 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11680 they are now on lisp.h.
11681
11682 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11683
11684 * search.c (search_buffer): Use it to inhibit relocation of buffer
11685 text while re_search_2 is doing its job, because re_search_2 is
11686 passed C pointers to buffer text. (Bug#11519)
11687
11688 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11689 Update value to 24.
11690
11691 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11692 state after an additional call to move_it_in_display_line_to, keep
11693 the values of it->max_ascent and it->max_descent found for the
11694 entire line.
11695 (pos_visible_p): Revert the comparison against bottom_y to what it
11696 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11697 (Bug#11464)
11698
11699 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11700
11701 Fix coding-related core dumps with gcc -ftrapv.
11702 The code was computing A - B, where A and B are pointers, and B is
11703 random garbage. This can lead to core dumps on platforms that
11704 have special pointer registers, and it also leads to core dumps on
11705 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11706 A - B only when B is initialized properly.
11707 * coding.c (coding_set_source, coding_set_destination): Return void.
11708 (coding_change_source, coding_change_destinations): New functions,
11709 with the old behaviors of coding_set_source and coding_set_destination.
11710 All callers that need an offset changed to use these new functions.
11711
11712 2012-05-26 Glenn Morris <rgm@gnu.org>
11713
11714 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11715
11716 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11717
11718 Extend mouse support on W32 text-mode console.
11719 * xdisp.c (draw_row_with_mouse_face):
11720 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
11721
11722 * w32console.c: Include window.h.
11723 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11724 New functions.
11725 (initialize_w32_display): Initialize mouse-highlight data.
11726
11727 * w32inevt.c: Include termchar.h and window.h.
11728 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11729 moves, call note_mouse_highlight. If help_echo changed, call
11730 gen_help_event to produce help-echo message in the echo area.
11731 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11732 highlight info.
11733
11734 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11735
11736 * lread.c (read1): Simplify slightly to avoid an overflow warning
11737 with GCC 4.7.0 on x86-64.
11738
11739 2012-05-26 Eli Zaretskii <eliz@gnu.org>
11740
11741 * bidi.c (bidi_mirror_char): Revert last change: an int is
11742 definitely wide enough here.
11743
11744 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
11745
11746 Fix integer width and related bugs (Bug#9874).
11747 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
11748 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11749 (string_bytes, check_sblock, allocate_string_data):
11750 (compact_small_strings, Fmake_bool_vector, make_string)
11751 (make_unibyte_string, make_multibyte_string)
11752 (make_string_from_bytes, make_specified_string)
11753 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11754 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11755 (mark_vectorlike):
11756 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11757 (allocate_pseudovector):
11758 Use int, not EMACS_INT, where int is wide enough.
11759 (inhibit_garbage_collection, Fgarbage_collect):
11760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11761 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11762 int might not be wide enough.
11763 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11764 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11765 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11766 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11767 (bidi_level_of_next_char, bidi_move_to_visually_next):
11768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11769 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11770 (Fkill_buffer, Fset_buffer_major_mode)
11771 (advance_to_char_boundary, Fbuffer_swap_text)
11772 (Fset_buffer_multibyte, overlays_at, overlays_in)
11773 (overlay_touches_p, struct sortvec, record_overlay_string)
11774 (overlay_strings, recenter_overlay_lists)
11775 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11776 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11777 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11778 (Foverlay_recenter, last_overlay_modification_hooks_used)
11779 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11780 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11781 (validate_region): Omit unnecessary test for b <= e,
11782 since that's guaranteed by the previous test.
11783 (adjust_overlays_for_delete): Avoid pos + length overflow.
11784 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11785 (report_overlay_modification):
11786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11787 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11788 Omit pointer cast, which isn't needed anyway, and doesn't work
11789 after the EMACS_INT -> ptrdiff_t change.
11790 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
11791 * buffer.h: Adjust decls to match defn changes elsewhere.
11792 (struct buffer_text, struct buffer):
11793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11794 Use EMACS_INT, not int, where int might not be wide enough.
11795 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11796 not int, to avoid needless 32-bit limit on 64-bit hosts.
11797 (exec_byte_code): Use tighter memory-full test, one that checks
11798 for alloca overflow. Don't compute the address of the object just
11799 before an array, as that's not portable. Use EMACS_INT, not
11800 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
11801 * callint.c (Fcall_interactively):
11802 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11803 * callproc.c (call_process_kill, Fcall_process):
11804 Don't assume pid_t fits into an Emacs fixnum.
11805 (call_process_cleanup, Fcall_process, child_setup):
11806 Don't assume pid_t fits into int.
11807 (call_process_cleanup, Fcall_process, delete_temp_file)
11808 (Fcall_process_region):
11809 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11810 (Fcall_process): Simplify handling of volatile integers.
11811 Use int, not EMACS_INT, where int will do.
11812 * casefiddle.c (casify_object, casify_region, operate_on_word)
11813 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11815 (casify_object): Avoid integer overflow when overallocating buffer.
11816 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
11817 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
11818 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11819 * category.h (CATEGORYP): Don't assume arg is nonnegative.
11820 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11821 integers are now checked earlier. All uses replaced with XINT.
11822 (ccl_driver):
11823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11824 For CCL_MapSingle, check that content and value are in int range.
11825 (ccl_driver, Fregister_code_conversion_map):
11826 Check that Vcode_version_map_vector is a vector.
11827 (resolve_symbol_ccl_program): Check that vector header is in range.
11828 Always copy the vector, so that we can check its contents reliably
11829 now rather than having to recheck each instruction as it's being
11830 executed. Check that vector words fit in 'int'.
11831 (ccl_get_compiled_code, Fregister_ccl_program)
11832 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11833 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11834 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11835 contents are in range.
11836 (Fccl_execute_on_string): Check that status is in range.
11837 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11838 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11839 Accept and return EMACS_INT, not int, because callers can pass values
11840 out of 'int' range.
11841 (c_string_width, strwidth, lisp_string_width, chars_in_text)
11842 (multibyte_chars_in_text, parse_str_as_multibyte)
11843 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11844 (str_as_unibyte, str_to_unibyte, string_count_byte8)
11845 (string_escape_byte8, Fget_byte):
11846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11847 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
11848 avoid mishandling large integers.
11849 * character.h: Adjust decls to match defn changes elsewhere.
11850 * charset.c (load_charset_map_from_file, find_charsets_in_text)
11851 (Ffind_charset_region):
11852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11853 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11854 (load_charset_map_from_vector, Fdefine_charset_internal):
11855 Don't assume fixnum fits in int.
11856 (load_charset_map_from_vector, Fmap_charset_chars):
11857 Remove now-unnecessary CHECK_NATNUMs.
11858 (Fdefine_charset_internal): Check ranges here, more carefully.
11859 Don't rely on undefined behavior with signed left shift overflow.
11860 Don't assume unsigned int fits into fixnum, or that fixnum fits
11861 into unsigned int. Don't require max_code to be a valid fixnum;
11862 that's not true for gb10830 4-byte on a 32-bit host. Allow
11863 invalid_code to be a cons, for the same reason. Require code_offset
11864 to be a character. Avoid int overflow if max_char is close
11865 to INT_MAX.
11866 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11867 this is intended anyway and avoids some undefined behavior.
11868 (load_charset_map): Pass unsigned, not int, as 2nd arg of
11869 INDEX_TO_CODE_POINT, as that's what it expects.
11870 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
11871 * charset.h (DECODE_CHAR): Return int, not unsigned;
11872 this is what was intended anyway, and it avoids undefined behavior.
11873 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11874 integer-overflow issues.
11875 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11876 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11877 where the argument is EMACS_INT, and this behavior is not intended.
11878 * chartab.c (Fmake_char_table, Fset_char_table_range)
11879 (uniprop_get_decoder, uniprop_get_encoder):
11880 Don't assume fixnum fits in int.
11881 * cmds.c (move_point): New function, that does the gist of
11882 Fforward_char and Fbackward_char, but does so while checking
11883 for integer overflow more accurately.
11884 (Fforward_char, Fbackward_char): Use it.
11885 (Fforward_line, Fend_of_line, internal_self_insert)
11886 (internal_self_insert):
11887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11888 Fix a FIXME, by checking for integer overflow when calculating
11889 target_clm and actual_clm.
11890 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
11891 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
11892 (ASSURE_DESTINATION, coding_alloc_by_realloc)
11893 (coding_alloc_by_making_gap, alloc_destination)
11894 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11895 (encode_coding_utf_16, detect_coding_emacs_mule)
11896 (decode_coding_emacs_mule, encode_coding_emacs_mule)
11897 (detect_coding_iso_2022, decode_coding_iso_2022)
11898 (encode_invocation_designation, encode_designation_at_bol)
11899 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11900 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11901 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11902 (encode_coding_ccl, encode_coding_raw_text)
11903 (detect_coding_charset, decode_coding_charset)
11904 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11905 (produce_composition, produce_charset, produce_annotation)
11906 (decode_coding, handle_composition_annotation)
11907 (handle_charset_annotation, consume_chars, decode_coding_gap)
11908 (decode_coding_object, encode_coding_object, detect_coding_system)
11909 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11910 (code_convert_region, code_convert_string)
11911 (Fdefine_coding_system_internal)
11912 (coding_set_source, coding_set_destination):
11913 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11914 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11915 (Fdefine_coding_system_internal):
11916 Don't assume fixnums fit in int.
11917 (decode_coding_gap, decode_coding_object, encode_coding_object)
11918 (Fread_coding_system, Fdetect_coding_region)
11919 (Funencodable_char_position, Fcheck_coding_systems_region)
11920 (get_translation, handle_composition_annotation, consume_chars):
11921 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11922 (consume_chars): Rewrite to not calculate an address outside buffer.
11923 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
11924 Don't access memory outside of the args array.
11925 (Fdefine_coding_system_internal): Check for charset-id overflow.
11926 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11927 result of ENCODE_CHAR.
11928 * coding.h: Adjust decls to match defn changes elsewhere.
11929 (struct coding_system):
11930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11931 * composite.c (get_composition_id, find_composition)
11932 (run_composition_function, update_compositions)
11933 (compose_text, composition_gstring_put_cache)
11934 (composition_gstring_p, composition_gstring_width)
11935 (fill_gstring_header, fill_gstring_body, autocmp_chars)
11936 (composition_compute_stop_pos, composition_reseat_it)
11937 (composition_update_it, struct position_record)
11938 (find_automatic_composition, composition_adjust_point)
11939 (Fcomposition_get_gstring, Ffind_composition_internal):
11940 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11941 (update_compositions):
11942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11943 * composite.h: Adjust decls to match defn changes elsewhere.
11944 (struct composition):
11945 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11946 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
11947 Do not attempt to compute the address of the object just before a
11948 buffer; this is not portable.
11949 (Faref, Faset):
11950 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11951 (Faset): Use int, not EMACS_INT, where int is wide enough.
11952 (Fstring_to_number): Don't assume fixnums fit in int.
11953 (Frem): Don't assume arg is nonnegative.
11954 * dbusbind.c (xd_append_arg): Check for integers out of range.
11955 (Fdbus_call_method): Don't overflow the timeout int.
11956 (extract_signed, extract_unsigned): New functions.
11957 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
11958 (xd_get_connection_references): Return ptrdiff_t, not int.
11959 All uses changed.
11960 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
11961 (xd_read_message_1):
11962 Use int, not unsigned, where the dbus API uses int.
11963 (Fdbus_message_internal): Don't overflow mtype.
11964 (syms_of_dbusbind): Allocate right-sized buffer for integers.
11965 * dired.c (directory_files_internal, file_name_completion, scmp)
11966 (file_name_completion_stat):
11967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11968 (file_name_completion): Don't overflow matchcount.
11969 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
11970 * dispextern.h: Adjust decls to match defn changes elsewhere.
11971 (struct text_pos, struct glyph, struct bidi_saved_info)
11972 (struct bidi_string_data, struct bidi_it, struct composition_it)
11973 (struct it):
11974 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11975 (struct display_pos, struct composition_it, struct it):
11976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11977 * dispnew.c (increment_matrix_positions)
11978 (increment_row_positions, mode_line_string)
11979 (marginal_area_string):
11980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11981 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
11982 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11983 (duration_to_sec_usec): New function, to check for overflow better.
11984 (Fsleep_for, sit_for): Use it.
11985 * doc.c (get_doc_string, store_function_docstring):
11986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11987 (get_doc_string, Fsnarf_documentation):
11988 Use int, not EMACS_INT, where int is wide enough.
11989 (get_doc_string):
11990 Use SAFE_ALLOCA, not alloca.
11991 Check for overflow when converting EMACS_INT to off_t.
11992 * doprnt.c (doprnt):
11993 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11994 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
11995 Don't assume uid_t fits into fixnum.
11996 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
11997 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
11998 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
11999 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12000 (general_insert_function)
12001 (Finsert_char, make_buffer_string, make_buffer_string_both)
12002 (update_buffer_properties, Fbuffer_substring)
12003 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12004 (Fsubst_char_in_region, check_translation)
12005 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12006 (transpose_markers, Ftranspose_regions):
12007 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12008 (clip_to_bounds): Move to lisp.h as an inline function).
12009 (Fconstrain_to_field): Don't assume integers are nonnegative.
12010 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12011 (Fsubst_char_in_region, Fsave_restriction):
12012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12013 (Femacs_pid): Don't assume pid_t fits into fixnum.
12014 (lo_time): Use int, not EMACS_INT, when int suffices.
12015 (lisp_time_argument): Check for usec out of range.
12016 (Fencode_time): Don't assume fixnum fits in int.
12017 (Fuser_login_name, Fuser_full_name): Signal an error
12018 if a uid argument is out of range, rather than relying on
12019 undefined behavior.
12020 (Fformat_time_string): Remove now-unnecessary check.
12021 lisp_time_argument checks for out-of-range usec now.
12022 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12023 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12024 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12025 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12026 (init_cmdargs, Fdump_emacs):
12027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12028 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12029 the bottom (typically) 32 bits of the fixnum.
12030 * eval.c (specpdl_size, call_debugger):
12031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12032 (when_entered_debugger, Fbacktrace_debug):
12033 Don't assume fixnum can fit in int.
12034 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12035 the object just before a buffer; this is not portable.
12036 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12037 (grow_specpdl, unbind_to):
12038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12039 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12040 (grow_specpdl): Simplify allocation by using xpalloc.
12041 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
12042 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12043 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12044 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12045 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12046 (a_write, e_write):
12047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12048 (Fcopy_file, non_regular_nbytes, read_non_regular)
12049 (Finsert_file_contents):
12050 Use int, not EMACS_INT, where int is wide enough.
12051 (READ_BUF_SIZE): Verify that it fits in int.
12052 (Finsert_file_contents): Check that counts are in proper range,
12053 rather than assuming fixnums fit into ptrdiff_t etc.
12054 Don't assume fixnums fit into int.
12055 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12056 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12057 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12058 (string_char_to_byte, string_byte_to_char)
12059 (string_make_multibyte, string_to_multibyte)
12060 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12061 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12062 (substring_both, Fdelete, internal_equal, Ffillarray)
12063 (Fclear_string, mapcar1)
12064 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12065 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12066 (larger_vector, make_hash_table, maybe_resize_hash_table)
12067 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12068 (Fmaphash, secure_hash):
12069 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12070 (concat): Check for string index and length overflow.
12071 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12072 (Frequire):
12073 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12074 (larger_vector): New API (vec, incr_min, size_max) replaces old
12075 one (vec, new_size, init). This catches size overflow.
12076 INIT was removed because it was always Qnil.
12077 All callers changed.
12078 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12079 the upper bound on a hash table index size.
12080 (make_hash_table, maybe_resize_hash_table): Use it.
12081 (secure_hash): Computer start_byte and end_byte only after
12082 they're known to be in ptrdiff_t range.
12083 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12084 (Ffont_get_glyphs, Ffont_at):
12085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12086 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12087 (Flist_fonts, Fopen_font):
12088 Don't assume fixnum can fit in int.
12089 (check_gstring): Don't assume index can fit in int.
12090 (font_match_p): Check that fixnum is a character, not a nonnegative
12091 fixnum, since the later code needs to stuff it into an int.
12092 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12093 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12094 conversion overflow issues.
12095 (Fopen_font): Check for integer out of range.
12096 (Ffont_get_glyphs): Don't assume index can fit in int.
12097 * font.h: Adjust decls to match defn changes elsewhere.
12098 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12099 integer overflow.
12100 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12101 printmax_t, where ptrdiff_t is wide enough.
12102 (Finternal_char_font):
12103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12104 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12105 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12106 (Fset_frame_position, x_set_frame_parameters)
12107 (x_set_line_spacing, x_set_border_width)
12108 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12109 Check that fixnums are in proper range for system types.
12110 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12112 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12113 Use SAFE_ALLOCA_LISP, not alloca.
12114 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12115 intptr_t is wide enough.
12116 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12117 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12118 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12119 Check for fixnum out of range.
12120 * ftfont.c (ftfont_list): Don't assume index fits in int.
12121 Check that fixnums are in proper range for system types.
12122 (ftfont_shape_by_flt):
12123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12124 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12125 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12126 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12127 Check that fixnums are in proper range for system types.
12128 * gnutls.h: Adjust decls to match defn changes elsewhere.
12129 * gtkutil.c (xg_dialog_run):
12130 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12131 (update_frame_tool_bar):
12132 Check that fixnums are in proper range for system types.
12133 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12134 (lookup_image): Check that fixnums are in range for system types.
12135 * indent.c (last_known_column, last_known_column_point):
12136 (current_column_bol_cache):
12137 (skip_invisible, current_column, check_display_width):
12138 (check_display_width, scan_for_column, current_column_1)
12139 (Findent_to, Fcurrent_indentation, position_indentation)
12140 (indented_beyond_p, Fmove_to_column, compute_motion):
12141 (Fcompute_motion, Fvertical_motion):
12142 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12143 (last_known_column_modified): Use EMACS_INT, not int.
12144 (check_display_width):
12145 (Fcompute_motion):
12146 Check that fixnums and floats are in proper range for system types.
12147 (compute_motion): Don't assume index or fixnum fits in int.
12148 (compute_motion, Fcompute_motion):
12149 Use int, not EMACS_INT, when it is wide enough.
12150 (vmotion): Omit local var start_hpos that is always 0; that way
12151 we don't need to worry about overflow in expressions involving it.
12152 * indent.h: Adjust decls to match defn changes elsewhere.
12153 (struct position):
12154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12155 Use int, not EMACS_INT, where int is wide enough.
12156 Remove unused members ovstring_chars_done and tab_offset;
12157 all uses removed.
12158 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12159 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12160 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12161 (make_gap, copy_text, insert, insert_and_inherit)
12162 (insert_before_markers, insert_before_markers_and_inherit)
12163 (insert_1, count_combining_before, count_combining_after)
12164 (insert_1_both, insert_from_string)
12165 (insert_from_string_before_markers, insert_from_string_1)
12166 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12167 (adjust_after_replace, adjust_after_insert, replace_range)
12168 (replace_range_2, del_range, del_range_1, del_range_byte)
12169 (del_range_both, del_range_2, modify_region)
12170 (prepare_to_modify_buffer, signal_before_change)
12171 (signal_after_change, Fcombine_after_change_execute):
12172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12173 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12174 (balance_an_interval, split_interval_right, split_interval_left)
12175 (find_interval, next_interval, update_interval)
12176 (adjust_intervals_for_insertion, delete_node, delete_interval)
12177 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12178 (static_offset_intervals, offset_intervals)
12179 (merge_interval_right, merge_interval_left, make_new_interval)
12180 (graft_intervals_into_buffer, temp_set_point_both)
12181 (temp_set_point, set_point, adjust_for_invis_intang)
12182 (set_point_both, move_if_not_intangible, get_property_and_range)
12183 (get_local_map, copy_intervals, copy_intervals_to_string)
12184 (compare_string_intervals, set_intervals_multibyte_1):
12185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12186 * intervals.h: Adjust decls to match defn changes elsewhere.
12187 (struct interval):
12188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12189 * keyboard.c (this_command_key_count, this_single_command_key_start)
12190 (before_command_key_count, before_command_echo_length, echo_now)
12191 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12192 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12193 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12194 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12195 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12196 (last_non_minibuf_size, last_point_position, echo_truncate)
12197 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12198 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12199 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12200 (stuff_buffered_input):
12201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12202 (last_auto_save, command_loop_1, read_char):
12203 Use EMACS_INT, not int, to avoid integer overflow.
12204 (record_char): Avoid overflow in total_keys computation.
12205 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12206 * keyboard.h: Adjust decls to match defn changes elsewhere.
12207 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12208 (Fkey_description, Fdescribe_vector, Flookup_key):
12209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12210 (click_position): New function, to check that positions are in range.
12211 (Fcurrent_active_maps):
12212 (describe_command):
12213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12214 (Faccessible_keymaps, Fkey_description):
12215 (preferred_sequence_p):
12216 Don't assume fixnum can fit into int.
12217 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12218 Check for integer overflow in size calculations.
12219 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12220 avoid mishandling large integers.
12221 * lisp.h: Adjust decls to match defn changes elsewhere.
12222 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12223 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12224 (struct Lisp_Marker):
12225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12226 (clip_to_bounds): Now an inline function, moved here from editfns.c.
12227 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12228 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12229 All callers changed.
12230 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12231 Assume the arg has valid form, since it always does.
12232 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12233 unsigned integer system type.
12234 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12235 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12236 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12237 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12238 (duration_to_sec_usec): New decl.
12239 * lread.c (read_from_string_index, read_from_string_index_byte)
12240 (read_from_string_limit, readchar, unreadchar, openp)
12241 (read_internal_start, read1, oblookup):
12242 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12243 (Fload, readevalloop, Feval_buffer, Feval_region):
12244 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12245 (openp): Check for out-of-range argument to 'access'.
12246 (read1): Use int, not EMACS_INT, where int is wide enough.
12247 Don't assume fixnum fits into int.
12248 Fix off-by-one error that can read outside a buffer.
12249 (read_filtered_event): Use duration_to_sec_usec
12250 to do proper overflow checking on durations.
12251 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12252 in size calculation.
12253 (Fexecute_kbd_macro):
12254 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12255 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12256 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12257 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12258 (set_marker_both, set_marker_restricted_both, marker_position)
12259 (marker_byte_position, Fbuffer_has_markers_at):
12260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12261 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12262 * menu.c (ensure_menu_items): Rename from grow_menu_items.
12263 It now merely ensures that the menu is large enough, without
12264 necessarily growing it, as this avoids some integer overflow issues.
12265 All callers changed.
12266 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12267 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12268 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12269 Use SAFE_ALLOCA_LISP, not alloca.
12270 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12271 to EMACS_INT. Check that fixnums are in proper range for system types.
12272 * minibuf.c (minibuf_prompt_width, string_to_object)
12273 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12274 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12276 (get_minibuffer, read_minibuf_unwind):
12277 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12278 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12279 this simplifies overflow checking. All callers changed.
12280 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12281 (Ftest_completion):
12282 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12283 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12284 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12285 Check that fixnums are in proper range for system types.
12286 (Fx_create_frame, Fx_show_tip):
12287 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12288 * nsfont.m (ns_findfonts, nsfont_list_family):
12289 Don't assume fixnum fits in long.
12290 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12291 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12292 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12293 wide enough.
12294 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
12295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12296 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12297 (PRINTDECLARE, PRINTPREPARE):
12298 (strout, print_string):
12299 (print, print_preprocess, print_check_string_charset_prop)
12300 (print_object):
12301 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12302 (PRINTDECLARE):
12303 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12305 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
12306 (printchar, strout): Use xpalloc to catch size calculation overflow.
12307 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
12308 (print_error_message): Use SAFE_ALLOCA, not alloca.
12309 (print_object): Use int, not EMACS_INT, where int is wide enough.
12310 (print_depth, new_backquote_output, print_number_index):
12311 Use ptrdiff_t, not int, where int might not be wide enough.
12312 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12313 (Fset_process_window_size, Fformat_network_address)
12314 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
12315 (sigchld_handler):
12316 Check that fixnums are in proper range for system types.
12317 (Fsignal_process): Simplify by avoiding a goto.
12318 Check for process-ids out of pid_t range rather than relying on
12319 undefined behavior.
12320 (process_tick, update_tick): Use EMACS_INT, not int.
12321 (Fformat_network_address, read_process_output, send_process)
12322 (Fprocess_send_region, status_notify):
12323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12324 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12325 (wait_reading_process_output, read_process_output, exec_sentinel):
12326 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12327 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12328 (Faccept_process_output): Use duration_to_sec_usec to do proper
12329 overflow checking on durations.
12330 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12331 Don't assume pid_t fits in int.
12332 * process.h (struct Lisp_Process): Members tick and update_tick
12333 are now of type EMACS_INT, not int.
12334 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12335 configured --with-wide-int.
12336 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12337 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12338 * search.c (looking_at_1, string_match_1):
12339 (fast_string_match, fast_c_string_match_ignore_case)
12340 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12341 (scan_newline, find_before_next_newline, search_command)
12342 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12343 (set_search_regs, wordify):
12344 (Freplace_match):
12345 (Fmatch_data):
12346 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12347 (string_match_1, search_buffer, set_search_regs):
12348 (Fmatch_data):
12349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12350 (wordify): Check for overflow in size calculation.
12351 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12352 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12353 Check that fixnums are in proper range for system types.
12354 * sound.c (struct sound_device)
12355 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12357 (Fplay_sound_internal):
12358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12359 * syntax.c (struct lisp_parse_state, find_start_modiff)
12360 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12361 (Fparse_partial_sexp):
12362 Don't assume fixnums can fit in int.
12363 (struct lisp_parse_state, find_start_pos, find_start_value)
12364 (find_start_value_byte, find_start_begv)
12365 (update_syntax_table, char_quoted, dec_bytepos)
12366 (find_defun_start, prev_char_comend_first, back_comment):
12367 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12368 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12370 (Finternal_describe_syntax_value): Check that match_lisp is a
12371 character, not an integer, since the code stuffs it into int.
12372 (scan_words, scan_sexps_forward):
12373 Check that fixnums are in proper range for system types.
12374 (Fforward_word):
12375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12376 (scan_sexps_forward):
12377 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12378 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12379 * syntax.h: Adjust decls to match defn changes elsewhere.
12380 (struct gl_state_s):
12381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12382 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12383 MOST_POSITIVE_FIXNUM.
12384 * sysdep.c (wait_for_termination_1, wait_for_termination)
12385 (interruptible_wait_for_termination, mkdir):
12386 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12387 (emacs_read, emacs_write):
12388 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12389 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12390 and double all fit in int.
12391 * term.c (set_tty_color_mode):
12392 Check that fixnums are in proper range for system types.
12393 * termhooks.h (struct input_event):
12394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12395 * textprop.c (validate_interval_range, interval_of)
12396 (Fadd_text_properties, set_text_properties_1)
12397 (Fremove_text_properties, Fremove_list_of_text_properties)
12398 (Ftext_property_any, Ftext_property_not_all)
12399 (copy_text_properties, text_property_list, extend_property_ranges)
12400 (verify_interval_modification):
12401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12402 (Fnext_single_char_property_change)
12403 (Fprevious_single_char_property_change):
12404 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12405 (copy_text_properties):
12406 Check for integer overflow in index calculation.
12407 * undo.c (last_boundary_position, record_point, record_insert)
12408 (record_delete, record_marker_adjustment, record_change)
12409 (record_property_change):
12410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12411 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12412 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12413 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12414 (Fx_hide_tip, Fx_file_dialog):
12415 * w32menu.c (set_frame_menubar):
12416 Use ptrdiff_t, not int, for consistency with rest of code.
12417 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12418 (select_window, Fdelete_other_windows_internal)
12419 (window_scroll_pixel_based, window_scroll_line_based)
12420 (Frecenter, Fset_window_configuration):
12421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12422 (Fset_window_hscroll, run_window_configuration_change_hook)
12423 (set_window_buffer, temp_output_buffer_show, scroll_command)
12424 (Fscroll_other_window, Frecenter):
12425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12426 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12427 Don't assume fixnum fits in int.
12428 (Fset_window_scroll_bars):
12429 Check that fixnums are in proper range for system types.
12430 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12431 (string_pos, c_string_pos, number_of_chars, init_iterator)
12432 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12433 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12434 (compute_display_string_end, handle_face_prop)
12435 (face_before_or_after_it_pos, handle_invisible_prop)
12436 (handle_display_prop, handle_display_spec, handle_single_display_spec)
12437 (display_prop_intangible_p, string_buffer_position_lim)
12438 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12439 (get_overlay_strings_1, get_overlay_strings)
12440 (iterate_out_of_display_property, forward_to_next_line_start)
12441 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12442 (get_next_display_element, set_iterator_to_next)
12443 (get_visually_first_element, compute_stop_pos_backwards)
12444 (handle_stop_backwards, next_element_from_buffer)
12445 (move_it_in_display_line_to, move_it_in_display_line)
12446 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12447 (add_to_log, message_dolog, message_log_check_duplicate)
12448 (message2, message2_nolog, message3, message3_nolog
12449 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12450 (current_message_1, truncate_echo_area, truncate_message_1)
12451 (set_message, set_message_1, store_mode_line_noprop)
12452 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12453 (text_outside_line_unchanged_p, check_point_in_composition)
12454 (reconsider_clip_changes)
12455 (redisplay_internal, set_cursor_from_row, try_scrolling)
12456 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12457 (redisplay_window, find_last_unchanged_at_beg_row)
12458 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12459 (trailing_whitespace_p, find_row_edges, display_line)
12460 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12461 (display_mode_element, store_mode_line_string)
12462 (pint2str, pint2hrstr, decode_mode_spec)
12463 (display_count_lines, display_string, draw_glyphs)
12464 (x_produce_glyphs, x_insert_glyphs)
12465 (rows_from_pos_range, mouse_face_from_buffer_pos)
12466 (fast_find_string_pos, mouse_face_from_string_pos)
12467 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12469 (safe_call, init_from_display_pos, handle_fontified_prop)
12470 (handle_single_display_spec, load_overlay_strings)
12471 (with_echo_area_buffer, setup_echo_area_for_printing)
12472 (display_echo_area, echo_area_display)
12473 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12474 (update_tool_bar, hscroll_window_tree, redisplay_internal)
12475 (redisplay_window, dump_glyph_row, display_mode_line)
12476 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
12477 (handle_display_spec, display_prop_string_p):
12478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12479 (handle_single_display_spec, build_desired_tool_bar_string)
12480 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12481 (get_specified_cursor_type):
12482 Check that fixnums are in proper range for system types.
12483 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12484 (Flookup_image_map):
12485 Don't assume fixnums fit in int.
12486 (compare_overlay_entries):
12487 Avoid mishandling comparisons due to subtraction overflow.
12488 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12489 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12490 (handle_tool_bar_click):
12491 Use int, not unsigned, since we prefer signed and the signedness
12492 doesn't matter here.
12493 (get_next_display_element, next_element_from_display_vector):
12494 Use int, not EMACS_INT, when int is wide enough.
12495 (start_hourglass): Use duration_to_sec_usec to do proper
12496 overflow checking on durations.
12497 * xfaces.c (Fbitmap_spec_p):
12498 Check that fixnums are in proper range for system types.
12499 (compare_fonts_by_sort_order):
12500 Avoid mishandling comparisons due to subtraction overflow.
12501 (Fx_family_fonts, realize_basic_faces):
12502 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12503 (Fx_family_fonts):
12504 Don't assume fixnum fits in int.
12505 Use SAFE_ALLOCA_LISP, not alloca.
12506 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12507 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12508 (face_at_buffer_position, face_for_overlay_string)
12509 (face_at_string_position):
12510 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12511 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12512 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12513 (Fx_show_tip):
12514 Check that fixnums are in proper range for system types.
12515 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12516 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12518 (Fx_change_window_property): Don't assume fixnums fit in int.
12519 * xfont.c (xfont_chars_supported):
12520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12521 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12522 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12523 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12524 * xml.c (parse_region):
12525 * xrdb.c (magic_file_p):
12526 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12527 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12528 (x_get_local_selection, x_reply_selection_request)
12529 (x_handle_selection_request, wait_for_property_change):
12530 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12531 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12532 short is wide enough.
12533 (x_send_client_event): Don't assume fixnum fits in int.
12534 * xterm.c (x_x_to_emacs_modifiers):
12535 Don't assume EMACS_INT overflows nicely into int.
12536 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12537 may come from Lisp.
12538 (handle_one_xevent): NATNUMP can eval its arg twice.
12539 (x_connection_closed):
12540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12541 * xterm.h: Adjust decls to match defn changes elsewhere.
12542 (struct scroll_bar): Use struct vectorlike_header
12543 rather than rolling our own approximation.
12544 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12545
12546 2012-05-25 Glenn Morris <rgm@gnu.org>
12547
12548 * lisp.mk (lisp): Update for more files being compiled now.
12549
12550 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12551
12552 * lread.c: Remove `read_pure' which makes no difference.
12553 (read_pure): Remove var.
12554 (unreadpure): Remove function.
12555 (readevalloop): Don't call read_list with -1 flag.
12556 (read1, read_vector): Don't test read_pure any more.
12557 (read_list): Simplify.
12558
12559 * fileio.c, character.h: Minor style tweaks.
12560
12561 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12562
12563 * window.h (clip_changed): Remove useless declaration.
12564
12565 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
12566
12567 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12568 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12569
12570 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12571
12572 Remove src/m/*.
12573 This directory predates autoconf and is no longer needed nowadays.
12574 Move its few remaining bits of functionality to where they're needed.
12575 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12576 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12577 * m/template.h: Remove.
12578 * Makefile.in (M_FILE): Remove. All uses removed.
12579 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12580 * lisp.h (USE_LSB_TAG):
12581 * mem-limits.h (EXCEEDS_LISP_PTR):
12582 Use VAL_MAX, not VALBITS, in #if.
12583 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12584 (EMACS_UINT): Define unconditionally now.
12585 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12586 (BITS_PER_EMACS_INT): New constants, replacing
12587 what used to be in config.h, but not useful in #if.
12588 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12589 define them any more.
12590 (VAL_MAX): New macro.
12591 (VALMASK): Use it.
12592 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12593 BITS_PER_EMACS_INT, in #if.
12594 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12595 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12596 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12597 * s/ms-w32.h (DATA_START):
12598 Move here from removed file m/intel386.h.
12599 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12600 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12601
12602 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12603
12604 Assume C89 or later.
12605 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12606 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12607 (xrealloc):
12608 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12609 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12610 * textprop.c, tparam.c (NULL): Remove.
12611 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12612 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12613 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12614 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12615 * xterm.c (input_signal_count): Assume volatile works.
12616
12617 2012-05-21 Ken Brown <kbrown@cornell.edu>
12618
12619 * xgselect.c (xg_select): Fix first argument in call to 'select'
12620 (bug#11508).
12621
12622 2012-05-20 Ken Brown <kbrown@cornell.edu>
12623
12624 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
12625 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
12626
12627 2012-05-19 Ken Brown <kbrown@cornell.edu>
12628
12629 * xfns.c (x_in_use): Remove `static' qualifier.
12630 * xterm.h (x_in_use): Declare.
12631 * xgselect.c: Include xterm.h.
12632 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12633 and `display_arg' (bug#9754).
12634
12635 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12636
12637 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12638
12639 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12640 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12641
12642 2012-05-18 Eli Zaretskii <eliz@gnu.org>
12643
12644 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12645
12646 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
12647 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
12648
12649 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12650 reference to image_cache->refcount.
12651 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12652
12653 2012-05-17 Juri Linkov <juri@jurta.org>
12654
12655 * search.c (Fword_search_regexp, Fword_search_backward)
12656 (Fword_search_forward, Fword_search_backward_lax)
12657 (Fword_search_forward_lax): Move functions to isearch.el
12658 (bug#10145, bug#11381).
12659
12660 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12661
12662 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12663
12664 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12665
12666 * lread.c (init_obarray): Declare Qt and Qnil as special.
12667
12668 2012-05-14 Glenn Morris <rgm@gnu.org>
12669
12670 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
12671 Put "libexec" before "bin", for the sake of init_callproc_1.
12672
12673 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12674
12675 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12676
12677 * unexaix.c: Port to more-recent AIX compilers.
12678 (report_error, report_error_1, make_hdr, copy_sym)
12679 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12680 Make arguments const char *, not char *, to avoid violations of C
12681 standard and to fix some AIX warnings reported by Gilles Pion.
12682
12683 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12684
12685 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12686 already have overlays loaded.
12687 (handle_single_display_spec): Before returning without displaying
12688 fringe bitmap, synchronize the bidi iterator with the main display
12689 iterator, by calling iterate_out_of_display_property.
12690 (iterate_out_of_display_property): Detect buffer iteration by
12691 testing that it->string is a Lisp string.
12692 (get_next_display_element): When the current object is exhausted,
12693 and there's something on it->stack, call set_iterator_to_next to
12694 proceed with what's on the stack, instead of returning zero.
12695 (set_iterator_to_next): If called at the end of a Lisp string,
12696 proceed to consider_string_end without incrementing string
12697 position. Don't increment display vector index past the end of
12698 the display vector. (Bug#11417)
12699 (pos_visible_p): Don't report a position visible when move_it_to
12700 stopped at the last line of window, which happens to be scanned
12701 backwards by the bidi iteration. (Bug#11464)
12702
12703 2012-05-14 Eli Zaretskii <eliz@gnu.org>
12704
12705 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12706 and right-margin display specs even if the spec is invalid or we
12707 are on a TTY, and thus unable to display on the fringes.
12708 That's because the text with the property will not be displayed anyway,
12709 so we need to signal to the caller that this is a "replacing"
12710 display spec. This fixes display when the spec is invalid or we
12711 are on a TTY.
12712
12713 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12714
12715 * unexaix.c (make_hdr): Fix typo in prototype.
12716 This bug broke the build on AIX. Problem reported by Gilles Pion.
12717
12718 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
12719
12720 * keyboard.c (kbd_buffer_get_event): Read special events also in
12721 batch mode. (Bug#11415)
12722
12723 2012-05-12 Glenn Morris <rgm@gnu.org>
12724
12725 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12726
12727 2012-05-12 Eli Zaretskii <eliz@gnu.org>
12728
12729 * lisp.mk (lisp): Add newcomment.elc.
12730
12731 2012-05-12 Glenn Morris <rgm@gnu.org>
12732
12733 * Makefile.in (MKDIR_P): New, set by configure.
12734 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12735
12736 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12737
12738 Remove unused function hourglass_started.
12739 * dispextern.h (hourglass_started):
12740 * w32fns.c (hourglass_started):
12741 * xdisp.c (hourglass_started): Remove.
12742
12743 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
12744
12745 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12746 Update dependencies.
12747
12748 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12749
12750 * xgselect.c (xg_select): Put maxfds+1 into a var.
12751 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12752
12753 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12754
12755 2012-05-10 Dave Abrahams <dave@boostpro.com>
12756
12757 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12758 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12759
12760 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
12761
12762 * dbusbind.c (xd_registered_buses): New internal Lisp object.
12763 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
12764 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12765 Initialize xd_registered_buses.
12766
12767 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12768
12769 Untag more efficiently if USE_LSB_TAG.
12770 This is based on a proposal by YAMAMOTO Mitsuharu in
12771 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12772 For an admittedly artificial (nth 8000 longlist) benchmark on
12773 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12774 Emacs's overall text size by 1%.
12775 * lisp.h (XUNTAG): New macro.
12776 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12777 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12778 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12779 * eval.c (Fautoload):
12780 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12781 * frame.h (XFRAME): Use XUNTAG.
12782
12783 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12784 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12785 Remove unportable assumptions about print widths of types like
12786 dbus_uint32_t.
12787 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12788 intptr_t when converting between pointer and integer, to avoid GCC
12789 warnings about wrong width.
12790
12791 2012-05-09 Eli Zaretskii <eliz@gnu.org>
12792
12793 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12794 stack for each reader_thread, instead of defaulting to 8MB
12795 determined by the linker. This avoids failures in creating
12796 subprocesses on Windows 7, see the discussion in this thread:
12797 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12798
12799 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
12800
12801 Fix up display of the *Minibuf-0* buffer in the mini window.
12802 * keyboard.c (read_char): Don't clear the echo area if there's no
12803 message to clear.
12804 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
12805 contents of *Minibuf-0*) if there's no message displayed in its stead.
12806
12807 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
12808
12809 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12810 batch mode.
12811
12812 2012-05-06 Chong Yidong <cyd@gnu.org>
12813
12814 * lisp.mk (lisp): Update.
12815
12816 2012-05-05 Jim Meyering <meyering@redhat.com>
12817
12818 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12819
12820 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
12821
12822 * data.c (PUT_ERROR): New macro.
12823 (syms_of_data): Use it. Add new error type `user-error'.
12824 * undo.c (user_error): New function.
12825 (Fprimitive_undo): Use it.
12826 * print.c (print_error_message): Adjust print style for `user-error'.
12827 * keyboard.c (user_error): New function.
12828 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12829
12830 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
12831
12832 Do not limit current-time-string to years 1000..9999.
12833 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12834 (Fcurrent_time_string): Support any year that is supported by the
12835 underlying localtime representation. Don't use asctime, as it
12836 has undefined behavior for years outside the range -999..9999.
12837
12838 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
12839
12840 Fix race conditions involving setenv, gmtime, localtime, asctime.
12841 Without this fix, interrupts could mess up code that uses these
12842 nonreentrant functions, since setting TZ invalidates existing
12843 tm_zone or tzname values, and since most of these functions return
12844 pointers to static storage.
12845 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12846 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12847 Grow the critical sections to include not just invoking
12848 localtime/gmtime, but also accessing these functions' results
12849 including their tm_zone values if any, and any related TZ setting.
12850 (format_time_string): Last arg is now struct tm *, not struct tm **,
12851 so that the struct tm is saved in the critical section.
12852 All callers changed. Simplify allocation of initial buffer, partly
12853 motivated by the fact that memory allocation needs to be outside
12854 the critical section.
12855
12856 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
12857
12858 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12859 with RESET_INTERVAL.
12860
12861 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12862 Remove duplicated buffer name initialization.
12863
12864 2012-05-02 Jim Meyering <jim@meyering.net>
12865
12866 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12867
12868 * xfns.c (x_window): Use xstrdup (Bug#11375).
12869
12870 2012-05-02 Eli Zaretskii <eliz@gnu.org>
12871
12872 * xdisp.c (pos_visible_p): If already at a newline from the
12873 display string before the 'while' loop, don't walk back the glyphs
12874 from it3.glyph_row. Solves assertion violation when the display
12875 string begins with a newline (egg.el). (Bug#11367)
12876
12877 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12878
12879 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12880 Move to simple.el.
12881
12882 2012-05-01 Glenn Morris <rgm@gnu.org>
12883
12884 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12885 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12886 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12887 All were removed before 23.1.
12888
12889 * dispnew.c: Remove HAVE_LIBNCURSES test;
12890 it is always true on relevant platforms.
12891
12892 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12893 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12894
12895 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12896
12897 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
12898
12899 * .gdbinit (xpr): Remove checks for no longer existing misc types.
12900 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12901 Remove.
12902
12903 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
12904
12905 Do not avoid creating empty evaporating overlays (Bug#9642).
12906 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12907 That is, do not delete an evaporating overlay if it becomes
12908 empty after its bounds are adjusted to fit within its buffer.
12909 This fix caused other problems, and I'm reverting it until we get
12910 to the bottom of them.
12911
12912 2012-04-27 Chong Yidong <cyd@gnu.org>
12913
12914 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12915
12916 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12917
12918 * xdisp.c (pos_visible_p): If the window start position is beyond
12919 ZV, start the display from buffer beginning. Prevents assertion
12920 violation in init_iterator when the minibuffer window is scrolled
12921 via the scroll bar.
12922
12923 * window.c (window_scroll_pixel_based): Likewise.
12924
12925 2012-04-27 Chong Yidong <cyd@gnu.org>
12926
12927 * keymap.c (where_is_internal): Doc fix (Bug#10872).
12928
12929 2012-04-27 Glenn Morris <rgm@gnu.org>
12930
12931 * fileio.c (Fcopy_file, Fset_file_selinux_context):
12932 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
12933
12934 2012-04-27 Eli Zaretskii <eliz@gnu.org>
12935
12936 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
12937 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
12938
12939 2012-04-26 Eli Zaretskii <eliz@gnu.org>
12940
12941 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
12942 display element, check also the underlying string or buffer
12943 character. (Bug#11341)
12944
12945 * w32menu.c: Include w32heap.h.
12946 (add_menu_item): If the call to AppendMenuW (via
12947 unicode_append_menu) fails, disable Unicode menus only if we are
12948 running on Windows 9X/Me.
12949
12950 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
12951
12952 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
12953 (xgetint): Add missing shift for LSB tags.
12954
12955 2012-04-24 Martin Rudalics <rudalics@gmx.at>
12956
12957 * keyboard.c (read_char): Don't wipe echo area for select window
12958 events: These might get delayed via `mouse-autoselect-window'
12959 (Bug#11304).
12960
12961 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
12962
12963 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
12964 manipulation of :loaded-from data.
12965
12966 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
12967
12968 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
12969 now a cons (bug#11311).
12970
12971 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
12972
12973 Do not create empty overlays with the evaporate property (Bug#9642).
12974 * buffer.c (Fmove_overlay): Delete an evaporating overlay
12975 if it becomes empty after its bounds are adjusted to fit within
12976 its buffer. Without this fix, in a nonempty buffer (let ((o
12977 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
12978 yields an empty overlay that has the evaporate property, which is
12979 not supposed to happen.
12980
12981 Fix minor GTK3 problems found by static checking.
12982 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12983 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12984 (struct _EmacsFixedClass, emacs_fixed_get_type):
12985 Move decls here from emacsgtkfixed.h, since they needn't be public.
12986 (emacs_fixed_get_type): Now static.
12987 (emacs_fixed_class_init): Omit unused local.
12988 (emacs_fixed_child_type): Remove; unused.
12989 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
12990 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
12991 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
12992 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
12993 (EMACS_FIXED_GET_CLASS): Remove; unused.
12994 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
12995
12996 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
12997 Problem reported by Juanma Barranquero for Windows -Wunused-function.
12998
12999 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13000
13001 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13002 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13003 (__malloc_size_t, __malloc_ptrdiff_t):
13004 Remove. All uses removed, replaced by the definiens if needed,
13005 since we can assume C89 or better now.
13006 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13007 (protect_malloc_state, align, get_contiguous_space)
13008 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13009 (malloc_atfork_handler_child, malloc_enable_thread)
13010 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13011 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13012 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13013 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13014 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13015 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13016 Define using prototypes, not old style.
13017 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13018 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13019 (align): Don't assume that signed integer overflow wraps around.
13020 Omit unused local var.
13021 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13022 (_free_internal_nolock, memalign, mallochook, reallochook):
13023 Omit no-longer-needed casts.
13024 (valloc): Use getpagesize, not __getpagesize.
13025 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13026 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13027
13028 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13029
13030 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
13031
13032 Move functions from C to Lisp. Make non-blocking method calls
13033 the default. Implement further D-Bus standard interfaces.
13034
13035 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13036 (QCdbus_request_name_allow_replacement)
13037 (QCdbus_request_name_replace_existing)
13038 (QCdbus_request_name_do_not_queue)
13039 (QCdbus_request_name_reply_primary_owner)
13040 (QCdbus_request_name_reply_in_queue)
13041 (QCdbus_request_name_reply_exists)
13042 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13043 (QCdbus_registered_serial, QCdbus_registered_method)
13044 (QCdbus_registered_signal): New Lisp objects.
13045 (XD_DEBUG_MESSAGE): Use sizeof.
13046 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13047 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13048 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13049 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13050 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13051 (xd_signature, xd_append_arg): Allow float for integer types.
13052 (xd_get_connection_references): New function.
13053 (xd_get_connection_address): Rename from xd_initialize.
13054 Return cached address.
13055 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13056 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13057 level.
13058 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
13059 Return number of refcounts.
13060 (Fdbus_get_unique_name): Make stronger parameter check.
13061 (Fdbus_message_internal): New defun.
13062 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13063 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13064 (Fdbus_send_signal, Fdbus_register_service)
13065 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13066 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13067 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13068 (Vdbus_compiled_version, Vdbus_runtime_version)
13069 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13070 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13071 (Vdbus_message_type_signal): New defvars.
13072 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13073 Adapt docstring.
13074
13075 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13076
13077 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13078 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13079 Do not assume ptrdiff_t is the same width as 'int'.
13080
13081 * alloc.c: Handle unusual debugging option combinations.
13082 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13083 since the two debugging options are incompatible.
13084 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13085 is defined.
13086 (mem_init, mem_insert, mem_insert_fixup):
13087 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13088 (NEED_MEM_INSERT): Remove; no longer needed.
13089
13090 2012-04-22 Leo Liu <sdl.web@gmail.com>
13091
13092 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13093
13094 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13095
13096 * sysdep.c [__FreeBSD__]: Minor cleanups.
13097 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13098 Use Emacs indenting style more consistently. Avoid some casts.
13099 Use 'double' consistently rather than mixing 'float' and 'double'.
13100
13101 2012-04-21 Eduard Wiebe <usenet@pusto.de>
13102
13103 * sysdep.c (list_system_processes, system_process_attributes):
13104 Add implementation for FreeBSD (Bug#5243).
13105
13106 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13107
13108 * lisp.mk (lisp): Update.
13109
13110 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13111
13112 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13113 It is never used otherwise.
13114
13115 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13116
13117 * print.c (print_preprocess): Only check print_depth if print-circle
13118 is nil.
13119 (print_object): Check for cycles even when print-circle is nil and
13120 print-gensym is t, but only check print_depth if print-circle is nil.
13121
13122 2012-04-20 Chong Yidong <cyd@gnu.org>
13123
13124 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13125 set the status to "failed" and ensure that sentinel is run.
13126
13127 2012-04-20 Glenn Morris <rgm@gnu.org>
13128
13129 * process.c (Fset_process_inherit_coding_system_flag)
13130 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13131 (Fmake_network_process, Fmake_serial_process): Doc fix.
13132
13133 2012-04-20 Eli Zaretskii <eliz@gnu.org>
13134
13135 * xdisp.c (string_buffer_position_lim): Limit starting position to
13136 BEGV.
13137 (set_cursor_from_row): If called for a mode-line or header-line
13138 row, return zero immediately.
13139 (try_cursor_movement): If inside continuation line, don't back up
13140 farther than the first row after the header line, if any.
13141 Don't consider the header-line row as "partially visible", even if
13142 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13143
13144 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13145
13146 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13147 (bug#11238).
13148
13149 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
13150 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
13151
13152 configure: new option --enable-gcc-warnings (Bug#11207)
13153 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13154 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13155 (ALL_CFLAGS): Use new macros rather than old.
13156 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13157 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13158 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13159 -Wunused-result, -Wunused-variable. This should go away once
13160 the Emacs and Gnulib regex code is merged.
13161 (xmalloc, xrealloc): Now static.
13162
13163 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13164
13165 * dired.c (Fsystem_groups): Remove unused local.
13166
13167 2012-04-17 Glenn Morris <rgm@gnu.org>
13168
13169 * dired.c (Fsystem_users): Doc fix.
13170
13171 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13172
13173 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13174 (syms_of_dired): Add them.
13175
13176 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13177
13178 Fix minor alloc.c problems found by static checking.
13179 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13180 New extern decls, to avoid calling undeclared functions.
13181 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13182 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13183 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13184 (NEED_MEM_INSERT): New macro.
13185 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
13186 Remove one incorrect comment and fix another.
13187
13188 Fix minor ralloc.c problems found by static checking.
13189 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13190 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13191 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13192 (r_alloc_sbrk): Now static.
13193
13194 Improve ralloc.c interface checking.
13195 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13196 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13197 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13198 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13199 [REL_ALLOC]: ... to here, to check interface.
13200 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13201 Remove decls. This fixes an "It stinks!".
13202
13203 * alloc.c (which_symbols): Fix alignment issue / type clash.
13204
13205 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13206
13207 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13208 (struct Lisp_Misc_Any): Likewise.
13209 (struct Lisp_Free): Likewise.
13210 * alloc.c (union aligned_Lisp_Symbol): Define.
13211 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13212 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13213 (union aligned_Lisp_Misc): Define.
13214 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13215 aligned_Lisp_Misc instead of union Lisp_Misc.
13216 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13217
13218 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13219
13220 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13221 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13222 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13223 * s/netbsd.h, s/sol2-6.h:
13224 Remove definition of GC_MARK_STACK, since the default now works.
13225 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13226 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13227 no longer the default.
13228 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13229
13230 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
13231
13232 * lread.c (lisp_file_lexically_bound_p):
13233 Fix hang at ";-*-\n" (bug#11238).
13234
13235 2012-04-14 Eli Zaretskii <eliz@gnu.org>
13236
13237 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13238 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13239
13240 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13241
13242 * nsterm.m (constrainFrameRect): Always constrain when there is only
13243 one screen (Bug#10962).
13244
13245 2012-04-13 Ken Brown <kbrown@cornell.edu>
13246
13247 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13248
13249 2012-04-13 Reuben Thomas <rrt@sc3d.org>
13250
13251 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13252
13253 2012-04-11 Daniel Colascione <dancol@dancol.org>
13254
13255 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13256 against is gone. It's better to use vfork now so that when Cygwin
13257 gains a new, working vfork, we use it automatically (bug#10398).
13258
13259 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13260
13261 * window.c (save_window_save): Obey window-point-insertion-type.
13262
13263 2012-04-11 Glenn Morris <rgm@gnu.org>
13264
13265 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13266
13267 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13268
13269 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13270
13271 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
13272
13273 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13274 (force_quit_count): New var.
13275 (handle_interrupt): Use it.
13276
13277 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
13278
13279 * w32.c (w32_delayed_load): Record the full path of the library
13280 being loaded (bug#10424).
13281
13282 2012-04-09 Glenn Morris <rgm@gnu.org>
13283
13284 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13285 not just in the obarray, before snarfing them. (Bug#11036)
13286
13287 * Makefile.in ($(leimdir)/leim-list.el):
13288 Pass EMACS rather than BUILT_EMACS.
13289
13290 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13291
13292 * process.c (make_process):
13293 * process.h: Add integer `gnutls_handshakes_tried' member to
13294 process struct.
13295
13296 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13297 Add convenience `GNUTLS_LOG2i' macro.
13298
13299 * gnutls.c (gnutls_log_function2i): Convenience log function.
13300 (emacs_gnutls_read): Use new log functions,
13301 `gnutls_handshakes_tried' process member, and
13302 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13303 attempts per process (connection).
13304
13305 2012-04-09 Chong Yidong <cyd@gnu.org>
13306
13307 * eval.c (Fuser_variable_p, user_variable_p_eh)
13308 (lisp_indirect_variable): Functions deleted.
13309 (Fdefvar): Caller changed.
13310
13311 * callint.c (Finteractive, Fcall_interactively):
13312 * minibuf.c (Fread_variable): Callers changed.
13313
13314 2012-04-09 Eli Zaretskii <eliz@gnu.org>
13315
13316 * xdisp.c (set_cursor_from_row): If the display string appears in
13317 the buffer at position that is closer to point than the position
13318 after the display string, display the cursor on the first glyph of
13319 the display string. Fixes cursor display when a 'display' text
13320 property immediately follows invisible text. (Bug#11094)
13321
13322 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13323
13324 composite.c: use 'double' consistently
13325 * composite.c (get_composition_id): Use 'double' consistently
13326 instead of converting 'float' to 'double' and vice versa; this is
13327 easier to understand and avoids a GCC warning.
13328
13329 2012-04-09 Glenn Morris <rgm@gnu.org>
13330
13331 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13332 preparation for dumping it with emacs. (Bug#4789)
13333 (leimdir): New variable.
13334 ($(leimdir)/leim-list.el): New rule.
13335 (emacs$(EXEEXT)): Depend on leim-list.el.
13336
13337 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13338 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13339 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13340
13341 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13342
13343 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13344 proper alignment.
13345
13346 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
13347
13348 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13349 Remove unused local variable.
13350
13351 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13352
13353 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13354 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13355 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13356 objects, as mark_maybe_pointer will catch them otherwise.
13357 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13358 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13359
13360 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13361
13362 Fix typo that broke non-Windows builds.
13363 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13364
13365 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13366
13367 Support building on MS-Windows with libxml2.
13368
13369 * makefile.w32-in (OBJ2): Add xml.$(O).
13370 (GLOBAL_SOURCES): Add xml.c.
13371 ($(BLD)/xml.$(O)): New dependency list.
13372
13373 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13374 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13375 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13376 [!WINDOWSNT]: New macros.
13377 (init_libxml2_functions, libxml2_loaded_p): New functions.
13378 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13379 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13380 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13381 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13382 linked in).
13383 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13384 Call init_libxml2_functions before calling libxml2 functions.
13385 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13386
13387 * emacs.c: Don't include libxml/parser.h.
13388 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13389 xmlCleanupParser directly.
13390
13391 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13392
13393 2012-04-07 Eli Zaretskii <eliz@gnu.org>
13394
13395 * indent.c (Fvertical_motion): If there is a display string at
13396 point, use it.vpos to compute how many lines to backtrack after
13397 move_it_to point. (Bug#11133)
13398
13399 2012-04-06 Eli Zaretskii <eliz@gnu.org>
13400
13401 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13402 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13403 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13404 macros related to unification of CJK characters. For the details,
13405 see the discussion following the message here:
13406 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13407
13408 2012-04-04 Chong Yidong <cyd@gnu.org>
13409
13410 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13411
13412 2012-04-01 Eli Zaretskii <eliz@gnu.org>
13413
13414 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13415 instead of alloca. (Bug#11138)
13416
13417 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13418
13419 * w32menu.c (is_simple_dialog): Properly check lisp types.
13420 (Bug#11141)
13421
13422 2012-03-31 Eli Zaretskii <eliz@gnu.org>
13423
13424 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13425 position we get to after a call to move_it_to fails the
13426 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13427 only if we wind up in a string from display property. (Bug#11063)
13428
13429 * window.c (Fdelete_other_windows_internal): Invalidate the row
13430 and column information about mouse highlight, so that redisplay
13431 restores it after reallocating the glyph matrices. (Bug#7464)
13432
13433 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13434 string comes from a `display' text property, use the buffer
13435 position of that property as if we actually saw that position in
13436 the row's glyphs.
13437 (move_it_by_lines): Remove the assertion that
13438 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13439 violated when there's a before-string at the beginning of a line.
13440 (Bug#11063)
13441
13442 2012-03-30 Eli Zaretskii <eliz@gnu.org>
13443
13444 * xdisp.c (append_space_for_newline): If the default face was
13445 remapped, use the remapped face for the appended newline.
13446 (extend_face_to_end_of_line): Use the remapped default face for
13447 extending the face to the end of the line.
13448 (display_line): Call extend_face_to_end_of_line when the default
13449 face was remapped. (Bug#11068)
13450
13451 2012-03-29 Eli Zaretskii <eliz@gnu.org>
13452
13453 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13454
13455 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13456
13457 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13458
13459 2012-03-27 Glenn Morris <rgm@gnu.org>
13460
13461 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13462 Doc fixes.
13463
13464 2012-03-26 Kenichi Handa <handa@m17n.org>
13465
13466 * dispextern.h (struct glyph): Fix previous change. Change the
13467 bit length of glyphless.ch to 25 (Bug#11082).
13468
13469 2012-03-26 Chong Yidong <cyd@gnu.org>
13470
13471 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13472 (command_loop_1): Use it; inhibit selection update for
13473 handle-select-window too (Bug#8996).
13474
13475 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13476
13477 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
13478
13479 2012-03-25 Kenichi Handa <handa@m17n.org>
13480
13481 * dispextern.h (struct glyph): Change the bit length of
13482 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13483
13484 2012-03-24 Eli Zaretskii <eliz@gnu.org>
13485
13486 * s/ms-w32.h (tzname): Include time.h before redirecting to
13487 _tzname. Fixes the MSVC build. (Bug#9960)
13488
13489 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13490
13491 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13492 characters.
13493
13494 * xterm.c (XTread_socket): Only modify handling_signal if
13495 !SYNC_INPUT. (Bug#11080)
13496
13497 2012-03-23 Eli Zaretskii <eliz@gnu.org>
13498
13499 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13500 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13501 when fetching a multibyte character consumes more bytes than
13502 CHAR_BYTES returns, due to unification of CJK characters in
13503 string_char. (Bug#11073)
13504
13505 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13506
13507 * process.c (wait_reading_process_output): Handle pty disconnect
13508 by refraining from sending oneself a SIGCHLD (bug#10933).
13509
13510 2012-03-22 Chong Yidong <cyd@gnu.org>
13511
13512 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13513
13514 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
13515 Mark string as coming from a prefix property.
13516 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13517 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13518
13519 2012-03-21 Chong Yidong <cyd@gnu.org>
13520
13521 * xfaces.c (Vface_remapping_alist): Doc fix.
13522
13523 2012-03-20 Eli Zaretskii <eliz@gnu.org>
13524
13525 * w32proc.c (Fw32_set_console_codepage)
13526 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13527 Doc fixes.
13528
13529 2012-03-20 Chong Yidong <cyd@gnu.org>
13530
13531 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13532 to reflect default non-nil value of redisplay-dont-pause.
13533
13534 2012-03-19 Kenichi Handa <handa@m17n.org>
13535
13536 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13537 it fit in a valid range (Bug#11003).
13538
13539 2012-03-18 Eli Zaretskii <eliz@gnu.org>
13540
13541 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13542 that is not from display property, accept the row as a "cursor
13543 row" if one of the string's character has a non-nil `cursor'
13544 property. Fixes cursor positioning when there are newlines in
13545 overlay strings, e.g. in icomplete.el. (Bug#11035)
13546
13547 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13548
13549 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13550
13551 2012-03-12 Chong Yidong <cyd@gnu.org>
13552
13553 * eval.c (inhibit_lisp_code): Rename from
13554 inhibit_window_configuration_change_hook; move from window.c.
13555
13556 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13557 * window.c (run_window_configuration_change_hook)
13558 (syms_of_window): Callers changed.
13559
13560 2012-03-11 Chong Yidong <cyd@gnu.org>
13561
13562 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13563
13564 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13565
13566 2012-03-10 Chong Yidong <cyd@gnu.org>
13567
13568 * frame.c (other_visible_frames): Don't assume the selected frame
13569 is visible (Bug#10955).
13570
13571 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13572
13573 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13574
13575 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13576
13577 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13578 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13579 zero (Bug#10954).
13580
13581 2012-03-03 Glenn Morris <rgm@gnu.org>
13582
13583 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
13584
13585 2012-03-02 Eli Zaretskii <eliz@gnu.org>
13586
13587 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13588 position past the first glyph_row that ends at ZV. (Bug#10902)
13589 (redisplay_window, next_element_from_string): Fix typos in
13590 comments.
13591 (redisplay_window): Pass to move_it_vertically the margin in
13592 pixels, not in screen lines.
13593
13594 2012-03-02 Glenn Morris <rgm@gnu.org>
13595
13596 * buffer.c (buffer-list-update-hook): Doc fix.
13597
13598 2012-02-29 Eli Zaretskii <eliz@gnu.org>
13599
13600 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13601 push_it before setting up the iterator for the first overlay
13602 string, even if we have an empty string loaded.
13603 (next_overlay_string): If there's an empty string on the iterator
13604 stack, pop the stack. (Bug#10903)
13605
13606 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13607
13608 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13609 Suggested by Stefan Monnier in
13610 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13611 * alloc.c (widen_to_Lisp_Object): New static function.
13612 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13613 and widening them to Lisp_Objects. This would work even if
13614 USE_LSB_TAG is defined and wide integers are used, which might
13615 happen in a future version of Emacs.
13616
13617 2012-02-25 Chong Yidong <cyd@gnu.org>
13618
13619 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13620 Doc fix.
13621
13622 * xselect.c (Fx_selection_exists_p): Doc fix.
13623 (x_clipboard_manager_save_all): Print an informative message
13624 before saving to clipboard manager.
13625
13626 2012-02-24 Chong Yidong <cyd@gnu.org>
13627
13628 * keyboard.c (process_special_events): Handle all X selection
13629 requests in kbd_buffer, not just the next one (Bug#8869).
13630
13631 2012-02-23 Chong Yidong <cyd@gnu.org>
13632
13633 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13634 call when setting menu-bar-lines and tool-bar-lines parameters.
13635 (unwind_create_frame_1): New helper function.
13636
13637 * window.c (inhibit_window_configuration_change_hook): New var.
13638 (run_window_configuration_change_hook): Obey it.
13639 (syms_of_window): Initialize it.
13640
13641 2012-02-22 Chong Yidong <cyd@gnu.org>
13642
13643 * xterm.c (x_draw_image_relief): Add missing type check for
13644 Vtool_bar_button_margin (Bug#10743).
13645
13646 2012-02-21 Chong Yidong <cyd@gnu.org>
13647
13648 * fileio.c (Vfile_name_handler_alist): Doc fix.
13649
13650 * buffer.c (Fget_file_buffer): Protect against invalid file
13651 handler return value.
13652
13653 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13654
13655 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13656 when computing $valmask.
13657
13658 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13659 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13660 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13661 It's useless in that case, and it can cause problems on hosts
13662 that allocate halves of EMACS_INT values separately.
13663 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13664 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13665 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13666 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13667 it avoids undefined behavior on hosts where shifting right by more
13668 than the word width has undefined behavior.
13669
13670 2012-02-19 Chong Yidong <cyd@gnu.org>
13671
13672 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13673 (Funhandled_file_name_directory, Ffile_name_as_directory)
13674 (Fdirectory_file_name, Fexpand_file_name)
13675 (Fsubstitute_in_file_name): Protect against invalid file handler
13676 return values (Bug#10845).
13677
13678 2012-02-18 Eli Zaretskii <eliz@gnu.org>
13679
13680 * .gdbinit (pitx): Fix incorrect references to fields of the
13681 iterator stack.
13682
13683 2012-02-17 Chong Yidong <cyd@gnu.org>
13684
13685 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13686
13687 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13688
13689 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13690 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13691
13692 2012-02-15 Chong Yidong <cyd@gnu.org>
13693
13694 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13695 marked as special. Also, starting docstrings with * is obsolete.
13696
13697 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13698
13699 * gnutls.c (emacs_gnutls_write): Fix last change.
13700
13701 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13702
13703 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13704 send_process.
13705
13706 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13707
13708 * keymap.c (Fsingle_key_description): Handle char ranges.
13709
13710 2012-02-12 Chong Yidong <cyd@gnu.org>
13711
13712 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13713 as that creates a dangerous corner case.
13714
13715 * window.c (Fdelete_window_internal): Invalidate the mouse
13716 highlight (Bug#9904).
13717
13718 2012-02-12 Glenn Morris <rgm@gnu.org>
13719
13720 * xselect.c (Fx_own_selection_internal)
13721 (Fx_get_selection_internal, Fx_disown_selection_internal)
13722 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13723 * nsselect.m (Fx_own_selection_internal)
13724 (Fx_disown_selection_internal, Fx_selection_exists_p)
13725 (Fx_selection_owner_p, Fx_get_selection_internal):
13726 Sync docs and argument specs with the xselect.c versions.
13727
13728 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13729
13730 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13731
13732 2012-02-11 Eli Zaretskii <eliz@gnu.org>
13733
13734 * w32select.c (Fx_selection_exists_p): Sync doc string and
13735 argument list with xselect.c. (Bug#10783)
13736
13737 * w16select.c (Fx_selection_exists_p): Sync doc string and
13738 argument list with xselect.c. (Bug#10783)
13739
13740 2012-02-10 Glenn Morris <rgm@gnu.org>
13741
13742 * fns.c (Fsecure_hash): Doc fix.
13743
13744 2012-02-09 Kenichi Handa <handa@m17n.org>
13745
13746 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13747
13748 2012-02-07 Chong Yidong <cyd@gnu.org>
13749
13750 * buffer.c (Fbuffer_local_variables)
13751 (buffer_lisp_local_variables): Handle unbound vars correctly;
13752 don't let Qunbound leak into Lisp.
13753
13754 2012-02-07 Glenn Morris <rgm@gnu.org>
13755
13756 * image.c (Fimagemagick_types): Doc fix.
13757
13758 * image.c (imagemagick-render-type): Change it from a lisp object
13759 to an integer. Move the doc here from the lisp manual.
13760 Treat all values not equal to 0 the same.
13761
13762 2012-02-06 Chong Yidong <cyd@gnu.org>
13763
13764 * doc.c (store_function_docstring): Avoid applying docstring of
13765 alias to base function (Bug#2603).
13766
13767 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13768
13769 * .gdbinit (pp1, pv1): Remove redundant defines.
13770 (pr): Use pp.
13771
13772 2012-02-04 Chong Yidong <cyd@gnu.org>
13773
13774 * nsterm.m: Declare a global (Bug#10694).
13775
13776 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13777
13778 * w32.c (get_emacs_configuration_options):
13779 Include --enable-checking, if specified, in the return value.
13780
13781 2012-02-04 Martin Rudalics <rudalics@gmx.at>
13782
13783 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13784 after rounding frame sizes. (Bug#9723)
13785
13786 2012-02-04 Eli Zaretskii <eliz@gnu.org>
13787
13788 * keyboard.c (adjust_point_for_property): Don't position point
13789 before BEGV. (Bug#10696)
13790
13791 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13792
13793 Handle overflow when computing char display width (Bug#9496).
13794 * character.c (char_width): Return EMACS_INT, not int.
13795 (char_width, c_string_width): Check for overflow when
13796 computing the width; this is possible now that individual
13797 characters can have unbounded width. Problem introduced
13798 by merge from Emacs 23 on 2012-01-19.
13799
13800 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
13801
13802 * dbusbind.c (Fdbus_register_method): Mention the return value
13803 :ignore in the docstring.
13804
13805 2012-02-02 Glenn Morris <rgm@gnu.org>
13806
13807 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13808
13809 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13810 Unconditionally set to t. (Bug#10673)
13811 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13812 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13813 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13814
13815 2012-02-02 Kenichi Handa <handa@m17n.org>
13816
13817 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
13818 0, do not call append_composite_glyph.
13819
13820 2012-02-02 Kenichi Handa <handa@m17n.org>
13821
13822 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13823 NULL (Bug#6988).
13824 (x_produce_glyphs): If the component of a composition is a null
13825 string, set it->pixel_width to 1 to avoid zero-width glyph.
13826
13827 2012-02-01 Eli Zaretskii <eliz@gnu.org>
13828
13829 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13830 first 2 arguments are identical. This makes inserting large
13831 output from a subprocess an order of magnitude faster on
13832 MS-Windows, where all sbrk'ed memory is always contiguous.
13833
13834 2012-01-31 Glenn Morris <rgm@gnu.org>
13835
13836 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13837 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13838 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13839
13840 2012-01-29 Glenn Morris <rgm@gnu.org>
13841
13842 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13843
13844 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
13845
13846 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13847
13848 2012-01-28 Chong Yidong <cyd@gnu.org>
13849
13850 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13851
13852 2012-01-26 Chong Yidong <cyd@gnu.org>
13853
13854 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13855
13856 * search.c (Fsearch_forward, Fsearch_backward): Document negative
13857 repeat counts (Bug#10507).
13858
13859 2012-01-26 Glenn Morris <rgm@gnu.org>
13860
13861 * lread.c (syms_of_lread): Doc fix.
13862
13863 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
13864
13865 * coding.c (encode_designation_at_bol): Change return value to
13866 EMACS_INT.
13867
13868 2012-01-25 Chong Yidong <cyd@gnu.org>
13869
13870 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13871
13872 2012-01-21 Chong Yidong <cyd@gnu.org>
13873
13874 * floatfns.c (Fcopysign): Make the second argument non-optional,
13875 since nil is not allowed anyway.
13876
13877 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
13878
13879 * process.c (read_process_output): Use p instead of XPROCESS (proc).
13880 (send_process): Likewise.
13881
13882 2012-01-19 Martin Rudalics <rudalics@gmx.at>
13883
13884 * window.c (save_window_save, Fcurrent_window_configuration)
13885 (Vwindow_persistent_parameters): Do not use Qstate.
13886 Rewrite doc-strings.
13887
13888 2012-01-19 Kenichi Handa <handa@m17n.org>
13889
13890 * character.c (char_width): New function.
13891 (Fchar_width, c_string_width, lisp_string_width):
13892 Use char_width (Bug#9496).
13893
13894 2012-01-16 Martin Rudalics <rudalics@gmx.at>
13895
13896 * window.c (Vwindow_persistent_parameters): New variable.
13897 (Fset_window_configuration, save_window_save): Handle persistent
13898 window parameters.
13899
13900 2012-01-14 Eli Zaretskii <eliz@gnu.org>
13901
13902 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13903 thrashing the stack of the thread. (Bug#9087)
13904
13905 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
13906
13907 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13908
13909 2012-01-11 Eli Zaretskii <eliz@gnu.org>
13910
13911 * xdisp.c (rows_from_pos_range): Handle the case where the
13912 highlight ends on a newline. (Bug#10464)
13913 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13914 he end column for display of highlight that ends on a newline
13915 before a R2L line.
13916
13917 2012-01-11 Glenn Morris <rgm@gnu.org>
13918
13919 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13920 from load-path also when installation-directory is nil. (Bug#10208)
13921
13922 2012-01-10 Glenn Morris <rgm@gnu.org>
13923
13924 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13925
13926 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13927 Update template values to be closer to their typical values these days.
13928
13929 2012-01-09 Eli Zaretskii <eliz@gnu.org>
13930
13931 * xdisp.c (rows_from_pos_range): Accept additional argument
13932 DISP_STRING, and accept any glyph in a row whose object is that
13933 string as eligible for mouse highlight. Fixes mouse highlight of
13934 display strings from overlays. (Bug#10464)
13935
13936 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
13937
13938 emacs: fix an auto-save permissions race condition (Bug#10400)
13939 * fileio.c (auto_saving_dir_umask): New static var.
13940 (Fmake_directory_internal): Use it.
13941 (do_auto_save_make_dir): Set it, instead of invoking chmod after
13942 creating the directory. The old code temporarily assigns
13943 too-generous permissions to the directory.
13944 (do_auto_save_eh): Clear it.
13945 (Fdo_auto_save): Catch all errors, not just file errors, so
13946 that the var is always cleared.
13947
13948 2012-01-07 Eli Zaretskii <eliz@gnu.org>
13949
13950 * search.c (scan_buffer): Pass character positions to
13951 know_region_cache, not byte positions. (Bug#6540)
13952
13953 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
13954
13955 * w32.c (sys_rename): Report EXDEV when rename of a directory
13956 fails because the target is on another logical disk. (Bug#10284)
13957
13958 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
13959
13960 * xterm.c (x_embed_request_focus): New function.
13961
13962 * xterm.h: Add prototype.
13963
13964 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
13965
13966 2012-01-05 Glenn Morris <rgm@gnu.org>
13967
13968 * emacs.c (emacs_copyright): Update short copyright year to 2012.
13969
13970 2012-01-01 Eli Zaretskii <eliz@gnu.org>
13971
13972 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
13973 Load gnutls_transport_set_lowat only if GnuTLS version is below
13974 2.11.1.
13975 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
13976 GnuTLS versions below 2.11.1.
13977
13978 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
13979
13980 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
13981 to the doc string advising against its use for altering the way
13982 windows are scrolled.
13983
13984 2011-12-28 Kenichi Handa <handa@m17n.org>
13985
13986 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
13987 coding-system ASCII compatible only when it does not produce BOM
13988 on encoding (Bug#10383).
13989
13990 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
13991
13992 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
13993 can scroll.
13994 (create_and_show_popup_menu): Always use menu_position_func for
13995 Gtk3 (Bug#10361).
13996
13997 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
13998
13999 * callint.c (Fcall_interactively): Don't truncate prompt string.
14000
14001 2011-12-23 Eli Zaretskii <eliz@gnu.org>
14002
14003 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14004 property that ends at ZV, so that the bidi iteration could be
14005 resumed from there (after widening). (Bug#10360)
14006
14007 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14008
14009 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14010
14011 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14012
14013 * nsterm.m (x_free_frame_resources):
14014 Release f->output_data.ns->miniimage.
14015 (ns_index_color): Fix indentation. Do not retain
14016 color_table->colors[i].
14017
14018 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14019 before returning.
14020
14021 * nsfns.m (x_set_background_color): Assign return value from
14022 ns_index_color to face-background instead of NSColor*.
14023 (ns_implicitly_set_icon_type): Fix indentation.
14024 Change assignment in for loop to comparison.
14025
14026 * emacs.c (ns_pool): New variable.
14027 (main): Assign ns_pool.
14028 (Fkill_emacs): Call ns_release_autorelease_pool.
14029
14030 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14031 autorelease fdesc, release fdAttrs and tdict.
14032 (ns_get_covering_families): Release charset.
14033 (ns_findfonts): Release NSFontDescriptor created with new.
14034 (ns_uni_to_glyphs): Fix indentation.
14035 (setString): Release attrStr before assigning new value.
14036
14037 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14038
14039 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14040 and NS_IMPL_COCOA.
14041 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14042 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14043
14044 2011-12-18 David Reitter <reitter@cmu.edu>
14045
14046 * nsterm.m (ns_term_init): Subscribe for notifications
14047 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14048 to method trackingNotification in EmacsMenu.
14049
14050 * nsmenu.m (trackingMenu): New variable.
14051 (trackingNotification): New method (from Aquamacs).
14052 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14053 from Aquamacs (Bug#7030).
14054
14055 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14056
14057 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14058 (symbol_to_nsstring): Fix indentation.
14059 (ns_symbol_to_pb): New function.
14060 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14061 (Fns_rotate_cut_buffers_internal): Remove.
14062 (Fns_store_selection_internal): Rename from
14063 Fns_store_cut_buffer_internal.
14064 (ns_get_foreign_selection, Fx_own_selection_internal)
14065 (Fx_disown_selection_internal, Fx_selection_exists_p)
14066 (Fns_get_selection_internal, Fns_store_selection_internal):
14067 Use ns_symbol_to_pb and check if return value is nil.
14068 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14069 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
14070 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14071 renamed to Sns_store_selection_internal.
14072 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14073 and remove this function.
14074 (ns_handle_selection_clear): Remove, never used.
14075 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14076 here.
14077
14078 2011-12-17 Ken Brown <kbrown@cornell.edu>
14079
14080 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14081 GID is unknown (Bug#10257).
14082
14083 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14084
14085 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14086 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14087 which caused a build failure on GNU/Linux IA-64. This problem was
14088 introduced by my 2011-10-07 patch.
14089
14090 2011-12-15 Juri Linkov <juri@jurta.org>
14091
14092 * image.c (imagemagick_error): New function. (Bug#10112)
14093 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14094 Use `imagemagick_error' where ImageMagick functions return
14095 `MagickFalse'.
14096 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14097 proper order.
14098
14099 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14100
14101 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14102 fill background (Bug#8992).
14103
14104 2011-12-13 Martin Rudalics <rudalics@gmx.at>
14105
14106 * window.c (Vwindow_combination_resize)
14107 (Vwindow_combination_limit): Use t instead of non-nil in
14108 doc-strings.
14109 (Vrecenter_redisplay): Add first sentence of doc-string on
14110 separate line.
14111 (Frecenter): Fix doc-string typo.
14112
14113 2011-12-11 Kenichi Handa <handa@m17n.org>
14114
14115 * coding.c (Funencodable_char_position): Pay attention to the
14116 buffer text relocation (Bug#9389).
14117
14118 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14119
14120 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14121 gtk_init (Bug#10100).
14122
14123 2011-12-10 Eli Zaretskii <eliz@gnu.org>
14124
14125 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14126 IT->string is nil. (Bug#10263)
14127
14128 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14129
14130 * nsterm.h (x_free_frame_resources): Declare.
14131
14132 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14133 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14134
14135 * nsterm.h (ns_get_defaults_value): Declare.
14136
14137 * nsterm.m (ns_default): Call ns_get_defaults_value.
14138
14139 2011-12-09 Eli Zaretskii <eliz@gnu.org>
14140
14141 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14142 (Bug#10170)
14143
14144 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14145
14146 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14147 that where the value of an _OBJC_* symbol points to is in the .bss
14148 section (Bug#10240).
14149
14150 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14151
14152 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14153 after the loop to call ccl_driver at least once (Bug#8619).
14154
14155 2011-12-08 Kenichi Handa <handa@m17n.org>
14156
14157 * ftfont.c (get_adstyle_property): Fix previous change
14158 (Bug#10233).
14159
14160 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
14161
14162 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14163 dirs from the default value of EMACSLOADPATH (bug#10208).
14164
14165 2011-12-07 Glenn Morris <rgm@gnu.org>
14166
14167 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14168 installation and source directories as well. (Bug#10208)
14169
14170 2011-12-06 Chong Yidong <cyd@gnu.org>
14171
14172 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14173
14174 2011-12-06 Glenn Morris <rgm@gnu.org>
14175
14176 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14177 as an error, not just -1. (Bug#10217)
14178
14179 2011-12-05 Chong Yidong <cyd@gnu.org>
14180
14181 * keyboard.c (process_special_events): New function.
14182 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14183
14184 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14185
14186 * coding.c (encode_designation_at_bol): Don't use uninitialized
14187 local variable (Bug#9318).
14188
14189 2011-12-05 Kenichi Handa <handa@m17n.org>
14190
14191 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14192 return Qnil (Bug#8046, Bug#10193).
14193
14194 2011-12-05 Kenichi Handa <handa@m17n.org>
14195
14196 * coding.c (encode_designation_at_bol): New args charbuf_end and
14197 dst. Return the number of produced bytes. Callers changed.
14198 (coding_set_source): Return how many bytes coding->source was
14199 relocated.
14200 (coding_set_destination): Return how many bytes
14201 coding->destination was relocated.
14202 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14203 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14204
14205 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14206
14207 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14208 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14209 macro (Bug#9318).
14210
14211 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14212
14213 The following changes are to fix Bug#9318.
14214
14215 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14216 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14217 (encode_coding_iso_2022, encode_coding_sjis)
14218 (encode_coding_big5, encode_coding_charset): Use the above macros.
14219
14220 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
14221
14222 * lisp.h (process_quit_flag): Fix external declaration.
14223
14224 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14225
14226 Don't macro-inline non-performance-critical code.
14227 * eval.c (process_quit_flag): New function.
14228 * lisp.h (QUIT): Use it.
14229
14230 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14231
14232 * nsfns.m (get_geometry_from_preferences): New function.
14233 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14234
14235 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14236
14237 * emacs.c (Qkill_emacs): Define.
14238 (syms_of_emacs): Initialize it.
14239 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14240 Qquit_flag to `kill-emacs' instead.
14241 (quit_throw_to_read_char): Add parameter `from_signal'.
14242 All callers changed. Call Fkill_emacs if requested and safe.
14243 * lisp.h (QUIT): Call Fkill_emacs if requested.
14244
14245 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14246
14247 * widget.c (update_wm_hints): Return if wmshell is null.
14248 (widget_update_wm_size_hints): New function.
14249
14250 * widget.h (widget_update_wm_size_hints): Declare.
14251
14252 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14253 widget_update_wm_size_hints (Bug#10104).
14254
14255 2011-12-03 Eli Zaretskii <eliz@gnu.org>
14256
14257 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14258 before a newline, prepare the bidi iterator for consuming the
14259 newline, and keep the current paragraph direction. (Bug#10183)
14260 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
14261
14262 2011-12-02 Juri Linkov <juri@jurta.org>
14263
14264 * search.c (Fword_search_regexp): New Lisp function created from
14265 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14266 (Fword_search_backward, Fword_search_forward)
14267 (Fword_search_backward_lax, Fword_search_forward_lax):
14268 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14269 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14270
14271 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14272
14273 * fileio.c (Finsert_file_contents): Move after-change-function call
14274 to before the "handled:" label, since all "goto handled" appear in
14275 cases where the *-change-functions have already been properly called
14276 (bug#10117).
14277
14278 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14279
14280 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14281 waiting for input. (Bug#10169)
14282
14283 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14284
14285 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14286 verifies glyph row's hash code--we have just reallocated the
14287 glyphs, so their contents can be complete garbage. (Bug#10164)
14288
14289 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
14290
14291 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14292
14293 2011-11-30 Eli Zaretskii <eliz@gnu.org>
14294
14295 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14296 attributes are tested _before_ calling verify_row_hash, to protect
14297 against GCC re-ordering of the tests. (Bug#10164)
14298
14299 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14300
14301 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14302
14303 * xterm.c (handle_one_xevent): Only set async_visible and friends
14304 if net_wm_state_hidden_seen is non-zero (Bug#10002)
14305 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
14306 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14307
14308 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14309
14310 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14311 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14312 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14313 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14314 All uses changed to use GCPRO1 etc.
14315 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14316 Revert to old implementation (i.e., before 2011-03-11).
14317
14318 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14319
14320 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14321 of scroll runs so as to avoid assigning disabled bogus rows and
14322 unnecessary graphics copy operations.
14323
14324 2011-11-27 Eli Zaretskii <eliz@gnu.org>
14325
14326 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14327 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14328 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14329 (malloc, free, realloc, calloc): Redirect to e_* only when
14330 compiling Emacs.
14331
14332 * lisp.h (GCTYPEBITS): Move before first use.
14333 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14334 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14335 this macro definition.
14336
14337 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14338 _MSC_VER.
14339
14340 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14341
14342 * gtkutil.c (xg_create_frame_widgets):
14343 Call gtk_window_set_has_resize_grip (FALSE) if that function is
14344 present with Gtk+ 2.0.
14345
14346 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14347
14348 * fileio.c (Finsert_file_contents): Undo previous change; see
14349 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14350
14351 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14352
14353 Rename locals to avoid shadowing.
14354 * fileio.c (Finsert_file_contents):
14355 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14356 * process.c (wait_reading_process_output):
14357 Rename inner 'proc' to 'p' to avoid shadowing.
14358 Indent for consistency with usual Emacs style.
14359
14360 2011-11-25 Eli Zaretskii <eliz@gnu.org>
14361
14362 * xdisp.c (redisplay_window): If cursor row is not fully visible
14363 after recentering, and scroll-conservatively is set to a large
14364 number, scroll window by a few more lines to make the cursor fully
14365 visible and out of scroll-margin. (Bug#10105)
14366 (start_display): Don't move to the next line if the display should
14367 start at a newline that is part of a display vector or an overlay
14368 string. (Bug#10119)
14369
14370 2011-11-24 Juri Linkov <juri@jurta.org>
14371
14372 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14373 after the `MagickPingImage' call. (Bug#10112)
14374
14375 2011-11-23 Chong Yidong <cyd@gnu.org>
14376
14377 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14378
14379 2011-11-23 Martin Rudalics <rudalics@gmx.at>
14380
14381 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14382 making another buffer current. (Bug#10114)
14383
14384 2011-11-23 Glenn Morris <rgm@gnu.org>
14385
14386 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14387
14388 2011-11-23 Chong Yidong <cyd@gnu.org>
14389
14390 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14391 using it (Bug#5984).
14392
14393 2011-11-22 Eli Zaretskii <eliz@gnu.org>
14394
14395 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14396 and header-lines, as they don't have one computed for them.
14397 (Bug#10098)
14398
14399 * .gdbinit (prow): Make displayed values more self-explaining.
14400 Add row's hash code.
14401
14402 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14403
14404 * process.c (wait_reading_process_output): Fix asynchrounous
14405 GnuTLS socket handling on some versions of the GnuTLS library.
14406 (wait_reading_process_output): Add comment and URL.
14407
14408 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14409
14410 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14411
14412 2011-11-21 Chong Yidong <cyd@gnu.org>
14413
14414 * window.c (Fnext_window, Fprevious_window): Doc fix.
14415
14416 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14417
14418 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14419
14420 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14421
14422 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14423
14424 2011-11-20 Martin Rudalics <rudalics@gmx.at>
14425
14426 * window.c (Fset_window_combination_limit): Rename argument
14427 STATUS to LIMIT.
14428 (Vwindow_combination_limit): Remove "status" from doc-string.
14429
14430 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14431
14432 * m/ibms390.h: Remove.
14433 * m/ibms390x.h: Don't include "ibms390.h".
14434
14435 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14436
14437 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14438 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14439
14440 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
14441
14442 * casetab.c (Fset_case_table):
14443 * charset.c (Fcharset_after): Fix typos.
14444
14445 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
14446
14447 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14448 Otherwise, valgrind does not work on some platforms.
14449 Problem reported by Andreas Schwab in
14450 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14451 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14452 is set, removing the need for VIRT_ADDRESS_VARIES.
14453 (PURE_P): Use a more-efficient implementation that needs just one
14454 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14455 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14456 to 4 (xorl, subq, cmpq, setbe).
14457 * alloc.c (pure): Always extern now, since that's the
14458 VIRT_ADDR_VARIES behavior.
14459 (PURE_POINTER_P): Use a single comparison, not two, for
14460 consistency with the new puresize.h.
14461 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14462 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14463 Remove VIRT_ADDR_VARIES no longer needed.
14464
14465 2011-11-19 Eli Zaretskii <eliz@gnu.org>
14466
14467 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14468 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14469 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14470 behave as if the cursor position were at the window margin.
14471
14472 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14473 and the cursor position is out of bounds, behave as if the cursor
14474 position were at the window margin. (Bug#10075)
14475
14476 2011-11-18 Chong Yidong <cyd@gnu.org>
14477
14478 * window.c (Fwindow_combination_limit): Make first argument
14479 non-optional, since it is meaningless for live windows like the
14480 selected window.
14481
14482 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14483
14484 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14485
14486 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14487
14488 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14489 (graft_intervals_into_buffer): Simplify.
14490
14491 2011-11-18 Eli Zaretskii <eliz@gnu.org>
14492
14493 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14494 hash values of the two rows.
14495 (copy_row_except_pointers): Preserve the used[] arrays and the
14496 hash values of the two rows. (Bug#10035)
14497 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
14498
14499 * xdisp.c (row_hash): New function, body extracted from
14500 compute_line_metrics.
14501 (compute_line_metrics): Call row_hash, instead of computing the
14502 hash code inline.
14503
14504 * dispnew.c (verify_row_hash): Call row_hash for computing the
14505 hash code of a row, instead of duplicating code from xdisp.c.
14506
14507 * dispextern.h (row_hash): Add prototype.
14508
14509 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14510
14511 * frame.c (delete_frame): Don't delete the terminal when the last
14512 X frame is closed if emacs is built with GTK toolkit.
14513
14514 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
14515
14516 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14517
14518 2011-11-17 Martin Rudalics <rudalics@gmx.at>
14519
14520 * window.c (Vwindow_splits): Rename to
14521 Vwindow_combination_resize. Suggested by Juri Linkov.
14522 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14523 of Vwindow_splits.
14524
14525 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
14526
14527 * nsfns.m (Fns_font_name):
14528 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
14529
14530 2011-11-16 Martin Rudalics <rudalics@gmx.at>
14531
14532 * window.h (window): Rename slot "nest" to "combination_limit".
14533 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14534 (Fset_window_nest): Rename to Fset_window_combination_limit.
14535 (Vwindow_nest): Rename to Vwindow_combination_limit.
14536 (recombine_windows, make_parent_window, make_window)
14537 (Fsplit_window_internal, saved_window)
14538 (Fset_window_configuration, save_window_save): Rename all
14539 occurrences of window_nest to window_combination_limit.
14540
14541 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
14542
14543 * image.c (imagemagick_load_image): Fix typo.
14544
14545 2011-11-14 Eli Zaretskii <eliz@gnu.org>
14546
14547 * xdisp.c (display_line): Move the call to
14548 highlight_trailing_whitespace before the call to
14549 compute_line_metrics, since the latter needs to see the final
14550 faces of all the glyphs to compute ROW's hash value.
14551 Fixes assertion violations in row_equal_p. (Bug#10035)
14552
14553 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
14554
14555 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14556 just return (bug#10044).
14557
14558 2011-11-12 Eli Zaretskii <eliz@gnu.org>
14559
14560 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14561 with user-defined heap size. Bump the default size of the temacs
14562 heap to 27MB, to avoid memory warning when running temacs.
14563 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14564
14565 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14566 current_matrix and desired_matrix. (Bug#9990)
14567 (verify_row_hash) [XASSERTS]: New function.
14568 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14569 that the hash value of glyph rows is correct.
14570
14571 2011-11-12 Martin Rudalics <rudalics@gmx.at>
14572
14573 * window.h (window): Remove splits slot.
14574 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14575 (Fdelete_other_windows_internal, make_parent_window)
14576 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14577 (Fset_window_configuration, save_window_save): Don't deal with
14578 split status of windows.
14579 (saved_window): Remove splits slot.
14580 (Vwindow_splits): Rewrite doc-string.
14581
14582 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14583
14584 * xfns.c (unwind_create_frame):
14585 * nsfns.m (unwind_create_frame):
14586 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14587 Vframe_list (Bug#9999).
14588
14589 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14590
14591 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
14592
14593 2011-11-11 Kenichi Handa <handa@m17n.org>
14594
14595 * callproc.c (Fcall_process): Set the member dst_multibyte of
14596 process_coding.
14597
14598 2011-11-11 Johan Bockgård <bojohan@gnu.org>
14599
14600 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14601 avoid a crash (bug#9496).
14602
14603 2011-11-09 Chong Yidong <cyd@gnu.org>
14604
14605 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14606 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14607
14608 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14609
14610 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14611
14612 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14613
14614 Avoid some portability problems by eschewing 'extern inline' functions.
14615 The trivial performance wins aren't worth the portability hassles; see
14616 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14617 et seq.
14618 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14619 (window_box_width, window_box_left, window_box_left_offset)
14620 (window_box_right, window_box_right_offset): Undo previous change,
14621 by removing the "extern"s.
14622 * intervals.c (adjust_intervals_for_insertion)
14623 (adjust_intervals_for_deletion): Undo previous change,
14624 making these static again.
14625 (offset_intervals, temp_set_point_both, temp_set_point)
14626 (copy_intervals_to_string): No longer inline.
14627 * xdisp.c (window_text_bottom_y, window_box_width)
14628 (window_box_height, window_box_left_offset)
14629 (window_box_right_offset, window_box_left, window_box_right)
14630 (window_box): No longer inline.
14631
14632 2011-11-08 Chong Yidong <cyd@gnu.org>
14633
14634 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
14635 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14636 Signal an error if not a live window.
14637 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14638 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14639
14640 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
14641
14642 * lisp.h (syms_of_abbrev): Remove declaration.
14643 Reported by CHENG Gao <chenggao@royau.me>.
14644
14645 2011-11-07 Eli Zaretskii <eliz@gnu.org>
14646
14647 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14648 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14649 of temacs in GUI mode.
14650
14651 2011-11-07 Martin Rudalics <rudalics@gmx.at>
14652
14653 * window.h: Declare delete_all_child_windows instead of
14654 delete_all_subwindows.
14655 * window.c (Fwindow_nest, Fset_window_nest)
14656 (Fset_window_new_total, Fset_window_new_normal)
14657 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14658 (delete_all_subwindows): Rename to delete_all_child_windows.
14659 (Fdelete_other_windows_internal, Fset_window_configuration):
14660 Call delete_all_child_windows instead of delete_all_subwindows.
14661 * frame.c (delete_frame): Call delete_all_child_windows instead
14662 of delete_all_subwindows.
14663
14664 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14665
14666 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14667 This is also needed for porting to any host where GC_MARK_STACK is
14668 not GC_MAKE_GCPROS_NOOPS.
14669 (which_symbols): Use it.
14670
14671 2011-11-07 Kenichi Handa <handa@m17n.org>
14672
14673 * coding.c (coding_set_destination): Check coding->src_pos only
14674 when coding->src_object is a buffer (bug#9910).
14675
14676 * process.c (send_process): Set the member src_multibyte of coding
14677 to 0 (bug#9911) when sending a unibyte text.
14678
14679 * callproc.c (Fcall_process): Set the member src_multibyte of
14680 process_coding to 0 (bug#9912).
14681
14682 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14683
14684 * xmenu.c (cleanup_widget_value_tree): New function.
14685 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14686 calling free_menubar_widget_value_tree directly (Bug#9830).
14687
14688 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14689
14690 Fix some portability problems with 'inline'.
14691 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14692 (window_box_width, window_box_left, window_box_left_offset)
14693 (window_box_right, window_box_right_offset): Declare extern.
14694 Otherwise, these inline functions do not conform to C99 and
14695 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14696 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14697 * intervals.c (adjust_intervals_for_insertion)
14698 (adjust_intervals_for_deletion): Now extern, because otherwise the
14699 extern inline functions 'offset_intervals' couldn't refer to it.
14700 (static_offset_intervals): Remove.
14701 (offset_intervals): Rewrite using the old contents of
14702 static_offset_intervals. The old version didn't conform to C99
14703 because an extern inline function contained a reference to an
14704 identifier with static linkage.
14705
14706 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14707
14708 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14709 GC.
14710
14711 2011-11-06 Eli Zaretskii <eliz@gnu.org>
14712
14713 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14714 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14715 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14716 return Qleft_to_right.
14717
14718 2011-11-06 Chong Yidong <cyd@gnu.org>
14719
14720 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14721 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14722 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14723 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14724 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14725 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14726 (Fwindow_vscroll): Doc fix.
14727 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14728 argument, since it makes no sense to pass a live window and for
14729 consistency with window-child.
14730
14731 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14732
14733 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14734 support MSVC.
14735
14736 2011-11-05 Jason Rumney <jasonr@gnu.org>
14737
14738 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14739 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14740 fonts (Bug#6029).
14741 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14742 bitwise arithmetic preventing use of unicode-sip and non-truetype
14743 opentype fonts.
14744
14745 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14746
14747 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14748 "emacs"-only part.
14749
14750 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14751 initialization code to keep similarity to xfns.c after changes
14752 from 2011-11-05.
14753
14754 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14755
14756 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14757 (unwind_create_frame): New function (Bug#9943).
14758 (Fx_create_frame): Restructure code to be more similar to the one in
14759 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14760 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14761 Move terminal->reference_count++ just before making the frame official
14762 (Bug#9943).
14763
14764 * nsterm.m (x_free_frame_resources): New function.
14765 (x_destroy_window): Move code to x_free_frame_resources.
14766
14767 * xfns.c (unwind_create_frame): Fix comment.
14768 (Fx_create_frame, x_create_tip_frame):
14769 Move terminal->reference_count++ just before making the frame
14770 official. Move initialization of image_cache_refcount and
14771 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14772
14773 2011-11-05 Eli Zaretskii <eliz@gnu.org>
14774
14775 Support MSVC build with newer versions of Visual Studio.
14776 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14777 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14778 nt/gmake.defs.
14779
14780 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14781 which are not supported by MSVC.
14782 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14783 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14784 bitfields.
14785 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14786 types in bitfields.
14787 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14788
14789 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14790
14791 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
14792
14793 Support MSVC build with newer versions of Visual Studio.
14794 * w32.c: Don't include w32api.h for MSVC.
14795 (init_environment) [_MSC_VER]: Call sys_access, not _access.
14796
14797 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14798 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14799 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14800 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14801 e_* cousins.
14802 (alloca) [_MSC_VER]: Define to _alloca.
14803
14804 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14805
14806 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14807
14808 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14809
14810 * xdisp.c (note_mouse_highlight): If either of
14811 previous/next-single-property-change returns nil, treat that as
14812 the beginning or the end of the buffer. (Bug#9955)
14813
14814 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
14815
14816 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
14817 label is not null (Bug#9951).
14818 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14819 may be NULL.
14820
14821 2011-11-04 Eli Zaretskii <eliz@gnu.org>
14822
14823 * window.c (Fwindow_body_size): Mention in the doc string that the
14824 return value is in frame's canonical units. (Bug#9949)
14825
14826 2011-11-03 Eli Zaretskii <eliz@gnu.org>
14827
14828 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
14829
14830 * w32fns.c (unwind_create_frame): If needed, free the glyph
14831 matrices of the partially constructed frame. (Bug#9943)
14832 * xfns.c (unwind_create_frame): Likewise.
14833
14834 2011-11-01 Eli Zaretskii <eliz@gnu.org>
14835
14836 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14837 Don't stop backward scan on the continuation glyph, even though
14838 its CHARPOS is positive.
14839 (mouse_face_from_buffer_pos, note_mouse_highlight):
14840 Rename cover_string to disp_string.
14841
14842 2011-11-01 Martin Rudalics <rudalics@gmx.at>
14843
14844 * window.c (temp_output_buffer_show): Don't use
14845 Vtemp_buffer_show_specifiers.
14846 (Vtemp_buffer_show_specifiers): Remove unused variable.
14847
14848 2011-10-30 Eli Zaretskii <eliz@gnu.org>
14849
14850 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14851 past the beginning of the current glyph matrix.
14852
14853 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
14854
14855 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14856 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14857 HAVE_GTK3 (Bug#9869).
14858
14859 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14860 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14861
14862 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14863
14864 * xterm.c: Declare x_handle_net_wm_state to return int.
14865 (handle_one_xevent): Check if we are iconified but don't have
14866 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
14867 (get_current_wm_state): Return non-zero if not hidden,
14868 check for _NET_WM_STATE_HIDDEN (Bug#9893).
14869 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14870 (x_handle_net_wm_state): Return what get_current_wm_state returns.
14871 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14872
14873 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
14874
14875 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14876 so that this new function doesn't get optimized away by a
14877 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
14878
14879 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14880
14881 * frame.h (MOUSE_HL_INFO): Remove excess parens.
14882
14883 2011-10-29 Eli Zaretskii <eliz@gnu.org>
14884
14885 Fix the `xbytecode' command.
14886 * .gdbinit (xprintbytestr): New command.
14887 (xwhichsymbols): Rename from `which'; all callers changed.
14888 (xbytecode): Print the byte-code string as well.
14889
14890 2011-10-29 Kim Storm <storm@cua.dk>
14891
14892 * alloc.c (which_symbols): New function.
14893
14894 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
14895
14896 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14897 line. (Bug#9903)
14898
14899 2011-10-29 Glenn Morris <rgm@gnu.org>
14900
14901 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14902 Not clear what it was for, and it causes various bugs. (Bug#9839)
14903
14904 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14905
14906 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14907 possible random value that matches one of those tested as
14908 condition to clear the mouse face.
14909
14910 2011-10-28 Chong Yidong <cyd@gnu.org>
14911
14912 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14913
14914 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
14915
14916 * window.c (make_window): Initialize phys_cursor_on_p.
14917
14918 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
14919
14920 * lisp.h (struct Lisp_Symbol): Update comments.
14921
14922 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
14923
14924 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14925
14926 2011-10-28 Eli Zaretskii <eliz@gnu.org>
14927
14928 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
14929 <oslsachem@gmail.com> for helping to debug this.
14930
14931 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14932 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14933 (g_b_init_get_glyph_outline_w): New static variables.
14934 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
14935 (GetGlyphOutlineW_Proc): New typedefs.
14936 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
14937 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
14938 New functions.
14939 (w32font_open_internal, compute_metrics):
14940 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
14941 instead of calling the "wide" APIs directly.
14942
14943 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
14944
14945 * w32.h (syms_of_w32font): Add prototype.
14946
14947 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14948
14949 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
14950 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
14951 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
14952 (Fmove_to_window_line): Doc fix.
14953
14954 2011-10-27 Chong Yidong <cyd@gnu.org>
14955
14956 * process.c (make_process): Set gnutls_state to NULL.
14957
14958 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
14959 non-NULL, regardless of GNUTLS_INITSTAGE.
14960 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
14961 an error. Set process slots as soon as we allocate them.
14962
14963 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
14964
14965 2011-10-27 Chong Yidong <cyd@gnu.org>
14966
14967 * gnutls.c (emacs_gnutls_deinit): New function.
14968 Deallocate credentials structures as well as calling gnutls_deinit.
14969 (Fgnutls_deinit, Fgnutls_boot): Use it.
14970
14971 * process.c (make_process): Initialize GnuTLS credentials to NULL.
14972 (deactivate_process): Call emacs_gnutls_deinit.
14973
14974 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
14975
14976 * image.c (x_create_x_image_and_pixmap):
14977 * w32.c (sys_rename, w32_delayed_load):
14978 * w32font.c (fill_in_logfont):
14979 * w32reg.c (x_get_string_resource): Silence compiler warnings.
14980
14981 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
14982
14983 * w32fns.c (w32_default_color_map): New function,
14984 extracted from Fw32_default_color_map.
14985 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
14986
14987 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
14988
14989 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
14990
14991 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
14992
14993 * keyboard.c (test_undefined): New function (bug#9751).
14994 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
14995
14996 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
14997
14998 * sysdep.c (init_sys_modes): Fix the check for the controlling
14999 terminal (Bug#6649).
15000
15001 2011-10-20 Eli Zaretskii <eliz@gnu.org>
15002
15003 * dispextern.h (struct bidi_it): New member next_en_type.
15004
15005 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15006 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15007 current character, check also for next_en_type being WEAK_EN.
15008 (bidi_resolve_weak): Don't enter the expensive loop if the current
15009 position is before next_en_pos. Record the bidi type of the first
15010 non-ET, non-BN character we find, in addition to its position.
15011 (bidi_level_of_next_char): Invalidate next_en_type when
15012 next_en_pos is over-stepped.
15013
15014 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15015
15016 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15017 * editfns.c: Rewrite current-time-zone so that it invokes
15018 the equivalent of (format-time-string "%Z") to get the time zone name.
15019 This fixes a bug when the time zone name contains characters that
15020 need converting from the system time locale to Emacs internal format.
15021 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15022 that patch fixed format-time-string to do the conversion, but
15023 I forgot to fix current-time-zone.
15024 (format_time_string): New function, containing most of
15025 what Fformat_time_string used to contain.
15026 (Fformat_time_string): Rewrite in terms of format_time_string.
15027 This doesn't change this function's behavior.
15028 (current-time-zone): Rewrite to use format_time_string.
15029 This fixes the bug reported by Michael Schierl in
15030 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15031 Jason Rumney's 2007-06-07 change worked around this bug, but
15032 didn't fix it.
15033 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15034
15035 2011-10-19 Eli Zaretskii <eliz@gnu.org>
15036
15037 * xdisp.c (start_display): If the character at POS is displayed
15038 via a display vector, reset IT->current.dpvec_index to zero.
15039 (try_window_reusing_current_matrix): If a line ends in a display
15040 vector or the next line starts in a display vector, continue
15041 redrawing the window even though the character position of
15042 start_row was reached.
15043 (Bug#9771, part 2)
15044
15045 2011-10-18 Chong Yidong <cyd@gnu.org>
15046
15047 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15048 with nobreak-char-display too.
15049
15050 2011-10-18 Eli Zaretskii <eliz@gnu.org>
15051
15052 Fix part 3 of bug#9771.
15053 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15054 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15055 non-neutral characters if the current character is a paragraph
15056 separator (a.k.a. Newline). This avoids running the same
15057 expensive loop twice, once when we consume the preceding newline
15058 and the other time when the line actually needs to be displayed.
15059 Avoid the loop when we see neutrals on the base embedding level
15060 following a character whose directionality is the same as the
15061 paragraph's. This avoids running the expensive loop when a line
15062 ends in a long sequence of neutrals, like control characters.
15063 Add assertion against STRONG_AL type. Slightly rearrange code
15064 that determines the type of a neutral given the first non-neutral
15065 that follows it.
15066 (bidi_level_of_next_char): Set next_en_pos to zero when
15067 invalidating its info.
15068
15069 2011-10-17 Eli Zaretskii <eliz@gnu.org>
15070
15071 * xdisp.c (push_display_prop): Determine whether to record string
15072 or buffer position by IT->string, not by IT->method. Allow
15073 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
15074 (move_it_vertically_backward): Don't look for character position
15075 immediately after the newline when in a continuation line.
15076 (Bug#9771, part 1)
15077
15078 2011-10-15 Martin Rudalics <rudalics@gmx.at>
15079
15080 * window.c (coordinates_in_window): Rewrite and delabelize
15081 vertical border check. (Bug#5357) (Bug#9618)
15082
15083 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15084
15085 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15086 errors in XSetWindowBorder (bug#9310).
15087
15088 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15089
15090 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15091 avoid crash when xmalloc overrun checking is enabled.
15092
15093 2011-10-13 Eli Zaretskii <eliz@gnu.org>
15094
15095 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15096 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15097 cursor motion with <left> and <right> arrow keys.
15098
15099 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15100 some callers set that themselves.
15101
15102 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15103
15104 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15105 display string and the previous row comes from the same string and
15106 is empty. (Bug#9739) (Bug#9738)
15107
15108 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15109
15110 * doc.c (get_doc_string): Encode file name (bug#9735).
15111
15112 2011-10-12 Eli Zaretskii <eliz@gnu.org>
15113
15114 * bidi.c (bidi_level_of_next_char):
15115 * xdisp.c (get_visually_first_element): Remove old incorrect
15116 comments regarding the Unicode Line Separator character.
15117
15118 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15119
15120 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15121
15122 * alloc.c (Fgc_status): Do not access beyond zombies array
15123 boundary if nzombies > MAX_ZOMBIES.
15124 * alloc.c (dump_zombies): Add missing format specifier.
15125
15126 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15127
15128 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15129 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15130
15131 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15132 Some packages use them to denote characters with modifiers.
15133
15134 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15135
15136 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15137 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15138 matching a pp-number. Rename parameter var to var1.
15139
15140 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15141
15142 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15143
15144 2011-10-08 Glenn Morris <rgm@gnu.org>
15145
15146 * callint.c (Fcall_interactively): Give a more explicit error for the
15147 'c' case with a non-character input. (Bug#8479)
15148
15149 2011-10-08 Eli Zaretskii <eliz@gnu.org>
15150
15151 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15152 lines.
15153 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15154 lines that are hscrolled on the left.
15155
15156 * dispnew.c (buffer_posn_from_coords): Account for a possible
15157 presence of header-line. (Bug#4426)
15158
15159 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15160
15161 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15162 Don't advertise functionality which we discourage or doesn't work.
15163
15164 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15165
15166 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15167 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15168 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15169 this makes Emacs dump core during garbage collection on rare
15170 occasions. sizeof is obviously inferior to offsetof here, so
15171 stick with offsetof.
15172 (GC_POINTER_ALIGNMENT): New macro.
15173 (mark_memory): Omit 3rd (offset) arg; caller changed.
15174 Don't assume EMACS_INT alignment is the same as pointer alignment.
15175
15176 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15177
15178 * keyboard.c (read_key_sequence_remapped): New var.
15179 (read_key_sequence): Compute remapping in the right buffer.
15180 (command_loop_1): Use read_key_sequence's remapping directly.
15181
15182 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15183
15184 * dired.c (file_name_completion): Don't expand file name.
15185 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15186 before checking file name handler.
15187
15188 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15189 they've been requested explicitly (bug#9591).
15190
15191 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
15192
15193 * keymap.c (Fsingle_key_description): Use make_specified_string
15194 instead of build_string to build string from push_key_description.
15195 (Bug#5193)
15196
15197 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15198
15199 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15200 This fixes a Y2038 bug on 64-bit hosts.
15201 * buffer.c (reset_buffer):
15202 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15203 (Fclear_buffer_auto_save_failure):
15204 Use 0, not -1, to represent an unset failure time, since time_t
15205 might not be signed.
15206
15207 Remove dependency on glibc malloc internals.
15208 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15209 Move back here from lisp.h, but with their new implementations.
15210 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15211 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15212 * charset.c (charset_table_init): New static var.
15213 (syms_of_charset): Use it instead of xmalloc. This removes a
15214 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15215 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15216 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15217 Move back to alloc.c.
15218 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15219 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15220
15221 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15222
15223 * nsterm.m (windowDidResize): Call x_set_window_size only when
15224 ns_in_resize is true. Otherwise set pixelwidth/height and
15225 call change_frame_size (Bug#9628).
15226
15227 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15228
15229 Port --enable-checking=all to Fedora 14 x86-64.
15230 * charset.c (syms_of_charset): Also account for glibc malloc's
15231 internal overhead when calculating the initial malloc maximum.
15232
15233 Port --enable-checking=all to Fedora 14 x86.
15234 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15235 Move to lisp.h.
15236 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15237 (overrun_check_realloc, overrun_check_free):
15238 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15239 That way, xmalloc returns a properly-aligned pointer even if
15240 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15241 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15242 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15243 into account when calculating the initial malloc maximum.
15244 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15245 Move here from alloc.c, so that charset.c can use it too.
15246 Properly align; the old code wasn't right for common 32-bit hosts
15247 when configured with --enable-checking=all.
15248 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15249 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15250
15251 2011-09-29 Eli Zaretskii <eliz@gnu.org>
15252
15253 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15254 use EDOM.
15255
15256 2011-09-28 Eli Zaretskii <eliz@gnu.org>
15257
15258 * xdisp.c (compute_display_string_end): If there's no display
15259 string at CHARPOS, return -1.
15260
15261 * bidi.c (bidi_fetch_char): When compute_display_string_end
15262 returns a negative value, treat the character as a normal
15263 character not covered by a display string. (Bug#9624)
15264
15265 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
15266
15267 * lread.c (Fread_from_string): Fix typo in docstring.
15268
15269 2011-09-27 Eli Zaretskii <eliz@gnu.org>
15270
15271 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15272 newline, reseat the iterator instead of bidi-iterating there one
15273 character at a time. (Bug#9610)
15274 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15275 TO_CHARPOS if the bidi iterator is at base embedding level.
15276
15277 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15278
15279 * lread.c (readevalloop): Use correct code for NBSP.
15280 (read1): Likewise. (Bug#9608)
15281
15282 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
15283
15284 * dbusbind.c (Fdbus_register_signal): When service is not
15285 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15286
15287 2011-09-25 Glenn Morris <rgm@gnu.org>
15288
15289 * buffer.c (truncate-lines): Doc fix.
15290
15291 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
15292
15293 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15294 (Fset_window_next_buffers): Doc fix.
15295
15296 2011-09-24 Glenn Morris <rgm@gnu.org>
15297
15298 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15299
15300 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15301
15302 Fix minor problems found by static checking.
15303 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
15304 * indent.c (Fvertical_motion): Fix == vs = typo.
15305
15306 2011-09-24 Eli Zaretskii <eliz@gnu.org>
15307
15308 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15309 Default value is now t. Doc fix.
15310
15311 * indent.c (Fvertical_motion): Compute and apply the overshoot
15312 logic when moving up, not only when moving down. Fix the
15313 confusing name and values of the it_overshoot_expected variable;
15314 logic changes accordingly. (Bug#9254) (Bug#9549)
15315
15316 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15317 CHARPOS is covered by a display string which includes newlines.
15318 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15319 is covered by a display string with embedded newlines.
15320
15321 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
15322
15323 * dbusbind.c (Fdbus_register_signal): Add match rule to
15324 Vdbus_registered_objects_table. (Bug#9581)
15325 (Fdbus_register_method, Vdbus_registered_objects_table):
15326 Fix docstring.
15327
15328 2011-09-24 Jim Meyering <meyering@redhat.com>
15329
15330 do not ignore write error for any output size
15331 The previous change was incomplete.
15332 While it makes emacs --batch detect the vast majority of stdout
15333 write failures, errors were still ignored whenever the output size is
15334 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15335 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15336 && echo FAIL: ignored write error
15337 FAIL: ignored write error
15338 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15339 && echo FAIL: ignored write error
15340 FAIL: ignored write error
15341 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15342
15343 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15344
15345 * emacs.c (Fkill_emacs): In noninteractive mode exit
15346 non-successfully if a write error occurred on stdout. (Bug#9574)
15347
15348 2011-09-21 Eli Zaretskii <eliz@gnu.org>
15349
15350 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15351 the xassert test.
15352
15353 * dispextern.h (struct it): Update the comment documenting what
15354 can it->OBJECT be.
15355
15356 2011-09-20 Eli Zaretskii <eliz@gnu.org>
15357
15358 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15359 a display string, extend search for cursor position to end of row.
15360 (find_row_edges): If the row ends in a newline from a display
15361 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15362 Handle the case of a display string with multiple newlines.
15363 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15364 non-empty line. Fixes confusing cursor motion with arrow keys at
15365 the beginning of a line that starts with whitespace.
15366
15367 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15368
15369 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15370 (bug#9493).
15371
15372 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
15373
15374 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15375 boolean (Bug#9154).
15376
15377 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15378
15379 * xdisp.c (display_line): Record maximum and minimum buffer
15380 positions even if no glyphs were produced (e.g., by a zero-width
15381 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15382 buffer positions that will be removed from the glyph row because
15383 they don't fit.
15384 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15385 column is beyond frame width: don't subtract 1 "pixel" when
15386 computing width of the stretch.
15387 (reseat_at_next_visible_line_start): Undo the change made on
15388 2011-09-17 that saved paragraph information and restored it after
15389 the call to `reseat'. (Bug#9545)
15390
15391 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15392
15393 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15394 and turn window cursor on if cleared (Bug#9415).
15395
15396 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
15397
15398 * search.c (boyer_moore): Take unibyte characters from pattern
15399 literally. (Bug#9458)
15400
15401 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15402
15403 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15404
15405 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15406
15407 Fix minor problem found by static checking.
15408 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15409 initialized, to pacify gcc -Wuninitialized.
15410
15411 * fileio.c: Report proper errno when syscall falls.
15412 (Finsert_file_contents): Save and restore errno,
15413 so that report_file_error outputs the correct diagnostic.
15414 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15415
15416 2011-09-18 Eli Zaretskii <eliz@gnu.org>
15417
15418 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15419
15420 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15421
15422 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15423 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15424
15425 2011-09-17 Eli Zaretskii <eliz@gnu.org>
15426
15427 * xdisp.c (reseat_at_next_visible_line_start): Keep information
15428 about the current paragraph and restore it after the call to reseat.
15429
15430 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15431 (bidi_find_paragraph_start): Search back for paragraph beginning
15432 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15433 (bidi_move_to_visually_next): Only trigger paragraph-related
15434 computations when the last character is a newline or at EOB, not
15435 just any NEUTRAL_B. (Bug#9470)
15436
15437 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15438 truncated lines if point is covered by a display string. (Bug#9524)
15439
15440 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15441
15442 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15443 (cons_to_x_long): New function.
15444 (lisp_data_to_selection_data): Use it. Correct the test for
15445 short-versus-long data; it was negated. Break out of vector
15446 loop, for efficiency, when a long datum is discovered.
15447
15448 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15449
15450 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15451
15452 2011-09-16 Eli Zaretskii <eliz@gnu.org>
15453
15454 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15455 GCC PR/17406) by declaring this function with external scope.
15456
15457 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15458
15459 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15460 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15461
15462 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15463
15464 * editfns.c (Fformat): Correctly handle text properties on "%%".
15465
15466 2011-09-15 Eli Zaretskii <eliz@gnu.org>
15467
15468 * xterm.c (x_draw_composite_glyph_string_foreground):
15469 * w32term.c (x_draw_composite_glyph_string_foreground):
15470 * term.c (encode_terminal_code):
15471 * composite.c (composition_update_it, get_composition_id):
15472 * xdisp.c (get_next_display_element)
15473 (fill_composite_glyph_string): Add comments about special meaning
15474 of TAB characters in a composition.
15475
15476 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15477
15478 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
15479 This occurs when processing a multibyte format.
15480 Problem reported by Wolfgang Jenker.
15481
15482 2011-09-15 Johan Bockgård <bojohan@gnu.org>
15483
15484 * xdisp.c (try_cursor_movement): Only check for exact match if
15485 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15486
15487 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15488
15489 Remove unused external symbols.
15490 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15491 * xdisp.c (calc_pixel_width_or_height): Now static.
15492 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15493 * indent.c (check_display_width):
15494 * w32term.c: Fix comment to match code.
15495 * xterm.c, xterm.h (x_catching_errors): Remove.
15496
15497 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15498
15499 * xselect.c: Use signed conversions more consistently (Bug#9498).
15500 (selection_data_to_lisp_data): Assume incoming selection data are
15501 signed integers, not unsigned. This is to be consistent with
15502 outgoing selection data, which was modified to use signed integers
15503 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15504 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15505 expects long, not unsigned long.
15506
15507 2011-09-14 Eli Zaretskii <eliz@gnu.org>
15508
15509 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15510 computation of loop end. Reported by Johan Bockgård
15511 <bojohan@gnu.org>.
15512
15513 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
15514
15515 * frame.c (Fother_visible_frames_p): Function deleted.
15516
15517 2011-09-12 Eli Zaretskii <eliz@gnu.org>
15518
15519 * indent.c (compute_motion): Process display vector front to back
15520 rather than the other way around. (Bug#2496)
15521
15522 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15523
15524 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15525
15526 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
15527
15528 * minibuf.c (Fread_from_minibuffer): Doc fix.
15529
15530 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15531
15532 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15533 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15534
15535 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15536
15537 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15538 value for non-existent files.
15539
15540 2011-09-11 Eli Zaretskii <eliz@gnu.org>
15541
15542 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15543 set its "size" to -1. This will set the modtime_size field of
15544 the corresponding buffer to -1, which is what
15545 verify-visited-file-modtime expects for files that do not exist.
15546 (Bug#9139)
15547
15548 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15549
15550 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15551 here ...
15552 * lisp.h: ... from here. push_key_description is no longer
15553 defined in keyboard.c, so its declaration should not be in
15554 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15555 logically belongs with push_key_description.
15556
15557 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15558
15559 * buffer.h: Include <sys/types.h> instead of <time.h>.
15560 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15561 Problem reported by Herbert J. Skuhra.
15562
15563 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15564
15565 * xml.c (parse_region): Make the parsing work for
15566 non-comment-starting XML files again (bug#9144).
15567
15568 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15569
15570 * image.c (gif_load): Fix calculation of bottom and right corner.
15571 (Bug#9468)
15572
15573 2011-09-10 Eli Zaretskii <eliz@gnu.org>
15574
15575 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15576 redisplay in small windows.
15577
15578 2011-09-09 Eli Zaretskii <eliz@gnu.org>
15579
15580 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15581
15582 2011-09-08 Martin Rudalics <rudalics@gmx.at>
15583
15584 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15585 Operate on live windows only.
15586
15587 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
15588
15589 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15590
15591 2011-09-07 Eli Zaretskii <eliz@gnu.org>
15592
15593 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15594 only under bidi iteration.
15595
15596 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15597
15598 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15599
15600 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15601
15602 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15603 Without this fix, the command to link temacs failed due to an
15604 undefined symbol __builtin_isnan. This is because
15605 /usr/include/iso/math_c99.h #defines isnan(x) to
15606 __builtin_isnan(x), but the bundled gcc, which identifies itself
15607 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15608 a __builtin_isnan.
15609 * floatfns.c (isnan): #undef, and then #define to a clone of
15610 what's in data.c.
15611 (Fisnan): Always define, since it's always available now.
15612 (syms_of_floatfns): Always define isnan at the Lisp level.
15613
15614 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15615
15616 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15617
15618 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15619
15620 * fileio.c: Fix bugs with large file offsets (Bug#9428).
15621 The previous code assumed that file offsets (off_t values) fit in
15622 EMACS_INT variables, which is not true on typical 32-bit hosts.
15623 The code messed up by falsely reporting buffer overflow in cases
15624 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15625 when "big" contains more than 2**29 bytes, even though this
15626 inserts just one byte and does not overflow the buffer.
15627 (Finsert_file_contents): Store file offsets as off_t
15628 values, not as EMACS_INT values. Check for overflow when
15629 converting between EMACS_INT and off_t. When checking for
15630 buffer overflow or for overlap, take the offsets into account.
15631 Don't use EMACS_INT for small values where int suffices.
15632 When checking for overlap, fix a typo: ZV was used where
15633 ZV_BYTE was intended.
15634 (Fwrite_region): Don't assume off_t fits into 'long'.
15635 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15636
15637 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
15638
15639 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15640
15641 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15642
15643 sprintf-related integer and memory overflow issues (Bug#9412).
15644
15645 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
15646 (esprintf, exprintf, evxprintf): New functions.
15647 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
15648 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
15649 (modify_event_symbol): Do not assume that the length of
15650 name_alist_or_stem is safe to alloca and fits in int.
15651 (Fexecute_extended_command): Likewise for function name and binding.
15652 (Frecursion_depth): Wrap around reliably on integer overflow.
15653 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15654 since some callers pass EMACS_INT values.
15655 (Fsingle_key_description): Don't crash if symbol name contains more
15656 than MAX_ALLOCA bytes.
15657 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15658 (get_minibuffer): Arg is now EMACS_INT, not int.
15659 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
15660 (esprintf, exprintf, evxprintf): New decls.
15661 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15662
15663 * dbusbind.c (signature_cat): New function.
15664 (xd_signature, Fdbus_register_signal):
15665 Do not overrun buffer; instead, report string overflow.
15666
15667 * dispnew.c (add_window_display_history): Don't overrun buffer.
15668 Truncate instead; this is OK since it's just a log.
15669
15670 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15671 even if the time zone offset is outlandishly large.
15672 Don't mishandle offset == INT_MIN.
15673
15674 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15675 when creating daemon; the previous buffer-overflow check was incorrect.
15676
15677 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15678 which has the guts of the old verror function.
15679
15680 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15681 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15682
15683 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15684 (font_unparse_xlfd): Don't blindly alloca long strings.
15685 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
15686 fits in int, when using sprintf. Use single snprintf to count
15687 length of string rather than counting it via multiple sprintfs;
15688 that's simpler and more reliable.
15689 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15690 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15691 sprintf, in case result does not fit in int.
15692
15693 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15694 (fontset_from_font): Print it.
15695
15696 * frame.c (tty_frame_count): Now printmax_t, not int.
15697 (make_terminal_frame, set_term_frame_name): Print it.
15698 (x_report_frame_params): In X, window IDs are unsigned long,
15699 not signed long, so print them as unsigned.
15700 (validate_x_resource_name): Check for implausibly long names,
15701 and don't assume name length fits in 'int'.
15702 (x_get_resource_string): Don't blindly alloca invocation name;
15703 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15704 not fit in int.
15705
15706 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15707 (xg_check_special_colors, xg_set_geometry):
15708 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15709
15710 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15711 Use esprintf, not sprintf, in case result does not fit in int.
15712
15713 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15714 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15715 it as a large positive number.
15716 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15717 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15718
15719 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15720 in case result does not fit in int.
15721
15722 * print.c (float_to_string): Detect width overflow more reliably.
15723 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15724 buffer overrun. Don't assume list length fits in 'int'. Treat
15725 print length of 0 as 0, not as infinity; to be consistent with other
15726 uses of print length in this function. Don't overflow print length
15727 index. Don't assume hash table size fits in 'long', or that
15728 vectorlike size fits in 'unsigned long'.
15729
15730 * process.c (make_process): Use printmax_t, not int, to format
15731 process-name gensyms.
15732
15733 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15734
15735 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15736 to avoid potential buffer overrun.
15737
15738 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15739 if X resource line is longer than 512 bytes.
15740
15741 * xfns.c (x_window): Make sprintf buffer a bit bigger
15742 to avoid potential buffer overrun.
15743
15744 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15745
15746 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15747
15748 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15749
15750 Integer overflow fixes for scrolling, etc.
15751 Without these, Emacs silently mishandles large integers sometimes.
15752 For example, "C-u 4294967297 M-x recenter" was treated as if
15753 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15754
15755 * xdisp.c (try_window_id): Check Emacs fixnum range before
15756 converting to 'int'.
15757
15758 * window.c (window_scroll_line_based, Frecenter):
15759 Check that an Emacs fixnum is in range before assigning it to 'int'.
15760 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15761 values converted from Emacs fixnums.
15762 (Frecenter): Don't wrap around a line count if it is out of 'int'
15763 range; instead, treat it as an extreme value.
15764 (Fset_window_configuration, compare_window_configurations):
15765 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15766
15767 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15768 that can exceed INT_MAX. Check that EMACS_INT value is in range
15769 before assigning it to the (possibly-narrower) index.
15770 (match_limit): Don't assume that a fixnum can fit in 'int'.
15771
15772 * print.c (print_object): Use ptrdiff_t, not int, for index that can
15773 exceed INT_MAX.
15774
15775 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
15776 (Fvertical_motion): Don't wrap around LINES values that don't fit
15777 in 'int'. Instead, treat them as extreme values. This is good
15778 enough for windows, which can't have more than INT_MAX lines anyway.
15779
15780 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15781
15782 * Require libxml/parser.h to avoid compilation warning.
15783
15784 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15785
15786 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15787 since this reportedly can destroy thread storage.
15788
15789 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
15790
15791 * syntax.c (find_defun_start): Update all cache variables if
15792 exiting early (Bug#9401).
15793
15794 2011-08-30 Eli Zaretskii <eliz@gnu.org>
15795
15796 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15797
15798 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15799 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
15800 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
15801
15802 * term.c (tty_append_glyph): New function.
15803 (produce_stretch_glyph): Static function and its prototype deleted.
15804
15805 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15806 Add prototypes.
15807
15808 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
15809
15810 * image.c (parse_image_spec): Check for nonnegative, not for positive,
15811 when checking :margin (Bug#9390).
15812 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
15813 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
15814 so that the name doesn't mislead. All uses changed.
15815
15816 2011-08-28 Johan Bockgård <bojohan@gnu.org>
15817
15818 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15819 set_tty_hooks.
15820
15821 2011-08-27 Eli Zaretskii <eliz@gnu.org>
15822
15823 * xdisp.c (move_it_to): Don't bail out early when reaching
15824 position beyond to_charpos, if we are scanning backwards.
15825 (move_it_vertically_backward): When DY == 0, make sure we get to
15826 the first character in the line after the newline.
15827
15828 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
15829
15830 * ccl.c: Improve and simplify overflow checking (Bug#9196).
15831 (ccl_driver): Do not generate an out-of-range pointer.
15832 (Fccl_execute_on_string): Remove unnecessary check for
15833 integer overflow, noted by Stefan Monnier in
15834 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15835 Remove a FIXME that didn't need fixing.
15836 Simplify the newly-introduced buffer reallocation code.
15837
15838 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
15839
15840 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15841
15842 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
15843
15844 Integer and memory overflow issues (Bug#9196).
15845
15846 * doc.c (get_doc_string): Rework so that
15847 get_doc_string_buffer_size is the actual buffer size, rather than
15848 being 1 less than the actual buffer size; this makes xpalloc more
15849 convenient.
15850
15851 * image.c (x_allocate_bitmap_record, cache_image):
15852 * xselect.c (Fx_register_dnd_atom):
15853 Simplify previous changes by using xpalloc.
15854
15855 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15856 since either will do and ptrdiff_t is convenient with xpalloc.
15857
15858 * charset.c (charset_table_size)
15859 (struct charset_sort_data.priority): Now ptrdiff_t.
15860 (charset_compare): Don't overflow if priorities differ greatly.
15861 (Fsort_charsets): Don't assume list length fits in int.
15862 Check for size-calculation overflow when allocating sort data.
15863 (syms_of_charset): Allocate an initial charset table that is
15864 just under 64 KiB, to avoid problems with glibc malloc and mmap.
15865
15866 * cmds.c (internal_self_insert): Check for size-calculation overflow.
15867
15868 * composite.h (struct composition.glyph_len): Now int, not unsigned.
15869 The actual value is always <= INT_MAX, and leaving it unsigned made
15870 overflow checking harder.
15871
15872 * dispextern.h (struct glyph_matrix.rows_allocated)
15873 (struct face_cache.size): Now ptrdiff_t, for convenience in use
15874 with xpalloc. The values are still always <= INT_MAX.
15875
15876 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15877
15878 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15879 (SAFE_NALLOCA): New macro.
15880
15881 * region-cache.c (struct boundary.pos, find_cache_boundary)
15882 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15883 (set_cache_region, invalidate_region_cache)
15884 (revalidate_region_cache, know_region_cache, region_cache_forward)
15885 (region_cache_backward, pp_cache):
15886 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
15887 so that ptrdiff_t * can be passed to xpalloc.
15888 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15889 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15890 (pp_cache): Don't assume cache_len fits in int.
15891 * region-cache.h: Adjust extern decls to match.
15892
15893 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15894 EMACS_INT, since either will do, for xpalloc.
15895
15896 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15897 (xnmalloc, xnrealloc, xpalloc): New functions.
15898
15899 * bidi.c (bidi_shelve_header_size): New constant.
15900 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15901 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15902
15903 * bidi.c (bidi_cache_shrink):
15904 * buffer.c (overlays_at, overlays_in, record_overlay_string)
15905 (overlay_strings):
15906 Don't update size of array until after memory allocation succeeds,
15907 because xmalloc/xrealloc may not return.
15908 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15909 now that we have proper integer overflow checking.
15910 (record_overlay_string, overlay_strings): Catch overflows when
15911 calculating size of overlay_str_buf.
15912
15913 * callproc.c (Fcall_process): Check for size overflow when
15914 calculating size of args2.
15915 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15916 Normally we prefer signed values, but sticking with ptrdiff_t would
15917 require adding more-complicated checks.
15918
15919 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15920 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15921 Redo buffer-overflow calculations to avoid integer overflow.
15922 Add a FIXME comment where memory seems to be over-allocated.
15923
15924 * character.c (Fstring): Check for size-calculation overflow.
15925
15926 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15927 unnecessary integer overflow. Check for size overflow.
15928 (encode_coding_object): Don't update size until xmalloc succeeds.
15929
15930 * composite.c (get_composition_id): Check for overflow in glyph
15931 length calculations.
15932
15933 Integer and memory overflow fixes for display code.
15934 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
15935 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
15936 (scrolling_window): Check for overflow in size calculations.
15937 (line_draw_cost, realloc_glyph_pool, add_row_entry):
15938 Don't assume glyph table len fits in int.
15939 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
15940 (row_table_size): Now ptrdiff_t, not int.
15941 (scrolling_window): Avoid overflow in size calculations.
15942 Don't update size until allocation succeeds.
15943 * fns.c (concat): Check for overflow in size calculations.
15944 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
15945 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
15946 (NEXT_ALMOST_PRIME_LIMIT): New constant.
15947
15948 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
15949 (get_doc_string): Check for size calculation overflow.
15950 Don't update size until allocation succeeds.
15951 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
15952 EMACS_INT, where ptrdiff_t will do.
15953 (Fsubstitute_command_keys): Check for string overflow.
15954
15955 * editfns.c (set_time_zone_rule): Don't assume environment length
15956 fits in int.
15957 (message_length): Now ptrdiff_t, not int.
15958 (Fmessage_box): Don't update size until allocation succeeds.
15959 Don't assume message length fits in int.
15960 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
15961
15962 * emacs.c (main): Do not reallocate argv, since there is a null at
15963 the end that can be overwritten, and this way there's no need to
15964 worry about size-calculation overflow.
15965 (sort_args): Check for size-calculation overflow.
15966
15967 * eval.c (init_eval_once, grow_specpdl): Don't update size until
15968 alloc succeeds.
15969 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
15970
15971 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
15972 (x_set_scroll_bar_width, x_figure_window_size):
15973 Check for integer overflow.
15974 (x_set_alpha): Do not assume XINT fits in int.
15975
15976 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
15977 This is for the members text_lines, text_cols, total_lines, total_cols,
15978 where the system imposes an 'int' limit.
15979
15980 * fringe.c (Fdefine_fringe_bitmap):
15981 Don't update size until alloc works.
15982
15983 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
15984 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
15985
15986 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
15987 Check for size-calculation overflow.
15988 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
15989 do, as we prefer signed integers.
15990 (id_to_widget.max_size, id_to_widget.used)
15991 (xg_store_widget_in_map, xg_remove_widget_from_map)
15992 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
15993 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
15994 Use and return ptrdiff_t, not int.
15995 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
15996 * gtkutil.h: Change prototypes to match the above.
15997
15998 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
15999 are duplicate now that they've been promoted to lisp.h.
16000 (x_allocate_bitmap_record, x_alloc_image_color)
16001 (make_image_cache, cache_image, xpm_load):
16002 Don't update size until alloc is done.
16003 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16004 (x_detect_edges):
16005 Check for size calculation overflow.
16006 (ct_colors_allocated_max): New constant.
16007 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16008 overflow.
16009
16010 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16011 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16012 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16013 Use ptrdiff_t, not int, to count maps.
16014 (read_char_minibuf_menu_prompt): Check for overflow in size
16015 calculations. Don't update size until allocation succeeds.
16016 Redo calculations to avoid overflow.
16017 * keyboard.h: Change prototypes to match the above.
16018
16019 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16020 to count maps.
16021 (current_minor_maps): Check for size calculation overflow.
16022 * keymap.h: Change prototypes to match the above.
16023
16024 * lread.c (read1, init_obarray): Don't update size until alloc done.
16025
16026 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16027 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16028
16029 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16030 Now ptrdiff_t, not int.
16031 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16032 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16033
16034 * process.c (Fnetwork_interface_list): Check for overflow
16035 in size calculation.
16036
16037 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16038
16039 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16040 overflow. Don't bother calling xmalloc when xrealloc will do.
16041
16042 * search.c (Freplace_match): Check for size calculation overflow.
16043 (Fset_match_data): Don't assume list lengths fit in 'int'.
16044
16045 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16046 for command line length. Do not attempt to address one before the
16047 beginning of an array, as that's not portable.
16048
16049 * term.c (max_frame_lines): Remove; unused.
16050 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16051 not int.
16052 (encode_terminal_code, calculate_costs): Check for size
16053 calculation overflow.
16054 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16055 table lengths and related sizes. Don't update size until alloc
16056 done. Redo calculations to avoid overflow.
16057 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16058
16059 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16060 subtracting pointers.
16061 (gobble_line): Check for overflow more carefully. Don't update size
16062 until alloc done.
16063
16064 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16065 Don't update size until alloc done.
16066 Redo size calculations to avoid overflow.
16067 Check for size calculation overflow.
16068 (main) [DEBUG]: Fix typo in invoking tparam1.
16069
16070 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16071 Use ptrdiff_t, not int, for sizes.
16072 (store_mode_line_noprop_char): Don't update size until alloc done.
16073
16074 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16075 Use ptrdiff_t, not int, for sizes.
16076 (Finternal_make_lisp_face, cache_face):
16077 Check for size calculation overflow.
16078 (cache_face): Treat size calculation overflows as if they were
16079 memory exhaustion (the usual treatment), rather than aborting.
16080
16081 * xfns.c (x_encode_text, x_set_name_internal)
16082 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16083 sizes, since they can exceed INT_MAX in size. Check for size
16084 calculation overflow.
16085
16086 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16087 (xg_select): Check for size calculation overflow.
16088 Don't update size until alloc done.
16089
16090 * xrdb.c (get_environ_db): Don't assume path length fits in int,
16091 as sprintf is limited to int lengths.
16092
16093 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16094 (X_LONG_MIN): New macros.
16095 Use them to make the following changes clearer.
16096 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16097 This change doesn't affect the value now, but it may help remind
16098 future maintainers not to raise the value too much later.
16099 (SELECTION_QUANTUM): Remove, replacing with ...
16100 (selection_quantum): ... new function, which avoids overflow.
16101 All uses changed.
16102 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16103 assumption that selection length fits in 'int'.
16104 (x_reply_selection_request, x_handle_selection_request)
16105 (x_get_window_property, receive_incremental_selection)
16106 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16107 (lisp_data_to_selection_data, clean_local_selection_data):
16108 Use ptrdiff_t, not int, to record length of selection.
16109 (x_reply_selection_request, x_get_window_property)
16110 (receive_incremental_selection, x_property_data_to_lisp):
16111 Redo calculations to avoid overflow.
16112 (x_reply_selection_request): When sending hint, ceiling it at
16113 X_LONG_MAX rather than relying on wraparound overflow to send
16114 something.
16115 (x_get_window_property, receive_incremental_selection)
16116 (lisp_data_to_selection_data, x_property_data_to_lisp):
16117 Check for size-calculation overflow.
16118 (x_get_window_property, receive_incremental_selection)
16119 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16120 Don't store size until memory allocation succeeds.
16121 (x_get_window_property): Plug memory leak on memory exhaustion.
16122 Don't double-block input; malloc is safe here. Don't assume 2**34
16123 - 4 fits in unsigned long. Add an xassert to check
16124 XGetWindowProperty overflow. Be more careful about overflow
16125 calculations, and distinguish size from memory overflow better.
16126 (receive_incremental_selection): When tracing, don't assume
16127 unsigned int is less than INT_MAX.
16128 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16129 harmful) conversions of unsigned short to int.
16130 (lisp_data_to_selection_data): Don't assume that integers
16131 in the range -65535 through -1 fit in an X unsigned short.
16132 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16133 result parameters unless successful. Rely on cons_to_unsigned
16134 to report problems with elements; the old code wasn't right anyway.
16135 (x_check_property_data): Check for int overflow; we cannot use
16136 a wider type due to X limits.
16137 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16138
16139 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16140
16141 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16142 (x_term_init): Check for size calculation overflow.
16143 (x_color_cells): Don't store size until memory allocation succeeds.
16144 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16145 Don't assume alloca size is less than MAX_ALLOCA.
16146 (x_term_init): Don't assume length fits in int (sprintf is limited
16147 to int size).
16148
16149 Use ptrdiff_t for composition IDs.
16150 * character.c (lisp_string_width):
16151 * composite.c (composition_table_size, n_compositions)
16152 (get_composition_id, composition_gstring_from_id):
16153 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16154 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16155 * window.c (Frecenter):
16156 Use ptrdiff_t, not int, for composition IDs.
16157 * composite.c (get_composition_id): Check for integer overflow.
16158 * composite.h: Adjust prototypes to match the above changes.
16159
16160 Use ptrdiff_t for hash table indexes.
16161 * category.c (hash_get_category_set):
16162 * ccl.c (ccl_driver):
16163 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16164 * coding.c (coding_system_charset_list, detect_coding_system):
16165 * coding.h (struct coding_system.id):
16166 * composite.c (get_composition_id, gstring_lookup_cache):
16167 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16168 * image.c (xpm_get_color_table_h):
16169 * lisp.h (hash_lookup, hash_put):
16170 * minibuf.c (Ftest_completion):
16171 Use ptrdiff_t for hash table indexes, not int (which is too
16172 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16173 32-bit --with-wide-int hosts).
16174
16175 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16176 Add a FIXME comment about memory leaks.
16177 (syms_of_charset): Don't assume xmalloc returns.
16178
16179 Don't assume that stated character widths fit in int.
16180 * character.c (Fchar_width, c_string_width, lisp_string_width):
16181 * character.h (CHAR_WIDTH):
16182 * indent.c (MULTIBYTE_BYTES_WIDTH):
16183 Use sanitize_char_width to avoid undefined and/or bad behavior
16184 with outlandish widths.
16185 * character.h (sanitize_tab_width): Rename from sanitize_width,
16186 now that we have two such functions. All uses changed.
16187 (sanitize_char_width): New inline function.
16188
16189 Don't assume that tab-width fits in int.
16190 * character.h (sanitize_width): New inline function.
16191 (SANE_TAB_WIDTH): New macro.
16192 (ASCII_CHAR_WIDTH): Use it.
16193 * indent.c (sane_tab_width): Remove. All uses replaced by
16194 SANE_TAB_WIDTH (current_buffer).
16195 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16196
16197 * fileio.c: Integer overflow issues with file modes.
16198 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16199
16200 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16201 Remove unreachable code.
16202 (read_hex, load_charset_map_from_file): Check for integer overflow.
16203
16204 * xterm.c: Don't go over XClientMessageEvent limit.
16205 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16206 (x_send_scroll_bar_event): Likewise. Check that the size does not
16207 exceed limits imposed by XClientMessageEvent, as well as the usual
16208 ptrdiff_t and size_t limits.
16209
16210 * keyboard.c: Overflow, signedness and related fixes.
16211 (make_lispy_movement): Use same integer type in forward decl
16212 that is used in the definition.
16213 (read_key_sequence, keyremap_step):
16214 Change bufsize argument back to int, undoing my 2011-03-30 change.
16215 We prefer signed types, and int is wide enough here.
16216 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16217 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16218 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16219 length, not size_t. Use ptrdiff_t for index, not int.
16220 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16221 possibility of integer overflow.
16222
16223 Overflow, signedness and related fixes for images.
16224
16225 * dispextern.h (struct it.stack[0].u.image.image_id)
16226 (struct_it.image_id, struct image.id, struct image_cache.size)
16227 (struct image_cache.used, struct image_cache.ref_count):
16228 * gtkutil.c (update_frame_tool_bar):
16229 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16230 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16231 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16232 * nsmenu.m (update_frame_tool_bar):
16233 * xdisp.c (calc_pixel_width_or_height):
16234 * xfns.c (image_cache_refcount):
16235 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16236 on typical 64-bit hosts.
16237
16238 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16239 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16240 Omit unnecessary casts to int.
16241 (parse_image_spec): Check that integers fall into 'int' range
16242 when the callers expect that.
16243 (image_ascent): Redo ascent calculation to avoid int overflow.
16244 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16245 (lookup_image): Remove unnecessary tests.
16246 (xbm_image_p): Locals are now of int, not EMACS_INT,
16247 since parse_image_check makes sure they fit into int.
16248 (png_load, gif_load, svg_load_image):
16249 Prefer int to unsigned where either will do.
16250 (tiff_handler): New function, combining the cores of the
16251 old tiff_error_handler and tiff_warning_handler.
16252 This function is rewritten to use vsnprintf and thereby avoid
16253 stack buffer overflows. It uses only the features of vsnprintf
16254 that are common to both POSIX and native Microsoft.
16255 (tiff_error_handler, tiff_warning_handler): Use it.
16256 (tiff_load, gif_load, imagemagick_load_image):
16257 Don't assume :index value fits in 'int'.
16258 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16259 (imagemagick_load_image): Check that crop parameters fit into
16260 the integer types that MagickCropImage accepts. Don't assume
16261 Vimagemagick_render_type has a nonnegative value. Don't assume
16262 size_t fits in 'long'.
16263 (gs_load): Use printmax_t to print the widest integers possible.
16264 Check for integer overflow when computing image height and width.
16265
16266 2011-08-26 Eli Zaretskii <eliz@gnu.org>
16267
16268 * xdisp.c (redisplay_window): Don't force window start if point
16269 will be invisible in the resulting window. (Bug#9324)
16270
16271 2011-08-25 Eli Zaretskii <eliz@gnu.org>
16272
16273 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16274 the display spec is of the form `(space ...)'.
16275 (handle_display_spec): Return the value returned by
16276 handle_single_display_spec, not just 1 or zero.
16277 (handle_single_display_spec): If the display spec is of the form
16278 `(space ...)', and specifies display in the text area, return 2
16279 rather than 1.
16280 (try_cursor_movement): Check for the need to scroll more
16281 accurately, and prefer exact match for point under bidi.
16282 Don't advance `row' beyond the last row of the window.
16283
16284 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16285 into disp_prop; all users changed.
16286
16287 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16288 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16289 for the text covered by the display property.
16290
16291 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
16292
16293 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16294 Change return value to nil.
16295 (Frecord_buffer): Delete unused function.
16296
16297 2011-08-24 Eli Zaretskii <eliz@gnu.org>
16298
16299 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16300 buffers, return left-to-right.
16301 (set_cursor_from_row): Consider candidate row a win if its glyph
16302 represents a newline and point is on that newline. Fixes cursor
16303 positioning on the newline at EOL of R2L text within L2R
16304 paragraph, and vice versa.
16305 (try_cursor_movement): Check continued rows, in addition to
16306 continuation rows. Fixes unwarranted scroll when point enters a
16307 continued line of R2L text within an L2R paragraph, or vice versa.
16308 (cursor_row_p): Consider the case of point being equal to
16309 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16310 from the end of a short line to the beginning of a continued line
16311 of R2L text within L2R paragraph.
16312 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16313 composed characters.
16314
16315 * bidi.c (bidi_check_type): Use xassert.
16316 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16317 members.
16318
16319 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16320
16321 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16322 a character.
16323
16324 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
16325
16326 * nsfont.m (ns_otf_to_script): Fix typo.
16327
16328 2011-08-22 Kenichi Handa <handa@m17n.org>
16329
16330 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16331 extra slot even if the purpose is char-code-property-table.
16332
16333 2011-08-23 Eli Zaretskii <eliz@gnu.org>
16334
16335 * xdisp.c (redisplay_window): When computing centering_position,
16336 account for the height of the header line. (Bug#8874)
16337
16338 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16339 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16340 candidate is selected by the mouse, and that candidate has a
16341 composed character under the mouse.
16342
16343 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16344 coordinates reported by pos-visible-in-window-p for a composed
16345 character in column zero.
16346
16347 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16348
16349 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16350
16351 2011-08-22 Eli Zaretskii <eliz@gnu.org>
16352
16353 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16354 consider it a hit if to_charpos is anywhere in the range of the
16355 composed buffer positions.
16356
16357 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
16358
16359 * image.c (gif_load): Don't assume that each subimage has the same
16360 dimensions as the base image. Handle disposal method that is
16361 "undefined" by the gif spec (Bug#9335).
16362
16363 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
16364
16365 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
16366 (Fcondition_case): Document `debug' symbol in error handler.
16367
16368 2011-08-19 Eli Zaretskii <eliz@gnu.org>
16369
16370 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16371 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16372 from an Org mode buffer to a Speedbar frame.
16373
16374 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16375 a composition, take its buffer position from IT->cmp_it.charpos.
16376 Fixes cursor positioning at the beginning of a line that begins
16377 with a composed character.
16378
16379 2011-08-18 Eli Zaretskii <eliz@gnu.org>
16380
16381 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16382 character bidirectional type, use STRONG_L instead. Fixes crashes
16383 in a buffer produced by `describe-categories'.
16384
16385 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16386 members before the level stack, so they would be saved and
16387 restored when copying iterator state. Fixes incorrect reordering
16388 around TABs covered by display properties.
16389
16390 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16391
16392 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
16393
16394 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
16395
16396 * eval.c (internal_condition_case, internal_condition_case_1)
16397 (internal_condition_case_2, internal_condition_case_n):
16398 Remove unnecessary aborts (Bug#9081).
16399
16400 2011-08-17 Eli Zaretskii <eliz@gnu.org>
16401
16402 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16403 has no `load' handler, try opening the file locally. (Bug#9311)
16404
16405 2011-08-16 Ken Brown <kbrown@cornell.edu>
16406
16407 * gmalloc.c: Expand comment.
16408
16409 2011-08-16 Eli Zaretskii <eliz@gnu.org>
16410
16411 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16412 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16413
16414 2011-08-16 Ken Brown <kbrown@cornell.edu>
16415
16416 Fix memory allocation problems in Cygwin build (Bug#9273).
16417
16418 * unexcw.c ( __malloc_initialized): Declare external variable.
16419 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16420
16421 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16422 New variables.
16423 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16424 dumped emacs.
16425 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16426 in the static heap.
16427 [CYGWIN] (special_realloc): New function.
16428 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16429 requests to realloc storage in the static heap.
16430
16431 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16432
16433 * bidi.c (bidi_initialize): Remove unused local.
16434
16435 2011-08-15 Eli Zaretskii <eliz@gnu.org>
16436
16437 * bidimirror.h:
16438 * biditype.h: Remove file.
16439 * makefile.w32-in ($(BLD)/bidi.$(O)):
16440 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
16441
16442 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16443
16444 * chartab.c: Improve commentary for the uniprop_table API.
16445
16446 * bidi.c (bidi_paragraph_init): Support zero value of
16447 bidi_ignore_explicit_marks_for_paragraph_level.
16448 (bidi_initialize): Use uniprop_table instead of including
16449 biditype.h and bidimirror.h.
16450
16451 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16452 coordinates of the iterator when restoring from ppos_it.
16453 (Bug#9296)
16454
16455 2011-08-14 Kenichi Handa <handa@m17n.org>
16456
16457 * process.c (create_process): Call setup_process_coding_systems
16458 after the pid of the process is set to -1 (Bug#8162).
16459
16460 2011-08-14 Eli Zaretskii <eliz@gnu.org>
16461
16462 * xdisp.c (move_it_in_display_line_to): Don't invoke
16463 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16464 ppos_it. Fixes vertical cursor motion when line beginning is
16465 covered by an image. (Bug#9296)
16466
16467 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16468
16469 * nsterm.h (ns_run_ascript): Declare.
16470 (NSAPP_DATA2_RUNASSCRIPT): Define.
16471
16472 * nsfns.m (as_script, as_result, as_status): New static variables.
16473 (ns_run_ascript): New function.
16474 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
16475 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16476 the event loop. Get status from as_status (Bug#7276).
16477
16478 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16479 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16480 the event loop (Bug#7276).
16481
16482 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16483
16484 * gnutls.c (QCgnutls_bootprop_priority)
16485 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16486 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16487 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16488 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16489 (QCgnutls_bootprop_verify_hostname_error)
16490 (QCgnutls_bootprop_callbacks_verify): Rename from
16491 Qgnutls_bootprop_..., all uses changed.
16492
16493 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16494 uses changed.
16495
16496 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16497
16498 * xfaces.c (Qframe_set_background_mode): Now static.
16499 * dispextern.h (Qframe_set_background_mode): Remove decl.
16500
16501 * process.c (Fnetwork_interface_info): Declare local only if needed.
16502
16503 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16504
16505 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16506 (Fnetwork_interface_list): Allocate in increments of bytes instead
16507 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16508 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16509 sockaddr.
16510 (struct ifflag_def): notrailers is smart on OSX.
16511 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16512 Get hardware address with getifaddrs if available.
16513
16514 2011-08-12 Eli Zaretskii <eliz@gnu.org>
16515
16516 * xdisp.c (iterate_out_of_display_property): xassert that
16517 IT->position is set to within IT->object's boundaries. Break from
16518 the loop as soon as EOB is reached; avoids infloops in redisplay
16519 when IT->position is set up wrongly due to some bug.
16520 Set IT->current to match the bidi iterator unconditionally.
16521 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16522 entry. Force push_it to save on the stack the current
16523 buffer/string position, to be restored by pop_it. Fix flags in
16524 the iterator structure wrt the object coming from a display
16525 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16526 properties. (Bug#9284)
16527
16528 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
16529
16530 * fontset.c (fontset_get_font_group): Add proper type checks.
16531 (Bug#9172)
16532
16533 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16534
16535 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16536 and LC_VERSION_MIN_MACOSX.
16537 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16538 (dump_it) [LC_FUNCTION_STARTS]: Use it.
16539
16540 2011-08-08 Eli Zaretskii <eliz@gnu.org>
16541
16542 * xdisp.c (forward_to_next_line_start): Allow to use the
16543 no-display-properties-and-no-overlays under bidi display.
16544 Set disp_pos in the bidi iterator to avoid searches for display
16545 properties and overlays.
16546
16547 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
16548
16549 * editfns.c (Fset_time_zone_rule): Document relationship with the
16550 setenv function.
16551
16552 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16553 the font entity extracted from the cache (Bug#8109).
16554
16555 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
16556
16557 * composite.c (autocmp_chars): Don't reset point. That is done by
16558 restore_point_unwind (Bug#5984).
16559
16560 2011-08-07 Juri Linkov <juri@jurta.org>
16561
16562 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16563 to show the arg `TIME' instead of `TIMEVAL'.
16564
16565 2011-08-06 Eli Zaretskii <eliz@gnu.org>
16566
16567 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16568 display property strides EOL and includes a newline, as in
16569 longlines-mode. (Bug#9254)
16570 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16571 word-wrap under bidirectional display. (Bug#9224)
16572
16573 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16574 is non-zero, even if the data buffer is NULL. Fixes a crash in
16575 vertical-motion with longlines-mode. (Bug#9254)
16576
16577 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16578
16579 * bidi.c <bidi_cache_total_alloc>: Now static.
16580 (bidi_initialize): Initialize bidi_cache_total_alloc.
16581
16582 * xdisp.c (display_line): Release buffer allocated for shelved bidi
16583 cache. (Bug#9221)
16584
16585 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16586 amount allocated this far in `bidi_cache_total_alloc'.
16587 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16588 non-zero, only free the data buffer without restoring the cache
16589 contents. All callers changed.
16590
16591 * dispextern.h (bidi_unshelve_cache): Update prototype.
16592
16593 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16594 (move_it_in_display_line, move_it_to)
16595 (move_it_vertically_backward, move_it_by_lines): Replace the call
16596 to xfree to an equivalent call to bidi_unshelve_cache.
16597 (move_it_in_display_line_to): Fix logic of returning
16598 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
16599
16600 2011-08-05 Eli Zaretskii <eliz@gnu.org>
16601
16602 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16603 came from a string character with a `cursor' property. (Bug#9229)
16604
16605 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16606
16607 * Makefile.in (LIB_PTHREAD): New variable.
16608 (LIBES): Add LIB_PTHREAD (Bug#9216).
16609
16610 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16611 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16612
16613 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16614
16615 * regex.c (re_iswctype): Remove some redundant boolean conversions.
16616
16617 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16618
16619 * xterm.c (x_find_topmost_parent): New function.
16620 (x_set_frame_alpha): Find topmost parent window with
16621 x_find_topmost_parent and set the property there also (bug#9181).
16622 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16623
16624 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16625
16626 * callproc.c (Fcall_process): Avoid vfork clobbering
16627 the local vars buffer, coding_systems, current_dir.
16628
16629 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16630
16631 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16632
16633 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16634
16635 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16636 so that it is not optimized away.
16637
16638 * xdisp.c (compute_display_string_pos): Remove unused local.
16639
16640 2011-08-02 Eli Zaretskii <eliz@gnu.org>
16641
16642 Fix slow cursor motion and scrolling in large buffers with
16643 selective display, like Org Mode buffers. (Bug#9218)
16644
16645 * dispextern.h (struct bidi_it): New member disp_prop_p.
16646
16647 * xdisp.c: Remove one-slot cache of display string positions.
16648 (compute_display_string_pos): Accept an additional argument
16649 DISP_PROP_P; callers changed. Scan at most 5K characters forward
16650 for a display string or property. If found, set DISP_PROP_P
16651 non-zero.
16652
16653 * bidi.c (bidi_fetch_char): Accept an additional argument
16654 DISP_PROP_P, and pass it to compute_display_string_pos.
16655 Only handle text covered by a display string if DISP_PROP_P is returned
16656 non-zero. All callers of bidi_fetch_char changed.
16657
16658 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16659
16660 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16661
16662 2010-12-03 Don March <don@ohspite.net>
16663
16664 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16665 last character M-[char] is translated to ESC [char] (bug#7541).
16666
16667 2011-08-02 Kenichi Handa <handa@m17n.org>
16668
16669 * lisp.h (uniprop_table): Extern it.
16670
16671 * chartab.c (uniprop_table): Make it non-static.
16672
16673 2011-08-01 Eli Zaretskii <eliz@gnu.org>
16674
16675 * xdisp.c (forward_to_next_line_start): Accept additional argument
16676 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16677 on the newline.
16678 (reseat_at_next_visible_line_start): Use the bidi iterator state
16679 returned by forward_to_next_line_start to restore the state of
16680 it->bidi_it after backing up to previous newline. (Bug#9212)
16681
16682 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16683
16684 * regex.c (re_comp): Protoize.
16685 (re_exec): Fix return type.
16686 (regexec): Fix type of `ret'. (Bug#9203)
16687
16688 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16689
16690 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16691 This is needed if max-image-size is a floating-point number.
16692
16693 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16694
16695 * print.c (print_object): Print empty symbol as ##.
16696
16697 * lread.c (read1): Read ## as empty symbol.
16698
16699 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16700
16701 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16702 setting frame foreground color (Bug#9175).
16703 (x_set_background_color): Likewise.
16704
16705 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16706 contents (Bug#9176).
16707 (EmacsTooltip -init): Remove bezels and add shadows to
16708 tooltip windows.
16709
16710 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16711 or scroll bar (Bug#8470).
16712
16713 * nsfont.m (nsfont_open): Remove assignment to voffset and
16714 unnecessary vars hshink, expand, hd, full_height, min_height.
16715 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16716
16717 * nsterm.h (nsfont_info): Remove voffset field.
16718
16719 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16720
16721 Implement strike-through and overline on NextStep (Bug#8863).
16722
16723 * nsfont.m (nsfont_open): Use underline position provided by font,
16724 instead of hard-coded value of 2.
16725 (nsfont_draw): Call ns_draw_text_decoration instead.
16726
16727 * nsterm.h: Add declaration for ns_draw_text_decoration.
16728
16729 * nsterm.m (ns_draw_text_decoration): New function for drawing
16730 underline, overline, and strike-through.
16731 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16732 ns_draw_text_decoration. Change treatment of cursor drawing to
16733 accommodate underlining, etc.
16734
16735 2011-07-28 Eli Zaretskii <eliz@gnu.org>
16736
16737 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16738 default.
16739
16740 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16741
16742 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16743 Without this fix, if a signal arrives just after memory fills up,
16744 'malloc' might be invoked reentrantly.
16745
16746 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16747 In other words, assume that every image size is allowed, on non-X
16748 hosts. This assumption is probably wrong, but it lets Emacs compile.
16749
16750 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16751
16752 * regex.c (re_iswctype): Convert return values to boolean.
16753
16754 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16755
16756 * xdisp.c (compute_display_string_pos): Don't use cached display
16757 string position if the buffer had its restriction changed.
16758 (Bug#9184)
16759
16760 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16761
16762 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16763
16764 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16765
16766 Integer signedness and overflow and related fixes. (Bug#9079)
16767
16768 * bidi.c: Integer size and overflow fixes.
16769 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16770 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16771 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16772 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16773 (bidi_find_other_level_edge):
16774 Use ptrdiff_t instead of EMACS_INT where either will do.
16775 This works better on 32-bit hosts configured --with-wide-int.
16776 (bidi_cache_ensure_space): Check for size-calculation overflow.
16777 Use % rather than repeated addition, for better worst-case speed.
16778 Don't set bidi_cache_size until after xrealloc returns, because it
16779 might not return.
16780 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
16781 (bidi_cache_ensure_space): Also check that the bidi cache size
16782 does not exceed that of the largest Lisp string or buffer. See Eli
16783 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
16784
16785 * alloc.c (__malloc_size_t): Remove.
16786 All uses replaced by size_t. See Andreas Schwab's note
16787 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16788
16789 * image.c: Improve checking for integer overflow.
16790 (check_image_size): Assume that f is nonnull, since
16791 it is always nonnull in practice. This is one less thing to
16792 worry about when checking for integer overflow later.
16793 (x_check_image_size): New function, which checks for integer
16794 overflow issues inside X.
16795 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16796 This removes the need for a memory_full check.
16797 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16798 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16799 (xbm_read_bitmap_data): Change locals back to 'int', since
16800 their values must fit in 'int'.
16801 (xpm_load_image, png_load, tiff_load):
16802 Invoke x_create_x_image_and_pixmap earlier,
16803 to avoid much needless work if the image is too large.
16804 (tiff_load): Treat overly large images as if
16805 x_create_x_image_and_pixmap failed, not as malloc failures.
16806 (gs_load): Use x_check_image_size.
16807
16808 * gtkutil.c: Omit integer casts.
16809 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16810 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16811
16812 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16813
16814 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16815 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16816 would wrongly return t on a 64-bit host.
16817
16818 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16819 The plain *_OVERFLOW macros run afoul of GCC bug 49705
16820 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16821 and therefore cause GCC to emit a bogus diagnostic in some cases.
16822
16823 * image.c: Integer signedness and overflow and related fixes.
16824 This is not an exhaustive set of fixes, but it's time to
16825 record what I've got.
16826 (lookup_pixel_color, check_image_size): Remove redundant decls.
16827 (check_image_size): Don't assume that arbitrary EMACS_INT values
16828 fit in 'int', or that arbitrary 'double' values fit in 'int'.
16829 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16830 (tiff_load, imagemagick_load_image):
16831 Check for overflow in size calculations.
16832 (x_create_x_image_and_pixmap): Remove unnecessary test for
16833 xmalloc returning NULL; that can't happen.
16834 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16835 (xpm_color_bucket): Use better integer hashing function.
16836 (xpm_cache_color): Don't possibly over-allocate memory.
16837 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16838 (gif_memory_source):
16839 Use ptrdiff_t, not int or size_t, to record sizes.
16840 (png_load): Don't assume values greater than 2**31 fit in 'int'.
16841 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16842 either works, as we prefer signed integers.
16843 (tiff_read_from_memory, tiff_write_from_memory):
16844 Return tsize_t, not size_t, since that's what the TIFF API wants.
16845 (tiff_read_from_memory): Don't fail simply because the read would
16846 go past EOF; instead, return a short read.
16847 (tiff_load): Omit no-longer-needed casts.
16848 (Fimagemagick_types): Don't assume size fits into 'int'.
16849
16850 Improve hashing quality when configured --with-wide-int.
16851 * fns.c (hash_string): New function, taken from sxhash_string.
16852 Do not discard information about ASCII character case; this
16853 discarding is no longer needed.
16854 (sxhash-string): Use it. Change sig to match it. Caller changed.
16855 * lisp.h: Declare it.
16856 * lread.c (hash_string): Remove, since we now use fns.c's version.
16857 The fns.c version returns a wider integer if --with-wide-int is
16858 specified, so this should help the quality of the hashing a bit.
16859
16860 * emacs.c: Integer overflow minor fix.
16861 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
16862 Define only if GNU_LINUX.
16863 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16864
16865 * dispnew.c: Integer signedness and overflow fixes.
16866 Remove unnecessary forward decls, that were a maintenance hassle.
16867 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16868 All uses changed.
16869 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16870 (scrolling_window): Use ptrdiff_t, not int, for byte count.
16871 (prepare_desired_row, line_draw_cost):
16872 Use int, not unsigned, where either works.
16873 (save_current_matrix, restore_current_matrix):
16874 Use ptrdiff_t, not size_t, where either works.
16875 (init_display): Check for overflow more accurately, and without
16876 relying on undefined behavior.
16877
16878 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16879 Remove, replacing with the new symbols in lisp.h. All uses changed.
16880 * fileio.c (make_temp_name):
16881 * filelock.c (lock_file_1, lock_file):
16882 * xdisp.c (message_dolog):
16883 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16884 Use pMd etc. instead.
16885 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16886 replacing the pWIDE etc. symbols removed from editfns.c.
16887
16888 * keyboard.h (num_input_events): Now uintmax_t.
16889 This is (very slightly) less likely to mess up due to wraparound.
16890 All uses changed.
16891
16892 * buffer.c: Integer signedness fixes.
16893 (alloc_buffer_text, enlarge_buffer_text):
16894 Use ptrdiff_t rather than size_t when either will do, as we prefer
16895 signed integers.
16896
16897 * alloc.c: Integer signedness and overflow fixes.
16898 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16899 (__malloc_size_t): Default to size_t, not to int.
16900 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16901 (Fgarbage_collect, mark_object_loop_halt, mark_object):
16902 Prefer ptrdiff_t to size_t when either would do, as we prefer
16903 signed integers.
16904 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16905 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16906 Now const. Initialize with values that are in range even if char
16907 is signed.
16908 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16909 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
16910 These functions do the right thing with sizes > 2**32.
16911 (check_depth): Now ptrdiff_t, not int.
16912 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16913 Adjust to new way of storing sizes. Check for size overflow bugs
16914 in rest of code.
16915 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
16916 slightly wrong anyway, as it missed one instance of
16917 XMALLOC_OVERRUN_CHECK_OVERHEAD.
16918 (refill_memory_reserve): Omit needless cast to size_t.
16919 (mark_object_loop_halt): Mark as externally visible.
16920
16921 * xselect.c: Integer signedness and overflow fixes.
16922 (Fx_register_dnd_atom, x_handle_dnd_message):
16923 Use ptrdiff_t, not size_t, since we prefer signed.
16924 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16925 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16926 x_dnd_atoms_size and x_dnd_atoms_length.
16927
16928 * doprnt.c: Prefer signed to unsigned when either works.
16929 * eval.c (verror):
16930 * doprnt.c (doprnt):
16931 * lisp.h (doprnt):
16932 * xdisp.c (vmessage):
16933 Use ptrdiff_t, not size_t, when using or implementing doprnt,
16934 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
16935 prefer signed arithmetic to avoid comparison confusion.
16936 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
16937 but is a bit tricky.
16938
16939 Assume freestanding C89 headers, string.h, stdlib.h.
16940 * data.c, doprnt.c, floatfns.c, print.c:
16941 Include float.h unconditionally.
16942 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
16943 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
16944 * regex.c: Likewise for stddef.h, string.h.
16945 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
16946 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
16947 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
16948 (STDC_HEADERS): Remove obsolete defines.
16949 * sysdep.c: Include limits.h unconditionally.
16950
16951 Assume support for memcmp, memcpy, memmove, memset.
16952 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
16953 * regex.c (memcmp, memcpy):
16954 Remove; we assume C89 now.
16955
16956 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
16957 (__malloc_safe_bcopy): Remove; no longer needed.
16958
16959 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
16960 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
16961 well either way, and we prefer signed to unsigned.
16962
16963 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
16964
16965 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
16966 closes the connection while we're reading (bug#9182).
16967
16968 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
16969
16970 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
16971 are specified (Bug#9168).
16972
16973 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
16974
16975 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
16976 Found by GCC static checking and --with-wide-int on a 32-bit host.
16977
16978 2011-07-25 Eli Zaretskii <eliz@gnu.org>
16979
16980 * xdisp.c (compute_display_string_pos): Fix logic of caching
16981 previous display string position. Initialize cached_prev_pos to
16982 -1. Fixes slow-down at the beginning of a buffer.
16983
16984 2011-07-24 Eli Zaretskii <eliz@gnu.org>
16985
16986 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
16987 for attrs[LFACE_FONTSET_INDEX].
16988
16989 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
16990
16991 * xml.c (parse_region): Remove unused local
16992 that was recently introduced.
16993
16994 2011-07-23 Eli Zaretskii <eliz@gnu.org>
16995
16996 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
16997 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
16998
16999 * xdisp.c (move_it_in_display_line_to): Record the best matching
17000 position for TO_CHARPOS while scanning the line, and restore it on
17001 exit if none of the characters scanned was an exact match.
17002 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17003 when exact match is impossible due to invisible text, and the
17004 lines are truncated.
17005
17006 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17007
17008 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17009 for OSX >= 10.7.
17010
17011 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17012
17013 Fix a significant slow-down of cursor motion with C-n, C-p,
17014 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17015 auto-repeat under bidi redisplay in fontified buffers.
17016 * xdisp.c (compute_stop_pos_backwards): New function.
17017 (next_element_from_buffer): Call compute_stop_pos_backwards to
17018 find a suitable prev_stop when we find ourselves before
17019 base_level_stop.
17020 (reseat): Don't look for prev_stop, as that could mean a very long
17021 run.
17022 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17023 <cached_disp_overlay_modiff>: Cache for last found display string
17024 position.
17025 (compute_display_string_pos): Return the cached position if asked
17026 about the same buffer in the same area of character positions, and
17027 the buffer wasn't changed since the time the display string
17028 position was cached.
17029
17030 2011-07-22 Eli Zaretskii <eliz@gnu.org>
17031
17032 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17033 is an integer, which is important for empty lines. (Bug#9149)
17034
17035 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
17036
17037 * frame.c (Fmodify_frame_parameters): In tty case, update the
17038 default face if necessary (Bug#4238).
17039
17040 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
17041
17042 * editfns.c (Fstring_to_char): No need to explain what a character
17043 is in the docstring (Bug#6576).
17044
17045 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17046
17047 * xml.c (parse_region): Make sure we always return a tree.
17048
17049 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17050
17051 * xml.c (parse_region): If a document contains only comments,
17052 return that, too.
17053
17054 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17055
17056 * xml.c (make_dom): Return comments, too.
17057
17058 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17059
17060 Port to OpenBSD.
17061 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17062 and the surrounding thread.
17063 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17064 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17065 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17066 timer goes off.
17067 * s/openbsd.h (BROKEN_SIGIO): Define.
17068 * unexelf.c (unexec) [__OpenBSD__]:
17069 Don't update the .mdebug section of the Alpha COFF symbol table.
17070
17071 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17072
17073 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17074 (bug#8460).
17075
17076 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17077
17078 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17079 This fixes some race conditions on the permissions of any newly
17080 created file.
17081
17082 * alloc.c (valid_pointer_p): Use pipe, not open.
17083 This fixes some permissions issues when debugging.
17084
17085 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17086 If fchown fails to set both uid and gid, try to set just gid,
17087 as that is sometimes allowed. Adjust the file's mode to eliminate
17088 setuid or setgid bits that are inappropriate if fchown fails.
17089
17090 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17091
17092 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17093 to compare Lisp_Objects.
17094 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17095 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17096 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17097
17098 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17099
17100 * lread.c (read_integer): Unread even EOF character.
17101 (read1): Likewise. Properly record start position of symbol.
17102
17103 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17104 symbol character follows.
17105
17106 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17107
17108 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17109 This works around a problem with the previous change to Fcopy_file.
17110 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17111 and without this change, GCC might complain about discarding
17112 fchown's return value.
17113
17114 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
17115
17116 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17117
17118 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17119
17120 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17121
17122 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17123
17124 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17125 it's used from the C level.
17126
17127 * process.c: Use the same condition for POLL_FOR_INPUT in both
17128 keyboard.c and process.c (bug#1858).
17129
17130 2011-07-09 Lawrence Mitchell <wence@gmx.li>
17131
17132 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17133 (Fgnutls_boot): Use it.
17134
17135 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17136
17137 * doc.c (Fsubstitute_command_keys): Revert last change.
17138
17139 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17140
17141 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17142 quotes the next character, and doesn't affect other longer
17143 sequences (bug#8935).
17144
17145 * lread.c (syms_of_lread): Clarify that is isn't only
17146 `eval-buffer' and `eval-defun' that's affected by
17147 `lexical-binding' (bug#8460).
17148
17149 2011-07-15 Eli Zaretskii <eliz@gnu.org>
17150
17151 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17152 bidi redisplay when a line includes both an image and is truncated.
17153
17154 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17155
17156 Fix minor problems found by static checking.
17157 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17158 (elsz): Now a signed constant, not a size_t var. We prefer signed
17159 types to unsigned, to avoid integer comparison confusion. Without
17160 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17161 "cannot optimize loop, the loop counter may overflow", a symptom
17162 of the confusion.
17163 * indent.c (Fvertical_motion): Mark locals as initialized.
17164 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17165
17166 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17167
17168 * search.c (Fre_search_backward): Mention `case-fold-search' in
17169 all the re_search_* functions (bug#8138).
17170
17171 * keyboard.c (Fopen_dribble_file): Document when the file is
17172 closed (bug#8056).
17173
17174 2011-07-14 Eli Zaretskii <eliz@gnu.org>
17175
17176 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17177 bidi_cache_idx.
17178
17179 Support bidi reordering of display and overlay strings.
17180 * xdisp.c (compute_display_string_pos)
17181 (compute_display_string_end): Accept additional argument STRING.
17182 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17183 (reseat_to_string): Initialize bidi_it->string.s and
17184 bidi_it->string.schars.
17185 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
17186 NULL (avoids a crash in bidi_paragraph_init).
17187 Initialize itb.string.lstring.
17188 (init_iterator): Call bidi_init_it only of a valid
17189 buffer position was specified. Initialize paragraph_embedding to
17190 L2R.
17191 (reseat_to_string): Initialize the bidi iterator.
17192 (display_string): If we need to ignore text properties of
17193 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17194 original value of -1 will not work with bidi.)
17195 (compute_display_string_pos): First arg is now struct
17196 `text_pos *'; all callers changed. Support display properties on
17197 Lisp strings.
17198 (compute_display_string_end): Support display properties on Lisp
17199 strings.
17200 (init_iterator, reseat_1, reseat_to_string): Initialize the
17201 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17202 when iterating on a string not from display properties).
17203 (compute_display_string_pos, compute_display_string_end):
17204 Fix calculation of the object to scan. Fixes an error when using
17205 arrow keys.
17206 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17207 base_level_stop; instead, set base_level_stop to BEGV.
17208 Fixes crashes in vertical-motion.
17209 (next_element_from_buffer): Improve commentary for when
17210 the iterator is before prev_stop.
17211 (init_iterator): Initialize bidi_p from the default value of
17212 bidi-display-reordering, not from buffer-local value. Use the
17213 buffer-local value only if initializing for buffer iteration.
17214 (handle_invisible_prop): Support invisible properties on strings
17215 that are being bidi-reordered.
17216 (set_iterator_to_next): Support bidi reordering of C strings and
17217 Lisp strings.
17218 (next_element_from_string): Support bidi reordering of Lisp
17219 strings.
17220 (handle_stop_backwards): Support Lisp strings as well.
17221 (display_string): Support display of R2L glyph rows.
17222 Use IT_STRING_CHARPOS when displaying from a Lisp string.
17223 (init_iterator): Don't initialize it->bidi_p for strings
17224 here.
17225 (reseat_to_string): Initialize it->bidi_p for strings here.
17226 (next_element_from_string, next_element_from_c_string)
17227 (next_element_from_buffer): Add xassert's for correspondence
17228 between IT's object being iterated and it->bidi_it.string
17229 structure.
17230 (face_before_or_after_it_pos): Support bidi iteration.
17231 (next_element_from_c_string): Handle the case of the first string
17232 character that is not the first one in the visual order.
17233 (get_visually_first_element): New function, refactored from common
17234 parts of next_element_from_buffer, next_element_from_string, and
17235 next_element_from_c_string.
17236 (tool_bar_lines_needed, redisplay_tool_bar)
17237 (display_menu_bar): Force left-to-right direction. Add a FIXME
17238 comment for making that be controlled by a user option.
17239 (push_it, pop_it): Save and restore the state of the
17240 bidi iterator. Save and restore the bidi_p flag.
17241 (pop_it): Iterate out of display property for string iteration as
17242 well.
17243 (iterate_out_of_display_property): Support iteration over strings.
17244 (handle_single_display_spec): Set up it->bidi_it for iteration
17245 over a display string, and call bidi_init_it.
17246 (handle_single_display_spec, next_overlay_string)
17247 (get_overlay_strings_1, push_display_prop): Set up the bidi
17248 iterator for displaying display or overlay strings.
17249 (forward_to_next_line_start): Don't use the shortcut if
17250 bidi-iterating.
17251 (back_to_previous_visible_line_start): If handle_display_prop
17252 pushed the iterator stack, restore the internal state of the bidi
17253 iterator by calling bidi_pop_it same number of times.
17254 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17255 and we are bidi-iterating, don't decrement the iterator position;
17256 instead, set the first_elt flag in the bidi iterator, to produce
17257 the same effect.
17258 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17259 (push_display_prop): xassert that we are iterating a buffer.
17260 (push_it, pop_it): Save and restore paragraph_embedding member.
17261 (handle_single_display_spec, next_overlay_string)
17262 (get_overlay_strings_1, reseat_1, reseat_to_string)
17263 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17264 correctly. Don't assume unibyte strings are not bidi-reordered.
17265 (compute_display_string_pos)
17266 (compute_display_string_end): Fix handling the case of C string.
17267 (push_it, pop_it): Save and restore from_disp_prop_p.
17268 (handle_single_display_spec, push_display_prop): Set the
17269 from_disp_prop_p flag.
17270 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17271 (pop_it): Call iterate_out_of_display_property only if we are
17272 popping after iteration over a string that came from a display
17273 property. Fix a typo in popping stretch info. Add an assertion
17274 for verifying that the iterator position is in sync with the bidi
17275 iterator.
17276 (handle_single_display_spec, get_overlay_strings_1)
17277 (push_display_prop): Fix initialization of paragraph direction for
17278 string when that of the parent object is not yet determined.
17279 (reseat_1): Call bidi_init_it to resync the bidi
17280 iterator with IT's position. (Bug#7616)
17281 (find_row_edges): If ROW->start.pos gives position
17282 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17283 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17284 Reset the from_disp_prop_p flag.
17285 (SAVE_IT, RESTORE_IT): New macros.
17286 (pos_visible_p, face_before_or_after_it_pos)
17287 (back_to_previous_visible_line_start)
17288 (move_it_in_display_line_to, move_it_in_display_line)
17289 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17290 (try_scrolling, redisplay_window, display_line): Use them when
17291 saving a temporary copy of the iterator and restoring it back.
17292 (back_to_previous_visible_line_start, reseat_1)
17293 (init_iterator): Empty the bidi cache "stack".
17294 (move_it_in_display_line_to): If iterator ended up at
17295 EOL, but we never saw any buffer positions smaller than
17296 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17297 motion in bidi-reordered lines.
17298 (move_it_in_display_line_to): Record prev_method and prev_pos
17299 immediately before the call to set_iterator_to_next. Fixes cursor
17300 motion in bidi-reordered lines with stretch glyphs and strings
17301 displayed in margins. (Bug#8133) (Bug#8867)
17302 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17303 TO_CHARPOS.
17304 (pos_visible_p): Support positions in bidi-reordered lines.
17305 Save and restore bidi cache.
17306
17307 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17308 (bidi_paragraph_info): Delete unused struct.
17309 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17310 (bidi_cache_start): New variable.
17311 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17312 to zero.
17313 (bidi_cache_fetch_state, bidi_cache_search)
17314 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17315 (bidi_cache_find, bidi_peek_at_next_level)
17316 (bidi_level_of_next_char, bidi_find_other_level_edge)
17317 (bidi_move_to_visually_next): Compare cache index with
17318 bidi_cache_start rather than with zero.
17319 (bidi_fetch_char): Accept new argument STRING; all callers
17320 changed. Support iteration over a string. Support strings with
17321 display properties. Support unibyte strings. Fix the type of
17322 `len' according to what STRING_CHAR_AND_LENGTH expects.
17323 (bidi_paragraph_init, bidi_resolve_explicit_1)
17324 (bidi_resolve_explicit, bidi_resolve_weak)
17325 (bidi_level_of_next_char, bidi_move_to_visually_next):
17326 Support iteration over a string.
17327 (bidi_set_sor_type, bidi_resolve_explicit_1)
17328 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17329 can now be zero (for strings); special values 0 and -1 were
17330 changed to -1 and -2, respectively.
17331 (bidi_char_at_pos): New function.
17332 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17333 Call it instead of FETCH_MULTIBYTE_CHAR.
17334 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17335 initialized to valid values.
17336 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17337 values.
17338 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17339 the test for valid cached positions. Fix the logic for looking up
17340 the sentinel state in the cache. GCPRO the Lisp string we are
17341 iterating.
17342 (bidi_push_it, bidi_pop_it): New functions.
17343 (bidi_initialize): Initialize the bidi cache start stack pointer.
17344 (bidi_cache_ensure_space): New function, refactored from part of
17345 bidi_cache_iterator_state. Don't assume the required size is just
17346 one BIDI_CACHE_CHUNK away.
17347 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17348 (bidi_count_bytes, bidi_char_at_pos): New functions.
17349 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17350 always valid if bidi_cache_idx is valid.
17351 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17352 is valid if it's going to be used.
17353 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17354 (bidi_cache_fetch_state, bidi_cache_search)
17355 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17356 (bidi_cache_iterator_state, bidi_cache_find)
17357 (bidi_find_other_level_edge, bidi_cache_start_stack):
17358 All variables related to cache indices are now EMACS_INT.
17359
17360 * dispextern.h (struct bidi_string_data): New structure.
17361 (struct bidi_it): New member `string'. Make flag members be 1-bit
17362 fields, and put them last in the struct.
17363 (compute_display_string_pos, compute_display_string_end):
17364 Update prototypes.
17365 (bidi_push_it, bidi_pop_it): Add prototypes.
17366 (struct iterator_stack_entry): New members bidi_p,
17367 paragraph_embedding, and from_disp_prop_p.
17368 (struct it): Member bidi_p is now a bit field 1 bit wide.
17369 (bidi_shelve_cache, bidi_unshelve_cache):
17370 Declare prototypes.
17371
17372 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17373 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17374 and vector-like objects.
17375
17376 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17377 cache around display iteration.
17378
17379 * window.c (Fwindow_end, window_scroll_pixel_based)
17380 (displayed_window_lines, Frecenter): Save and restore the bidi
17381 cache around display iteration.
17382
17383 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17384
17385 * editfns.c (Fdelete_region): Clarify the use of the named
17386 parameters (bug#6788).
17387
17388 2011-07-14 Martin Rudalics <rudalics@gmx.at>
17389
17390 * indent.c (Fvertical_motion): Set and restore w->pointm when
17391 saving and restoring the window's buffer (Bug#9006).
17392
17393 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17394
17395 * editfns.c (Fstring_to_char): Clarify just what is returned
17396 (bug#6576). Text by Eli Zaretskii.
17397
17398 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
17399
17400 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17401
17402 2011-07-13 Eli Zaretskii <eliz@gnu.org>
17403
17404 * buffer.c (mmap_find): Fix a typo.
17405
17406 2011-07-13 Johan Bockgård <bojohan@gnu.org>
17407
17408 Fix execution of x selection hooks.
17409 * xselect.c (Qx_lost_selection_functions)
17410 (Qx_sent_selection_functions): New vars.
17411 (syms_of_xselect): DEFSYM them.
17412 (x_handle_selection_request): Pass Qx_sent_selection_functions
17413 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17414 (x_handle_selection_clear,x_clear_frame_selections):
17415 Pass Qx_lost_selection_functions rather than
17416 Vx_lost_selection_functions to Frun_hook_with_args.
17417
17418 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17419
17420 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
17421 The old code sometimes used this field without initializing it.
17422
17423 * alloc.c (gc_sweep): Don't read past end of array.
17424 In theory, the old code could also have corrupted Emacs internals,
17425 though it'd be very unlikely.
17426
17427 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17428
17429 * character.c (Fcharacterp): Don't advertise optional ignored
17430 argument. (Bug#4026)
17431
17432 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17433
17434 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17435 key" (bug#4257).
17436
17437 * window.c (Fset_window_start): Doc fix (bug#4199).
17438 (Fset_window_hscroll): Ditto.
17439
17440 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17441
17442 Fix minor new problems caught by GCC 4.6.1.
17443 * term.c (init_tty): Remove unused local.
17444 * xsettings.c (store_monospaced_changed): Define this function only
17445 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
17446 not used otherwise.
17447
17448 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
17449
17450 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17451
17452 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17453
17454 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17455 are the mini-buffer and the echo area (bug#3320).
17456
17457 * term.c (init_tty): Remove support for supdup, c10 and perq
17458 terminals, which are no longer supported (bug#1482).
17459
17460 2011-07-10 Johan Bockgård <bojohan@gnu.org>
17461
17462 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17463
17464 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17465
17466 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17467 for non-popups (Bug#3642).
17468
17469 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17470
17471 * alloc.c (reset_malloc_hooks): Protoize.
17472 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
17473 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17474 * cm.c (losecursor): Likewise.
17475 * data.c (fmod): Likewise.
17476 * dispnew.c (swap_glyphs_in_rows): Likewise.
17477 * emacs.c (memory_warning_signal): Likewise.
17478 * floatfns.c (float_error): Likewise.
17479 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17480 (otf_open, font_otf_capability, generate_otf_features)
17481 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17482 Likewise.
17483 * image.c (pbm_read_file): Likewise.
17484 * indent.c (string_display_width): Likewise.
17485 * intervals.c (check_for_interval, search_for_interval)
17486 (inc_interval_count, count_intervals, root_interval)
17487 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17488 * lread.c (defalias): Likewise.
17489 * ralloc.c (r_alloc_check): Likewise.
17490 * regex.c (set_image_of_range_1, set_image_of_range)
17491 (regex_grow_registers): Likewise.
17492 * sysdep.c (strerror): Likewise.
17493 * termcap.c (valid_filename_p, tprint, main): Likewise.
17494 * tparam.c (main): Likewise.
17495 * unexhp9k800.c (run_time_remap, save_data_space)
17496 (update_file_ptrs, read_header, write_header, calculate_checksum)
17497 (copy_file, copy_rest, display_header): Likewise.
17498 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17499 Likewise.
17500 * xdisp.c (check_it): Likewise.
17501 * xfaces.c (register_color, unregister_color, unregister_colors):
17502 Likewise.
17503 * xfns.c (print_fontset_result): Likewise.
17504 * xrdb.c (member, fatal, main): Likewise.
17505
17506 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17507
17508 Fix minor problems found by static checking (Bug#9031).
17509 * chartab.c (char_table_set_range, map_sub_char_table):
17510 Remove unused locals.
17511 (uniprop_table): Now static.
17512 * composite.c (_work_char): Remove unused static var.
17513
17514 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
17515
17516 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17517
17518 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17519
17520 * gtkutil.c (qttip_cb): Remove code without function.
17521
17522 2011-07-09 Eli Zaretskii <eliz@gnu.org>
17523
17524 * w32.c (pthread_sigmask): New stub.
17525
17526 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
17527
17528 Use pthread_sigmask, not sigprocmask (Bug#9010).
17529 sigprocmask is portable only for single-threaded applications, and
17530 Emacs can be multi-threaded when it uses GTK.
17531 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17532 (LIBES): Use it.
17533 * callproc.c (Fcall_process):
17534 * process.c (create_process):
17535 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17536 Use pthread_sigmask, not sigprocmask.
17537
17538 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17539
17540 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17541 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17542 wrong (Bug#8591).
17543
17544 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17545
17546 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17547 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17548 (xg_hide_tooltip): Fix comment.
17549
17550 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17551 in registerServicesMenuSendTypes.
17552 (validRequestorForSendType): Don't check ns_return_types.
17553
17554 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17555 ns_return_type.
17556
17557 2011-07-08 Jason Rumney <jasonr@gnu.org>
17558
17559 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17560 SH_SHOW for hidden windows (Bug#5482).
17561
17562 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17563 frame struct members of non-existent frames (Bug#6284).
17564
17565 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17566
17567 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17568 variable firstTime not needed on OSX >= 10.6.
17569 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17570 >= 10.5. Use setKnobProportion, setDoubleValue.
17571
17572 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17573 (MAC_OS_X_VERSION_10_5): Define if not defined.
17574 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17575 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17576 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17577
17578 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
17579 cString and lossyCString on OSX >= 10.4.
17580
17581 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
17582 sizeToFit on OSX >= 10.2.
17583
17584 * nsimage.m (allocInitFromFile): Don't use deprecated method
17585 bestRepresentationForDevice on OSX >= 10.6.
17586
17587 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17588 to avoid warning.
17589
17590 * emacs.c: Declare unexec_init_emacs_zone.
17591
17592 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17593
17594 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17595
17596 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17597 on svcsMenu (Bug#8842).
17598
17599 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17600 ns_return_types.
17601 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17602
17603 * nsterm.m (QUTF8_STRING): Declare.
17604 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17605 (validRequestorForSendType): Return type is (id).
17606 Change indexOfObjectIdenticalTo to indexOfObject.
17607 Check if we have local selection before returning self (Bug#8842).
17608 (writeSelectionToPasteboard): Put local selection into paste board
17609 if we have a local selection (Bug#8842).
17610 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17611
17612 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17613 (ns_get_local_selection): Declare.
17614
17615 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17616
17617 * keymap.c (describe_map_tree): Don't insert a double newline at
17618 the end of the buffer (bug#1169) and return whether we inserted
17619 something.
17620
17621 * callint.c (Fcall_interactively): Change "reading args" to
17622 "providing args" to try to clarify what it does (bug#1010).
17623
17624 2011-07-07 Kenichi Handa <handa@m17n.org>
17625
17626 * composite.c (composition_compute_stop_pos): Ignore a static
17627 composition starting before CHARPOS (Bug#8915).
17628
17629 * xdisp.c (handle_composition_prop): Likewise.
17630
17631 2011-07-07 Eli Zaretskii <eliz@gnu.org>
17632
17633 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17634 (Bug#9015)
17635
17636 2011-07-07 Kenichi Handa <handa@m17n.org>
17637
17638 * character.h (unicode_category_t): New enum type.
17639
17640 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17641 (Qchar_code_property_table): New variable.
17642 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17643 (UNIPROP_COMPRESSED_FORM_P): New macros.
17644 (char_table_ascii): Uncompress the compressed values.
17645 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17646 Uncompress the compressed values.
17647 (sub_char_table_ref_and_range): Likewise.
17648 (char_table_ref_and_range): Uncompress the compressed values.
17649 (sub_char_table_set): New arg is_uniprop. Callers changed.
17650 Uncompress the compressed values.
17651 (sub_char_table_set_range): Args changed. Callers changed.
17652 (char_table_set_range): Adjuted for the above change.
17653 (map_sub_char_table): Delete args default_val and parent. Add arg
17654 top. Give decoded values to a Lisp function.
17655 (map_char_table): Adjust for the above change. Give decoded
17656 values to a Lisp function. Gcpro more variables.
17657 (uniprop_table_uncompress)
17658 (uniprop_decode_value_run_length): New functions.
17659 (uniprop_decoder, uniprop_decoder_count): New variables.
17660 (uniprop_get_decoder, uniprop_encode_value_character)
17661 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17662 New functions.
17663 (uniprop_encoder, uniprop_encoder_count): New variables.
17664 (uniprop_get_encoder, uniprop_table)
17665 (Funicode_property_table_internal, Fget_unicode_property_internal)
17666 (Fput_unicode_property_internal): New functions.
17667 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17668 Sunicode_property_table_internal, Sget_unicode_property_internal,
17669 and Sput_unicode_property_internal. Defvar_lisp
17670 char-code-property-alist.
17671
17672 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
17673 Vunicode_category_table.
17674
17675 * font.c (font_range): Adjust for the change of
17676 Vunicode_category_table.
17677
17678 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17679
17680 * m/iris4d.h: Remove file, move contents ...
17681 * s/irix6-5.h: ... here.
17682
17683 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17684
17685 Remove unportable assumption about struct layout (Bug#8884).
17686 * alloc.c (mark_buffer):
17687 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17688 (clone_per_buffer_values): Don't assume that
17689 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17690 This isn't true in general, and it's particularly not true
17691 if Emacs is configured with --with-wide-int.
17692 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17693 New macros, used in the buffer.c change.
17694
17695 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17696
17697 * xsettings.c: Use both GConf and GSettings if both are available.
17698 (store_config_changed_event): Add comment.
17699 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17700 (store_tool_bar_style_changed): New functions.
17701 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
17702 (struct xsettings): Move font inside HAVE_XFT.
17703 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
17704 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
17705 Move inside HAVE_XFT.
17706 (something_changed_gsettingsCB): Rename from something_changedCB.
17707 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17708 also.
17709 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
17710 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
17711 (something_changed_gconfCB): Rename from something_changedCB.
17712 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17713 (parse_settings): Move check for font inside HAVE_XFT.
17714 (read_settings, apply_xft_settings): Add comment.
17715 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17716 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17717 call store_font_name_changed.
17718 (xft_settings_event): Add comment.
17719 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17720 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17721 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17722 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17723 (xsettings_initialize): Call init_gsettings last.
17724 (xsettings_get_system_font, xsettings_get_system_normal_font):
17725 Add comment.
17726
17727 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17728
17729 Random fixes. E.g., (random) never returned negative values.
17730 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17731 subseconds part to the entropy, as that's a bit more random.
17732 Prefer signed to unsigned, since the signedness doesn't matter and
17733 in general we prefer signed. When given a limit, use a
17734 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17735 latter isn't right if USE_2_TAGS_FOR_INTS.
17736 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17737 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17738
17739 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17740
17741 * textprop.c (text_property_stickiness):
17742 Obey Vtext_property_default_nonsticky.
17743 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17744 * w32fns.c (syms_of_w32fns):
17745 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17746
17747 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17748
17749 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17750 This is more efficient than Ffile_directory_p and avoids a minor race.
17751
17752 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17753
17754 * buffer.c (Foverlay_put): Say what the return value is
17755 (bug#7835).
17756
17757 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17758 is a directory before asking whether to use the file name
17759 (bug#7564).
17760 (barf_or_query_if_file_exists): Make the "File is a directory"
17761 error be more correct.
17762
17763 * fns.c (Frequire): Remove the mention of the .gz files, since
17764 that's installation-specific, but keep the mention of
17765 `get-load-suffixes'.
17766
17767 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17768
17769 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17770 Report string overflow if the output is too long.
17771
17772 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
17773
17774 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17775 (syms_of_gnutls): Remove duplicate DEFSYM for
17776 Qgnutls_bootprop_verify_hostname_error, an error for
17777 Qgnutls_bootprop_verify_error (which is no longer used).
17778
17779 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17780 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17781 Also (re)move comments that are misplaced or no longer relevant.
17782
17783 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17784
17785 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17786
17787 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
17788
17789 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17790 and background color parameters if they have been changed.
17791
17792 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17793
17794 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17795
17796 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
17797
17798 * xsettings.c (SYSTEM_FONT): Define only when used.
17799 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17800
17801 * keymap.c (access_keymap_1): Now static.
17802
17803 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
17804
17805 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17806 leave any prefix arg for the up event (Bug#1586).
17807
17808 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
17809
17810 * lread.c (syms_of_lread): Mention single symbols defined by
17811 `defvar' or `defconst' (bug#7154).
17812
17813 * fns.c (Frequire): Mention .el.gz files (bug#7314).
17814 (Frequire): Mention get-load-suffixes.
17815
17816 2011-07-02 Martin Rudalics <rudalics@gmx.at>
17817
17818 * window.h (window): Remove clone_number slot.
17819 * window.c (Fwindow_clone_number, Fset_window_clone_number):
17820 Remove.
17821 (make_parent_window, make_window, saved_window)
17822 (Fset_window_configuration, save_window_save): Don't deal with
17823 clone numbers.
17824 * buffer.c (Qclone_number): Remove declaration.
17825 (sort_overlays, overlay_strings): Don't deal with clone numbers.
17826
17827 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
17828
17829 Add multiple inheritance to keymaps.
17830 * keymap.c (Fmake_composed_keymap): New function.
17831 (Fset_keymap_parent): Simplify.
17832 (fix_submap_inheritance): Remove.
17833 (access_keymap_1): New function extracted from access_keymap to handle
17834 embedded parents and handle lists of maps.
17835 (access_keymap): Use it.
17836 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17837 (Fcopy_keymap): Handle embedded parents.
17838 (Fcommand_remapping, define_as_prefix): Simplify.
17839 (Fkey_binding): Simplify.
17840 (syms_of_keymap): Move minibuffer-local-completion-map,
17841 minibuffer-local-filename-completion-map,
17842 minibuffer-local-must-match-map, and
17843 minibuffer-local-filename-must-match-map to Elisp.
17844 (syms_of_keymap): Defsubr make-composed-keymap.
17845 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17846 (parse_menu_item): Trivial simplification.
17847
17848 2011-07-01 Glenn Morris <rgm@gnu.org>
17849
17850 * Makefile.in (SETTINGS_LIBS): Fix typo.
17851
17852 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
17853
17854 * coding.c (Fencode_coding_string): Record the last coding system
17855 used, as the function doc string says (bug#8738).
17856
17857 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
17858
17859 * xsettings.c (store_monospaced_changed): Take new font as arg and
17860 check for change against current_mono_font.
17861 (EMACS_TYPE_SETTINGS): Remove this and related defines.
17862 (emacs_settings_constructor, emacs_settings_get_property)
17863 (emacs_settings_set_property, emacs_settings_class_init)
17864 (emacs_settings_init, gsettings_obj): Remove.
17865 (something_changedCB): New function for HAVE_GSETTINGS.
17866 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17867 with value as argument.
17868 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17869 g_settings_new (Bug#8967). Do not create gsettings_obj.
17870 Remove calls to g_settings_bind. Connect something_changedCB to
17871 "changed".
17872
17873 * xgselect.c: Add defined (HAVE_GSETTINGS).
17874 (xgselect_initialize): Ditto.
17875
17876 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17877 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17878 xg_select.
17879
17880 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
17881
17882 * eval.c (struct backtrace): Simplify and port the data structure.
17883 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17884 signed bit field, as this assumption is not portable and it makes
17885 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
17886 "char debug_on_exit : 1" as this is not portable either; instead,
17887 use the portable "unsigned int debug_on_exit : 1". Remove unused
17888 member evalargs. Remove obsolete comments about cc bombing out.
17889
17890 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
17891
17892 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
17893 Let HAVE_GSETTINGS override HAVE_GCONF.
17894 (store_monospaced_changed): New function.
17895 (EMACS_SETTINGS): A new type derived from GObject to handle
17896 GSettings notifications.
17897 (emacs_settings_constructor, emacs_settings_get_property)
17898 (emacs_settings_set_property, emacs_settings_class_init):
17899 New functions.
17900 (gsettings_client, gsettings_obj): New variables.
17901 (GSETTINGS_SCHEMA): New define.
17902 (something_changedCB): Call store_monospaced_changed.
17903 (init_gsettings): New function.
17904 (xsettings_initialize): Call init_gsettings.
17905 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17906 to NULL.
17907
17908 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
17909 GCONF_CFLAGS/LIBS.
17910
17911 2011-06-29 Martin Rudalics <rudalics@gmx.at>
17912
17913 * window.c (resize_root_window, grow_mini_window)
17914 (shrink_mini_window): Rename Qresize_root_window to
17915 Qwindow_resize_root_window and Qresize_root_window_vertically to
17916 Qwindow_resize_root_window_vertically.
17917
17918 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
17919
17920 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17921
17922 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
17923
17924 * makefile.w32-in: Redesign dependencies so they reflect more
17925 clearly which files are directly included by each source file,
17926 and not through other includes.
17927
17928 2011-06-27 Martin Rudalics <rudalics@gmx.at>
17929
17930 * buffer.c (Qclone_number): Declare static and DEFSYM it.
17931 (sort_overlays, overlay_strings): When an overlay's clone number
17932 matches the window's clone number process the overlay even if
17933 the overlay's window property doesn't match the current window.
17934
17935 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
17936 (Fwindow_hchild): Rename to Fwindow_left_child.
17937 (Fwindow_next): Rename to Fwindow_next_sibling.
17938 (Fwindow_prev): Rename to Fwindow_prev_sibling.
17939 (resize_window_check): Rename to window_resize_check.
17940 (resize_window_apply): Rename to window_resize_apply.
17941 (Fresize_window_apply): Rename to Fwindow_resize_apply.
17942 (Fdelete_other_windows_internal, resize_frame_windows)
17943 (Fsplit_window_internal, Fdelete_window_internal)
17944 (grow_mini_window, shrink_mini_window)
17945 (Fresize_mini_window_internal): Fix callers accordingly.
17946
17947 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
17948
17949 * emacsgtkfixed.h: State that this is only used with Gtk+3.
17950 (emacs_fixed_set_min_size): Remove.
17951 (emacs_fixed_new): Take frame as argument.
17952
17953 * emacsgtkfixed.c: State that this is only used with Gtk+3.
17954 (_EmacsFixedPrivate): Remove minwidth/height.
17955 Add struct frame *f.
17956 (emacs_fixed_init): Initialize priv->f.
17957 (get_parent_class, emacs_fixed_set_min_size): Remove.
17958 (emacs_fixed_new): Set priv->f to argument.
17959 (emacs_fixed_get_preferred_width)
17960 (emacs_fixed_get_preferred_height): Use min_width/height from
17961 frames size_hint to set minimum and natural (Bug#8919).
17962 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
17963 and use min_width/height from frames size_hint to set
17964 min_width/height (Bug#8919).
17965
17966 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
17967 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
17968 Fix indentation.
17969
17970 2011-06-26 Eli Zaretskii <eliz@gnu.org>
17971
17972 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
17973 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
17974 called at ZV.
17975
17976 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
17977
17978 * process.c (wait_reading_process_output): Bypass select if
17979 waiting for a cell while ignoring keyboard input, and input is
17980 pending. Suggested by Jan Djärv (Bug#8869).
17981
17982 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
17983
17984 Use gnulib's dup2 module instead of rolling our own.
17985 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
17986
17987 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17988
17989 * dispnew.c (scrolling_window): Before scrolling, turn off a
17990 mouse-highlight in the window being scrolled.
17991
17992 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
17993
17994 Move DEFSYM to lisp.h and use everywhere.
17995
17996 * character.h (DEFSYM): Move declaration...
17997 * lisp.h (DEFSYM): ...here.
17998
17999 * gnutls.c:
18000 * minibuf.c:
18001 * w32menu.c:
18002 * w32proc.c:
18003 * w32select.c: Don't include character.h.
18004
18005 * alloc.c (syms_of_alloc):
18006 * buffer.c (syms_of_buffer):
18007 * bytecode.c (syms_of_bytecode):
18008 * callint.c (syms_of_callint):
18009 * casefiddle.c (syms_of_casefiddle):
18010 * casetab.c (init_casetab_once):
18011 * category.c (init_category_once, syms_of_category):
18012 * ccl.c (syms_of_ccl):
18013 * cmds.c (syms_of_cmds):
18014 * composite.c (syms_of_composite):
18015 * dbusbind.c (syms_of_dbusbind):
18016 * dired.c (syms_of_dired):
18017 * dispnew.c (syms_of_display):
18018 * doc.c (syms_of_doc):
18019 * editfns.c (syms_of_editfns):
18020 * emacs.c (syms_of_emacs):
18021 * eval.c (syms_of_eval):
18022 * fileio.c (syms_of_fileio):
18023 * fns.c (syms_of_fns):
18024 * frame.c (syms_of_frame):
18025 * fringe.c (syms_of_fringe):
18026 * insdel.c (syms_of_insdel):
18027 * keymap.c (syms_of_keymap):
18028 * lread.c (init_obarray, syms_of_lread):
18029 * macros.c (syms_of_macros):
18030 * msdos.c (syms_of_msdos):
18031 * print.c (syms_of_print):
18032 * process.c (syms_of_process):
18033 * search.c (syms_of_search):
18034 * sound.c (syms_of_sound):
18035 * syntax.c (init_syntax_once, syms_of_syntax):
18036 * terminal.c (syms_of_terminal):
18037 * textprop.c (syms_of_textprop):
18038 * undo.c (syms_of_undo):
18039 * w32.c (globals_of_w32):
18040 * window.c (syms_of_window):
18041 * xdisp.c (syms_of_xdisp):
18042 * xfaces.c (syms_of_xfaces):
18043 * xfns.c (syms_of_xfns):
18044 * xmenu.c (syms_of_xmenu):
18045 * xsettings.c (syms_of_xsettings):
18046 * xterm.c (syms_of_xterm): Use DEFSYM.
18047
18048 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18049
18050 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18051
18052 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18053
18054 Integer and buffer overflow fixes (Bug#8873).
18055
18056 * print.c (printchar, strout): Check for string overflow.
18057 (PRINTPREPARE, printchar, strout):
18058 Don't set size unless allocation succeeds.
18059
18060 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18061 for sizes. Check for string overflow more accurately.
18062 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18063
18064 * macros.c: Integer and buffer overflow fixes.
18065 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18066 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18067 Use ptrdiff_t, not int, for sizes.
18068 Don't increment bufsize until after realloc succeeds.
18069 Check for size-calculation overflow.
18070 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18071
18072 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18073
18074 * lread.c: Integer overflow fixes.
18075 (read_integer): Radix is now EMACS_INT, not int,
18076 to improve quality of diagnostics for out-of-range radices.
18077 Calculate buffer size correctly for out-of-range radices.
18078 (read1): Check for integer overflow in radices, and in
18079 read-circle numbers.
18080 (read_escape): Avoid int overflow.
18081 (Fload, openp, read_buffer_size, read1)
18082 (substitute_object_recurse, read_vector, read_list, map_obarray):
18083 Use ptrdiff_t, not int, for sizes.
18084 (read1): Use EMACS_INT, not int, for sizes.
18085 Check for size overflow.
18086
18087 * image.c (cache_image): Check for size arithmetic overflow.
18088
18089 * lread.c: Integer overflow issues.
18090 (saved_doc_string_size, saved_doc_string_length)
18091 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18092 Now ptrdiff_t, not int.
18093 (read1): Don't assume doc string length fits in int. Check for
18094 out-of-range doc string lengths.
18095 (read_list): Don't assume file position fits in int.
18096 (read_escape): Check for hex character overflow.
18097
18098 2011-06-22 Leo Liu <sdl.web@gmail.com>
18099
18100 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18101 Move to minibuffer.el.
18102
18103 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18104
18105 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18106 The following patches are for when GLYPH_DEBUG && !XASSERT.
18107 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18108 * dispnew.c (flush_stdout):
18109 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18110 Mark as externally visible.
18111 * dispnew.c (check_window_matrix_pointers): Now static.
18112 * dispnew.c (window_to_frame_vpos):
18113 * xfns.c (unwind_create_frame):
18114 * xterm.c (x_check_font): Remove unused local.
18115 * scroll.c (CHECK_BOUNDS):
18116 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18117 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18118 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18119 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18120 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18121 Now static.
18122 (debug_method_add): Use va_list and vsprintf rather than relying
18123 on undefined behavior with wrong number of arguments.
18124 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18125 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18126 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18127 since we're not interested in debugging glyphs with old libraries.
18128 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18129 GCC 4.6.0's static checking.
18130
18131 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18132
18133 Integer overflow and signedness fixes (Bug#8873).
18134 A few related buffer overrun fixes, too.
18135
18136 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18137
18138 * dispextern.h (struct face.stipple):
18139 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18140 (x_bitmap_mask, x_allocate_bitmap_record)
18141 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18142 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18143 (x_create_bitmap_from_xpm_data):
18144 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18145 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18146 (.bitmaps_last):
18147 * xfaces.c (load_pixmap):
18148 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18149 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18150 (.bitmaps_last, struct x_output.icon_bitmap):
18151 Use ptrdiff_t, not int, for bitmap indexes.
18152 (x_allocate_bitmap_record): Check for size overflow.
18153 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18154
18155 Use ptrdiff_t, not int, for overlay counts.
18156 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18157 * editfns.c (overlays_around, get_pos_property):
18158 * textprop.c (get_char_property_and_overlay):
18159 * xdisp.c (next_overlay_change, note_mouse_highlight):
18160 * xfaces.c (face_at_buffer_position):
18161 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18162 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18163 (Fnext_overlay_change, Fprevious_overlay_change)
18164 (mouse_face_overlay_overlaps, Foverlays_in):
18165 Use ptrdiff_t, not int, for sizes.
18166 (overlays_at, overlays_in): Check for size-calculation overflow.
18167
18168 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18169
18170 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18171 (x_session_initialize): Do not assume string length fits in int.
18172
18173 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18174 This is unlikely, but can occur if DPI is outlandish.
18175
18176 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
18177 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18178
18179 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18180 * xrdb.c (magic_file_p, search_magic_path):
18181 Omit last arg SUFFIX; it was always 0. All callers changed.
18182 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18183
18184 * xfont.c (xfont_match): Avoid need for strlen.
18185
18186 * xfns.c: Don't assume strlen fits in int.
18187 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18188
18189 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18190 not unsigned long, as we prefer signed integers. All callers changed.
18191 Detect integer overflow in repeat count.
18192 (message_dolog): Don't assume print length fits in 39 bytes.
18193 (display_mode_element): Don't assume strlen fits in int.
18194
18195 * termcap.c: Don't assume sizes fit in int and never overflow.
18196 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18197 (gobble_line): Check for size-calculation overflow.
18198
18199 * minibuf.c (Fread_buffer):
18200 * lread.c (intern, intern_c_string):
18201 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18202 Don't assume string length fits in int.
18203
18204 * keyboard.c (parse_tool_bar_item):
18205 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18206
18207 * font.c: Don't assume string length fits in int.
18208 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18209 Use ptrdiff_t, not int.
18210 (font_intern_prop): Don't assume string length fits in int.
18211 Don't assume integer property fits in fixnum.
18212 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18213
18214 * filelock.c: Fix some buffer overrun and integer overflow issues.
18215 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18216 Reformulate so as not to need the command string.
18217 Invoke gzip -cd rather than gunzip, as it's more portable.
18218 (lock_info_type, lock_file_1, lock_file):
18219 Don't assume pid_t and time_t fit in unsigned long.
18220 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18221 (current_lock_owner): Prefer signed type for sizes.
18222 Use memcpy, not strncpy, where memcpy is what is really wanted.
18223 Don't assume (via atoi) that time_t and pid_t fit in int.
18224 Check for time_t and/or pid_t out of range, e.g., via a network share.
18225 Don't alloca where an auto var works fine.
18226
18227 * fileio.c: Fix some integer overflow issues.
18228 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18229 Don't assume string length fits in int.
18230 (directory_file_name): Don't assume string length fits in long.
18231 (make_temp_name): Don't assume pid fits in int, or that its print
18232 length is less than 20.
18233
18234 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18235
18236 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18237
18238 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18239
18240 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18241 We prefer signed integers, even for size calculations.
18242
18243 * emacs.c: Don't assume string length fits in 'int'.
18244 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18245 (main): Don't invoke strlen when not needed.
18246
18247 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18248 (XD_DEBUG_MESSAGE): Don't waste a byte.
18249
18250 * callproc.c (getenv_internal_1, getenv_internal)
18251 (Fgetenv_internal):
18252 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18253
18254 * lread.c (invalid_syntax): Omit length argument.
18255 All uses changed. This doesn't fix a bug, but it simplifies the
18256 code away from its former Hollerith-constant appearance, and it's
18257 one less 'int' to worry about when looking at integer-overflow issues.
18258 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18259
18260 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18261 This didn't break anything, but it didn't help either.
18262 It's confusing to put a bogus integer in a place where the actual
18263 value does not matter.
18264 (LIST_END_P): Remove unused macro and its bogus comment.
18265 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18266
18267 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18268 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18269 implementation.
18270 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18271 We prefer signed types, and the value cannot exceed the EMACS_INT
18272 range anyway (because otherwise the length would not be representable).
18273 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18274 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18275 This avoids a GCC warning when WIDE_EMACS_INT.
18276
18277 * indent.c (sane_tab_width): New function.
18278 (current_column, scan_for_column, Findent_to, position_indentation)
18279 (compute_motion): Use it. This is just for clarity.
18280 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
18281
18282 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
18283
18284 * lisp.h (lint_assume): New macro.
18285 * composite.c (composition_gstring_put_cache):
18286 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18287
18288 * editfns.c, insdel.c:
18289 Omit unnecessary forward decls, to simplify future changes.
18290
18291 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18292
18293 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18294
18295 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
18296 Use much-faster test for byte-length change.
18297 Don't assume string byte-length fits in 'int'.
18298 Check that character arg fits in 'int'.
18299 (mapcar1): Declare byte as byte, for clarity.
18300
18301 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18302
18303 * fns.c (concat): Catch string overflow earlier.
18304 Do not rely on integer wraparound.
18305
18306 * dispextern.h (struct it.overlay_strings_charpos)
18307 (struct it.selective): Now EMACS_INT, not int.
18308 * xdisp.c (forward_to_next_line_start)
18309 (back_to_previous_visible_line_start)
18310 (reseat_at_next_visible_line_start, next_element_from_buffer):
18311 Don't arbitrarily truncate the value of 'selective' to int.
18312
18313 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18314
18315 * composite.c: Don't truncate sizes to 'int'.
18316 (composition_gstring_p, composition_reseat_it)
18317 (composition_adjust_point): Use EMACS_INT, not int.
18318 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18319 not EMACS_UINT, for indexes.
18320
18321 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18322
18323 * buffer.c: Include <verify.h>.
18324 (struct sortvec.priority, struct sortstr.priority):
18325 Now EMACS_INT, not int.
18326 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
18327 (struct sortstr.size, record_overlay_string)
18328 (struct sortstrlist.size, struct sortlist.used):
18329 Don't truncate size to int.
18330 (record_overlay_string): Check for size-calculation overflow.
18331 (init_buffer_once): Check at compile-time, not run-time.
18332
18333 2011-06-22 Jim Meyering <meyering@redhat.com>
18334
18335 Don't leak an XBM-image-sized buffer
18336 * image.c (xbm_load): Free the image buffer after using it.
18337
18338 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18339
18340 Port to Sun C.
18341 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18342 that Sun C diagnosed.
18343 * fns.c (secure_hash): Fix pointer signedness issue.
18344 * intervals.c (static_offset_intervals): New function.
18345 (offset_intervals): Use it.
18346
18347 2011-06-21 Leo Liu <sdl.web@gmail.com>
18348
18349 * deps.mk (fns.o):
18350 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18351 sha512.h.
18352
18353 * fns.c (secure_hash): Rename from crypto_hash_function and change
18354 the first arg to accept symbols.
18355 (Fsecure_hash): New primitive.
18356 (syms_of_fns): New symbols.
18357
18358 2011-06-20 Deniz Dogan <deniz@dogan.se>
18359
18360 * process.c (Fset_process_buffer): Clarify return value in
18361 docstring.
18362
18363 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
18364
18365 * dispnew.c (add_window_display_history): Use BVAR.
18366
18367 * xdisp.c (debug_method_add): Use BVAR.
18368 (check_window_end, dump_glyph_matrix, dump_glyph)
18369 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18370
18371 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18372 Likewise.
18373
18374 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18375 check till after the cache is created in init_frame_faces.
18376
18377 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18378
18379 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18380
18381 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18382
18383 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18384 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18385 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18386
18387 Improve buffer-overflow checking (Bug#8873).
18388 * fileio.c (Finsert_file_contents):
18389 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18390 Remove the old (too-loose) buffer overflow checks.
18391 They weren't needed, since make_gap checks for buffer overflow.
18392 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18393 The old code merely checked for Emacs fixnum overflow, and relied
18394 on undefined (wraparound) behavior. The new code avoids undefined
18395 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18396
18397 * editfns.c (Finsert_char): Don't dump core with very negative counts.
18398 Tune. Don't use wider integers than needed. Don't use alloca.
18399 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
18400
18401 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18402
18403 * insdel.c, lisp.h (buffer_overflow): New function.
18404 (insert_from_buffer_1, replace_range, replace_range_2):
18405 * insdel.c (make_gap_larger):
18406 * editfns.c (Finsert_char):
18407 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18408
18409 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18410
18411 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18412
18413 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
18414
18415 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18416 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18417
18418 * fileio.c: Don't assume EMACS_INT fits in off_t.
18419 (emacs_lseek): New static function.
18420 (Finsert_file_contents, Fwrite_region): Use it.
18421 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18422
18423 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18424
18425 * fns.c: Don't overflow int when computing a list length.
18426 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18427 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18428 truncation on 64-bit hosts. Check for QUIT every
18429 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18430 faster and is responsive enough.
18431 (Flength): Report an error instead of overflowing an integer.
18432 (Fsafe_length): Return a float if the value is not representable
18433 as a fixnum. This shouldn't happen except in contrived situations.
18434 (Fnthcdr, Fsort): Don't assume list length fits in int.
18435 (Fcopy_sequence): Don't assume vector length fits in int.
18436
18437 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18438 (header_size, word_size): New constants.
18439 (allocate_vectorlike): Don't check size overflow here.
18440 (allocate_vector): Check it here instead, since this is the only
18441 caller of allocate_vectorlike that could cause overflow.
18442 Check that the new vector's length is representable as a fixnum.
18443
18444 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18445 The previous code was bogus. For example, next_almost_prime (32)
18446 returned 39, which is undesirable as it is a multiple of 3; and
18447 next_almost_prime (24) returned 25, which is a multiple of 5 so
18448 why was the code bothering to check for multiples of 7?
18449
18450 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18451
18452 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18453
18454 Variadic C functions now count arguments with ptrdiff_t.
18455 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18456 Back then I didn't know that the Emacs coding style prefers signed int.
18457 Also, in the meantime I found a few more instances where arguments
18458 were being counted with int, which may truncate counts on 64-bit
18459 machines, or EMACS_INT, which may be unnecessarily wide.
18460 * lisp.h (struct Lisp_Subr.function.aMANY)
18461 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18462 Arg counts are now ptrdiff_t, not size_t.
18463 All variadic functions and their callers changed accordingly.
18464 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18465 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18466 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18467 * callint.c (Fcall_interactively): Check arg count for overflow,
18468 to avoid potential buffer overrun. Use signed char, not 'int',
18469 for 'varies' array, so that we needn't bother to check its size
18470 calculation for overflow.
18471 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18472 * eval.c (apply_lambda):
18473 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18474 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18475 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18476
18477 * callint.c (Fcall_interactively): Don't use index var as event count.
18478
18479 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18480 * mem-limits.h (SIZE): Remove; no longer used.
18481
18482 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
18483
18484 Remove unnecessary casts.
18485 * xterm.c (x_term_init):
18486 * xfns.c (x_set_border_pixel):
18487 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18488 These aren't needed now that we assume ANSI C.
18489
18490 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18491 It's more likely to cause problems (due to unsigned overflow)
18492 than to cure them.
18493
18494 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18495
18496 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18497
18498 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18499
18500 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18501
18502 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18503
18504 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18505
18506 GLYPH_CODE_FACE returns EMACS_INT, not int.
18507 * dispextern.h (merge_faces):
18508 * xfaces.c (merge_faces):
18509 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18510 Don't assume EMACS_INT fits in int.
18511
18512 * character.h (CHAR_VALID_P): Remove unused parameter.
18513 * fontset.c, lisp.h, xdisp.c: All uses changed.
18514
18515 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18516
18517 * fns.c (concat): Minor tuning based on overflow analysis.
18518 This doesn't fix any bugs. Use int to hold character, instead
18519 of constantly refetching from Emacs object. Use XFASTINT, not
18520 XINT, for value known to be a character. Don't bother comparing
18521 a single byte to 0400, as it's always less.
18522
18523 * floatfns.c (Fexpt):
18524 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18525
18526 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18527 for characters.
18528
18529 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18530
18531 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18532 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18533 incorrectly succeed when S was a string, because 4294967386 was
18534 truncated before it was used.
18535
18536 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18537 Otherwise, an out-of-range integer could cause undefined behavior
18538 on a 64-bit host.
18539
18540 * composite.c: Use int, not EMACS_INT, for characters.
18541 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18542 EMACS_INT, for values that are known to be in character range.
18543 This doesn't fix any bugs but is the usual style inside Emacs and
18544 may generate better code on 32-bit machines.
18545
18546 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18547 This is for reasons similar to the recent CHAR_STRING fix.
18548 * charset.c (Fencode_char): Check that character arg is actually
18549 a character. Pass an int to ENCODE_CHAR.
18550 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18551 wider than 'int', as a compile-time check to prevent future regressions
18552 in this area.
18553
18554 * character.c (char_string): Remove unnecessary casts.
18555
18556 Make sure a 64-bit char is never passed to CHAR_STRING.
18557 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18558 by silently ignoring the top 32 bits, allowing some values
18559 that were far too large to be valid characters.
18560 * character.h: Include <verify.h>.
18561 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18562 arguments are no wider than unsigned, as a compile-time check
18563 to prevent future regressions in this area.
18564 * data.c (Faset):
18565 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
18566 (Fsubst_char_in_region):
18567 * fns.c (concat):
18568 * xdisp.c (decode_mode_spec_coding):
18569 Adjust to CHAR_STRING's new requirement.
18570 * editfns.c (Finsert_char, Fsubst_char_in_region):
18571 * fns.c (concat): Check that character args are actually
18572 characters. Without this test, these functions did the wrong
18573 thing with wildly out-of-range values on 64-bit hosts.
18574
18575 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18576 These casts should not be needed on 32-bit hosts, either.
18577 * keyboard.c (read_char):
18578 * lread.c (Fload): Remove casts to unsigned.
18579
18580 * lisp.h (UNSIGNED_CMP): New macro.
18581 This fixes comparison bugs on 64-bit hosts.
18582 (ASCII_CHAR_P): Use it.
18583 * casefiddle.c (casify_object):
18584 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
18585 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18586 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18587 * dispextern.h (FACE_FROM_ID):
18588 * keyboard.c (read_char): Use UNSIGNED_CMP.
18589
18590 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18591 not to EMACS_INT, to avoid GCC warning.
18592
18593 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18594
18595 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18596 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18597 isn't needed on 32-bit machines.
18598
18599 * buffer.c (Fgenerate_new_buffer_name):
18600 Use EMACS_INT for count, not int.
18601 (advance_to_char_boundary): Return EMACS_INT, not int.
18602
18603 * data.c (Qcompiled_function): Now static.
18604
18605 * window.c (window_body_lines): Now static.
18606
18607 * image.c (gif_load): Rename local to avoid shadowing.
18608
18609 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18610 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18611 * alloc.c (make_save_value): Integer argument is now of type
18612 ptrdiff_t, not int.
18613 (mark_object): Use ptrdiff_t, not int.
18614 * lisp.h (pD): New macro.
18615 * print.c (print_object): Use it.
18616
18617 * alloc.c: Use EMACS_INT, not int, to count objects.
18618 (total_conses, total_markers, total_symbols, total_vector_size)
18619 (total_free_conses, total_free_markers, total_free_symbols)
18620 (total_free_floats, total_floats, total_free_intervals)
18621 (total_intervals, total_strings, total_free_strings):
18622 Now EMACS_INT, not int. All uses changed.
18623 (Fgarbage_collect): Compute overall total using a double, so that
18624 integer overflow is less likely to be a problem. Check for overflow
18625 when converting back to an integer.
18626 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18627 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18628 These were 'int' variables that could overflow on 64-bit hosts;
18629 they were never used, so remove them instead of repairing them.
18630 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
18631 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18632 Previously, this ceilinged at INT_MAX, but that doesn't work on
18633 64-bit machines.
18634 (allocate_pseudovector): Don't use EMACS_INT when int would do.
18635
18636 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
18637 (allocate_vectorlike): Check for ptrdiff_t overflow.
18638 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18639 when a (possibly-narrower) signed value would do just as well.
18640 We prefer using signed arithmetic, to avoid comparison confusion.
18641
18642 * alloc.c: Catch some string size overflows that we were missing.
18643 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18644 for convenience in STRING_BYTES_MAX.
18645 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18646 The definition here is exact; the one in lisp.h was approximate.
18647 (allocate_string_data): Check for string overflow. This catches
18648 some instances we weren't catching before. Also, it catches
18649 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18650 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18651 and ptrdiff_t and EMACS_INT are both 64 bits.
18652
18653 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18654 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
18655 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
18656
18657 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18658
18659 * alloc.c (Fmake_string): Check for out-of-range init.
18660
18661 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18662
18663 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18664
18665 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18666
18667 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18668 xg_get_default_scrollbar_width.
18669
18670 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18671 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18672 (style_changed_cb): Call update_theme_scrollbar_width and call
18673 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18674 all frames (Bug#8505).
18675 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18676 Call gtk_window_set_resizable if HAVE_GTK3.
18677 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18678 and height if HAVE_GTK3 (Bug#8505).
18679 (scroll_bar_width_for_theme): New variable.
18680 (update_theme_scrollbar_width): New function.
18681 (xg_get_default_scrollbar_width): Move code to
18682 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18683 (xg_initialize): Call update_theme_scrollbar_width.
18684
18685 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18686
18687 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18688
18689 2011-06-12 Martin Rudalics <rudalics@gmx.at>
18690
18691 * frame.c (make_frame): Call other_buffer_safely instead of
18692 other_buffer.
18693
18694 * window.c (temp_output_buffer_show): Call display_buffer with
18695 second argument Vtemp_buffer_show_specifiers and reset latter
18696 immediately after the call.
18697 (Vtemp_buffer_show_specifiers): New variable.
18698 (auto_window_vscroll_p, next_screen_context_lines)
18699 (Vscroll_preserve_screen_position): Remove leading asterisks from
18700 doc-strings.
18701
18702 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
18703
18704 Fix minor problems found by GCC 4.6.0 static checking.
18705 * buffer.c (Qclone_number): Remove for now, as it's unused.
18706 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18707 (record_buffer): Remove unused local.
18708 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18709 (set_frame_buffer_list): Remove; unused.
18710 * frame.h (other_visible_frames): Remove decl.
18711 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18712 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18713 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18714 if HAVE_GPM.
18715 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18716 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18717 Define only if HAVE_GPM.
18718 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18719 (update_hints_inhibit): Remove; never set. All uses removed.
18720 * widgetprv.h (emacsFrameClassRec): Remove decl.
18721 * window.c (delete_deletable_window): Now returns void, since it
18722 wasn't returning anything.
18723 (compare_window_configurations): Remove unused locals.
18724 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18725 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
18726 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18727 the same widths as pointers. This follows up on the 2011-05-06 patch.
18728 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18729 * xterm.h: Likewise.
18730 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18731
18732 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
18733
18734 * makefile.w32-in: Update dependencies.
18735 (LISP_H): Add lib/intprops.h.
18736
18737 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18738
18739 * image.c (gif_load): Add animation frame delay to the metadata.
18740 (syms_of_image): Use DEFSYM. New symbol `delay'.
18741
18742 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18743
18744 * window.c (delete_deletable_window): Re-add.
18745 (Fset_window_configuration): Rewrite to handle dead buffers and
18746 consequently deletable windows.
18747 (window_tree, Fwindow_tree): Remove. Supply functionality in
18748 window.el.
18749 (compare_window_configurations): Simplify code.
18750
18751 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18752
18753 * image.c (imagemagick_load_image): Fix type mismatch.
18754 (Fimagemagick_types): Likewise.
18755
18756 * window.h (replace_buffer_in_windows): Declare.
18757
18758 2011-06-11 Martin Rudalics <rudalics@gmx.at>
18759
18760 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18761 Qclone_number. Remove external declaration of Qdelete_window.
18762 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18763 code.
18764 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18765 Run Qbuffer_list_update_hook if allowed.
18766 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18767 buffer list implementation.
18768 (other_buffer_safely): New function.
18769 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18770 calls to replace_buffer_in_windows and
18771 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18772 if allowed.
18773 (record_buffer): Inhibit quitting and rewrite using quittable
18774 functions. Run Qbuffer_list_update_hook if allowed.
18775 (Frecord_buffer, Funrecord_buffer): New functions.
18776 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18777 Move switch-to-buffer to window.el.
18778 (bury-buffer): Move to window.el.
18779 (Vbuffer_list_update_hook): New variable.
18780
18781 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18782 section.
18783
18784 * window.h (resize_frame_windows): Move up in code.
18785 (Fwindow_frame): Remove EXFUN.
18786 (replace_buffer_in_all_windows): Remove prototype.
18787 (replace_buffer_in_windows_safely): Add prototype.
18788
18789 * window.c: Declare Qdelete_window static again. Move down
18790 declaration of select_count.
18791 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18792 (Fother_window): Move to window.el.
18793 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18794 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18795 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18796 window.el.
18797 (replace_buffer_in_windows): Implement by calling
18798 Qreplace_buffer_in_windows.
18799 (replace_buffer_in_all_windows): Remove with some functionality
18800 moved into replace_buffer_in_windows_safely.
18801 (replace_buffer_in_windows_safely): New function.
18802 (select_window_norecord, select_frame_norecord): Move in front
18803 of run_window_configuration_change_hook. Remove now obsolete
18804 declarations.
18805 (Fset_window_buffer): Rewrite doc-string.
18806 Call Qrecord_window_buffer.
18807 (keys_of_window): Move binding for other-window to window.el.
18808
18809 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
18810
18811 * dispextern.h (struct image): Replace data member, whose int_val
18812 and ptr_val fields were not used by anything, with a single
18813 lisp_val object.
18814
18815 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18816 (gif_clear_image, gif_load, imagemagick_load_image)
18817 (gs_clear_image, gs_load): Callers changed.
18818
18819 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
18820
18821 * buffer.h: Include <time.h>, for time_t.
18822 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
18823
18824 Fix minor problems found by static checking.
18825
18826 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18827
18828 Make identifiers static if they are not used in other modules.
18829 * data.c (Qcompiled_function, Qframe, Qvector):
18830 * image.c (QimageMagick, Qsvg):
18831 * minibuf.c (Qmetadata):
18832 * window.c (resize_window_check, resize_root_window): Now static.
18833 * window.h (resize_window_check, resize_root_window): Remove decls.
18834
18835 * window.c (window_deletion_count, delete_deletable_window):
18836 Remove; unused.
18837 (window_body_lines): Now static.
18838 (Fdelete_other_windows_internal): Mark vars as initialized.
18839 Make sure 'resize_failed' is initialized.
18840 (run_window_configuration_change_hook): Rename local to avoid shadowing.
18841 (resize_window_apply): Remove unused local.
18842 * window.h (delete_deletable_window): Remove decl.
18843
18844 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
18845 (imagemagick_load_image): Fix pointer signedness problem by changing
18846 last arg from unsigned char * to char *. All uses changed.
18847 Also, fix a local for similar reasons.
18848 Remove unused locals. Remove locals to avoid shadowing.
18849 (fn_rsvg_handle_free): Remove; unused.
18850 (svg_load, svg_load_image): Fix pointer signedness problem.
18851 (imagemagick_load_image): Don't use garbage pointer image_wand.
18852
18853 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18854
18855 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
18856
18857 * image.c (gif_load): Fix omitted cast error introduced by
18858 2011-06-06 change.
18859
18860 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18861
18862 * window.h (resize_proportionally, orig_total_lines)
18863 (orig_top_line): Remove from window structure.
18864 (set_window_height, set_window_width, change_window_heights)
18865 (Fdelete_window): Remove prototypes.
18866 (resize_frame_windows): Remove duplicate declaration.
18867
18868 2011-06-10 Eli Zaretskii <eliz@gnu.org>
18869
18870 * window.h (resize_frame_windows, resize_window_check)
18871 (delete_deletable_window, resize_root_window)
18872 (resize_frame_windows): Declare prototypes.
18873
18874 * window.c (resize_window_apply): Make definition be "static" to
18875 match the prototype.
18876
18877 2011-06-10 Martin Rudalics <rudalics@gmx.at>
18878
18879 * window.c: Remove declarations of Qwindow_size_fixed,
18880 window_min_size_1, window_min_size_2, window_min_size,
18881 size_window, window_fixed_size_p, enlarge_window, delete_window.
18882 Remove static from declaration of Qdelete_window, it's
18883 temporarily needed by Fbury_buffer.
18884 (replace_window): Don't assign orig_top_line and
18885 orig_total_lines.
18886 (Fdelete_window, delete_window): Remove. Window deletion is
18887 handled by window.el.
18888 (window_loop): Remove DELETE_OTHER_WINDOWS case.
18889 Replace Fdelete_window calls with calls to Qdelete_window.
18890 (Fdelete_other_windows): Remove. Deleting other windows is
18891 handled by window.el.
18892 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
18893 handled in window.el.
18894 (window_min_size_2, window_min_size_1, window_min_size): Remove.
18895 Window minimum sizes are handled in window.el.
18896 (shrink_windows, size_window, set_window_height)
18897 (set_window_width, change_window_heights, window_height)
18898 (window_width, CURBEG, CURSIZE, enlarge_window)
18899 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18900 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
18901 handled in window.el.
18902 (make_dummy_parent): Rename to make_parent_window and give it a
18903 second argument horflag.
18904 (make_window): Don't set resize_proportionally any more.
18905 (Fsplit_window): Remove. Windows are split in window.el.
18906 (save_restore_action, save_restore_orig_size)
18907 (shrink_window_lowest_first, save_restore_orig_size): Remove.
18908 Resize mini windows in window.el.
18909 (grow_mini_window, shrink_mini_window): Implement by calling
18910 Qresize_root_window_vertically, resize_window_check and
18911 resize_window_apply.
18912 (saved_window, Fset_window_configuration, save_window_save):
18913 Do not handle orig_top_line, orig_total_lines, and
18914 resize_proportionally.
18915 (window_min_height, window_min_width): Move to window.el.
18916 (keys_of_window): Move bindings for delete-other-windows,
18917 split-window, delete-window and enlarge-window to window.el.
18918
18919 * buffer.c: Temporarily extern Qdelete_window.
18920 (Fbury_buffer): Temporarily call Qdelete_window instead of
18921 Fdelete_window (Fbury_buffer will move to window.el soon).
18922
18923 * frame.c (set_menu_bar_lines_1): Remove code handling
18924 orig_top_line and orig_total_lines.
18925
18926 * dispnew.c (adjust_frame_glyphs_initially): Don't use
18927 set_window_height but set heights directly.
18928 (change_frame_size_1): Use resize_frame_windows.
18929
18930 * xdisp.c (init_xdisp): Don't use set_window_height but set
18931 heights directly.
18932
18933 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18934 Use resize_frame_windows instead of change_window_heights and run
18935 run_window_configuration_change_hook.
18936
18937 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
18938 instead of change_window_heights and run
18939 run_window_configuration_change_hook.
18940
18941 2011-06-09 Martin Rudalics <rudalics@gmx.at>
18942
18943 * window.c (replace_window): Rename second argument REPLACEMENT to
18944 NEW. New third argument SETFLAG. Rewrite.
18945 (delete_window, make_dummy_parent): Call replace_window with
18946 third argument 1.
18947 (window_list_1): Move down in code.
18948 (run_window_configuration_change_hook): Move set_buffer part
18949 before select_frame_norecord part in order to unwind correctly.
18950 Rename count1 to count.
18951 (recombine_windows, delete_deletable_window, resize_root_window)
18952 (Fdelete_other_windows_internal)
18953 (Frun_window_configuration_change_hook, make_parent_window)
18954 (resize_window_check, resize_window_apply, Fresize_window_apply)
18955 (resize_frame_windows, Fsplit_window_internal)
18956 (Fdelete_window_internal, Fresize_mini_window_internal):
18957 New functions.
18958 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
18959
18960 2011-06-08 Martin Rudalics <rudalics@gmx.at>
18961
18962 * window.h (window): Add some new members to window structure -
18963 normal_lines, normal_cols, new_total, new_normal, clone_number,
18964 splits, nest, prev_buffers, next_buffers.
18965 (WINDOW_TOTAL_SIZE): Move here from window.c.
18966 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
18967
18968 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
18969 Remove.
18970 (make_dummy_parent): Set new members of windows structure.
18971 (make_window): Move down in code. Handle new members of window
18972 structure.
18973 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
18974 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
18975 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
18976 (Fset_window_prev_buffers, Fwindow_next_buffers)
18977 (Fset_window_next_buffers, Fset_window_clone_number):
18978 New functions.
18979 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
18980 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
18981 Doc-string fixes.
18982 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
18983 Argument WINDOW can be now internal window too.
18984 (Fwindow_use_time): Move up in code.
18985 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
18986 Rewrite doc-string.
18987 (Fset_window_configuration, saved_window)
18988 (Fcurrent_window_configuration, save_window_save): Handle new
18989 members of window structure.
18990 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
18991 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
18992 (syms_of_window): New Lisp objects Qrecord_window_buffer,
18993 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
18994 Qget_mru_window, Qresize_root_window,
18995 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
18996 Qauto_buffer_name; staticpro them.
18997
18998 2011-06-07 Martin Rudalics <rudalics@gmx.at>
18999
19000 * window.c (Fwindow_total_size, Fwindow_left_column)
19001 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19002 (Fwindow_list_1): New functions.
19003 (window_box_text_cols): Replace with window_body_cols.
19004 (Fwindow_width, Fscroll_left, Fscroll_right):
19005 Use window_body_cols instead of window_box_text_cols.
19006 (delete_window, Fset_window_configuration):
19007 Call delete_all_subwindows with window as argument.
19008 (delete_all_subwindows): Take a window as argument and not a
19009 structure. Rewrite.
19010 (window_loop): Remove handling of GET_LRU_WINDOW and
19011 GET_LARGEST_WINDOW.
19012 (Fget_lru_window, Fget_largest_window): Move to window.el.
19013
19014 * window.h: Extern window_body_cols instead of
19015 window_box_text_cols. delete_all_subwindows now takes a
19016 Lisp_Object as argument.
19017
19018 * indent.c (compute_motion, Fcompute_motion):
19019 Use window_body_cols instead of window_box_text_cols.
19020
19021 * frame.c (delete_frame): Call delete_all_subwindows with root
19022 window as argument.
19023
19024 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19025
19026 * fns.c (Fputhash): Document return value.
19027
19028 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
19029
19030 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19031
19032 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19033
19034 Cons<->int and similar integer overflow fixes (Bug#8794).
19035
19036 Check for overflow when converting integer to cons and back.
19037 * charset.c (Fdefine_charset_internal, Fdecode_char):
19038 Use cons_to_unsigned to catch overflow.
19039 (Fencode_char): Use INTEGER_TO_CONS.
19040 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19041 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19042 * data.c (long_to_cons, cons_to_long): Remove.
19043 (cons_to_unsigned, cons_to_signed): New functions.
19044 These signal an error for invalid or out-of-range values.
19045 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19046 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19047 * font.c (Ffont_variation_glyphs):
19048 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19049 * lisp.h: Include <intprops.h>.
19050 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19051 (cons_to_signed, cons_to_unsigned): New decls.
19052 (long_to_cons, cons_to_long): Remove decls.
19053 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19054 (Fprimitive_undo): Use CONS_TO_INTEGER.
19055 * xfns.c (Fx_window_property): Likewise.
19056 * xselect.c: Include <limits.h>.
19057 (x_own_selection, selection_data_to_lisp_data):
19058 Use INTEGER_TO_CONS.
19059 (x_handle_selection_request, x_handle_selection_clear)
19060 (x_get_foreign_selection, Fx_disown_selection_internal)
19061 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19062 (lisp_data_to_selection_data): Use cons_to_unsigned.
19063 (x_fill_property_data): Use cons_to_signed.
19064 Report values out of range.
19065
19066 Check for buffer and string overflow more precisely.
19067 * buffer.h (BUF_BYTES_MAX): New macro.
19068 * lisp.h (STRING_BYTES_MAX): New macro.
19069 * alloc.c (Fmake_string):
19070 * character.c (string_escape_byte8):
19071 * coding.c (coding_alloc_by_realloc):
19072 * doprnt.c (doprnt):
19073 * editfns.c (Fformat):
19074 * eval.c (verror):
19075 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19076 since they may not be the same number.
19077 * editfns.c (Finsert_char):
19078 * fileio.c (Finsert_file_contents):
19079 Likewise for BUF_BYTES_MAX.
19080
19081 * image.c: Use ptrdiff_t, not int, for sizes.
19082 (slurp_file): Switch from int to ptrdiff_t.
19083 All uses changed.
19084 (slurp_file): Check that file size fits in both size_t (for
19085 malloc) and ptrdiff_t (for sanity and safety).
19086
19087 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19088 if b->modtime has its maximal value.
19089
19090 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19091
19092 Don't assume time_t can fit into int.
19093 * buffer.h (struct buffer.modtime): Now time_t, not int.
19094 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19095 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19096
19097 Minor fixes for signed vs unsigned integers.
19098 * character.h (MAYBE_UNIFY_CHAR):
19099 * charset.c (maybe_unify_char):
19100 * keyboard.c (read_char, reorder_modifiers):
19101 XINT -> XFASTINT, since the integer must be nonnegative.
19102 * ftfont.c (ftfont_spec_pattern):
19103 * keymap.c (access_keymap, silly_event_symbol_error):
19104 XUINT -> XFASTINT, since the integer must be nonnegative.
19105 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19106 since it makes no difference and we prefer signed.
19107 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19108 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19109 nonnegative.
19110
19111 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19112
19113 * window.h (Fwindow_frame): Declare.
19114
19115 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19116
19117 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19118 (SPARE_MEMORY): Always define.
19119 (LARGE_REQUEST): Remove.
19120 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19121
19122 2011-06-06 Martin Rudalics <rudalics@gmx.at>
19123
19124 * lisp.h: Move EXFUNS for Fframe_root_window,
19125 Fframe_first_window and Fset_frame_selected_window to window.h.
19126
19127 * window.h: Move EXFUNS for Fframe_root_window,
19128 Fframe_first_window and Fset_frame_selected_window here from
19129 lisp.h.
19130
19131 * frame.c (Fwindow_frame, Fframe_first_window)
19132 (Fframe_root_window, Fframe_selected_window)
19133 (Fset_frame_selected_window): Move to window.c.
19134 (Factive_minibuffer_window): Move to minibuf.c.
19135 (Fother_visible_frames_p): New function.
19136
19137 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19138
19139 * window.c (decode_window, decode_any_window): Move up in code.
19140 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19141 (inhibit_frame_unsplittable): Remove unused variable.
19142 (Fwindow_buffer): Move up and rewrite doc-string.
19143 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19144 (Fwindow_prev): New functions.
19145 (Fwindow_frame): Move here from frame.c. Accept any window as
19146 argument.
19147 (Fframe_root_window, Fframe_first_window)
19148 (Fframe_selected_window): Move here from frame.c. Accept frame
19149 or arbitrary window as argument. Update doc-strings.
19150 (Fminibuffer_window): Move up in code.
19151 (Fwindow_minibuffer_p): Move up in code and simplify.
19152 (Fset_frame_selected_window): Move here from frame.c.
19153 Marginal rewrite.
19154 (Fselected_window, select_window, Fselect_window): Move up in
19155 code. Minor doc-string fixes.
19156
19157 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19158
19159 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19160 Do not assume that spare memory exists; that assumption is valid
19161 only if SYSTEM_MALLOC.
19162 (LARGE_REQUEST): New macro, so that the issue of large requests
19163 is separated from the issue of spare memory.
19164
19165 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19166
19167 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19168 format. (Bug#8806)
19169
19170 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19171
19172 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19173 before statements.
19174
19175 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19176
19177 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19178
19179 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19180
19181 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19182 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19183
19184 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
19185
19186 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19187
19188 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
19189
19190 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19191 (x_clipboard_manager_save): Add return value.
19192 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19193 New error handlers.
19194 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19195 Obey Vx_select_enable_clipboard_manager. Catch errors in
19196 x_clipboard_manager_save (Bug#8779).
19197 (Vx_select_enable_clipboard_manager): New variable.
19198 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19199
19200 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
19201
19202 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19203
19204 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19205
19206 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19207 in the current matrix if keep_current_p is non-zero.
19208
19209 2011-06-04 Eli Zaretskii <eliz@gnu.org>
19210
19211 * bidi.c (bidi_level_of_next_char): Fix last change.
19212
19213 2011-06-03 Eli Zaretskii <eliz@gnu.org>
19214
19215 Support bidi reordering of text covered by display properties.
19216
19217 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19218 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19219 (bidi_cache_search, bidi_cache_iterator_state)
19220 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19221 (bidi_level_of_next_char, bidi_move_to_visually_next):
19222 Support character positions inside a run of characters covered by a
19223 display string.
19224 (bidi_paragraph_init, bidi_resolve_explicit_1)
19225 (bidi_level_of_next_char): Call bidi_fetch_char and
19226 bidi_fetch_char_advance instead of FETCH_CHAR and
19227 FETCH_CHAR_ADVANCE.
19228 (bidi_init_it): Initialize new members.
19229 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19230 definitions.
19231 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19232 instead of using explicit *_CHAR codes.
19233 (bidi_resolve_explicit, bidi_resolve_weak):
19234 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19235 bidirectional text is supported only in multibyte buffers.
19236 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19237 it to initialize the frame_window_p member of struct bidi_it.
19238 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19239 (bidi_resolve_explicit, bidi_resolve_weak)
19240 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19241 bidi_it->nchars is non-positive.
19242 (bidi_level_of_next_char): Don't try to lookup the cache for the
19243 next/previous character if nothing is cached there yet, or if we
19244 were just reseat()'ed to a new position.
19245
19246 * xdisp.c (set_cursor_from_row): Set start and stop points
19247 according to the row's direction when priming the loop that looks
19248 for the glyph on which to display cursor.
19249 (single_display_spec_intangible_p): Function deleted.
19250 (display_prop_intangible_p): Reimplement to call
19251 handle_display_spec instead of single_display_spec_intangible_p.
19252 Accept 3 additional arguments needed by handle_display_spec.
19253 This fixes incorrect cursor motion across display property with complex
19254 values: lists, `(when COND...)' forms, etc.
19255 (single_display_spec_string_p): Support property values that are
19256 lists with the argument STRING its top-level element.
19257 (display_prop_string_p): Fix the condition for processing a
19258 property that is a list to be consistent with handle_display_spec.
19259 (handle_display_spec): New function, refactored from the
19260 last portion of handle_display_prop.
19261 (compute_display_string_pos): Accept additional argument
19262 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19263 value of a `display' property is a "replacing spec".
19264 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19265 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19266 the display property, but just return a value indicating whether
19267 the display property will replace the characters it covers.
19268 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19269 frame_window_p members of struct bidi_it.
19270 (compute_display_string_pos, compute_display_string_end):
19271 New functions.
19272 (push_it): Accept second argument POSITION, where pop_it should
19273 jump to continue iteration.
19274 (reseat_1): Initialize bidi_it.disp_pos.
19275
19276 * keyboard.c (adjust_point_for_property): Adjust the call to
19277 display_prop_intangible_p to its new signature.
19278
19279 * dispextern.h (struct bidi_it): New member frame_window_p.
19280 (bidi_init_it): Update prototypes.
19281 (display_prop_intangible_p): Update prototype.
19282 (compute_display_string_pos, compute_display_string_end):
19283 Declare prototypes.
19284 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19285 EMACS_INT.
19286
19287 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
19288
19289 Malloc failure behavior now depends on size of allocation.
19290 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19291 * lisp.h: Change signatures accordingly.
19292 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19293 All callers changed. (Bug#8762)
19294
19295 * gnutls.c: Use Emacs's memory allocators.
19296 Without this change, the gnutls library would invoke malloc etc.
19297 directly, which causes problems on non-SYNC_INPUT hosts, and which
19298 runs afoul of improving memory_full behavior. (Bug#8761)
19299 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19300 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19301 xfree instead of the default malloc, realloc, free.
19302 (Fgnutls_boot): No need to check for memory allocation failure,
19303 since xmalloc does that for us.
19304
19305 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
19306 * category.c (hash_get_category_set):
19307 * ccl.c (ccl_driver):
19308 * charset.c (Fdefine_charset_internal):
19309 * charset.h (struct charset.hash_index):
19310 * composite.c (get_composition_id, gstring_lookup_cache)
19311 (composition_gstring_put_cache):
19312 * composite.h (struct composition.hash_index):
19313 * dispextern.h (struct image.hash):
19314 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19315 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19316 (hashfn_equal, hashfn_user_defined, make_hash_table)
19317 (maybe_resize_hash_table, hash_lookup, hash_put)
19318 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19319 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19320 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19321 * image.c (make_image, search_image_cache, lookup_image)
19322 (xpm_put_color_table_h):
19323 * lisp.h (struct Lisp_Hash_Table):
19324 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
19325 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
19326 for hashes and hash indexes, instead of 'unsigned' and 'int'.
19327 * alloc.c (allocate_vectorlike):
19328 Check for overflow in vector size calculations.
19329 * ccl.c (ccl_driver):
19330 Check for overflow when converting EMACS_INT to int.
19331 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19332 need to be updated by these changes.
19333 * fns.c (make_hash_table, maybe_resize_hash_table):
19334 Check for integer overflow with large hash tables.
19335 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19336 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19337 (SXHASH_REDUCE): New macro.
19338 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19339 Use it instead of discarding useful hash info with large hash values.
19340 (sxhash_float): New function.
19341 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19342 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
19343 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19344 Rewrite to use FIXNUM_BITS, as this simplifies things.
19345 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19346 Adjust signatures to match updated version of code.
19347 (consing_since_gc): Now EMACS_INT, since a single hash table can
19348 use more than INT_MAX bytes.
19349
19350 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19351
19352 Make it possible to build with GCC-4.6+ -O2 -flto.
19353
19354 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19355
19356 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19357
19358 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19359 Call minibuffer-inactive-mode.
19360
19361 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
19362
19363 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19364 Update dependencies.
19365
19366 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19367
19368 * data.c (init_data): Remove code for UTS, this system is not
19369 supported anymore.
19370
19371 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19372
19373 Don't force ./temacs to start in terminal mode.
19374
19375 * frame.c (make_initial_frame): Initialize faces in all cases, not
19376 only when CANNOT_DUMP is defined.
19377 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19378
19379 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19380
19381 * dispnew.c (add_window_display_history): Use const for the string
19382 pointer. Remove declaration, not needed.
19383
19384 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19385
19386 Use 'inline', not 'INLINE'.
19387 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
19388 * alloc.c, fontset.c (INLINE): Remove.
19389 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19390 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19391 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19392 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19393 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19394
19395 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19396
19397 Make it possible to run ./temacs.
19398
19399 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19400 syms_of_callproc does the same thing. Remove test for
19401 "initialized", do it in the caller.
19402 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19403
19404 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19405
19406 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19407 (read_minibuf): Use get_minibuffer.
19408 (syms_of_minibuf): Use DEFSYM.
19409 (Qmetadata): New var.
19410 * data.c (Qbuffer): Don't make it static.
19411 (syms_of_data): Use DEFSYM.
19412
19413 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19414
19415 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19416 (CCL_CODE_MIN): New macro.
19417
19418 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19419
19420 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19421
19422 * eval.c (Qdebug): Now static.
19423 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19424 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19425 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19426
19427 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19428
19429 * image.c: Various fixes to ImageMagick code comments.
19430 (Fimagemagick_types): Doc fix.
19431
19432 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19433
19434 Minor fixes prompted by GCC 4.6.0 warnings.
19435
19436 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19437
19438 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19439 (x_clipboard_manager_save_all): Move extern decl to ...
19440 * xterm.h: ... here, so that it can be checked for consistency.
19441
19442 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
19443
19444 * xselect.c (x_clipboard_manager_save_frame)
19445 (x_clipboard_manager_save_all): New functions.
19446 (Fx_clipboard_manager_save): Lisp function deleted.
19447
19448 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19449 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19450
19451 * xterm.h: Update prototype.
19452
19453 2011-05-28 William Xu <william.xwl@gmail.com>
19454
19455 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19456 exiting (Bug#8239).
19457
19458 2011-05-28 Jim Meyering <meyering@redhat.com>
19459
19460 Avoid a sign-extension bug in crypto_hash_function.
19461 * fns.c (to_uchar): Define.
19462 (crypto_hash_function): Use it to convert some newly-signed
19463 variables to unsigned, to avoid sign-extension bugs. For example,
19464 without this change, (md5 "truc") would evaluate to
19465 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19466 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
19467 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
19468
19469 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19470
19471 Integer overflow fixes.
19472
19473 * dbusbind.c: Serial number integer overflow fixes.
19474 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
19475 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19476 to hold a serial number that is too large for a fixnum.
19477 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19478 Check for serial numbers out of range. Decode any serial number
19479 that was so large that it became a float. (Bug#8722)
19480
19481 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19482 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19483 Use XFASTINT rather than XUINT when numbers are nonnegative.
19484 (xd_append_arg, Fdbus_method_return_internal):
19485 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19486 arguments, check that Lisp number is nonnegative, rather than
19487 silently wrapping negative numbers around. (Bug#8722)
19488 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
19489 (Bug#8722)
19490
19491 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19492
19493 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19494
19495 ccl: Add integer overflow checks.
19496 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19497 (IN_INT_RANGE): New macros.
19498 (ccl_driver): Use them to check for integer overflow when
19499 decoding a CCL program. Many of the new checks are whether XINT (x)
19500 fits in int; it doesn't always, on 64-bit hosts. The new version
19501 doesn't catch all possible integer overflows, but it's an
19502 improvement. (Bug#8719)
19503
19504 * alloc.c (make_event_array): Use XINT, not XUINT.
19505 There's no need for unsigned here.
19506
19507 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19508 This follows up to the 2011-05-06 change that substituted uintptr_t
19509 for EMACS_INT. This case wasn't caught back then.
19510
19511 Rework Fformat to avoid integer overflow issues.
19512 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19513 now (part of C89). Include <verify.h>.
19514 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19515 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19516 (Fformat): Avoid the prepass trying to compute sizes; it was only
19517 approximate and thus did not catch overflow reliably. Instead, walk
19518 through the format just once, formatting and computing sizes as we go,
19519 checking for integer overflow at every step, and allocating a larger
19520 buffer as needed. Keep track separately whether the format is
19521 multibyte. Keep only the most-recently calculated precision, rather
19522 than them all. Record whether each argument has been converted to
19523 string. Use EMACS_INT, not int, for byte and char and arg counts.
19524 Support field widths and precisions larger than INT_MAX. Avoid
19525 sprintf's undefined behavior with conversion specifications such as %#d
19526 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19527 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19528 formatting out-of-range floating point numbers with int
19529 formats. (Bug#8668)
19530
19531 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19532
19533 * data.c: Avoid integer truncation in expressions involving floats.
19534 * data.c: Include <intprops.h>.
19535 (arith_driver): When there's an integer overflow in an expression
19536 involving floating point, convert the integers to floating point
19537 so that the resulting value does not suffer from catastrophic
19538 integer truncation. For example, on a 64-bit host (* 4
19539 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19540 Do not rely on undefined behavior after integer overflow.
19541
19542 merge count_size_as_multibyte, parse_str_to_multibyte
19543 * character.c, character.h (count_size_as_multibyte):
19544 Rename from parse_str_to_multibyte; all uses changed.
19545 Check for integer overflow.
19546 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19547 since it's now a duplicate of the other. This is more of
19548 a character than a buffer op, so better that it's in character.c.
19549 * fns.c, print.c: Adjust to above changes.
19550
19551 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19552
19553 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19554
19555 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19556
19557 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19558 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19559 (x_clipboard_manager_save): Now static.
19560 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19561
19562 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19563 (crypto_hash_function): Now static.
19564 Fix pointer signedness problems. Avoid unnecessary initializations.
19565
19566 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
19567
19568 * termhooks.h (Vselection_alist): Make it terminal-local.
19569
19570 * terminal.c (create_terminal): Initialize it.
19571
19572 * xselect.c: Support for clipboard managers.
19573 (Vselection_alist): Move to termhooks.h as terminal-local var.
19574 (LOCAL_SELECTION): New macro.
19575 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19576 (symbol_to_x_atom): Remove gratuitous arg.
19577 (x_handle_selection_request, lisp_data_to_selection_data)
19578 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
19579 (x_own_selection, x_get_local_selection, x_convert_selection):
19580 New arg, specifying work frame. Use terminal-local Vselection_alist.
19581 (some_frame_on_display): Delete unused function.
19582 (Fx_own_selection_internal, Fx_get_selection_internal)
19583 (Fx_disown_selection_internal, Fx_selection_owner_p)
19584 (Fx_selection_exists_p): New optional frame arg.
19585 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19586 (x_handle_selection_clear): Don't treat other terminals with the
19587 same keyboard specially. Use the terminal-local Vselection_alist.
19588 (x_clear_frame_selections): Use Frun_hook_with_args.
19589
19590 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19591
19592 * xterm.h: Add support for those atoms.
19593
19594 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
19595
19596 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19597 (converted_selections, conversion_fail_tag): New global variables.
19598 (x_selection_request_lisp_error): Free the above.
19599 (x_get_local_selection): Remove unnecessary code.
19600 (x_reply_selection_request): Args changed; handle arbitrary array
19601 of converted selections stored in converted_selections.
19602 Separate the XChangeProperty and SelectionNotify steps.
19603 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19604 (x_convert_selection): New function.
19605 (x_handle_selection_event): Simplify.
19606 (x_get_foreign_selection): Don't ignore incoming requests while
19607 waiting for an answer; this will fail when we implement
19608 SAVE_TARGETS, and seems unnecessary anyway.
19609 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19610 (Vx_sent_selection_functions): Doc fix.
19611
19612 2011-05-26 Leo Liu <sdl.web@gmail.com>
19613
19614 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19615
19616 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19617
19618 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19619
19620 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19621 for fringe update if it has periodic bitmap.
19622 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
19623 and fringe_bitmap_periodic_p.
19624
19625 * fringe.c (get_fringe_bitmap_data): New function.
19626 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19627 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19628 row. Mark glyph row for fringe update if periodicity changed.
19629
19630 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19631 for fringe update unless it has periodic bitmap.
19632
19633 2011-05-25 Kenichi Handa <handa@m17n.org>
19634
19635 * xdisp.c (get_next_display_element): Set correct it->face_id for
19636 a static composition.
19637
19638 2011-05-24 Leo Liu <sdl.web@gmail.com>
19639
19640 * deps.mk (fns.o):
19641 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19642
19643 * fns.c (crypto_hash_function, Fsha1): New function.
19644 (Fmd5): Use crypto_hash_function.
19645 (syms_of_fns): Add Ssha1.
19646
19647 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19648
19649 * gnutls.c: Remove unused macros.
19650 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19651 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19652 Remove macros that are defined and never used.
19653 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19654
19655 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19656
19657 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19658 (Fx_get_selection_internal): Minor cleanup.
19659 (Fx_own_selection_internal): Rename arguments for consistency with
19660 select.el.
19661
19662 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19663
19664 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19665
19666 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
19667
19668 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19669
19670 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19671
19672 * dispnew.c (scrolling_window): Don't exclude the case that the
19673 last enabled row in the desired matrix touches the bottom boundary.
19674
19675 2011-05-21 Glenn Morris <rgm@gnu.org>
19676
19677 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
19678 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19679 and add some more files.
19680
19681 2011-05-20 Eli Zaretskii <eliz@gnu.org>
19682
19683 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19684 report_file_error introduced by the change from 2011-05-07.
19685
19686 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19687
19688 * systime.h (Time): Define only if emacs is defined.
19689 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19690 where the include path doesn't have X11/X.h by default. See
19691 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19692
19693 2011-05-20 Kenichi Handa <handa@m17n.org>
19694
19695 * composite.c (find_automatic_composition): Fix previous change.
19696
19697 2011-05-20 Glenn Morris <rgm@gnu.org>
19698
19699 * lisp.mk: New file, split from Makefile.in.
19700 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19701 (shortlisp): Remove.
19702 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19703
19704 2011-05-19 Glenn Morris <rgm@gnu.org>
19705
19706 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19707 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19708 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19709 (lisp): Set the order to that of loadup.el.
19710 (shortlisp): Make it a copy of $lisp.
19711 (SOME_MACHINE_LISP): Remove.
19712 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19713 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19714
19715 2011-05-18 Kenichi Handa <handa@m17n.org>
19716
19717 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19718 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19719 (find_automatic_composition): Mostly rewrite for efficiency.
19720
19721 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
19722
19723 * makefile.w32-in: Update dependencies.
19724
19725 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19726
19727 * menu.c: Include limits.h (fixes the MS-Windows build broken by
19728 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
19729
19730 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
19731
19732 Fix some integer overflow issues, such as string length overflow.
19733
19734 * insdel.c (count_size_as_multibyte): Check for string overflow.
19735
19736 * character.c (lisp_string_width): Check for string overflow.
19737 Use EMACS_INT, not int, for string indexes and lengths; in
19738 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19739 the resulting string length overflows an EMACS_INT; instead,
19740 report a string overflow if no precision given. When checking for
19741 precision exhaustion, use a check that cannot possibly have
19742 integer overflow. (Bug#8675)
19743 * character.h (lisp_string_width): Adjust to new signature.
19744
19745 * alloc.c (string_overflow): New function.
19746 (Fmake_string): Use it. This doesn't change behavior, but saves
19747 a few bytes and will simplify future changes.
19748 * character.c (string_escape_byte8): Likewise.
19749 * lisp.h (string_overflow): New decl.
19750
19751 Fixups, following up to the user-interface timestamp change.
19752 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19753 for UI timestamps, instead of unsigned long.
19754 * msdos.c (mouse_get_pos): Likewise.
19755 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
19756 * w32gui.h (Time): Define by including "systime.h" rather than by
19757 declaring it ourselves. (Bug#8664)
19758
19759 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19760 * image.c (clear_image_cache): Likewise.
19761
19762 * term.c (term_mouse_position): Don't assume time_t wraparound.
19763
19764 Be more systematic about user-interface timestamps.
19765 Before, the code sometimes used 'Time', sometimes 'unsigned long',
19766 and sometimes 'EMACS_UINT', to represent these timestamps.
19767 This change causes it to use 'Time' uniformly, as that's what X uses.
19768 This makes the code easier to follow, and makes it easier to catch
19769 integer overflow bugs such as Bug#8664.
19770 * frame.c (Fmouse_position, Fmouse_pixel_position):
19771 Use Time, not unsigned long, for user-interface timestamps.
19772 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19773 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19774 * keyboard.h (last_event_timestamp): Likewise.
19775 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19776 * menu.h (xmenu_show): Likewise.
19777 * term.c (term_mouse_position): Likewise.
19778 * termhooks.h (struct input_event.timestamp): Likewise.
19779 (struct terminal.mouse_position_hook): Likewise.
19780 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19781 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19782 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19783 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19784 what it was before.
19785 * menu.h, termhooks.h: Include "systime.h", for Time.
19786
19787 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19788 Don't assume that the difference between two unsigned long values
19789 can fit into an integer. At this point, we know button_down_time
19790 <= event->timestamp, so the difference must be nonnegative, so
19791 there's no need to cast the result if double-click-time is
19792 nonnegative, as it should be; check that it's nonnegative, just in
19793 case. This bug is triggered when events are more than 2**31 ms
19794 apart (about 25 days). (Bug#8664)
19795
19796 * xselect.c (last_event_timestamp): Remove duplicate decl.
19797 (x_own_selection): Remove needless cast to unsigned long.
19798
19799 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19800 that always fit in int. Use a sentinel instead of a counter, to
19801 avoid a temp and to allay GCC's concerns about possible int overflow.
19802 * frame.h (struct frame): Use int for menu_bar_items_used
19803 instead of EMACS_INT, since it always fits in int.
19804
19805 * menu.c (grow_menu_items): Check for int overflow.
19806
19807 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19808
19809 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19810 Before, the code was not consistent. These values cannot exceed
19811 2**31 - 1 so there's no need to make them unsigned.
19812 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19813 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19814 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19815 as modifiers.
19816 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19817
19818 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19819 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19820 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19821 presumably because the widths might not match.
19822
19823 * window.c (size_window): Avoid needless test at loop start.
19824
19825 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
19826
19827 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19828
19829 2011-05-12 Drew Adams <drew.adams@oracle.com>
19830
19831 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19832
19833 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19834
19835 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19836 `width' to `bar_area_x' and `bar_area_width', respectively.
19837 (x_scroll_run): Take account of fringe background extension.
19838
19839 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19840 Rename local vars `left' and `width' to `bar_area_x' and
19841 `bar_area_width', respectively.
19842 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19843 background extension.
19844
19845 2011-05-10 Jim Meyering <meyering@redhat.com>
19846
19847 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19848
19849 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
19850
19851 * image.c (Finit_image_library): Return t for built-in image types,
19852 like pbm and xbm. (Bug#8640)
19853
19854 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
19855
19856 * w32menu.c (set_frame_menubar): Fix submenu allocation.
19857
19858 2011-05-07 Eli Zaretskii <eliz@gnu.org>
19859
19860 * w32console.c (Fset_screen_color): Doc fix.
19861 (Fget_screen_color): New function.
19862 (syms_of_ntterm): Defsubr it.
19863
19864 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19865 unlink the temporary file if Fcall_process didn't create it in the
19866 first place.
19867 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19868 child process will be redirected to a file specified with `:file'.
19869 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19870 cue to call_process_cleanup not to close that handle.
19871
19872 2011-05-07 Ben Key <bkey76@gmail.com>
19873
19874 * makefile.w32-in: The bootstrap-temacs rule now makes use of
19875 one of two shell specific rules, either bootstrap-temacs-CMD or
19876 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
19877 to the previous implementation of the bootstrap-temacs rule.
19878 The bootstrap-temacs-CMD rule is similar to the previous
19879 implementation of the bootstrap-temacs rule except that it
19880 makes use of the ESC_CFLAGS variable instead of the CFLAGS
19881 variable.
19882
19883 These changes, along with some changes to nt/configure.bat,
19884 nt/gmake.defs, and nt/nmake.defs, are required to extend my
19885 earlier fix to add support for --cflags and --ldflags options
19886 that include quotes so that it works whether make uses cmd or
19887 sh as the shell.
19888
19889 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
19890
19891 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19892 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19893 is a constant.
19894 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19895 a string. Handle both cases.
19896 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19897 (Fdbus_register_method): Use Qinvalid_function.
19898
19899 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
19900
19901 * makefile.w32-in: Update dependencies.
19902 (LISP_H): Add inttypes.h and stdin.h.
19903 (PROCESS_H): Add unistd.h.
19904
19905 2011-05-06 Eli Zaretskii <eliz@gnu.org>
19906
19907 * lread.c: Include limits.h (fixes the MS-Windows build broken by
19908 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
19909
19910 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
19911
19912 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19913
19914 * term.c (vfatal): Remove stray call to va_end.
19915 It's not needed and the C Standard doesn't allow it here anyway.
19916
19917 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19918 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
19919
19920 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19921 bytes.
19922
19923 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19924
19925 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19926
19927 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19928
19929 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19930
19931 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19932
19933 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19934 * charset.c (Fdefine_charset_internal): Don't initialize
19935 charset.code_space[15]. The value was garbage, on hosts with
19936 32-bit int (Bug#8600).
19937
19938 * lread.c (read_integer): Be more consistent with string-to-number.
19939 Use string_to_number to do the actual conversion; this avoids
19940 rounding errors and fixes some other screwups. Without this fix,
19941 for example, #x1fffffffffffffff was misread as -2305843009213693952.
19942 (digit_to_number): Move earlier, for benefit of read_integer.
19943 Return -1 if the digit is out of range for the base, -2 if it is
19944 not a digit in any supported base. (Bug#8602)
19945
19946 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
19947
19948 * dispnew.c (scrolling_window): Return 1 if we scrolled,
19949 to match comment at start of function. This also removes a
19950 GCC warning about overflow in a 32+64-bit port.
19951
19952 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
19953
19954 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
19955 Reported by Stefan Monnier in
19956 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
19957 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
19958 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
19959
19960 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
19961 (EMACS_UINTPTR): Likewise, with uintptr_t.
19962
19963 * lisp.h: Prefer 64-bit EMACS_INT if available.
19964 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
19965 on 32-bit hosts that have 64-bit int, so that they can access
19966 large files.
19967 However, temporarily disable this change unless the temporary
19968 symbol WIDE_EMACS_INT is defined.
19969
19970 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
19971
19972 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
19973 This removes an assumption that EMACS_INT and long are the same
19974 width as pointers. The assumption is true for Emacs porting targets
19975 now, but we want to make other targets possible.
19976 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
19977 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
19978 In the rest of the code, change types of integers that hold casted
19979 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
19980 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
19981 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
19982 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
19983 No need to cast type when ORing.
19984 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
19985 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
19986 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
19987 assume EMACS_INT is the same width as char *.
19988 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
19989 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
19990 Remove no-longer-needed casts.
19991 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
19992 (xg_tool_bar_help_callback, xg_make_tool_item):
19993 Use EMACS_INTPTR to hold an integer
19994 that will be cast to void *; this can avoid a GCC warning
19995 if EMACS_INT is not the same width as void *.
19996 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
19997 * xdisp.c (display_echo_area_1, resize_mini_window_1):
19998 (current_message_1, set_message_1):
19999 Use a local to convert to proper width without a cast.
20000 * xmenu.c (dialog_selection_callback): Likewise.
20001
20002 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20003 Also, don't assume VALBITS / RAND_BITS is less than 5,
20004 and don't rely on undefined behavior when shifting a 1 left into
20005 the sign bit.
20006 * lisp.h (get_random): Change signature to match.
20007
20008 * lread.c (hash_string): Use size_t, not int, for hash computation.
20009 Normally we prefer signed values; but hashing is special, because
20010 it's better to use unsigned division on hash table sizes so that
20011 the remainder is nonnegative. Also, size_t is the natural width
20012 for hashing into memory. The previous code used 'int', which doesn't
20013 retain enough info to hash well into very large tables.
20014 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20015
20016 * dbusbind.c: Don't possibly lose pointer info when converting.
20017 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20018 Use XPNTR rather than XHASH, so that the high-order bits of
20019 the pointer aren't lost when converting through void *.
20020
20021 * eval.c (Fautoload): Don't double-shift a pointer.
20022
20023 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20024
20025 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
20026
20027 * gnutls.c (DEF_GNUTLS_FN):
20028 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20029
20030 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20031
20032 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20033 marker. (Bug#8610)
20034
20035 2011-05-05 Eli Zaretskii <eliz@gnu.org>
20036
20037 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20038 New version that can reserve upto 2GB of heap space.
20039
20040 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
20041
20042 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20043
20044 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20045
20046 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20047 `gnutls_certificate_set_x509_key_file'.
20048
20049 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
20050
20051 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20052 Update dependencies.
20053
20054 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20055
20056 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20057 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20058 Remove unused parameter `fildes'.
20059 * process.c (read_process_output, send_process): Don't pass it.
20060
20061 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20062
20063 Fix previous change: the library cache is defined in w32.c.
20064 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20065 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20066
20067 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
20068
20069 Implement dynamic loading of GnuTLS on Windows.
20070
20071 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20072 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20073 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20074 Declare.
20075
20076 * gnutls.c (Qgnutls_dll): Define.
20077 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20078 (gnutls_*): Declare function pointers.
20079 (init_gnutls_functions): New function to initialize function pointers.
20080 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20081 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20082 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20083 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20084 (emacs_gnutls_write, emacs_gnutls_read)
20085 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20086 (Fgnutls_available_p): New function.
20087 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20088 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20089 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20090
20091 * image.c: Include w32.h.
20092 (Vimage_type_cache): Delete.
20093 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20094 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20095 (w32_delayed_load): Move to w32.c.
20096
20097 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20098
20099 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20100 (w32_delayed_load): Move from image.c. When loading a library, record
20101 its filename in the :loaded-from property of the library id.
20102 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20103 Initialize and staticpro them.
20104 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20105
20106 * process.c: Include lisp.h before w32.h, not after.
20107 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20108 instead of gnutls_record_check_pending.
20109
20110 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20111
20112 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20113
20114 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20115 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20116 as passed in.
20117
20118 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20119
20120 * xterm.c (x_set_frame_alpha): Do not set property on anything
20121 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20122
20123 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20124
20125 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20126
20127 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
20128
20129 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20130 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20131 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20132 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20133 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20134 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20135 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20136 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20137 (Qgnutls_bootprop_callbacks_verify): Make static.
20138
20139 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20140
20141 * callproc.c: Indentation fixup.
20142
20143 * sysdep.c (wait_for_termination_1): Make static.
20144 (wait_for_termination, interruptible_wait_for_termination):
20145 Move after wait_for_termination_1.
20146
20147 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20148
20149 * sysdep.c (interruptible_wait_for_termination): New function
20150 which is like wait_for_termination, but allows keyboard
20151 interruptions.
20152
20153 * callproc.c (Fcall_process): Add (:file "file") as an option for
20154 the STDOUT buffer.
20155 (Fcall_process_region): Ditto.
20156
20157 2011-04-30 Eli Zaretskii <eliz@gnu.org>
20158
20159 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20160 rather than `XVECTOR (FOO)->size'.
20161
20162 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20163 inttypes.h, as a gnulib replacement is used if it not available in
20164 system headers.
20165
20166 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20167
20168 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20169 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20170 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20171
20172 * coding.c (coding_alloc_by_realloc): Error out if destination
20173 will grow beyond MOST_POSITIVE_FIXNUM.
20174 (decode_coding_emacs_mule): Abort if there isn't enough place in
20175 charbuf for the composition carryover bytes. Reserve an extra
20176 space for up to 2 characters produced in a loop.
20177 (decode_coding_iso_2022): Abort if there isn't enough place in
20178 charbuf for the composition carryover bytes.
20179
20180 2011-04-21 Eli Zaretskii <eliz@gnu.org>
20181
20182 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20183 aborting when %lld or %lll format is passed.
20184 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20185 %llo or %llx format is passed. (Bug#8545)
20186
20187 * window.c (window_scroll_line_based): Use a marker instead of
20188 simple variables to record original value of point. (Bug#7952)
20189
20190 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20191 produced by %s or %c overflows available buffer space. (Bug#8545)
20192
20193 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20194
20195 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20196 (SIZE_MAX): Move defn after all includes, as they might #define it.
20197
20198 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20199
20200 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20201
20202 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20203
20204 * keyboard.c (Qdelayed_warnings_hook): Define.
20205 (command_loop_1): Run `delayed-warnings-hook'
20206 if Vdelayed_warnings_list is non-nil.
20207 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20208 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20209
20210 2011-04-28 Eli Zaretskii <eliz@gnu.org>
20211
20212 * doprnt.c (doprnt): Don't return value smaller than the buffer
20213 size if the message was truncated. (Bug#8545).
20214
20215 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
20216
20217 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20218 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20219
20220 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20221
20222 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20223
20224 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
20225
20226 * makefile.w32-in: Update dependencies.
20227
20228 2011-04-27 Eli Zaretskii <eliz@gnu.org>
20229
20230 Improve `doprnt' and its usage. (Bug#8545)
20231 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20232 `format_end'. Remove support for %l as a conversion specifier.
20233 Don't use xrealloc. Improve diagnostics when the %l size modifier
20234 is used. Update the commentary.
20235
20236 * eval.c (verror): Simplify calculation of size_t.
20237
20238 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20239 messages.
20240
20241 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20242
20243 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20244 change.
20245
20246 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20247
20248 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20249 This makes this file independent of the recent pseudovector change.
20250
20251 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
20252
20253 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20254
20255 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20256 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20257 Remove unused local.
20258 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20259
20260 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
20261 GCC 4.6.0 optimizes based on type-based alias analysis.
20262 For example, if b is of type struct buffer * and v of type struct
20263 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20264 != &v->size, and therefore "v->size = 1; b->size = 2; return
20265 v->size;" must therefore return 1. This assumption is incorrect
20266 for Emacs, since it type-puns struct Lisp_Vector * with many other
20267 types. To fix this problem, this patch adds a new type struct
20268 vectorlike_header that documents the constraints on layout of vectors
20269 and pseudovectors, and helps optimizing compilers not get fooled
20270 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20271 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
20272 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20273 the size member.
20274 (XSETPVECTYPE): Rewrite in terms of new macro.
20275 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20276 This is a bit clearer, and further avoids the possibility of
20277 undesirable aliasing.
20278 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
20279 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
20280 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20281 since Lisp_Subr is a special case (no "next" field).
20282 (ASIZE): Now uses header.size rather than size.
20283 All previous uses of XVECTOR (foo)->size replaced to use this macro,
20284 to avoid the hassle of writing XVECTOR (foo)->header.size.
20285 (struct vectorlike_header): New type.
20286 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20287 object, to help avoid aliasing.
20288 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20289 (SUBRP): Likewise, since Lisp_Subr is a special case.
20290 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20291 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20292 (struct Lisp_Hash_Table): Combine first two members into a single
20293 struct vectorlike_header member. All uses of "size" and "next" members
20294 changed to be "header.size" and "header.next".
20295 * buffer.h (struct buffer): Likewise.
20296 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20297 * frame.h (struct frame): Likewise.
20298 * process.h (struct Lisp_Process): Likewise.
20299 * termhooks.h (struct terminal): Likewise.
20300 * window.c (struct save_window_data, struct saved_window): Likewise.
20301 * window.h (struct window): Likewise.
20302 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20303 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20304 * buffer.c (init_buffer_once): Likewise.
20305 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20306 special case.
20307 * process.c (Fformat_network_address): Use local var for size,
20308 for brevity.
20309
20310 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20311
20312 Make the Lisp reader and string-to-float more consistent (Bug#8525)
20313 * data.c (atof): Remove decl; no longer used or needed.
20314 (digit_to_number): Move to lread.c.
20315 (Fstring_to_number): Use new string_to_number function, to be
20316 consistent with how the Lisp reader treats infinities and NaNs.
20317 Do not assume that floating-point numbers represent EMACS_INT
20318 without losing information; this is not true on most 64-bit hosts.
20319 Avoid double-rounding errors, by insisting on integers when
20320 parsing non-base-10 numbers, as the documentation specifies.
20321 * lisp.h (string_to_number): New decl, replacing ...
20322 (isfloat_string): Remove.
20323 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
20324 (read1): Do not accept +. and -. as integers; this
20325 appears to have been a coding error. Similarly, do not accept
20326 strings like +-1e0 as floating point numbers. Do not report
20327 overflow for integer overflows unless the base is not 10 which
20328 means we have no simple and reliable way to continue.
20329 Break out the floating-point parsing into a new
20330 function string_to_number, so that Fstring_to_number parses
20331 floating point numbers consistently with the Lisp reader.
20332 (digit_to_number): Move here from data.c. Make it static inline.
20333 (E_CHAR, EXP_INT): Remove, replacing with ...
20334 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20335 (string_to_number): New function, replacing isfloat_string.
20336 This function checks for valid syntax and produces the resulting
20337 Lisp float number too. Rework it so that string-to-number
20338 no longer mishandles examples like "1.0e+". Use strtoumax,
20339 so that overflow for non-base-10 numbers is reported only when
20340 there's no portable and simple way to convert to floating point.
20341
20342 * textprop.c (set_text_properties_1): Rewrite for clarity,
20343 and to avoid GCC warning about integer overflow.
20344
20345 * intervals.h (struct interval): Use EMACS_INT for members
20346 where EMACS_UINT might cause problems. See
20347 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20348 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20349 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20350 All uses changed.
20351 (offset_intervals): Tell GCC not to worry about length overflow
20352 when negating a negative length.
20353
20354 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20355 (overrun_check_free): Likewise.
20356
20357 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20358 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20359 word size.
20360
20361 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20362 (gnutls_make_error): Rename local to avoid shadowing.
20363 (gnutls_emacs_global_deinit): ifdef out; not used.
20364 (Fgnutls_boot): Use const for pointer to readonly storage.
20365 Comment out unused local. Fix pointer signedness problems.
20366
20367 * lread.c (openp): Don't stuff size_t into an 'int'.
20368 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20369 about possible signed overflow.
20370
20371 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20372 (GDK_KEY_g): Don't define if already defined.
20373 (xg_prepare_tooltip): Avoid pointer signedness problem.
20374 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20375
20376 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20377 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20378
20379 * xfns.c (Fx_window_property): Simplify a bit,
20380 to make a bit faster and to avoid GCC 4.6.0 warning.
20381 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20382
20383 * fns.c (internal_equal): Don't assume size_t fits in int.
20384
20385 * alloc.c (compact_small_strings): Tighten assertion a little.
20386
20387 Replace pEd with more-general pI, and fix some printf arg casts.
20388 * lisp.h (pI): New macro, generalizing old pEd macro to other
20389 conversion specifiers. For example, use "...%"pI"d..." rather
20390 than "...%"pEd"...".
20391 (pEd): Remove. All uses replaced with similar uses of pI.
20392 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
20393 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20394 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20395 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20396 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20397 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20398 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20399 64-bit hosts.
20400 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20401 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20402 * print.c (safe_debug_print, print_object): Likewise.
20403 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20404 to int.
20405 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20406 avoiding the 0 flag, which is not portable.
20407 * process.c (Fmake_network_process): Use pI to avoid cast.
20408 * region-cache.c (pp_cache): Likewise.
20409 * xdisp.c (decode_mode_spec): Likewise.
20410 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20411 behavior on 64-bit hosts with printf arg.
20412 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
20413 (x_stop_queuing_selection_requests): Likewise.
20414 (x_get_window_property): Don't truncate byte count to an 'int'
20415 when tracing.
20416
20417 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20418 here, since it parses constructs like leading '-' and spaces,
20419 which are not wanted; and it overflows with large numbers.
20420 Instead, simply match F[0-9]+, which is what is wanted anyway.
20421
20422 * alloc.c: Remove unportable assumptions about struct layout.
20423 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20424 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20425 (allocate_vectorlike, make_pure_vector): Use the new macros,
20426 plus offsetof, to remove unportable assumptions about struct layout.
20427 These assumptions hold on all porting targets that I know of, but
20428 they are not guaranteed, they're easy to remove, and removing them
20429 makes further changes easier.
20430
20431 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20432 This doesn't fix a bug but makes the code clearer.
20433 (string_overrun_cookie): Now const. Use initializers that
20434 don't formally overflow signed char, to avoid warnings.
20435 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20436 can cause Emacs to crash when string overrun checking is enabled.
20437 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20438 multiple of sizeof (EMACS_INT); it need not be, if
20439 alignof(EMACS_INT) < sizeof (EMACS_INT).
20440 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
20441
20442 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
20443
20444 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20445
20446 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20447
20448 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
20449 supposed to be handshaking. (Bug#8556)
20450 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20451
20452 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
20453
20454 * lisp.h (Qdebug): List symbol.
20455 * eval.c (Qdebug): Restore global linkage.
20456 * keyboard.c (debug-on-event): New variable.
20457 (handle_user_signal): Break into debugger when debug-on-event
20458 matches the current signal symbol.
20459
20460 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20461
20462 * alloc.c (check_sblock, check_string_bytes)
20463 (check_string_free_list): Convert to standard C.
20464
20465 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20466
20467 * w32.c (emacs_gnutls_push): Fix typo.
20468
20469 2011-04-25 Eli Zaretskii <eliz@gnu.org>
20470
20471 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20472 "cast to pointer from integer of different size".
20473
20474 Improve doprnt and its use in verror. (Bug#8545)
20475 * doprnt.c (doprnt): Document the set of format control sequences
20476 supported by the function. Use SAFE_ALLOCA instead of always
20477 using `alloca'.
20478
20479 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20480 is one byte too soon. Don't use xrealloc; instead xfree and
20481 xmalloc anew.
20482
20483 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20484
20485 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20486 callbacks stage.
20487
20488 * gnutls.c: Renamed global_initialized to
20489 gnutls_global_initialized. Added internals for the
20490 :verify-hostname-error, :verify-error, and :verify-flags
20491 parameters of `gnutls-boot' and documented those parameters in the
20492 docstring. Start callback support.
20493 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20494 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20495 on error. Return error code.
20496 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20497 (emacs_gnutls_read): Likewise.
20498 (Fgnutls_boot): Return handshake error code.
20499 (emacs_gnutls_handle_error): New function.
20500 (wsaerror_to_errno): Likewise.
20501
20502 * w32.h (emacs_gnutls_pull): Add prototype.
20503 (emacs_gnutls_push): Likewise.
20504
20505 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20506 (emacs_gnutls_push): Likewise.
20507
20508 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20509
20510 * process.c (wait_reading_process_output): Check if GnuTLS
20511 buffered some data internally if no FDs are set for TLS
20512 connections.
20513
20514 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20515 (LIBS): Link to USER_LIBS.
20516 ($(BLD)/gnutls.$(0)): New target.
20517
20518 2011-04-24 Eli Zaretskii <eliz@gnu.org>
20519
20520 * xdisp.c (handle_single_display_spec): Rename the
20521 display_replaced_before_p argument into display_replaced_p, to
20522 make it consistent with the commentary. Fix typos in the
20523 commentary.
20524
20525 * textprop.c (syms_of_textprop): Remove dead code.
20526 (copy_text_properties): Delete obsolete commentary about an
20527 interface that was deleted long ago. Fix typos in the description
20528 of arguments.
20529
20530 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20531 to changes in oldXMenu/XMenu.h from 2011-04-16.
20532 <menu_help_message, prev_menu_help_message>: Constify.
20533 (IT_menu_make_room): menu->help_text is now `const char **';
20534 adjust.
20535
20536 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20537 to changes in oldXMenu/XMenu.h from 2011-04-16.
20538 (struct XMenu): Declare `help_text' `const char **'.
20539
20540 * xfaces.c <Qunspecified>: Make extern again.
20541
20542 * syntax.c: Include sys/types.h before including regex.h, as
20543 required by POSIX.
20544
20545 * doc.c (get_doc_string): Improve the format passed to `error'.
20546
20547 * doprnt.c (doprnt): Improve commentary.
20548
20549 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20550
20551 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20552 them with etags.
20553
20554 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20555 changes in globals.h immediately force recompilation.
20556 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20557 $(CURDIR)/s/ms-w32.h.
20558 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
20559
20560 * character.c (Fchar_direction): Function deleted.
20561 (syms_of_character): Don't defsubr it.
20562 <char-direction-table>: Deleted.
20563
20564 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20565
20566 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20567 * doprnt.c: Include limits.h.
20568 (SIZE_MAX): New macro.
20569 (doprnt): Return a size_t value. 2nd arg is now size_t.
20570 Many local variables are now size_t instead of int or unsigned.
20571 Improve overflow protection. Support `l' modifier for integer
20572 conversions. Support %l conversion. Don't assume an EMACS_INT
20573 argument for integer conversions and for %c.
20574
20575 * lisp.h (doprnt): Restore prototype.
20576
20577 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20578 $(SRC)/character.h.
20579
20580 * Makefile.in (base_obj): Add back doprnt.o.
20581
20582 * deps.mk (doprnt.o): Add back prerequisites.
20583 (callint.o): Depend on character.h.
20584
20585 * eval.c (internal_lisp_condition_case): Include the handler
20586 representation in the error message.
20587 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20588 when breaking from the loop.
20589
20590 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20591
20592 * callint.c (Fcall_interactively): When displaying error message
20593 about invalid control letter, pass the character's codepoint, not
20594 a pointer to its multibyte form. Improve display of the character
20595 in octal and display also its hex code.
20596
20597 * character.c (char_string): Use %x to display the (unsigned)
20598 codepoint of an invalid character, to avoid displaying a bogus
20599 negative value.
20600
20601 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20602 `error', not SYMBOL_NAME itself.
20603
20604 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20605 character arguments to `error'.
20606
20607 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20608 to `error' in error message about FINAL_CHAR argument. Make sure
20609 FINAL_CHAR is a character, and use %c when it is passed as
20610 argument to `error'.
20611
20612 2011-04-23 Eli Zaretskii <eliz@gnu.org>
20613
20614 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20615
20616 * w32.c: Include <time.h>.
20617 (sys_localtime): New function.
20618
20619 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
20620
20621 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20622
20623 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
20624
20625 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
20626
20627 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20628 zombies (Bug#8467).
20629
20630 2011-04-19 Eli Zaretskii <eliz@gnu.org>
20631
20632 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20633 gl_state.e_property when gl_state.object is Qt.
20634
20635 * insdel.c (make_gap_larger): Remove limitation of buffer size
20636 to <= INT_MAX.
20637
20638 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
20639
20640 * xdisp.c (lookup_glyphless_char_display)
20641 (produce_glyphless_glyph): Handle cons cell entry in
20642 glyphless-char-display.
20643 (Vglyphless_char_display): Document it.
20644
20645 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20646 glyphless-char-display.
20647
20648 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
20649
20650 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20651
20652 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20653
20654 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20655 definition for no-X builds.
20656
20657 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
20658
20659 Static checks with GCC 4.6.0 and non-default toolkits.
20660
20661 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20662
20663 * process.c (keyboard_bit_set): Define only if SIGIO.
20664 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20665 (send_process): Repair possible setjmp clobbering.
20666
20667 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20668
20669 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20670
20671 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20672
20673 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20674 Define only if needed.
20675
20676 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20677 by pacifying GCC about it. Maybe it's time to retire it?
20678 * xfaces.c (USG, __TIMEVAL__): Likewise.
20679
20680 * dispextern.h (struct redisplay_interface): Rename param
20681 to avoid shadowing.
20682 * termhooks.h (struct terminal): Likewise.
20683 * xterm.c (xembed_send_message): Likewise.
20684
20685 * insdel.c (make_gap_smaller): Define only if
20686 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20687
20688 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20689 it.
20690
20691 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20692 so that we aren't warned about unused symbols.
20693
20694 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20695
20696 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
20697
20698 * xfns.c (x_real_positions): Mark locals as initialized.
20699
20700 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20701
20702 * xterm.c: Fix problems found by static analysis with other toolkits.
20703 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
20704 (x_dispatch_event): Declare static if USE_GTK, and
20705 define if USE_GTK || USE_X_TOOLKIT.
20706 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
20707 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
20708 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20709 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
20710
20711 * xmenu.c (menu_help_callback): Pointer type fixes.
20712 Use const pointers when pointing at readonly data. Avoid pointer
20713 signedness clashes.
20714 (FALSE): Remove unused macro.
20715 (update_frame_menubar): Remove unused decl.
20716
20717 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20718
20719 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20720 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20721 (single_menu_item): Rename local to avoid shadowing.
20722
20723 * keyboard.c (make_lispy_event): Remove unused local var.
20724
20725 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20726 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20727
20728 * bitmaps: Change bitmaps from unsigned char back to the X11
20729 compatible char. Avoid the old compiler warnings about
20730 out-of-range initializers by using, for example, '\xab' rather
20731 than 0xab.
20732
20733 * xgselect.c (xgselect_initialize): Check vs interface
20734 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20735
20736 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20737
20738 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20739 to read-only memory.
20740
20741 * fns.c (vector): Remove; this old hack is no longer needed.
20742
20743 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
20744 Remove unused var.
20745 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
20746
20747 * xrdb.c (x_load_resources): Omit unused local.
20748
20749 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
20750 (x_window): Rename locals to avoid shadowing.
20751 (USG): Use the kludged USG macro, to pacify gcc.
20752
20753 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
20754 (x_term_init): Remove local to avoid shadowing.
20755
20756 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
20757
20758 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20759 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20760
20761 2011-04-16 Eli Zaretskii <eliz@gnu.org>
20762
20763 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20764
20765 Fix regex.c, syntax.c and friends for buffers > 2GB.
20766 * syntax.h (struct gl_state_s): Declare character position members
20767 EMACS_INT.
20768
20769 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20770
20771 * textprop.c (verify_interval_modification, interval_of):
20772 Declare arguments EMACS_INT.
20773
20774 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20775 EMACS_INT.
20776
20777 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20778
20779 * indent.c (Fvertical_motion): Local variable it_start is now
20780 EMACS_INT.
20781
20782 * regex.c (re_match, re_match_2, re_match_2_internal)
20783 (bcmp_translate, regcomp, regexec, print_double_string)
20784 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20785 (re_compile_pattern, re_exec): Declare arguments and local
20786 variables `size_t' and `ssize_t' and return values `regoff_t', as
20787 appropriate.
20788 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20789 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20790 <compile_stack_type>: `size' and `avail' are now `size_t'.
20791
20792 * regex.h <regoff_t>: Use ssize_t, not int.
20793 (re_search, re_search_2, re_match, re_match_2): Arguments that
20794 specify buffer/string position and length are now ssize_t and
20795 size_t. Return type is regoff_t.
20796
20797 2011-04-16 Ben Key <bkey76@gmail.com>
20798
20799 * nsfont.m: Fixed bugs in ns_get_family and
20800 ns_descriptor_to_entity that were caused by using free to
20801 deallocate memory blocks that were allocated by xmalloc (via
20802 xstrdup). This caused Emacs to crash when compiled with
20803 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20804 --enable-checking=xmallocoverrun). xfree is now used to
20805 deallocate these memory blocks.
20806
20807 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
20808
20809 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20810
20811 emacs_write: Accept and return EMACS_INT for sizes.
20812 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20813 et seq.
20814 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20815 Accept and return EMACS_INT.
20816 (emacs_gnutls_write): Return the number of bytes written on
20817 partial writes.
20818 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
20819 (emacs_read, emacs_write): Remove check for negative size, as the
20820 Emacs source code has been audited now.
20821 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20822 (emacs_read, emacs_write): Use it.
20823 * process.c (send_process): Adjust to the new signatures of
20824 emacs_write and emacs_gnutls_write. Do not attempt to store
20825 a byte offset into an 'int'; it might overflow.
20826 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
20827
20828 * sound.c: Don't assume sizes fit in 'int'.
20829 (struct sound_device.period_size, alsa_period_size):
20830 Return EMACS_INT, not int.
20831 (struct sound_device.write, vox_write, alsa_write):
20832 Accept EMACS_INT, not int.
20833 (wav_play, au_play): Use EMACS_INT to store sizes and to
20834 record read return values.
20835
20836 2011-04-15 Ben Key <bkey76@gmail.com>
20837
20838 * keyboard.c (Qundefined): Don't declare static since it is used
20839 in nsfns.m.
20840 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20841 static since they are used in nsfont.m.
20842
20843 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
20844
20845 * process.c (Qprocessp): Don't declare static.
20846 * lisp.h (Qprocessp): Declare again.
20847
20848 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
20849
20850 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20851
20852 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
20853
20854 Improve C-level modularity by making more things 'static'.
20855
20856 Don't publish debugger-only interfaces to other modules.
20857 * lisp.h (safe_debug_print, debug_output_compilation_hack):
20858 (verify_bytepos, count_markers): Move decls to the only modules
20859 that need them.
20860 * region-cache.h (pp_cache): Likewise.
20861 * window.h (check_all_windows): Likewise.
20862 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20863
20864 * sysdep.c (croak): Now static, if
20865 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20866 * syssignal.h (croak): Declare only if not static.
20867
20868 * alloc.c (refill_memory_reserve): Now static if
20869 !defined REL_ALLOC || defined SYSTEM_MALLOC.
20870 * lisp.h (refill_memory_reserve): Declare only if not static.
20871
20872 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20873 Define only if USE_LUCID.
20874
20875 * xrdb.c (x_customization_string, x_rm_string): Now static.
20876
20877 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20878 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20879
20880 * xdisp.c (draw_row_with_mouse_face): Now static.
20881 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20882
20883 * window.h (check_all_windows): Mark externally visible.
20884
20885 * window.c (window_deletion_count): Now static.
20886
20887 * undo.c: Make symbols static if they're not exported.
20888 (last_undo_buffer, last_boundary_position, pending_boundary):
20889 Now static.
20890
20891 * textprop.c (interval_insert_behind_hooks): Now static.
20892 (interval_insert_in_front_hooks): Likewise.
20893
20894 * term.c: Make symbols static if they're not exported.
20895 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20896 (max_frame_lines, tty_set_terminal_modes):
20897 (tty_reset_terminal_modes, tty_turn_off_highlight):
20898 (get_tty_terminal): Now static.
20899 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20900 * termhooks.h (term_mouse_moveto): Do not declare if
20901 HAVE_WINDOW_SYSTEM.
20902 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20903 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20904
20905 * sysdep.c: Make symbols static if they're not exported.
20906 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20907 Now static.
20908 (sigprocmask_set, full_mask): Remove; unused.
20909 (wait_debugging): Mark as visible.
20910 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20911 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20912
20913 * syntax.c (syntax_temp): Define only if !__GNUC__.
20914
20915 * sound.c (current_sound_device, current_sound): Now static.
20916
20917 * search.c (searchbufs, searchbuf_head): Now static.
20918
20919 * scroll.c (scroll_cost): Remove; unused.
20920 * dispextern.h (scroll_cost): Remove decl.
20921
20922 * region-cache.h (pp_cache): Mark as externally visible.
20923
20924 * process.c: Make symbols static if they're not exported.
20925 (process_tick, update_tick, create_process, chan_process):
20926 (Vprocess_alist, proc_buffered_char, datagram_access):
20927 (fd_callback_data, send_process_frame, process_sent_to): Now static.
20928 (deactivate_process): Mark defn as static, as well as decl.
20929 * lisp.h (create_process): Remove decl.
20930 * process.h (chan_process, Vprocess_alist): Remove decls.
20931
20932 * print.c: Make symbols static if they're not exported.
20933 (print_depth, new_backquote_output, being_printed, print_buffer):
20934 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
20935 (print_interval, print_number_index, initial_stderr_stream):
20936 Now static.
20937 * lisp.h (Fprinc): Remove decl.
20938 (debug_output_compilation_hack): Mark as externally visible.
20939
20940 * sysdep.c (croak): Move decl from here to syssignal.h.
20941 * syssignal.h (croak): Put it here, so the API can be checked when
20942 'croak' is called from dissociate_if_controlling_tty.
20943
20944 * minibuf.c: Make symbols static if they're not exported.
20945 (minibuf_save_list, choose_minibuf_frame): Now static.
20946 * lisp.h (choose_minibuf_frame): Remove decl.
20947
20948 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
20949
20950 * lread.c: Make symbols static if they're not exported.
20951 (read_objects, initial_obarray, oblookup_last_bucket_number):
20952 Now static.
20953 (make_symbol): Remove; unused.
20954 * lisp.h (initial_obarray, make_symbol): Remove decls.
20955
20956 * keyboard.c: Make symbols static if they're not exported.
20957 (single_kboard, recent_keys_index, total_keys, recent_keys):
20958 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
20959 (this_single_command_key_start, echoing, last_auto_save):
20960 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
20961 (command_loop, echo_now, keyboard_init_hook, help_char_p):
20962 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
20963 (Vlispy_mouse_stem, double_click_count):
20964 Now static.
20965 (force_auto_save_soon): Define only if SIGDANGER.
20966 (ignore_mouse_drag_p): Now static if
20967 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
20968 (print_help): Remove; unused.
20969 (stop_character, last_timer_event): Mark as externally visible.
20970 * keyboard.h (ignore_mouse_drag_p): Declare only if
20971 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
20972 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
20973 * lisp.h (echoing): Remove decl.
20974 (force_auto_save_soon): Declare only if SIGDANGER.
20975 * xdisp.c (redisplay_window): Simplify code, to make it more
20976 obvious that ignore_mouse_drag_p is not accessed if !defined
20977 USE_GTK && !defined HAVE_NS.
20978
20979 * intervals.c: Make symbols static if they're not exported.
20980 (merge_properties_sticky, merge_interval_right, delete_interval):
20981 Now static.
20982 * intervals.h (merge_interval_right, delete_interval): Remove decls.
20983
20984 * insdel.c: Make symbols static if they're not exported.
20985 However, leave prepare_to_modify_buffer alone. It's never
20986 called from outside this function, but that appears to be a bug.
20987 (combine_after_change_list, combine_after_change_buffer):
20988 (adjust_after_replace, signal_before_change): Now static.
20989 (adjust_after_replace_noundo): Remove; unused.
20990 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
20991 (signal_before_change): Remove decls.
20992
20993 * indent.c (val_compute_motion, val_vmotion): Now static.
20994
20995 * image.c: Make symbols static if they're not exported.
20996 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
20997 if USE_GTK.
20998 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
20999 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21000
21001 * fringe.c (standard_bitmaps): Now static.
21002 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21003
21004 * frame.c: Make symbols static if they're not exported.
21005 (x_report_frame_params, make_terminal_frame): Now static.
21006 (get_frame_param): Now static, unless HAVE_NS.
21007 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21008 (x_get_resource_string): Remove; not used.
21009 * frame.h (make_terminal_frame, x_report_frame_params):
21010 (x_get_resource_string); Remove decls.
21011 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21012 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21013
21014 * font.c, fontset.c: Make symbols static if they're not exported.
21015 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21016 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21017 * font.c (font_close_object): Now static.
21018 * font.h (font_close_object): Remove.
21019 * fontset.c (FONTSET_OBJLIST): Remove.
21020 (free_realized_fontset) #if-0 the body, which does nothing.
21021 (face_suitable_for_char_p): #if-0, as it's never called.
21022 * fontset.h (face_suitable_for_char_p): Remove decl.
21023 * xfaces.c (face_at_string_position):
21024 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21025 since 0 is always ASCII.
21026
21027 * fns.c (weak_hash_tables): Now static.
21028
21029 * fileio.c: Make symbols static if they're not exported.
21030 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21031 (Vwrite_region_annotation_buffers): Now static.
21032
21033 * eval.c: Make symbols static if they're not exported.
21034 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21035 * lisp.h (backtrace_list): Remove decl.
21036
21037 * emacs.c: Make symbols static if they're not exported.
21038 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21039 (fatal_error_code, fatal_error_signal_hook, standard_args):
21040 Now static.
21041 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21042 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21043 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21044 * lisp.h (fatal_error_signal_hook): Remove decl.
21045 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21046
21047 * editfns.c: Move a (normally-unused) function to its only use.
21048 * editfns.c, lisp.h (get_operating_system_release): Remove.
21049 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21050 worth the hassle of breaking this out.
21051
21052 * xterm.c: Make symbols static if they're not exported.
21053 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21054 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21055 (x_destroy_window, x_delete_display):
21056 Now static.
21057 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21058 (x_mouse_leave): Remove; unused.
21059 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21060 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21061 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21062 Remove decls.
21063 (x_mouse_leave): Declare only if WINDOWSNT.
21064 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21065 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21066 USE_X_TOOLKIT.
21067
21068 * ftxfont.c: Make symbols static if they're not exported.
21069 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21070 HAVE_FREETYPE.
21071 * font.h (ftxfont_driver): Likewise.
21072
21073 * xfns.c: Make symbols static if they're not exported.
21074 (x_last_font_name, x_display_info_for_name):
21075 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21076 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21077 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21078 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21079 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21080 (last_show_tip_args): Now static.
21081 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21082 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21083 (x_screen_planes): Remove; unused.
21084 * dispextern.h (x_screen_planes): Remove decl.
21085
21086 * dispnew.c: Make symbols static if they're not exported.
21087 * dispextern.h (redraw_garbaged_frames, scrolling):
21088 (increment_row_positions): Remove.
21089 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21090 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21091 Now static.
21092 (redraw_garbaged_frames): Remove; unused.
21093
21094 * xfaces.c: Make symbols static if they're not exported.
21095 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21096 Remove decls.
21097 * xterm.h (defined_color): Remove decls.
21098 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21099 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21100 (menu_face_changed_default, defined_color, free_realized_face):
21101 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21102 (ascii_face_of_lisp_face): Remove; unused.
21103
21104 * xdisp.c: Make symbols static if they're not exported.
21105 * dispextern.h (scratch_glyph_row, window_box_edges):
21106 (glyph_to_pixel_coords, set_cursor_from_row):
21107 (get_next_display_element, set_iterator_to_next):
21108 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21109 (show_mouse_face): Remove decls
21110 * frame.h (message_buf_print): Likewise.
21111 * lisp.h (pop_message, set_message, check_point_in_composition):
21112 Likewise.
21113 * xterm.h (set_vertical_scroll_bar): Likewise.
21114 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21115 (message_buf_print, scratch_glyph_row, displayed_buffer):
21116 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21117 (get_next_display_element, show_mouse_face, window_box_edges):
21118 (frame_to_window_pixel_xy, check_point_in_composition):
21119 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21120 (glyph_to_pixel_coords): Remove; unused.
21121
21122 * dired.c (file_name_completion): Now static.
21123
21124 * dbusbind.c (xd_in_read_queued_messages): Now static.
21125
21126 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21127 * data.c (circular_list_error): Remove.
21128
21129 * commands.h (last_point_position, last_point_position_buffer):
21130 (last_point_position_window): Remove decls.
21131 * keyboard.c: Make these variables static.
21132
21133 * coding.h (coding, code_convert_region, encode_coding_gap):
21134 Remove decls.
21135 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21136 (iso_code_class, detect_coding, code_convert_region): Now static.
21137 (encode_coding_gap): Remove; unused.
21138
21139 * chartab.c (chartab_chars, chartab_bits): Now static.
21140
21141 * charset.h (charset_iso_8859_1): Remove decl.
21142 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21143 Now static.
21144
21145 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21146 * ccl.c (Vccl_program_table): Now static.
21147 (check_ccl_update): Remove; unused.
21148
21149 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21150 * category.h: ... from here.
21151 * category.c (check_category_table, set_category_set): Now static.
21152
21153 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21154 * lisp.h: Remove these decls.
21155
21156 * buffer.c (buffer_count): Remove unused var.
21157
21158 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21159 so that it's not optimized away.
21160 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21161 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21162 exported only to the debugger.
21163
21164 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21165 * atimer.h (run_all_atimers): Remove; not exported.
21166
21167 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21168 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21169 was inaccessible from Lisp.
21170 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21171 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21172
21173 alloc.c: Import and export fewer symbols, and remove unused items.
21174 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21175 is defined.
21176 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21177 it's not optimized away by whole-program optimization.
21178 (message_enable_multibyte, free_misc): Remove.
21179 (catchlist, handlerlist, mark_backtrace):
21180 Declare only if BYTE_MARK_STACK.
21181 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21182 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21183 (message_enable_multibyte): Remove decl.
21184 (free_misc, interval_free_list, float_block, float_block_index):
21185 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21186 (cons_free_list, last_marked_index):
21187 Now static.
21188 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21189 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21190 (mark_backtrace): Define only if BYTE_MARK_STACK.
21191 * xdisp.c (message_enable_multibyte): Now static.
21192
21193 Declare Lisp_Object Q* variables to be 'static' if not exported.
21194 This makes it easier for human readers (and static analyzers)
21195 to see whether these variables are used from other modules.
21196 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21197 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21198 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21199 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21200 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21201 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21202 * xmenu.c, xselect.c:
21203 Declare Q* vars static if they are not used in other modules.
21204 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21205 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21206 Remove decls of unexported vars.
21207 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21208
21209 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21210
21211 Make Emacs functions such as Fatom 'static' by default.
21212 This makes it easier for human readers (and static analyzers)
21213 to see whether these functions can be called from other modules.
21214 DEFUN now defines a static function. To make the function external
21215 so that it can be used in other C modules, use the new macro DEFUE.
21216 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21217 (Finit_image_library):
21218 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21219 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21220 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21221 Remove decls, since these functions are now static.
21222 (Funintern, Fget_internal_run_time): New decls, since these functions
21223 were already external.
21224
21225 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21226 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21227 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21228 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21229 * keyboard.c, keymap.c, lread.c:
21230 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21231 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21232 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21233 Mark functions with DEFUE instead of DEFUN,
21234 if they are used in other modules.
21235 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21236 decls for now-static functions.
21237 * buffer.h (Fdelete_overlay): Remove decl.
21238 * callproc.c (Fgetenv_internal): Mark as internal.
21239 * composite.c (Fremove_list_of_text_properties): Remove decl.
21240 (Fcomposition_get_gstring): New forward static decl.
21241 * composite.h (Fcomposite_get_gstring): Remove decl.
21242 * dired.c (Ffile_attributes): New forward static decl.
21243 * doc.c (Fdocumntation_property): New forward static decl.
21244 * eval.c (Ffetch_bytecode): New forward static decl.
21245 (Funintern): Remove extern decl; now in .h file where it belongs.
21246 * fileio.c (Fmake_symbolic_link): New forward static decl.
21247 * image.c (Finit_image_library): New forward static decl.
21248 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21249 * intervals.h (Fprevious_property_change):
21250 (Fremove_list_of_text_properties): Remove decls.
21251 * keyboard.c (Fthis_command_keys): Remove decl.
21252 (Fcommand_execute): New forward static decl.
21253 * keymap.c (Flookup_key): New forward static decl.
21254 (Fcopy_keymap): Now static.
21255 * keymap.h (Flookup_key): Remove decl.
21256 * process.c (Fget_process): New forward static decl.
21257 (Fprocess_datagram_address): Mark as internal.
21258 * syntax.c (Fsyntax_table_p): New forward static decl.
21259 (skip_chars): Remove duplicate decl.
21260 * textprop.c (Fprevious_property_change): New forward static decl.
21261 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21262 Now internal.
21263 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21264 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21265
21266 * editfns.c (Fformat): Remove unreachable code.
21267
21268 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21269
21270 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21271 change. (Bug#8496)
21272
21273 2011-04-13 Eli Zaretskii <eliz@gnu.org>
21274
21275 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21276 when at ZV. (Bug#8487)
21277
21278 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21279
21280 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21281 (Bug#8437)
21282 * keyboard.c (parse_tool_bar_item): Likewise.
21283 * sound.c (sound_cleanup, alsa_close): Likewise.
21284 * termcap.c (tgetent): Likewise.
21285 * xfns.c (x_default_font_parameter): Likewise.
21286 * xsettings.c (read_and_apply_settings): Likewise.
21287
21288 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21289 (overrun_check_free): Protoize.
21290
21291 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21292
21293 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21294 since callers should never pass a negative size.
21295 Change the signature to match that of plain 'read' and 'write'; see
21296 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21297 * lisp.h: Update prototypes of emacs_write and emacs_read.
21298
21299 2011-04-11 Eli Zaretskii <eliz@gnu.org>
21300
21301 * xdisp.c (redisplay_window): Don't try to determine the character
21302 position of the scroll margin if the window start point w->startp
21303 is outside the buffer's accessible region. (Bug#8468)
21304
21305 2011-04-10 Eli Zaretskii <eliz@gnu.org>
21306
21307 Fix write-region and its subroutines for buffers > 2GB.
21308 * fileio.c (a_write, e_write): Modify declaration of arguments and
21309 local variables to support buffers larger than 2GB.
21310 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21311
21312 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21313 argument, local variables, and return value.
21314
21315 * lisp.h: Update prototypes of emacs_write and emacs_read.
21316
21317 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21318
21319 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
21320
21321 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21322
21323 Fix more problems found by GCC 4.6.0's static checks.
21324
21325 * xdisp.c (vmessage): Use a better test for character truncation.
21326
21327 * charset.c (load_charset_map): <, not <=, for optimization,
21328 and to avoid potential problems with integer overflow.
21329 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
21330 * casetab.c (set_identity, shuffle): Likewise.
21331 * editfns.c (Fformat): Likewise.
21332 * syntax.c (skip_chars): Likewise.
21333
21334 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21335 This also lets GCC 4.6.0 generate slightly better loop code.
21336
21337 * callint.c (Fcall_interactively): <, not <=, for optimization.
21338 (Fcall_interactively): Count the number of arguments produced,
21339 not the number of arguments given. This is simpler and lets GCC
21340 4.6.0 generate slightly better code.
21341
21342 * ftfont.c: Distingish more carefully between FcChar8 and char.
21343 The previous code passed unsigned char * to a functions like
21344 strlen and xstrcasecmp that expect char *, which does not
21345 conform to the C standard.
21346 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21347 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21348 char * when the C standard requires it.
21349
21350 * keyboard.c (read_char): Remove unused var.
21351
21352 * eval.c: Port to Windows vsnprintf (Bug#8435).
21353 Include <limits.h>.
21354 (SIZE_MAX): Define if the headers do not.
21355 (verror): Do not give up if vsnprintf returns a negative count.
21356 Instead, grow the buffer. This ports to Windows vsnprintf, which
21357 does not conform to C99. Problem reported by Eli Zaretskii.
21358 Also, simplify the allocation scheme, by avoiding the need for
21359 calling realloc, and removing the ALLOCATED variable.
21360
21361 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21362
21363 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21364 But keep the doprint source code for now, as we might revamp it
21365 and use it again (Bug#8435).
21366 * lisp.h (doprnt): Remove.
21367 * Makefile.in (base_obj): Remove doprnt.o.
21368 * deps.mk (doprnt.o): Remove.
21369
21370 error: Print 32- and 64-bit integers portably (Bug#8435).
21371 Without this change, on typical 64-bit hosts error ("...%d...", N)
21372 was used to print both 32- and 64-bit integers N, which relied on
21373 undefined behavior.
21374 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
21375 * lisp.h (error, verror): Mark as printf-like functions.
21376 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21377 Report overflow in size calculations when allocating printf buffer.
21378 Do not truncate output string at its first null byte.
21379 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21380 Truncate the output at a character boundary, since vsnprintf does not
21381 do that.
21382 * charset.c (check_iso_charset_parameter): Convert internal
21383 character to string before calling 'error', since %c now has the
21384 printf meaning.
21385 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21386 overflow when computing char to be passed to 'error'. Do not
21387 pass Lisp_Object to 'error'; pass the integer instead.
21388 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21389 formatted with plain %d.
21390
21391 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21392
21393 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21394
21395 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21396
21397 * xterm.c (x_catch_errors): Remove duplicate declaration.
21398
21399 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21400
21401 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21402
21403 2011-04-10 Jim Meyering <meyering@redhat.com>
21404
21405 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21406 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21407 return ssize_t not "int", and use size_t as the buffer length.
21408 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21409 * gnutls.h: Update declarations.
21410 * process.c (read_process_output): Use ssize_t, to match.
21411 (send_process): Likewise.
21412
21413 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21414
21415 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21416
21417 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
21418
21419 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21420 Use unsigned char, to match FcChar8 type definition.
21421
21422 * xterm.c (handle_one_xevent):
21423 * xmenu.c (create_and_show_popup_menu):
21424 * xselect.c (x_decline_selection_request)
21425 (x_reply_selection_request): Avoid type-punned deref of X events.
21426
21427 2011-04-09 Eli Zaretskii <eliz@gnu.org>
21428
21429 Fix some uses of `int' instead of EMACS_INT.
21430 * search.c (string_match_1, fast_string_match)
21431 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21432 (scan_buffer, find_next_newline_no_quit)
21433 (find_before_next_newline, search_command, Freplace_match)
21434 (Fmatch_data): Make some `int' variables be EMACS_INT.
21435
21436 * xdisp.c (display_count_lines): 3rd argument and return value now
21437 EMACS_INT. All callers changed.
21438 (pint2hrstr): Last argument is now EMACS_INT.
21439
21440 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21441 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21442 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21443 (decode_coding_utf_16, decode_coding_emacs_mule)
21444 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21445 (decode_coding_ccl, decode_coding_charset)
21446 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21447 (decode_coding_iso_2022, decode_coding_emacs_mule)
21448 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21449 <char_offset, last_offset>: Declare EMACS_INT.
21450 (encode_coding_utf_8, encode_coding_utf_16)
21451 (encode_coding_emacs_mule, encode_invocation_designation)
21452 (encode_designation_at_bol, encode_coding_iso_2022)
21453 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21454 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21455 Declare EMACS_INT.
21456 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21457 (encode_invocation_designation): Last argument P_NCHARS is now
21458 EMACS_INT.
21459 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21460 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21461
21462 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21463 All users changed.
21464
21465 * ccl.c (Fccl_execute_on_string): Declare some variables
21466 EMACS_INT.
21467
21468 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
21469
21470 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21471
21472 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21473
21474 * process.c (Fformat_network_address): Doc fix.
21475
21476 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21477
21478 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
21479
21480 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
21481
21482 * keyboard.c (read_char): Call Lisp function help-form-show,
21483 instead of using internal_with_output_to_temp_buffer.
21484 (Qhelp_form_show): New var.
21485 (syms_of_keyboard): Use DEFSYM macro.
21486
21487 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21488
21489 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21490
21491 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
21492
21493 * process.c (Flist_processes): Remove to Lisp.
21494 (list_processes_1): Delete.
21495
21496 2011-04-06 Eli Zaretskii <eliz@gnu.org>
21497
21498 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21499
21500 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21501
21502 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
21503
21504 Fix more problems found by GCC 4.6.0's static checks.
21505
21506 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21507
21508 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21509
21510 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
21511
21512 * xdisp.c (vmessage): Mark as a printf-like function.
21513
21514 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21515
21516 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21517
21518 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21519 printf-like functions.
21520 (tiff_load): Add casts to remove these marks before passing them
21521 to system-supplied API.
21522
21523 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21524
21525 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21526 This avoids several warnings with gcc -Wstrict-overflow.
21527 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21528 directly, rather than having caller test rule sign. This avoids
21529 some unnecessary tests.
21530 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21531 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21532 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
21533
21534 * xfont.c (xfont_text_extents): Remove var that was set but not used.
21535 (xfont_open): Avoid unnecessary tests.
21536
21537 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21538
21539 * composite.h, composite.c (composition_gstring_put_cache):
21540 Use EMACS_INT, not int, for length.
21541
21542 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21543 breaking out part of COMPOSITION_DECODE_RULE.
21544 (COMPOSITION_DECODE_RULE): Use it.
21545 * composite.c (get_composition_id): Remove unused local vars,
21546 by using the new macro.
21547
21548 * textprop.c (set_text_properties_1): Change while to do-while,
21549 since the condition is always true at first.
21550
21551 * intervals.c (graft_intervals_into_buffer): Mark var as used.
21552 (interval_deletion_adjustment): Return unsigned value.
21553 All uses changed.
21554
21555 * process.c (list_processes_1, create_pty, read_process_output):
21556 (exec_sentinel): Remove vars that were set but not used.
21557 (create_pty): Remove unnecessary "volatile"s.
21558 (Fnetwork_interface_info): Avoid possibility of int overflow.
21559 (read_process_output): Do adaptive read buffering even if carryover.
21560 (read_process_output): Simplify nbytes computation if buffered.
21561
21562 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21563
21564 * syntax.c (scan_words): Remove var that was set but not used.
21565 (update_syntax_table): Use unsigned instead of int.
21566
21567 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
21568 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
21569 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
21570
21571 * print.c (print_error_message): Avoid int overflow.
21572
21573 * font.c (font_list_entities): Redo for clarity,
21574 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21575
21576 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
21577 (font_score): Avoid potential overflow in diff calculation.
21578
21579 * fns.c (substring_both): Remove var that is set but not used.
21580 (sxhash): Redo loop for clarity and to avoid wraparound warning.
21581
21582 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21583
21584 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21585 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21586 can always succeed if overflow has undefined behavior.
21587
21588 * search.c (boyer_moore, wordify): Remove vars set but not used.
21589 (wordify): Omit three unnecessary tests.
21590
21591 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21592 All callers changed. This avoids the need for an unused var.
21593
21594 * casefiddle.c (casify_region): Remove var that is set but not used.
21595
21596 * dired.c (file_name_completion): Remove var that is set but not used.
21597
21598 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21599
21600 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
21601 (Finsert_file_contents): Remove unnecessary code checking fd.
21602
21603 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21604 Check for integer overflow on size calculations.
21605
21606 * buffer.c (Fprevious_overlay_change): Remove var that is set
21607 but not used.
21608
21609 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21610 Remove vars that are set but not used.
21611 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
21612 (timer_check_2): Mark vars as initialized.
21613
21614 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21615
21616 * image.c (lookup_image): Remove var that is set but not used.
21617 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
21618
21619 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21620 that are set but not used.
21621
21622 * xfns.c (make_invisible_cursor): Don't return garbage
21623 if XCreateBitmapFromData fails (Bug#8410).
21624
21625 * xselect.c (x_get_local_selection, x_handle_property_notify):
21626 Remove vars that are set but not used.
21627
21628 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
21629 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
21630
21631 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21632 Remove var that is set but not used.
21633 (scroll_bar_windows_size): Now size_t, not int.
21634 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21635 Check for overflow.
21636
21637 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21638 (map_tty_color) [!defined MSDOS]: Likewise.
21639
21640 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21641
21642 * coding.c: Remove vars that are set but not used.
21643 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21644 All callers changed.
21645 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21646 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21647 (decode_coding_charset): Remove vars that are set but not used.
21648
21649 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21650 that is set but not used.
21651
21652 * print.c (print_object): Remove var that is set but not used.
21653
21654 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
21655 The gnulib version avoids calling malloc in the usual case,
21656 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21657 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21658 * filelock.c (current_lock_owner): Likewise.
21659 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21660 * sysdep.c: Include allocator.h, careadlinkat.h.
21661 (emacs_no_realloc_allocator): New static constant.
21662 (emacs_readlink): New function.
21663 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21664 ../lib/careadlinkat.h.
21665
21666 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21667
21668 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21669 first non-nil return value).
21670
21671 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21672
21673 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21674 if not defined (Bug#8403).
21675
21676 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21677
21678 * xdisp.c (display_count_lines): Remove parameter `start',
21679 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21680 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21681 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21682 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21683 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21684 and thereabouts. All callers changed.
21685 (get_per_char_metric): Remove parameter `f', unused since
21686 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21687
21688 2011-04-02 Jim Meyering <meyering@redhat.com>
21689
21690 do not dereference NULL upon failed strdup
21691 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21692 (ns_get_family): Likewise.
21693
21694 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
21695
21696 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21697
21698 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21699
21700 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21701 later (Bug#8403).
21702
21703 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21704
21705 Add lexical binding.
21706
21707 * window.c (Ftemp_output_buffer_show): New fun.
21708 (Fsave_window_excursion):
21709 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21710
21711 * lread.c (lisp_file_lexically_bound_p): New function.
21712 (Fload): Bind Qlexical_binding.
21713 (readevalloop): Remove `evalfun' arg.
21714 Bind Qinternal_interpreter_environment.
21715 (Feval_buffer): Bind Qlexical_binding.
21716 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21717 Mark as dynamic.
21718 (syms_of_lread): Declare `lexical-binding'.
21719
21720 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21721
21722 * keyboard.c (eval_dyn): New fun.
21723 (menu_item_eval_property): Use it.
21724
21725 * image.c (parse_image_spec): Use Ffunctionp.
21726
21727 * fns.c (concat, mapcar1): Accept byte-code-functions.
21728
21729 * eval.c (Fsetq): Handle lexical vars.
21730 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21731 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21732 (FletX, Flet): Obey lexical binding.
21733 (Fcommandp): Handle closures.
21734 (Feval): New `lexical' arg.
21735 (eval_sub): New function extracted from Feval. Use it almost
21736 everywhere where Feval was used. Look up vars in lexical env.
21737 Handle closures.
21738 (Ffunctionp): Move from subr.el.
21739 (Ffuncall): Handle closures.
21740 (apply_lambda): Remove `eval_flags'.
21741 (funcall_lambda): Handle closures and new byte-code-functions.
21742 (Fspecial_variable_p): New function.
21743 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21744 but without exporting it to Lisp.
21745
21746 * doc.c (Fdocumentation, store_function_docstring):
21747 * data.c (Finteractive_form): Handle closures.
21748
21749 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21750 interactive spec.
21751
21752 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21753 New byte-codes.
21754 (exec_byte_code): New function extracted from Fbyte_code to handle new
21755 calling convention for byte-code-functions. Add new byte-codes.
21756
21757 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
21758
21759 * alloc.c (Fmake_symbol): Init new `declared_special' field.
21760
21761 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21762
21763 * xdisp.c (redisplay_internal): Fix prototype.
21764
21765 2011-03-31 Eli Zaretskii <eliz@gnu.org>
21766
21767 * xdisp.c (SCROLL_LIMIT): New macro.
21768 (try_scrolling): Use it when setting scroll_limit.
21769 Limit scrolling to 100 screen lines.
21770 (redisplay_window): Even when falling back on "recentering",
21771 position point in the window according to scroll-conservatively,
21772 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21773
21774 (try_scrolling): When point is above the window, allow searching
21775 as far as scroll_max, or one screenful, to compute vertical
21776 distance from PT to the scroll margin position. This prevents
21777 try_scrolling from unnecessarily failing when
21778 scroll-conservatively is set to a value slightly larger than the
21779 window height. Clean up the case of PT below the margin at bottom
21780 of window: scroll_max can no longer be INT_MAX. When aggressive
21781 scrolling is in use, don't let point enter the opposite scroll
21782 margin as result of the scroll.
21783 (syms_of_xdisp) <scroll-conservatively>: Document the
21784 threshold of 100 lines for never-recentering scrolling.
21785
21786 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
21787
21788 * dispextern.h (move_it_by_lines):
21789 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21790 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21791 (message_log_check_duplicate): Remove parameters `prev_bol' and
21792 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21793 (redisplay_internal): Remove parameter `preserve_echo_area',
21794 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
21795
21796 * indent.c (Fvertical_motion):
21797 * window.c (window_scroll_pixel_based, Frecenter):
21798 Don't pass `need_y_p' to `move_it_by_lines'.
21799
21800 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
21801
21802 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21803 steal a few bits to be more compact.
21804 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21805 Remove unneeded casts.
21806
21807 * bytecode.c (Fbyte_code): CAR and CDR can GC.
21808
21809 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
21810
21811 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21812 binding" message (bug#7967).
21813
21814 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
21815
21816 Fix more problems found by GCC 4.6.0's static checks.
21817
21818 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21819 Remove unused local var.
21820
21821 * editfns.c (Fmessage_box): Remove unused local var.
21822
21823 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21824 (note_mode_line_or_margin_highlight, note_mouse_highlight):
21825 Omit unused local vars.
21826 * window.c (shrink_windows): Omit unused local var.
21827 * menu.c (digest_single_submenu): Omit unused local var.
21828 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21829 Omit unused local var.
21830
21831 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21832 Don't assume string length fits in int.
21833 (keyremap_step, read_key_sequence): Use size_t for sizes.
21834 (read_key_sequence): Don't check last_real_key_start redundantly.
21835
21836 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21837 instead of alloca (Bug#8344).
21838
21839 * eval.c (Fbacktrace): Don't assume nargs fits in int.
21840 (Fbacktrace_frame): Don't assume nframes fits in int.
21841
21842 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21843
21844 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21845 concerns.
21846
21847 * term.c (produce_glyphless_glyph): Remove unnecessary test.
21848
21849 * cm.c (calccost): Turn while-do into do-while, for clarity.
21850
21851 * keyboard.c (syms_of_keyboard): Use the same style as later
21852 in this function when indexing through an array. This also
21853 works around GCC bug 48267.
21854
21855 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21856
21857 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21858
21859 * chartab.c (sub_char_table_ref_and_range): Redo for slight
21860 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21861
21862 * keyboard.c, keyboard.h (num_input_events): Now size_t.
21863 This avoids undefined behavior on integer overflow, and is a bit
21864 more convenient anyway since it is compared to a size_t variable.
21865
21866 Variadic C functions now count arguments with size_t, not int.
21867 This avoids an unnecessary limitation on 64-bit machines, which
21868 caused (substring ...) to crash on large vectors (Bug#8344).
21869 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21870 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
21871 All variadic functions and their callers changed accordingly.
21872 (struct gcpro.nvars): Now size_t, not int. All uses changed.
21873 * data.c (arith_driver, float_arith_driver): Likewise.
21874 * editfns.c (general_insert_function): Likewise.
21875 * eval.c (struct backtrace.nargs, interactive_p)
21876 (internal_condition_case_n, run_hook_with_args, apply_lambda)
21877 (funcall_lambda, mark_backtrace): Likewise.
21878 * fns.c (concat): Likewise.
21879 * frame.c (x_set_frame_parameters): Likewise.
21880 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21881 0 if not found, not -1. All callers changed.
21882
21883 * alloc.c (garbage_collect): Don't assume stack size fits in int.
21884 (stack_copy_size): Now size_t, not int.
21885 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21886
21887 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21888
21889 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21890 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21891 All callers changed.
21892
21893 * lisp.h (multibyte_char_to_unibyte):
21894 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21895 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
21896 * character.h (CHAR_TO_BYTE8):
21897 * cmds.c (internal_self_insert):
21898 * editfns.c (general_insert_function):
21899 * keymap.c (push_key_description):
21900 * search.c (Freplace_match):
21901 * xdisp.c (message_dolog, set_message_1): All callers changed.
21902
21903 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
21904
21905 * keyboard.c (safe_run_hook_funcall): New function.
21906 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21907 don't set the hook to nil, but remove the offending function instead.
21908 (Qcommand_hook_internal): Remove, unused.
21909 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21910 Vcommand_hook_internal.
21911
21912 * eval.c (enum run_hooks_condition): Remove.
21913 (funcall_nil, funcall_not): New functions.
21914 (run_hook_with_args): Call each function through a `funcall' argument.
21915 Remove `cond' argument, now redundant.
21916 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21917 (Frun_hook_with_args_until_failure): Adjust accordingly.
21918 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21919
21920 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
21921
21922 * dispextern.h (string_buffer_position): Remove declaration.
21923
21924 * print.c (strout): Remove parameter `multibyte', unused since
21925 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
21926
21927 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21928 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
21929 All callers changed.
21930
21931 * w32.c (_wsa_errlist): Use braces for struct initializers.
21932
21933 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21934 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
21935 All callers changed.
21936 (string_buffer_position): Likewise. Also, make static (it's never
21937 used outside xdisp.c).
21938 (cursor_row_p): Remove parameter `w', unused since
21939 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
21940 (decode_mode_spec): Remove parameter `precision', introduced during
21941 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
21942 All callers changed.
21943
21944 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21945
21946 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
21947
21948 2011-03-27 Anders Lindgren <andlind@gmail.com>
21949
21950 * nsterm.m (ns_menu_bar_is_hidden): New variable.
21951 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
21952 (ns_update_auto_hide_menu_bar): New functions.
21953 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
21954 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
21955 ns_constrain_all_frames.
21956 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
21957 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
21958
21959 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
21960
21961 * nsmenu.m (runDialogAt): Remove argument to timer_check.
21962
21963 2011-03-27 Glenn Morris <rgm@gnu.org>
21964
21965 * syssignal.h: Replace RETSIGTYPE with void.
21966 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
21967 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
21968 Replace SIGTYPE with void everywhere.
21969 * s/usg5-4-common.h (SIGTYPE): Remove definition.
21970 * s/template.h (SIGTYPE): Remove commented out definition.
21971
21972 2011-03-26 Eli Zaretskii <eliz@gnu.org>
21973
21974 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
21975 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
21976
21977 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
21978
21979 * w32.c (read_unc_volume): Use parameter `henum', instead of
21980 global variable `wget_enum_handle'.
21981
21982 * keymap.c (describe_vector): Remove parameters `indices' and
21983 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
21984 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
21985
21986 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
21987
21988 * keyboard.c (timer_check): Remove parameter `do_it_now',
21989 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
21990 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
21991 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
21992
21993 * keyboard.c (read_char):
21994 * w32menu.c (w32_menu_display_help):
21995 * xmenu.c (show_help_event, menu_help_callback):
21996 Adjust calls to `show_help_echo'.
21997
21998 * gtkutil.c (xg_maybe_add_timer):
21999 * keyboard.c (readable_events):
22000 * process.c (wait_reading_process_output):
22001 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22002
22003 * insdel.c (adjust_markers_gap_motion):
22004 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22005 (gap_left, gap_right): Don't call it.
22006
22007 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
22008
22009 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22010 incurred during fontification.
22011
22012 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22013
22014 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22015 (DEFVAR_PER_BUFFER): Don't pass it.
22016
22017 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22018 (scrolling_window): Don't pass it.
22019
22020 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
22021
22022 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22023
22024 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22025 and `suffix'.
22026 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22027 of variables specific to SELinux and computation of `encoded_absname'.
22028
22029 * image.c (XPutPixel): Remove unused variable `height'.
22030
22031 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22032
22033 * unexw32.c (get_section_info): Remove unused variable `section'.
22034
22035 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22036 (system_process_attributes): Remove unused variable `sess'.
22037 (sys_read): Remove unused variable `err'.
22038
22039 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22040 (w32_wnd_proc): Remove unused variable `isdead'.
22041 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22042 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22043 (x_create_tip_frame): Remove unused variable `tem'.
22044
22045 * w32inevt.c (w32_console_read_socket):
22046 Remove unused variable `no_events'.
22047
22048 * w32term.c (x_draw_composite_glyph_string_foreground):
22049 Remove unused variable `width'.
22050
22051 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
22052
22053 * w32term.c (x_set_glyph_string_clipping):
22054 Don't pass uninitialized region to CombineRgn.
22055
22056 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
22057
22058 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22059 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22060 (Fx_close_connection): Remove unused variable `i'.
22061
22062 * w32font.c (w32font_draw): Return number of glyphs.
22063 (w32font_open_internal): Remove unused variable `i'.
22064 (w32font_driver): Add missing initializer.
22065
22066 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22067 (fill_in_menu): Remove unused variable `items_added'.
22068
22069 * w32term.c (last_mouse_press_frame): Remove static global variable.
22070 (w32_clip_to_row): Remove unused variable `f'.
22071 (x_delete_terminal): Remove unused variable `i'.
22072
22073 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22074 (NOTHING): Remove unused static global variable.
22075 (uniscribe_check_otf): Remove unused variable `table'.
22076 (uniscribe_font_driver): Add missing initializers.
22077
22078 2011-03-23 Julien Danjou <julien@danjou.info>
22079
22080 * term.c (Fsuspend_tty, Fresume_tty):
22081 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22082 * window.c (temp_output_buffer_show):
22083 * insdel.c (signal_before_change):
22084 * frame.c (Fhandle_switch_frame):
22085 * fileio.c (Fdo_auto_save):
22086 * emacs.c (Fkill_emacs):
22087 * editfns.c (save_excursion_restore):
22088 * cmds.c (internal_self_insert):
22089 * callint.c (Fcall_interactively):
22090 * buffer.c (Fkill_all_local_variables):
22091 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22092 Use Frun_hooks.
22093 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
22094 unconditionally since it does the check itself.
22095
22096 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
22097
22098 Fix more problems found by GCC 4.5.2's static checks.
22099
22100 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22101 the first time through the loop, since we know p0 < p1 then.
22102 This also avoids a gcc -Wstrict-overflow warning.
22103
22104 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22105 leading to a memory leak, possible in functions like
22106 load_charset_map_from_file that can allocate an unbounded number
22107 of objects (Bug#8318).
22108
22109 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22110 that could (at least in theory) be that large.
22111
22112 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22113 This is less likely to overflow, and avoids undefined behavior if
22114 overflow does occur. All callers changed. Use strtoul to scan
22115 for the unsigned long integer.
22116 (pint2hrstr): Simplify and tune code slightly.
22117 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22118
22119 * scroll.c (do_scrolling): Work around GCC bug 48228.
22120 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22121
22122 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22123 This also avoids a warning with gcc -Wstrict-overflow.
22124 (validate_x_resource_name): Simplify count usage.
22125 This also avoids a warning with gcc -Wstrict-overflow.
22126
22127 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22128 fail (Bug#8306).
22129
22130 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22131
22132 * process.c (Fmake_network_process): Use socklen_t, not int,
22133 where POSIX says socklen_t is required in portable programs.
22134 This fixes a porting bug on hosts like 64-bit HP-UX, where
22135 socklen_t is wider than int (Bug#8277).
22136 (Fmake_network_process, server_accept_connection):
22137 (wait_reading_process_output, read_process_output):
22138 Likewise.
22139
22140 * process.c: Rename or move locals to avoid shadowing.
22141 (list_processes_1, Fmake_network_process):
22142 (read_process_output_error_handler, exec_sentinel_error_handler):
22143 Rename or move locals.
22144 (Fmake_network_process): Define label "retry_connect" only if needed.
22145 (Fnetwork_interface_info): Fix pointer signedness.
22146 (process_send_signal): Add cast to avoid pointer signedness problem.
22147 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22148 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22149
22150 Make tparam.h and terminfo.c consistent.
22151 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22152 Include tparam.h instead, since it declares them.
22153 * cm.h (PC): Remove extern decl; tparam.h now does this.
22154 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22155 * terminfo.c: Include tparam.h, to check interfaces.
22156 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22157 (tparam): Adjust signature to match interface in tparam.h;
22158 this removes some undefined behavior. Check that outstring and len
22159 are zero, which they always are with Emacs.
22160 * tparam.h (PC, BC, UP): New extern decls.
22161
22162 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22163 (xftfont_open): Rename locals to avoid shadowing.
22164
22165 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22166 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22167 (OTF_TAG_SYM): Omit macro if not needed.
22168 (ftfont_list): Remove unused local.
22169 (get_adstyle_property, ftfont_pattern_entity):
22170 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22171 Rename locals to avoid shadowing.
22172
22173 * xfont.c (xfont_list_family): Mark var as initialized.
22174
22175 * xml.c (make_dom): Now static.
22176
22177 * composite.c (composition_compute_stop_pos): Rename local to
22178 avoid shadowing.
22179 (composition_reseat_it): Remove unused locals.
22180 (find_automatic_composition, composition_adjust_point): Likewise.
22181 (composition_update_it): Mark var as initialized.
22182 (find_automatic_composition): Mark vars as initialized,
22183 with a FIXME (Bug#8290).
22184
22185 character.h: Rename locals to avoid shadowing.
22186 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22187 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22188 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22189 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22190 to avoid shadowing.
22191
22192 * textprop.c (property_change_between_p): Remove; unused.
22193
22194 * intervals.c (interval_start_pos): Now static.
22195
22196 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22197
22198 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22199 Rename locals to avoid shadowing.
22200
22201 * sound.c (wav_play, au_play, Fplay_sound_internal):
22202 Fix pointer signedness.
22203 (alsa_choose_format): Remove unused local var.
22204 (wav_play): Initialize a variable to 0, to prevent undefined
22205 behavior (Bug#8278).
22206
22207 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22208
22209 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22210
22211 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22212 clobbering (Bug#8298).
22213 * sysdep.c (sys_subshell): Likewise.
22214 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22215
22216 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22217 This should get cleaned up, so that child_setup has the
22218 same signature on all platforms.
22219
22220 * callproc.c (call_process_cleanup): Now static.
22221 (relocate_fd): Rename locals to avoid shadowing.
22222
22223 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
22224
22225 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22226 not to be necessary, and produces flickering.
22227
22228 2011-03-20 Glenn Morris <rgm@gnu.org>
22229
22230 * config.in: Remove file.
22231
22232 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
22233
22234 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22235 are now in src/globals.h.
22236 (syms_of_minibuf): Remove spurious & from previous change.
22237
22238 2011-03-20 Leo Liu <sdl.web@gmail.com>
22239
22240 * minibuf.c (completing-read-function): New variable.
22241 (completing-read-default): Rename from completing-read.
22242 (completing-read): Call completing-read-function.
22243
22244 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22245
22246 * xfaces.c (Fx_load_color_file):
22247 Read color file from absolute filename (bug#8250).
22248
22249 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
22250
22251 * makefile.w32-in: Update dependencies.
22252
22253 2011-03-17 Eli Zaretskii <eliz@gnu.org>
22254
22255 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22256
22257 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22258
22259 Fix more problems found by GCC 4.5.2's static checks.
22260
22261 * process.c (make_serial_process_unwind, send_process_trap):
22262 (sigchld_handler): Now static.
22263
22264 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22265 That way, the code declares only the vars that it needs.
22266 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22267 * s/cygwin.h (PTY_ITERATION): Likewise.
22268 * s/darwin.h (PTY_ITERATION): Likewise.
22269 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22270
22271 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22272 * process.c (allocate_pty): Don't declare stb unless it's needed.
22273
22274 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
22275 (CONSTANTLIM): Remove; unused.
22276 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22277 Define only if needed.
22278
22279 * unexelf.c (unexec): Name an expression,
22280 to avoid gcc -Wbad-function-cast warning.
22281 Use a different way to cause a compilation error if anyone uses
22282 n rather than nn, a way that does not involve shadowing.
22283 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
22284
22285 * deps.mk (unexalpha.o): Remove; unused.
22286
22287 New file unexec.h, the (simple) interface for unexec (Bug#8267).
22288 * unexec.h: New file.
22289 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22290 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22291 Depend on unexec.h.
22292 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22293 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22294 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
22295 Change as necessary to match prototype in unexec.h.
22296
22297 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22298 shadowing.
22299 (back_comment, skip_chars): Mark vars as initialized.
22300
22301 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22302 Rename locals to avoid shadowing.
22303
22304 * lread.c (read1): Rewrite so as not to use empty "else".
22305 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
22306
22307 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22308
22309 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22310 warning when compiling print.c.
22311
22312 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22313 instead of using an uninitialized var.
22314 (font_sort_entities): Mark var as initialized.
22315
22316 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22317
22318 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22319 pointers to constants.
22320 (font_parse_fcname): Remove unused vars.
22321 (font_delete_unmatched): Now static.
22322 (font_get_spec): Remove; unused.
22323 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22324 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22325 Rename or move locals to avoid shadowing.
22326
22327 * fns.c (require_nesting_list, require_unwind): Now static.
22328 (Ffillarray): Rename locals to avoid shadowing.
22329
22330 * floatfns.c (domain_error2): Define only if needed.
22331 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
22332
22333 * alloc.c (mark_backtrace): Move decl from here ...
22334 * lisp.h: ... to here, so that it can be checked.
22335
22336 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
22337 (Fdefvar): Rewrite so as not to use empty "else".
22338 (lisp_indirect_variable): Name an expression,
22339 to avoid gcc -Wbad-function-cast warning.
22340 (Fdefvar): Rename locals to avoid shadowing.
22341
22342 * callint.c (quotify_arg, quotify_args): Now static.
22343 (Fcall_interactively): Rename locals to avoid shadowing.
22344 Use const pointer when appropriate.
22345
22346 * lisp.h (get_system_name, get_operating_system_release):
22347 Move decls here, to check interfaces.
22348 * process.c (get_operating_system_release): Move decl to lisp.h.
22349 * xrdb.c (get_system_name): Likewise.
22350 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22351 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22352 some of which prompt warnings from gcc -Wbad-function-cast.
22353 (Fformat_time_string, Fencode_time, Finsert_char):
22354 (Ftranslate_region_internal, Fformat):
22355 Rename or remove local vars to avoid shadowing.
22356 (Ftranslate_region_internal): Mark var as initialized.
22357
22358 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22359 avoid shadowing.
22360
22361 * lisp.h (eassert): Check that the argument compiles, even if
22362 ENABLE_CHECKING is not defined.
22363
22364 * data.c (Findirect_variable): Name an expression, to avoid
22365 gcc -Wbad-function-cast warning.
22366 (default_value, arithcompare, arith_driver, arith_error): Now static.
22367 (store_symval_forwarding): Rename local to avoid shadowing.
22368 (Fmake_variable_buffer_local, Fmake_local_variable):
22369 Mark variables as initialized.
22370 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
22371
22372 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
22373 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22374 Rename locals to avoid shadowing.
22375 (mark_stack): Move local variables into the #ifdef region where
22376 they're used.
22377 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22378 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22379 needed otherwise.
22380 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22381 (GC_STRING_CHARS): Remove; not used.
22382 (Fmemory_limit): Cast sbrk's returned value to char *.
22383
22384 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22385 avoids undefined behavior in theory.
22386
22387 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22388
22389 Use functions, not macros, for up- and down-casing (Bug#8254).
22390 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22391 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22392 to use the following functions instead of these macros.
22393 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22394 EMACS_INT, since callers assume the returned value fits in int.
22395 (upcase1): Likewise, for UPCASE_TABLE.
22396 (uppercasep, lowercasep, upcase): New static inline functions.
22397 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
22398 the race-condition problem in the old DOWNCASE.
22399
22400 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22401 Rename locals to avoid shadowing.
22402 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
22403 (regex_compile, re_search_2, re_match_2_internal):
22404 Remove unused local vars.
22405 (FREE_VAR): Rewrite so as not to use empty "else",
22406 which gcc can warn about.
22407 (regex_compile, re_match_2_internal): Mark locals as initialized.
22408 (RETALLOC_IF): Define only if needed.
22409 (WORDCHAR_P): Likewise. This one is never needed, but is used
22410 only in a comment talking about a compiler bug, so put inside
22411 the #if 0 of that comment.
22412 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22413 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22414 Remove; unused.
22415
22416 * search.c (boyer_moore): Rename locals to avoid shadowing.
22417 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22418 (PREV_CHAR_BOUNDARY): Likewise.
22419
22420 * search.c (simple_search): Remove unused var.
22421
22422 * dired.c (compile_pattern): Move decl from here ...
22423 * lisp.h: ... to here, so that it can be checked.
22424 (struct re_registers): New forward decl.
22425
22426 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22427
22428 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22429 All uses changed.
22430 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22431 Rename locals to avoid shadowing.
22432 (Fvertical_motion): Mark locals as initialized.
22433
22434 * casefiddle.c (casify_object, casify_region): Now static.
22435 (casify_region): Mark local as initialized.
22436
22437 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22438
22439 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22440 New macros, so that the caller can use some names other than
22441 gcpro1, gcpro2, etc.
22442 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22443 of the new macros.
22444 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22445 argument, for consistency with GCPRO2_VAR, etc: it is now the
22446 prefix of the variable, not the variable itself. All uses
22447 changed.
22448 * dired.c (directory_files_internal, file_name_completion):
22449 Rename locals to avoid shadowing.
22450
22451 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22452 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22453 dired.c's scmp function, had undefined behavior.
22454 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22455 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22456 * buffer.h: ... to here, because these macros use current_buffer,
22457 and the new implementation with inline functions needs to have
22458 current_buffer in scope now, rather than later when the macros
22459 are used.
22460 (downcase, upcase1): New static inline functions.
22461 (DOWNCASE, UPCASE1): Reimplement using these functions.
22462 This avoids undefined behavior in expressions like
22463 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22464 from race conditions in accessing the global variables
22465 case_temp1 and case_temp2.
22466 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22467 * lisp.h (case_temp1, case_temp2): Remove their decls.
22468 * character.h (ASCII_CHAR_P): Move from here ...
22469 * lisp.h: ... to here, so that the inline functions mentioned
22470 above can use them.
22471
22472 * dired.c (directory_files_internal_unwind): Now static.
22473
22474 * fileio.c (file_name_as_directory, directory_file_name):
22475 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22476 Now static.
22477 (file_name_as_directory): Use const pointers when appropriate.
22478 (Fexpand_file_name): Likewise. In particular, newdir might
22479 point at constant storage, so make it a const pointer.
22480 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
22481 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22482 signedness issues.
22483 (Fset_file_times, Finsert_file_contents, auto_save_error):
22484 Rename locals to avoid shadowing.
22485
22486 * minibuf.c (choose_minibuf_frame_1): Now static.
22487 (Ftry_completion, Fall_completions): Rename or remove locals
22488 to avoid shadowing.
22489
22490 * marker.c (bytepos_to_charpos): Remove; unused.
22491
22492 * lisp.h (verify_bytepos, count_markers): New decls,
22493 so that gcc does not warn that these functions aren't declared.
22494
22495 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22496 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
22497 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
22498 (copy_text): Remove unused local var.
22499
22500 * filelock.c (within_one_second): Now static.
22501 (lock_file_1): Rename local to avoid shadowing.
22502
22503 * buffer.c (fix_overlays_before): Mark locals as initialized.
22504 (fix_start_end_in_overlays): Likewise. This function should be
22505 simplified by using pointers-to-pointers, but that's a different
22506 matter.
22507 (switch_to_buffer_1): Now static.
22508 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22509 (report_overlay_modification): Rename locals to avoid shadowing.
22510
22511 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
22512 Fix pointer signedness issue.
22513 (sys_subshell): Mark local as volatile if checking for lint,
22514 to suppress a gcc -Wclobbered warning that does not seem to be right.
22515 (MAXPATHLEN): Define only if needed.
22516
22517 * process.c (serial_open, serial_configure): Move decls from here ...
22518 * systty.h: ... to here, so that they can be checked.
22519
22520 * fns.c (get_random, seed_random): Move extern decls from here ...
22521 * lisp.h: ... to here, so that they can be checked.
22522
22523 * sysdep.c (reset_io): Now static.
22524 (wait_for_termination_signal): Remove; unused.
22525
22526 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22527 (copy_keymap_item, append_key, push_text_char_description):
22528 Now static.
22529 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
22530 (DENSE_TABLE_SIZE): Remove; unused.
22531 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22532 (describe_map_tree):
22533 Rename locals to avoid shadowing.
22534
22535 * keyboard.c: Declare functions static if they are not used elsewhere.
22536 (echo_char, echo_dash, cmd_error, top_level_2):
22537 (poll_for_input, handle_async_input): Now static.
22538 (read_char, kbd_buffer_get_event, make_lispy_position):
22539 (make_lispy_event, make_lispy_movement, apply_modifiers):
22540 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22541 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22542 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
22543 (read_key_sequence, read_char): Mark locals as initialized.
22544 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
22545
22546 * keyboard.h (make_ctrl_char): New decl.
22547 (mark_kboards): Move decl here ...
22548 * alloc.c (mark_kboards): ... from here.
22549
22550 * lisp.h (force_auto_save_soon): New decl.
22551
22552 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
22553 (DEFINE_DUMMY_FUNCTION): New macro.
22554 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22555 Use it.
22556 (main): Add casts to avoid warnings
22557 if GCC considers string literals to be constants.
22558
22559 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22560
22561 * dbusbind.c: Pointer signedness fixes.
22562 (xd_signature, xd_append_arg, xd_initialize):
22563 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22564 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22565 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22566 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22567
22568 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22569 if GCC considers string literals to be constants.
22570 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
22571
22572 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22573
22574 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22575 (print_preprocess, print_object): New macro to fix last change.
22576
22577 * print.c (print_preprocess): Don't forget font objects.
22578
22579 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
22580
22581 * emacs.c (USAGE3): Doc fixes.
22582
22583 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22584
22585 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22586 structure.
22587
22588 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
22589
22590 * lisp.h (VWindow_system, Qfile_name_history):
22591 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22592 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22593 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22594
22595 * w32select.c: Don't #include "keyboard.h".
22596 (run_protected): Add extern declaration for waiting_for_input.
22597
22598 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22599 * w32console.c (detect_input_pending, read_input_pending)
22600 (encode_terminal_code):
22601 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22602 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22603 (w32_system_caret_y, Qfile_name_history):
22604 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22605 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22606 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22607 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22608 * w32proc.c (Qlocal, report_file_error):
22609 * w32term.c (Vwindow_system, updating_frame):
22610 * w32uniscribe.c (initialized, uniscribe_font_driver):
22611 Remove unneeded extern declarations.
22612
22613 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
22614
22615 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
22616
22617 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
22618
22619 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22620 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22621 These macros can no longer be used for assignment.
22622
22623 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22624 Assign struct members directly, instead of using BUF_BEGV etc.
22625 (record_buffer_markers, fetch_buffer_markers): New functions for
22626 recording and fetching special buffer markers.
22627 (set_buffer_internal_1, set_buffer_temp): Use them.
22628
22629 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22630
22631 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22632
22633 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22634 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22635
22636 * xdisp.c (hscroll_window_tree):
22637 (reconsider_clip_changes): Use PT instead of BUF_PT.
22638
22639 2011-03-13 Eli Zaretskii <eliz@gnu.org>
22640
22641 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22642 $(EMACS_ROOT)/lib/intprops.h.
22643
22644 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22645
22646 Fix more problems found by GCC 4.5.2's static checks.
22647
22648 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22649 to unsigned char * to avoid compiler diagnostic.
22650 (xg_free_frame_widgets): Make it clear that a local variable is
22651 needed only if USE_GTK_TOOLTIP.
22652 (gdk_window_get_screen): Make it clear that this macro is needed
22653 only if USE_GTK_TOOLTIP.
22654 (int_gtk_range_get_value): New function, which avoids a diagnostic
22655 from gcc -Wbad-function-cast.
22656 (xg_set_toolkit_scroll_bar_thumb): Use it.
22657 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22658 diagnostic from gcc -Wbad-function-cast.
22659 (get_utf8_string, xg_get_file_with_chooser):
22660 Rename locals to avoid shadowing.
22661 (create_dialog): Move locals to avoid shadowing.
22662
22663 * xgselect.c (xg_select): Remove unused var.
22664
22665 * image.c (four_corners_best): Mark locals as initialized.
22666 (gif_load): Initialize transparent_p to zero (Bug#8238).
22667 Mark another local as initialized.
22668 (my_png_error, my_error_exit): Mark with NO_RETURN.
22669
22670 * image.c (clear_image_cache): Now static.
22671 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
22672 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
22673 (x_edge_detection): Remove unnecessary cast that
22674 gcc -Wbad-function-cast diagnoses.
22675 (gif_load): Fix pointer signedness.
22676 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22677 (jpeg_load, gif_load): Rename locals to avoid shadowing.
22678
22679 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
22680
22681 Improve quality of tests for time stamp overflow.
22682 For example, without this patch (encode-time 0 0 0 1 1
22683 1152921504606846976) returns the obviously-bogus value (-948597
22684 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22685 reports time overflow. See
22686 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
22687 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22688 * editfns.c: Include limits.h and intprops.h.
22689 (TIME_T_MIN, TIME_T_MAX): New macros.
22690 (time_overflow): Move earlier, to before first use.
22691 (hi_time, lo_time): New functions, for an accurate test for
22692 out-of-range times.
22693 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22694 (Fget_internal_run_time): Don't assume time_t fits in int.
22695 (make_time): Use list2 instead of Fcons twice.
22696 (Fdecode_time): More accurate test for out-of-range times.
22697 (check_tm_member): New function.
22698 (Fencode_time): Use it, to test for out-of-range times.
22699 (lisp_time_argument): Don't rely on undefined left-shift and
22700 right-shift behavior when checking for time stamp overflow.
22701
22702 * editfns.c (time_overflow): New function, refactoring common code.
22703 (Fformat_time_string, Fdecode_time, Fencode_time):
22704 (Fcurrent_time_string): Use it.
22705
22706 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22707 * dired.c (make_time): Move to ...
22708 * editfns.c (make_time): ... here.
22709 * systime.h: Note the move.
22710
22711 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
22712
22713 * fringe.c (update_window_fringes): Remove unused variables.
22714
22715 * unexmacosx.c (copy_data_segment): Also copy __got section.
22716 (Bug#8223)
22717
22718 2011-03-12 Eli Zaretskii <eliz@gnu.org>
22719
22720 * termcap.c [MSDOS]: Include "msdos.h".
22721 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22722 Constify `char *' arguments and their references according to
22723 prototypes in tparam.h.
22724
22725 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
22726
22727 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22728 Adapt all references accordingly.
22729
22730 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22731
22732 2011-03-11 Tom Tromey <tromey@redhat.com>
22733
22734 * buffer.c (syms_of_buffer): Remove obsolete comment.
22735
22736 2011-03-11 Eli Zaretskii <eliz@gnu.org>
22737
22738 * termhooks.h (encode_terminal_code): Declare prototype.
22739
22740 * msdos.c (encode_terminal_code): Don't declare prototype.
22741
22742 * term.c (encode_terminal_code): Now external again, used by
22743 w32console.c and msdos.c.
22744
22745 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22746 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
22747
22748 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
22749
22750 Fix some minor problems found by GCC 4.5.2's static checks.
22751
22752 * fringe.c (update_window_fringes): Mark locals as initialized
22753 (Bug#8227).
22754 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
22755
22756 * alloc.c (mark_fringe_data): Move decl from here ...
22757 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22758 to check its interface.
22759 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22760
22761 * fontset.c (free_realized_fontset): Now static.
22762 (Fset_fontset_font): Rename local to avoid shadowing.
22763 (fontset_font): Mark local as initialized.
22764 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
22765
22766 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22767
22768 * xselect.c (x_disown_buffer_selections): Remove; not used.
22769 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
22770 (x_own_selection, Fx_disown_selection_internal): Rename locals
22771 to avoid shadowing.
22772 (x_handle_dnd_message): Remove local to avoid shadowing.
22773
22774 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22775 so that the caller can use some name other than gcpro1.
22776 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
22777 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22778 (Fx_backspace_delete_keys_p):
22779 Use them to avoid shadowing, and rename vars to avoid shadowing.
22780 (x_decode_color, x_set_name, x_window): Now static.
22781 (Fx_create_frame): Add braces to silence GCC warning.
22782 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
22783 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22784 Remove unused locals.
22785 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22786 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22787 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22788 macros.
22789
22790 * xterm.h (x_mouse_leave): New decl.
22791
22792 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22793 Remove unused functions.
22794 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22795 (x_calc_absolute_position): Now static.
22796 (XTread_socket): Don't define label "out" unless it's used.
22797 Don't declare local "event" unless it's used.
22798 (x_iconify_frame, x_free_frame_resources): Don't declare locals
22799 unless they are used.
22800 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22801 (x_fatal_error_signal): Remove; not used.
22802 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22803 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22804 (x_error_catcher, x_connection_closed, x_error_handler):
22805 (x_error_quitter, xembed_send_message, x_iconify_frame):
22806 (my_log_handler): Rename locals to avoid shadowing.
22807 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
22808 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
22809
22810 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22811 Rename or move locals to avoid shadowing.
22812 (tty_defined_color, merge_face_heights): Now static.
22813 (free_realized_faces_for_fontset): Remove; not used.
22814 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22815 does not deduce is never used uninitialized.
22816 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22817 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
22818
22819 * terminal.c (store_terminal_param): Now static.
22820
22821 * xmenu.c (menu_highlight_callback): Now static.
22822 (set_frame_menubar): Remove unused local.
22823 (xmenu_show): Rename parameter to avoid shadowing.
22824 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22825 since they might point to immutable storage.
22826 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22827 since it's unused otherwise.
22828
22829 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
22830 Add a FIXME, since the code still doesn't look right. (Bug#8215)
22831 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22832 avoids a gcc -Wuninitialized diagnostic.
22833 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
22834 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22835 does not deduce are never used uninitialized.
22836
22837 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22838
22839 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
22840 * window.c (window_loop, size_window):
22841 (run_window_configuration_change_hook, enlarge_window): Likewise.
22842
22843 * window.c (display_buffer): Now static.
22844 (size_window): Mark variables that gcc -Wuninitialized
22845 does not deduce are never used uninitialized.
22846 * window.h (check_all_windows): New decl, to forestall
22847 gcc -Wmissing-prototypes diagnostic.
22848 * dispextern.h (bidi_dump_cached_states): Likewise.
22849
22850 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22851 shadowing.
22852 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
22853 Include <limits.h>.
22854 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22855 and to avoid gcc -Wuninitialized warning.
22856 (load_charset_map): Mark variables that gcc -Wuninitialized
22857 does not deduce are never used uninitialized.
22858 (load_charset): Abort instead of using uninitialized var (Bug#8229).
22859
22860 * coding.c (coding_set_source, coding_set_destination):
22861 Use "else { /* comment */ }" rather than "else /* comment */;"
22862 for clarity, and to avoid gcc -Wempty-body warning.
22863 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22864 a block, when the outer 'i' will do.
22865 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22866 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22867 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22868 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22869 (Fdecode_sjis_char, Fdefine_coding_system_internal):
22870 Rename locals to avoid shadowing.
22871 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
22872 * coding.c (emacs_mule_char, encode_invocation_designation):
22873 Now static, since they're not used elsewhere.
22874 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
22875 (decode_coding_object, encode_coding_object, detect_coding_system):
22876 (decode_coding_emacs_mule): Mark variables that gcc
22877 -Wuninitialized does not deduce are never used uninitialized.
22878 (detect_coding_iso_2022): Initialize a local variable that might
22879 be used uninitialized. Leave a FIXME because it's not clear that
22880 this initialization is needed. (Bug#8211)
22881 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22882 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22883 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22884 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22885 Remove unused macros.
22886
22887 * category.c (hash_get_category_set): Remove unused local var.
22888 (copy_category_table): Now static, since it's not used elsewhere.
22889 * character.c (string_count_byte8): Likewise.
22890
22891 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22892 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22893
22894 * chartab.c (copy_sub_char_table): Now static, since it's not used
22895 elsewhere.
22896 (sub_char_table_ref_and_range, char_table_ref_and_range):
22897 Rename locals to avoid shadowing.
22898 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
22899
22900 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
22901 (BIDI_BOB): Remove unused macro.
22902
22903 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22904 deduce are never used uninitialized.
22905 * term.c (encode_terminal_code): Likewise.
22906
22907 * term.c (encode_terminal_code): Now static. Remove unused local.
22908
22909 * tparam.h: New file.
22910 * term.c, tparam.h: Include it.
22911 * deps.mk (term.o, tparam.o): Depend on tparam.h.
22912 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22913 Move these decls to tparam.h, and make them agree with what
22914 is actually in tparam.c. The previous trick of using incompatible
22915 decls in different modules does not conform to the C standard.
22916 All callers of tparam changed to use tparam's actual API.
22917 * tparam.c (tparam1, tparam, tgoto):
22918 Use const pointers where appropriate.
22919
22920 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22921 * cm.h (struct cm): Likewise.
22922 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22923 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22924 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22925 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22926 (turn_on_face, init_tty): Likewise.
22927 * termchar.h (struct tty_display_info): Likewise.
22928
22929 * term.c (term_mouse_position): Rename local to avoid shadowing.
22930
22931 * alloc.c (mark_ttys): Move decl from here ...
22932 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22933
22934 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
22935
22936 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
22937
22938 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
22939
22940 * search.c (compile_pattern_1): Remove argument regp, unused since
22941 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
22942 (compile_pattern): Don't pass it.
22943
22944 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
22945
22946 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
22947 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
22948 for ! HAVE_GTK3.
22949 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
22950
22951 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
22952
22953 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
22954 gdk_window_get_screen, gdk_window_get_geometry,
22955 gdk_x11_window_lookup_for_display and GDK_KEY_g.
22956 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
22957 (xg_get_pixbuf_from_pixmap): New function.
22958 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
22959 to Pixmap, take frame as parameter, remove GdkColormap parameter.
22960 Call xg_get_pixbuf_from_pixmap instead of
22961 gdk_pixbuf_get_from_drawable.
22962 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
22963 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
22964 (xg_check_special_colors): Use GtkStyleContext and its functions
22965 for HAVE_GTK3.
22966 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
22967 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
22968 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
22969 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
22970 Call gtk_widget_get_preferred_size.
22971 (xg_frame_resized): gdk_window_get_geometry only takes 5
22972 parameters.
22973 (xg_win_to_widget, xg_event_is_for_menubar):
22974 Call gdk_x11_window_lookup_for_display.
22975 (xg_set_widget_bg): New function.
22976 (delete_cb): New function.
22977 (xg_create_frame_widgets): Connect delete-event to delete_cb.
22978 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
22979 (xg_set_background_color): Call xg_set_widget_bg.
22980 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
22981 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
22982 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
22983 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
22984 if ! HAVE_GTK3.
22985 (update_frame_tool_bar): Call gtk_widget_hide.
22986 (xg_initialize): Use GDK_KEY_g.
22987
22988 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
22989 if ! HAVE_GTK3
22990 (x_session_initialize): Call gdk_x11_set_sm_client_id.
22991
22992 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
22993 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
22994 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
22995
22996 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
22997
22998 * w32xfns.c (select_palette): Check success of RealizePalette against
22999 GDI_ERROR, not zero.
23000
23001 See ChangeLog.11 for earlier changes.
23002
23003 ;; Local Variables:
23004 ;; coding: utf-8
23005 ;; End:
23006
23007 Copyright (C) 2011-2013 Free Software Foundation, Inc.
23008
23009 This file is part of GNU Emacs.
23010
23011 GNU Emacs is free software: you can redistribute it and/or modify
23012 it under the terms of the GNU General Public License as published by
23013 the Free Software Foundation, either version 3 of the License, or
23014 (at your option) any later version.
23015
23016 GNU Emacs is distributed in the hope that it will be useful,
23017 but WITHOUT ANY WARRANTY; without even the implied warranty of
23018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23019 GNU General Public License for more details.
23020
23021 You should have received a copy of the GNU General Public License
23022 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.