* window.c (window_resize_check, window_resize_apply)
[emacs/old-mirror.git] / src / ChangeLog
blob062f6ab43dd0a334e87693363970ecaea12afc5a
1 2013-03-18  Dmitry Antipov  <dmantipov@yandex.ru>
3         * window.c (window_resize_check, window_resize_apply)
4         (window_from_coordinates, recombine_windows, set_window_buffer)
5         (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
6         (Fsplit_window_internal, Fdelete_window_internal)
7         (freeze_window_starts): Use bool for booleans.
8         * window.h (window_frame_coordinates, resize_frame_windows)
9         (freeze_window_starts, set_window_buffer): Adjust prototypes.
11 2013-03-17  Stefan Monnier  <monnier@iro.umontreal.ca>
13         * dispnew.c (bitch_at_user): Use `user-error'.
15 2013-03-17  Ken Brown  <kbrown@cornell.edu>
17         * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c.  Use it
18         as return type of image_background.  (Bug#13981)
19         * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
21 2013-03-16  Jan Djärv  <jan.h.d@swipnet.se>
23         * nsterm.m (updateFrameSize:): Change resize increments if needed.
24         (ns_select): Don't return with result uninitialized.
26         * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
27         and getDirectory.
29         * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
30         New functions.
31         (Fns_read_file_name): ret is BOOL.  If ! dir_only_p, don't choose
32         directories.  If filename is nil, get directory name (Bug#13932).
33         Use getFilename and getDirectory.
34         (getFilename, getDirectory): New methods for EmacsSavePanel and
35         EmacsOpenPanel.
36         (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
38 2013-03-15  Paul Eggert  <eggert@cs.ucla.edu>
40         * coding.c (decode_coding_gap): Fix typo caught by static checking.
42 2013-03-15  handa  <handa@gnu.org>
44         * insdel.c (insert_from_gap): New arg text_at_gap_tail.
45         (adjust_after_replace): Make it back to static.  Delete the third
46         arg text_at_gap_tail.  Cancel the code for handling it.
48         * coding.h (struct coding_system): New member eol_seen.
50         * coding.c (detect_ascii): New function.
51         (detect_coding): Set coding->head_ascii and coding->eol_seen only
52         when the source bytes are actually scanned.  On detecting for
53         coding_category_utf_8_auto, call detect_ascii instead of scanning
54         source bytes directly.
55         (produce_chars): Call insert_from_gap with the new arg 0.
56         (encode_coding): Likewise.
57         (decode_coding_gap): Control ASCII optimization by the variable
58         disable_ascii_optimization instead of #ifndef .. #endif.
59         Deccode EOL format according to coding->eol_seen.
60         (syms_of_coding): Declare disable-ascii-optimization as a Lisp
61         variable.
63         * lisp.h (adjust_after_replace): Cancel externing it.
64         (insert_from_gap): Adjust prototype.
66 2013-03-15  Eli Zaretskii  <eliz@gnu.org>
68         * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
69         FULLSCREEN_MAXIMIZED.  (Bug#13935)
71 2013-03-15  Dmitry Antipov  <dmantipov@yandex.ru>
73         * region-cache.c (find_cache_boundary, move_cache_gap)
74         (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
75         Simplify debugging check and convert to eassert.  Adjust comment.
76         (pp_cache): Put under ENABLE_CHECKING.
78 2013-03-14  Eli Zaretskii  <eliz@gnu.org>
80         * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
81         and incorrect code.  Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
82         and WM_ACTIVATEAPP.
83         (w32fullscreen_hook): If the frame is visible, reset
84         f->want_fullscreen flag after changing the frame size.  If the
85         frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
86         (Bug#13953)
88 2013-03-13  Daniel Colascione  <dancol@dancol.org>
90         * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
91         too so that these builds can use Cygwin's file conversion
92         functions.  (We've been building and linking cygw32.o all along
93         and just not using it.)
95 2013-03-13  Paul Eggert  <eggert@cs.ucla.edu>
97         File synchronization fixes (Bug#13944).
98         * Makefile.in (LIB_FDATASYNC): New macro.
99         (LIBES): Use it.
100         * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
101         * fileio.c (Fwrite_region, write_region_inhibit_fsync):
102         Don't worry about HAVE_FSYNC, since a substitute fsync is
103         available if the system lacks one.
104         (Fwrite_regin): Retry fsync if interrupted.
106 2013-03-13  Eli Zaretskii  <eliz@gnu.org>
108         * w32term.c (w32_read_socket): If the Emacs frame is being
109         activated, call w32fullscreen_hook, to make sure the new frame
110         dimensions are in effect.  (Bug#13937)
112 2013-03-13  Dmitry Antipov  <dmantipov@yandex.ru>
114         * xdisp.c (init_iterator): Simplify because both character and byte
115         positions are either specified or -1.  Add eassert.  Adjust comment.
116         * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
117         character and byte positions can be obtained from marker.
119 2013-03-13  Paul Eggert  <eggert@cs.ucla.edu>
121         Static checking by Sun C 5.12.
122         * alloc.c (buffer_memory_full) [REL_ALLOC]:
123         * bytecode.c (exec_byte_code):
124         * dispnew.c (init_display):
125         * eval.c (error):
126         * fileio.c (Fsubstitute_in_file_name):
127         * keyboard.c (Fevent_convert_list):
128         * keymap.c (Fsingle_key_description):
129         * term.c (maybe_fatal, fatal):
130         * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
131         * xsmfns.c (Fhandle_save_session):
132         Omit unreachable code.
133         * keymap.c (map_keymap_char_table_item): Cast void * to
134         a function pointer type; the C Standard requires this.
136         * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
137         Include <sys/param.h> unconditionally, as that works elsewhere and
138         is simpler here.  Include <sys/sysctl.h> if DARWIN_OS ||
139         __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
140         and FreeBSD now.
142 2013-03-11  Paul Eggert  <eggert@cs.ucla.edu>
144         * insdel.c (adjust_after_replace): Use bool for boolean.
146 2013-03-11  Stefan Monnier  <monnier@iro.umontreal.ca>
148         * keyboard.c: Move keyboard decoding to read_key_sequence.
149         (decode_keyboard_code): Remove.
150         (tty_read_avail_input): Don't try to decode input.
151         (read_decoded_char): New function.
152         (read_key_sequence): Use it.
154 2013-03-10  Daniel Colascione  <dancol@dancol.org>
156         * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
157         (GUI_SDATA, guichar_t): Macros to abstract out differences between
158         NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
159         w32fns.c.
161         * w32term.c (construct_drag_n_drop): Use the above macros to make
162         drag-and-drop work for non-ASCII filenames in cygw32 builds.
164         * w32fns.c (x_set_name, x_set_title): Use the above macros to
165         properly display non-ASCII frame titles in cygw32 builds.
167         * w32fns.c (Fw32_shell_execute): Use the above macros to properly
168         call ShellExecute in cygw32 builds.
170         * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
171         common file dialog code.
173         * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
174         can just use du like other systems.
176         * coding.c (from_unicode_buffer): Declare.
177         * coding.c (from_unicode_buffer): Implement.
179 2013-03-10  Stefan Monnier  <monnier@iro.umontreal.ca>
181         * lread.c: Minor cleanup.
182         (FROM_FILE_P): New macro.
183         (skip_dyn_bytes, unreadchar, read1): Use it.
184         (read_list): Consolidate duplicated code.
186         * bytecode.c (struct byte_stack): Remove `constants' when unused.
188 2013-03-10  Eli Zaretskii  <eliz@gnu.org>
190         * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
191         (redisplay_internal, set_cursor_from_row, try_window)
192         (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
193         (display_line, notice_overwritten_cursor)
194         (mouse_face_from_buffer_pos, note_mouse_highlight):
195         Use MATRIX_ROW_DISPLAYS_TEXT_P.
196         (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
197         (mouse_face_from_string_pos, fast_find_string_pos):
198         Use MATRIX_ROW_VPOS.
200         * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
202         * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
204         * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
205         MATRIX_MODE_LINE_ROW.
207         * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
209 2013-03-10  handa  <handa@gnu.org>
211         * lisp.h (adjust_after_replace): Extern it.
213         * coding.c (detect_coding): Cound the heading ASCII bytes in the
214         case of detection for coding_category_utf_8_auto.
215         (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
216         Skip decoding if all bytes are ASCII.
218         * insdel.c (adjust_after_replace): Make it public.  New arg
219         text_at_gap_tail.
220         (adjust_after_insert): Call adjust_after_replace with the new arg
221         value 0.
223 2013-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
225         * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
226         (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
227         from Elisp via unread-command-events.
229         * keyboard.c (access_keymap_keyremap): Accept nil return value from
230         functions to mean "no change".
232 2013-03-08  Paul Eggert  <eggert@cs.ucla.edu>
234         region-cache.c, scroll.c, search.c: Use bool for booleans.
235         * lisp.h (compile_pattern):
236         * scroll.c (do_scrolling, do_direct_scrolling):
237         * search.c (struct regexp_cache, compile_pattern_1)
238         (compile_pattern, string_match_1, search_command)
239         (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
240         (search_regs_saved, Fregexp_quote):
241         Use bool for boolean.
242         * region-cache.c (region_cache_forward, region_cache_backward):
243         Fix comments to match code: these functions return int, not boolean.
245 2013-03-08  Dmitry Antipov  <dmantipov@yandex.ru>
247         * search.c (find_newline): Accept start and end byte positions
248         as arguments and allow -1 if not known.
249         (find_newline_no_quit): Likewise for start position.
250         * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
251         * bidi.c (bidi_find_paragraph_start): Pass byte position to
252         find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
253         * editfns.c (Fconstrain_to_field): Break long line.
254         Adjust call to find_newline.
255         * indent.c (vmotion): Adjust calls to find_newline_no_quit.
256         Use DEC_BOTH to start next search from the previous buffer
257         position, where appropriate.
258         * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
259         (get_visually_first_element, move_it_vertically_backward): Likewise.
260         Obtain byte position from the display iterator, where appropriate.
262 2013-03-08  Paul Eggert  <eggert@cs.ucla.edu>
264         print.c, process.c: Use bool for booleans.
265         * lisp.h (wait_reading_process_output):
266         * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
267         (strout, debug_output_compilation_hack, float_to_string, print)
268         (print_object):
269         * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
270         (decode_status, status_message, create_process, create_pty)
271         (Fmake_network_process, Fnetwork_interface_info)
272         (wait_reading_process_output, read_process_output)
273         (write_queue_push, write_queue_pop, process_send_signal)
274         (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
275         * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
276         Use bool for booleans.
277         * process.c (Fnetwork_interface_list): Remove unused local.
278         (connect_counter): Now EMACS_INT, not int.
280 2013-03-08  Dmitry Antipov  <dmantipov@yandex.ru>
282         * bidi.c (bidi_fetch_char): Swap first and second arguments
283         to match other functions accepting character and byte positions.
284         Adjust comment.
285         (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
286         (bidi_paragraph_init): Likewise.  Use DEC_BOTH which is faster
287         when you need just to move to the previous buffer position.
288         * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
290 2013-03-07  Eli Zaretskii  <eliz@gnu.org>
292         * .gdbinit (prowlims): Display the enabled_p flag of the row.
294 2013-03-07  Dmitry Antipov  <dmantipov@yandex.ru>
296         Avoid character to byte conversions in motion subroutines.
297         * indent.h (compute_motion, vmotion): Add byte position argument.
298         * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
299         Add eassert.
300         (Fcompute_motion): Break long line.  Adjust call to compute_motion.
301         Use list5 for return value.
302         (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
303         Adjust comments, style and calls to compute_motion.
304         (Fvertical_motion): Adjust call to vmotion.
305         * window.c (Fdelete_other_windows_internal): Record window start
306         byte position and adjust call to vmotion.
307         (window_scroll_line_based): Likewise with call to compute_motion.
308         Use SET_PT_BOTH.
309         (Frecenter): Adjust calls to vmotion.
311 2013-03-07  Dmitry Antipov  <dmantipov@yandex.ru>
313         * lisp.h (list2i, list3i): New functions.
314         (list4i): Move from window.c and make LISP_INLINE.
315         * editfns.c (make_lisp_time):
316         * fns.c (Flocale_info):
317         * keyboard.c (parse_modifiers):
318         * xterm.c (x_ewmh_activate_frame): Use list2i.
319         * instel.c (signal_after_change):
320         * nsfns.m (Fx_server_version, Fxw_color_values):
321         * w32fns.c (Fxw_color_values, Fx_server_version):
322         * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
323         * fileio.c (Fvisited_file_modtime):
324         * nsfns.m (Fns_display_usable_bounds):
325         * w32.c (ltime): Use list4i.
327 2013-03-06  Eli Zaretskii  <eliz@gnu.org>
329         * search.c (find_newline_no_quit): Rename from find_next_newline.
330         Add commentary.
332         * lisp.h (find_newline_no_quit): Rename prototype.
334         * xdisp.c (back_to_previous_line_start)
335         (forward_to_next_line_start, get_visually_first_element)
336         (move_it_vertically_backward): Callers of find_newline_no_quit changed.
337         * indent.c (vmotion): Callers of find_newline_no_quit changed.
338         * bidi.c (bidi_find_paragraph_start): Callers of
339         find_newline_no_quit changed.
341         * msdos.c: Change encoding to cp850.  (Bug#13879)
342         (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
344 2013-03-06  Dmitry Antipov  <dmantipov@yandex.ru>
346         Coding system support cleanup and minor refactoring.
347         * coding.h (enum coding_result_code): Remove
348         CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
349         (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
350         (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
351         (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
352         (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
353         (decode_coding_region, encode_coding_region, decode_coding_string):
354         Remove unused compatibility macros.
355         * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
356         (record_conversion_result): Adjust user.
357         (syms_of_coding): Likewise.
358         (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
359         (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
360         (decode_coding_object): Simplify since xrealloc never returns NULL.
361         Add eassert.
363 2013-03-06  Paul Eggert  <eggert@cs.ucla.edu>
365         Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
366         * sysdep.c (list_system_processes)
367         [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
368         Make it a stub in this case; otherwise the build might fail,
369         and this code hasn't been tested on such hosts anyway.
370         Problem reported by Nelson H. F. Beebe in
371         <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
372         and analyzed by Jérémie Courrèges-Anglas in
373         <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
375 2013-03-06  Dmitry Antipov  <dmantipov@yandex.ru>
377         * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
378         * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
379         (get_visually_first_element, move_it_vertically_backward): Ajust users.
380         * bidi.c (bidi_find_paragraph_start): Likewise.
381         * indent.c (vmotion): Likewise.
383 2013-03-05  Paul Eggert  <eggert@cs.ucla.edu>
385         FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
386         * filelock.c: Include <c-ctype.h>.
387         (MAX_LFINFO): New top-level constant.
388         (lock_info_type): Remove members pid, boot_time.  Add members at,
389         dot, colon.  Change user member to be the entire buffer, not a
390         pointer.  This allows us to handle the case where a foreign
391         pid or boot time exceeds the local range.  All uses changed.
392         (LINKS_MIGHT_NOT_WORK): New constant.
393         (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
394         (defined_WINDOWSNT): Remove.
395         (MAKE_LOCK_NAME, file_in_lock_file_name):
396         Always use .#FILE (not .#-FILE) for the file lock,
397         even if it is a regular file.
398         (rename_lock_file): New function.
399         (create_lock_file): Use it.
400         (create_lock_file, read_lock_data):
401         Prefer a symbolic link for the lock file, falling back on a
402         regular file if symlinks don't work.  Do not try to create
403         symlinks on MS-Windows, due to security hassles.  Stick with
404         POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
405         link, rename, unlink, mkstemp) when creating locks, as a GNUish
406         host may be using a Windowsish file system, and cannot use
407         MS-Windows-only system calls.  Fall back on mktemp if mkstemp
408         doesn't work.  Don't fail merely because of a symlink-contents
409         length limit in the current file system; fall back on regular
410         files.  Increase the symlink contents length limit to 8 KiB, this
411         should be big enough for any real use and doesn't crunch the
412         stack.
413         (create_lock_file, lock_file_1, read_lock_data):
414         Simplify allocation of lock file buffers now that they fit in 8 KiB.
415         (lock_file_1): Return error number, not bool.  All callers changed.
416         (ELOOP): New macro, if not already defined.
417         (read_lock_data): Return size of lock file contents, not Lisp object.
418         All callers changed.  Handle a race condition if some other process
419         replaces a regular-file lock with a symlink lock or vice versa,
420         while we're trying to read the lock.
421         (current_lock_owner): Parse contents more carefully, to help avoid
422         confusing a regular-file lock with some other application's use
423         of the file.  Check for lock file contents being too long, or
424         not parsing correctly.
425         (current_lock_owner, lock_file):
426         Allow foreign pid and boot times that exceed the local range.
427         (current_lock_owner, lock_if_free, lock_file):
428         Simplify allocation of lock file contents.
429         * w32.c (sys_rename_replace): New function, containing most of
430         the contents of the old sys_rename.
431         (sys_rename): Use it.
432         (fchmod): New dummy function.
433         * w32.h (sys_rename_replace, fchmod): New decls.
435 2013-03-05  Eli Zaretskii  <eliz@gnu.org>
437         * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
438         bidi_count_bytes, as the callers now arrange for bidi_it->charpos
439         to be in sync with bidi_it->bytepos.  Suggested by Dmitry Antipov
440         <dmantipov@yandex.ru>.
442 2013-03-05  Dmitry Antipov  <dmantipov@yandex.ru>
444         * composite.c (get_composition_id, fill_gstring_header):
445         Use make_uninit_vector where appropriate.
446         * font.c (Ffont_get_glyphs, build_style_table): Likewise.
447         * xselect.c (clean_local_selection_data): Likewise.
449 2013-03-04  Paul Eggert  <eggert@cs.ucla.edu>
451         Fix misuse of ImageMagick that caused core dump (Bug#13846).
452         * image.c (imagemagick_load_image): Calculate height and width
453         after flattening the image, not before.
455 2013-03-04  Dmitry Antipov  <dmantipov@yandex.ru>
457         * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
458         * ftfont.c (ftfont_shape_by_flt): Likewise.
459         * w32uniscribe.c (uniscribe_shape): Likewise.
461 2013-03-02  Paul Eggert  <eggert@cs.ucla.edu>
463         The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
464         The old approach, which fell back on DIR/.#FILE.0 through
465         DIR/.#FILE.9, had race conditions that could not be easily fixed.
466         If DIR/.#FILE is a non-symlink file, Emacs now does not create a
467         lock file for DIR/FILE; that is, DIR/FILE is no longer partly
468         protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
469         because the locking mechanism was never reliable in that case).
470         This patch fixes this and other bugs discovered by a code
471         inspection that was prompted by
472         <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
473         Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
474         to avoid interoperability problems between the MS-Windows and
475         non-MS-Windows implementations.  MS-Windows and non-MS-Windows
476         instances of Emacs now ignore each others' locks.
477         * filelock.c (defined_WINDOWSNT): New constant.
478         (MAKE_LOCK_NAME, fill_in_lock_file_name):
479         Don't create DIR/.#FILE.0 through DIR/.#FILE.9.  Instead, create
480         DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
481         regular files on MS-Windows hosts.
482         (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
483         Use SAFE_ALLOCA to avoid problems with long file names.
484         (MAX_LFINFO): Now a local constant, not a global macro.
485         (IS_LOCK_FILE): Remove.
486         (lock_file_1): Don't inspect errno if symlink call succeeds;
487         that's not portable.
488         (lock_file): Document that this function can return if lock
489         creation fails.
490         (lock_file): Don't access freed storage.
492 2013-03-02  Andreas Schwab  <schwab@linux-m68k.org>
494         * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren.  (Bug#13734)
496 2013-03-02  Paul Eggert  <eggert@cs.ucla.edu>
498         * textprop.c: Use bool for booleans.
499         (validate_interval_range, Fadd_text_properties)
500         (Fremove_text_properties): Prefer bool to int when either works.
502 2013-03-02  Eli Zaretskii  <eliz@gnu.org>
504         * textprop.c (Fadd_text_properties, Fremove_text_properties):
505         If the interval tree changes as a side effect of calling
506         modify_region, re-do processing starting from the call to
507         validate_interval_range.  (Bug#13743)
509 2013-02-28  Eli Zaretskii  <eliz@gnu.org>
511         * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
512         (Bug#13546).
514 2013-02-27  Eli Zaretskii  <eliz@gnu.org>
516         * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
517         _SH_DENYRW flag, instead of emacs_open, to deny any other process
518         access to the lock file until it is written and closed.
519         (Bug#13807)
521 2013-02-27  Paul Eggert  <eggert@cs.ucla.edu>
523         * callint.c (Qcall_interactively):
524         * macros.c (Qexecute_kbd_macro):
525         Now static.
527 2013-02-26  Bastien Guerry  <bzg@gnu.org>
529         * window.c (Frecenter): Tiny docstring enhancement.
531 2013-02-26  Paul Eggert  <eggert@cs.ucla.edu>
533         Minor textprop integer cleanup.
534         * intervals.h, textprop.c (add_text_properties_from_list):
535         Return void, not int, since nobody uses the return value.
536         * textprop.c (validate_plist, add_properties, remove_properties)
537         (Fadd_text_properties):
538         Don't assume list length fits in int.
539         (interval_has_all_properties, interval_has_some_properties)
540         (interval_has_some_properties_list, add_properties, remove_properties)
541         (Fadd_text_properties, Fremove_text_properties)
542         (Fremove_list_of_text_properties, text_property_stickiness):
543         Use bool for booleans.
544         (Fadd_text_properties, Fremove_text_properties):
545         (Fremove_list_of_text_properties):
546         Reindent do-while as per GNU style.
548 2013-02-25  Eli Zaretskii  <eliz@gnu.org>
550         Implement CLASH_DETECTION for MS-Windows.
552         * filelock.c [WINDOWSNT]: Include w32.h.
553         (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
554         function of that name.  Up-case the macro arguments.
555         (IS_LOCK_FILE): New macro.
556         (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
557         (create_lock_file): New function, with body extracted from
558         lock_file_1.
559         [WINDOWSNT]: Implement lock files by writing a regular file with
560         the lock information as its contents.
561         (read_lock_data): New function, on Posix platforms just calls
562         emacs_readlinkat.
563         [WINDOWSNT]: Read the lock info from the file.
564         (current_lock_owner): Call read_lock_data instead of calling
565         emacs_readlinkat directly.
566         (lock_file) [WINDOWSNT]: Run the file name through
567         dostounix_filename.
569         * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
570         just check if the process by that PID exists.
572         * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
573         also present, as doing so will fail to error out if the file
574         already exists.
576         * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
578         * textprop.c (Fadd_text_properties, Fremove_text_properties)
579         (Fremove_list_of_text_properties): Skip all of the intervals in
580         the region between START and END that already have resp. don't
581         have the requested properties, not just the first one.
582         Add assertions that the loop afterwards always modifies the
583         properties.  (Bug#13743)
585 2013-02-25  Stefan Monnier  <monnier@iro.umontreal.ca>
587         * callint.c (Fcall_interactively): Use the right lexical environment
588         for `interactive' specs (bug#13811).
589         * eval.c (Feval): Accept a lexical environment.
591 2013-02-25  Paul Eggert  <eggert@cs.ucla.edu>
593         Simplify data_start configuration (Bug#13783).
594         This is a followon simplification to the fix for Bug#13650.
595         * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
596         (START_FILES): Remove.  All uses removed.
597         (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
598         (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
599         (buildobj.h): Use it.
600         ($(ALLOBJS)): Depend on globals.h.
601         (temacs$(EXEEXT)): Use $(ALLOBJS).
602         * autodeps.mk (ALLOBJS): Move to Makefile.in.
603         * deps.mk (vm-limit.o):
604         * makefile.w32-in ($(BLD)/vm-limit.$(O)):
605         Do not depend on mem-limits.h.
606         * emacs.c (__do_global_ctors, __do_global_ctors_aux)
607         (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
608         [__GNUC__ && !ORDINARY_LINK]: Remove.
609         * mem-limits.h, pre-crt0.c: Remove.
610         * unexaix.c, unexcoff.c: Don't include mem-limits.h.
611         * unexcoff.c (etext): New decl.
612         (make_hdr): Use DATA_START instead of start_of_data.
613         * vm-limit.c: Move most of mem-limits.h's contents here.
614         (data_start): New decl.  It's OK if this is approximate,
615         so simplify-away some unnecessary exactness.
616         (POINTER): Remove; all uses removed.
617         (data_space_start): Now char *, to avoid casts.
618         (exceeds_lisp_ptr): New function, replacing the old
619         EXCEEDS_LISP_PTR macro.  All uses changed.
620         (check_memory_limits): Simplify and remove casts.
621         (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
622         (memory_warnings): Use data_start instead of start_of_data.
624 2013-02-24  Andreas Schwab  <schwab@linux-m68k.org>
626         * xdisp.c (set_message): Only check for debug-on-message if STRING
627         is a string.  (Bug#13797)
629 2013-02-24  Paul Eggert  <eggert@cs.ucla.edu>
631         Fix regression introduced by July 10 filelock.c patch.
632         * filelock.c (fill_in_lock_file_name): Fix crash caused by the
633         2012-07-10 patch to this file.  Reported by Eli Zaretskii in
634         <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
635         and diagnosed by Andreas Schwab in
636         <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
638 2013-02-22  Paul Eggert  <eggert@cs.ucla.edu>
640         Assume C89 or better.
641         * ralloc.c (SIZE, POINTER, NIL):
642         * vm-limit.c (POINTER):
643         Remove, replacing all uses with C89 equivalents.  These old
644         symbols were present only for porting to pre-C89 platforms.
646 2013-02-22  Claudio Bley  <claudio.bley@gmail.com>
648         * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
649         This avoids warning messages reported as part of Bug#13546.
651 2013-02-21  Ken Brown  <kbrown@cornell.edu>
653         * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
655 2013-02-20  Stefan Monnier  <monnier@iro.umontreal.ca>
657         * sheap.c (report_sheap_usage): Prefer message1_nolog.
659         * keyboard.c (Qcommand_execute): New var.
660         (command_loop_1, read_char): Use it.
661         (Fcommand_execute): Remove, replace by an Elisp implementation.
662         (syms_of_keyboard): Adjust accordingly.
664 2013-02-19  Daniel Colascione <dancol@dancol.org>
666         * sheap.c (report_sheap_usage): Use message, not message1, so
667         that we don't try to create a buffer while we're in the middle
668         of dumping Emacs.  Explain why.
670 2013-02-20  Dmitry Antipov  <dmantipov@yandex.ru>
672         * search.c (find_newline): Return byte position in bytepos.
673         Adjust comment.
674         (find_next_newline_no_quit, find_before_next_newline):
675         Add bytepos argument.
676         * lisp.h (find_newline, find_next_newline_no_quit)
677         (find_before_next_newline): Adjust prototypes.
678         * bidi.c (bidi_find_paragraph_start):
679         * editfns.c (Fconstrain_to_field, Fline_end_position):
680         * indent.c (compute_motion, vmotion):
681         * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
682         (get_visually_first_element, move_it_vertically_backward):
683         Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
685 2013-02-19  Eli Zaretskii  <eliz@gnu.org>
687         * w32proc.c (new_child): Avoid leaking handles if the subprocess
688         resources were not orderly released.
690 2013-02-17  Eli Zaretskii  <eliz@gnu.org>
692         * xdisp.c (x_draw_vertical_border): For a window that is neither
693         the leftmost nor the rightmost, redraw both the left and the right
694         vertical borders.  (Bug#13723)
696 2013-02-17  Stefan Monnier  <monnier@iro.umontreal.ca>
698         * xml.c (init_libxml2_functions):
699         * sound.c (sound_warning):
700         * sheap.c (report_sheap_usage):
701         * process.c (wait_reading_process_output):
702         * msdos.c (XMenuActivate):
703         * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
704         * keyboard.c (top_level_1):
705         * editfns.c (Fmessage, Fmessage_box):
706         * callint.c (Fcall_interactively):
707         * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
709 2013-02-17  Jan Djärv  <jan.h.d@swipnet.se>
711         * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
712         * frame.c (syms_of_frame): ... to here.
714 2013-02-16  Eli Zaretskii  <eliz@gnu.org>
716         * w32.c (sys_chown): Remove unused function.
718         * w32term.c <input_signal_count>: Declare 'volatile'
719         unconditionally.  (Bug#9066)
721         * w32.c (set_errno): Reset h_errno and don't set it to any other
722         value.  Set errno instead.
723         (check_errno): Reset h_errno.
724         (sys_socket, socket_to_fd, sys_bind, sys_connect)
725         (sys_gethostname, sys_getservbyname, sys_getpeername)
726         (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
727         (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
728         h_errno.
729         (sys_gethostbyname): Set h_errno only errors detected.
731 2013-02-15  Paul Eggert  <eggert@cs.ucla.edu>
733         * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
735 2013-02-15  Eli Zaretskii  <eliz@gnu.org>
737         * keyboard.c (read_char): Fix calculation of auto-save time out
738         when auto-save-timeout is less than 4.  (Bug#13720)
740         * w32proc.c (new_child): Free up to 2 slots of dead processes at a
741         time.  Improve diagnostics in DebPrint.  (Bug#13546)
743         * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
744         (sys_gethostbyname, sys_getservbyname, sys_getpeername)
745         (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
746         (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
747         make sure errno is set to an appropriate value.  (Bug#13546)
748         (socket_to_fd): Add assertion against indexing fd_info[] with a
749         value that is out of bounds.
750         (sys_accept): If fd is negative, do not set up the child_process
751         structure for reading.
753 2013-02-15  Dmitry Antipov  <dmantipov@yandex.ru>
755         * composite.c (fill_gstring_header): Remove useless prototype.
756         Break long line.
757         * lisp.h (message_dolog, compile_pattern): Adjust prototype.
758         * print.c (PRINTDECLARE, print_object):
759         * search.c (compile_pattern, fast_looking_at, search_buffer):
760         (simple_search, boyer_moore, Freplace_match):
761         * xdisp.c (c_string_pos, number_of_chars, message_dolog):
762         (get_overlay_arrow_glyph_row, display_mode_element):
763         (decode_mode_spec_coding, message3):
764         * xfaces.c (face_at_string_position): Use bool for booleans.
765         Adjust comments.
767 2013-02-15  Paul Eggert  <eggert@cs.ucla.edu>
769         Fix AIX port (Bug#13650).
770         * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
771         Fix bug introduced in 2012-07-27 change.  DATA_SEG_BITS, if set,
772         was #undeffed earlier, so it cannot be used as a macro here.
773         Use the constant and not the macro.
775 2013-02-15  Eli Zaretskii  <eliz@gnu.org>
777         * w32proc.c (new_child): If no vacant slots are found in
778         child_procs[], make another pass looking for slots whose process
779         has exited or died.  (Bug#13546)
781         * w32.c (sys_pipe): When failing due to file descriptors above
782         MAXDESC, set errno to EMFILE.
783         (_sys_read_ahead): Update cp->status when failing to read serial
784         communications input, so that the status doesn't stay at
785         STATUS_READ_IN_PROGRESS.  (Bug#13546)
787 2013-02-14  Jan Djärv  <jan.h.d@swipnet.se>
789         * gtkutil.c (tb_size_cb): New function.
790         (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
792 2013-02-14  Stefan Monnier  <monnier@iro.umontreal.ca>
794         * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
795         an event.
797 2013-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
799         * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
801 2013-02-13  Dmitry Antipov  <dmantipov@yandex.ru>
803         * font.c (font_range): Add pos_byte argument.  Adjust comment
804         and break long line.
805         * font.h (font_range): Adjust prototype.
806         * composite.c (autocmp_chars): Pass byte position to font_range.
807         Break long line.  Remove useless prototype and format comment.
809 2013-02-13  Glenn Morris  <rgm@gnu.org>
811         * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
813 2013-02-13  Paul Eggert  <eggert@cs.ucla.edu>
815         Improve AIX port some more (Bug#13650).
816         With this, it should be as good as it was in 23.3, though it's
817         still pretty bad: the dumped emacs does not run.  See Mark Fleishman in
818         http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
819         * unexaix.c (start_of_text): Remove.
820         (_data, _text): Declare as char[], not int, as AIX manual suggests.
821         (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
822         (orig_load_scnptr, orig_data_scnptr):
823         Now off_t, not long, since they are file offsets.
824         (make_hdr): Use _data, not start_of_data ().
825         This is the key part of the fix.
826         (make_hdr, unrelocate_symbols): Use off_t for file offsets.
827         (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
829         * pre-crt0.c (data_start): Initialize to 1.
830         This ports to compilers that optimize the external declaration
831         'int x = 0;' as if it were 'int x;' to shrink the executable.
833         Improve AIX port (Bug#13650).
834         This doesn't fix the bug, but it makes progress: Emacs builds now.
835         * unexaix.c: Include inttypes.h, stdarg.h.
836         (report_error, report_error_1): Mark as _Noreturn.
837         (report_error): Don't report the wrong errno.
838         (report_error_1): Now varargs.  All callers changed.
839         (make_hdr): Use uintptr_t, not unsigned, when converting pointers
840         to unsigned.  Don't use ADDR_CORRECT, as it no longer exists.
841         (write_ptr): Use %p to print address rather than %lx and a cast
842         to unsigned long.  Grow buffer a bit, to be safer.
844 2013-02-13  Eli Zaretskii  <eliz@gnu.org>
846         * bidi.c (bidi_resolve_neutral): After finding the next
847         non-neutral character, accept NEUTRAL_ON type as well, because
848         directional control characters, such as LRE and RLE, have their
849         type converted to that by bidi_resolve_weak.  This avoids aborts
850         when LRE/RLE follows a run of neutrals.
851         (bidi_move_to_visually_next): Assert that return value of
852         bidi_peek_at_next_level is non-negative.  Negative values will
853         cause an infloop.
855 2013-02-13  Paul Eggert  <eggert@cs.ucla.edu>
857         Minor getenv-related fixes.
858         * callproc.c (Fcall_process_region) [!DOS_NT]:
859         Avoid unnecessary duplicate call to getenv.
860         * callproc.c (init_callproc):
861         * dispnew.c (init_display):
862         * sysdep.c (sys_subshell):
863         Omit unnecessary cast of getenv or egetenv.
865 2013-02-13  Juanma Barranquero  <lekktu@gmail.com>
867         * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
868         Update dependencies.
870 2013-02-12  Eli Zaretskii  <eliz@gnu.org>
872         * xdisp.c (redisplay_internal): Don't set w->region_showing to the
873         marker's position.
874         (display_line): Set w->region_showing to the value of
875         it->region_beg_charpos, not to -1.  This fixes redisplay
876         optimization when cursor is moved up after M->.  (Bug#13623)
877         (Bug#13626)
878         (try_scrolling): Scroll text up more if point is too close to ZV
879         and inside the scroll margin.  This makes sure point is moved
880         outside the scroll margin in these cases.
882         * window.h (struct window): region_showing can no longer be
883         negative.
885 2013-02-11  Paul Eggert  <eggert@cs.ucla.edu>
887         Tune by using memchr and memrchr.
888         * doc.c (Fsnarf_documentation):
889         * fileio.c (Fsubstitute_in_file_name):
890         * search.c (find_newline, scan_newline):
891         * xdisp.c (pos_visible_p, display_count_lines):
892         Use memchr and memrchr rather than scanning byte-by-byte.
893         * search.c (find_newline): Rename from scan_buffer.
894         Omit first arg TARGET, as it's always '\n'.  All callers changed.
896         Clean up read_key_sequence a tiny bit more.
897         * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
898         (read_key_sequence): Remove unused locals.
900 2013-02-11  Stefan Monnier  <monnier@iro.umontreal.ca>
902         Clean up read_key_sequence a bit; reread active keymaps after first event.
903         * keyboard.c (read_char, read_char_x_menu_prompt)
904         (read_char_minibuf_menu_prompt):
905         Replace nmaps+maps with a single `map' arg.
906         (follow_key): Operate on a single map.
907         (active_maps): New function.
908         (test_undefined): Also return true for nil bindings.
909         (read_key_sequence): Use active_maps to replace the arrays of keymaps with
910         a single (composed) keymap.  Remember `first_event' to choose the right
911         set of active keymaps.  Recompute the set of keymaps after receiving
912         the first event.  Remove GOBBLE_FIRST_EVENT.
913         (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
914         * keyboard.h (read_char): Update declaration.
915         * lread.c (read_filtered_event): Adjust call to read_char.
917 2013-02-11  Eli Zaretskii  <eliz@gnu.org>
919         * xdisp.c (move_it_vertically_backward, move_it_by_lines):
920         Don't use the limitation on backwards movement when lines are truncated
921         in the window.  (Bug#13675)
923 2013-02-11  Dmitry Antipov  <dmantipov@yandex.ru>
925         * marker.c (set_marker_internal): If desired position is passed
926         as a marker, avoid call to buf_charpos_to_bytepos.
927         * window.c (Fset_window_point): Omit redundant type checking.
928         (Fset_window_start): Likewise.  Format comment.
929         (window_scroll_pixel_based): Use set_marker_restricted_both
930         with character and byte positions obtained from an iterator.
931         (Fset_window_configuration): Use set_marker_restricted_both.
932         * xdisp.c (message_dolog): Likewise.
934 2013-02-10  Eli Zaretskii  <eliz@gnu.org>
936         * xdisp.c (move_it_vertically_backward, move_it_by_lines):
937         When text lines are longer than window's screen lines, don't move back
938         too far.  This speeds up some redisplay operations.  (Bug#13675)
940 2013-02-10  Dmitry Antipov  <dmantipov@yandex.ru>
942         * syntax.c (scan_sexps_forward): Fix byte position calculation
943         Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
945 2013-02-10  Paul Eggert  <eggert@cs.ucla.edu>
947         * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
948         that was not needed.
950 2013-02-09  Paul Eggert  <eggert@cs.ucla.edu>
952         Minor hashing refactoring.
953         * fns.c (SXHASH_REDUCE): Move to lisp.h.
954         (sxhash_float): Return EMACS_UINT, for consistency with the other
955         hash functions.
956         * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
957         non-static inline function and therefore can't use static vars.
958         (SXHASH_REDUCE): Move here from fns.c, and make it inline.
959         * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
960         with the other hash functions.
962 2013-02-09  Eli Zaretskii  <eliz@gnu.org>
964         * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
965         XXXXXX part of the temporary file pattern is not downcased even
966         when w32-downcase-file-names is non-nil.  (Bug#13661)
968         * xdisp.c (decode_mode_spec): Remove handling of %t.
970         * msdos.c (careadlinkatcwd): Remove.
972 2013-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>
974         * lread.c (skip_dyn_bytes): New function (bug#12598).
975         (read1): Use it.  Use getc instead of READCHAR to read bytes.
976         (load_each_byte): Remove.  Update users.
978 2013-02-08  Dmitry Antipov  <dmantipov@yandex.ru>
980         * search.c (scan_buffer): Calculate end byte position just once.
981         (scan_newline): Do not recalculate start_byte.
982         (search_command): Use eassert.
983         * syntax.c (struct lisp_parse_state): New member location_byte.
984         (scan_sexps_forward): Record from_byte and avoid redundant
985         character to byte position calculation ...
986         (Fparse_partial_sexp): ... here.  Break too long line.
988 2013-02-08  Dmitry Antipov  <dmantipov@yandex.ru>
990         * lisp.h (make_uninit_vector): New function.
991         * alloc.c (Fvector, Fmake_byte_code):
992         * ccl.c (Fregister_ccl_program):
993         * charset.c (Fdefine_charset_internal, define_charset_internal):
994         * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
995         * composite.c (syms_of_composite):
996         * font.c (Fquery_font, Ffont_info, syms_of_font):
997         * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
998         * ftfont.c (ftfont_shape_by_flt):
999         * indent.c (recompute_width_table):
1000         * nsselect.m (clean_local_selection_data):
1001         * syntax.c (init_syntax_once):
1002         * w32unsubscribe.c (uniscribe_shape):
1003         * window.c (Fcurrent_window_configuration):
1004         * xfaces.c (Fx_family_fonts):
1005         * xselect.c (selection_data_to_lisp_data): Use it.
1007 2013-02-07  Dmitry Antipov  <dmantipov@yandex.ru>
1009         * coding.c (Fdefine_coding_system_internal): Use AREF where
1010         argument is known to be a vector.
1011         * fns.c (Flocale_info): Likewise for ASET.
1012         * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1013         * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1015 2013-02-05  Jan Djärv  <jan.h.d@swipnet.se>
1017         * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1018         height.
1020         * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1021         (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1022         updateCollectionBehaviour.
1024         * nsterm.m (NEW_STYLE_FS): Remove.
1025         (ns_last_use_native_fullscreen): New variable.
1026         (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1027         (x_set_window_size): Do not take title bar and tool bar into account
1028         if isFullscreen returns YES.
1029         (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1030         (check_native_fs): New function.
1031         (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1032         (ns_term_init): Remove NEW_STYLE_FS.
1033         (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1034         and tool bar if isFullscreen returns NO.
1035         (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1036         (initFrameFromEmacs:): Initialize fs_is_native.  Replace NEW_STYLE_FS
1037         with HAVE_NATIVE_FS.
1038         (window:willUseFullScreenPresentationOptions:): New method.
1039         (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1040         Hide toolbar if not enabled (Bug#13444).
1041         (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1042         Restore tool bar if enabled, hide it otherwise (Bug#13444).
1043         (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1044         (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1045         window.  Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1046         Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1047         FRAME_TOOLBAR_HEIGHT (f).  Call updateFrameSize when going non-fs.
1048         (syms_of_nsterm): Add ns-use-native-fullscreen.
1050 2013-02-04  Paul Eggert  <eggert@cs.ucla.edu>
1052         * fileio.c (Qchoose_write_coding_system): Now static.
1054 2013-02-04  Eli Zaretskii  <eliz@gnu.org>
1056         * xdisp.c (window_buffer_changed): region_showing can be negative,
1057         which still means region is being displayed.
1058         (redisplay_internal): Resurrect code that forced redisplay of the
1059         whole window when showing region and the mark has changed.
1060         Record the new mark position to allow redisplay optimizations.
1061         (display_line): If it->region_beg_charpos is non-zero, set the
1062         window's region_showing member to -1.  (Bug#13623)  (Bug#13626)
1064         * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1065         not bitfield of 1 bit.
1067 2013-02-03  Daniel Colascione  <dancol@dancol.org>
1069         * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1070         daemon mode works on cygw32 when Emacs is installed and not just
1071         during development.
1073 2013-02-02  Paul Eggert  <eggert@cs.ucla.edu>
1075         Avoid file time stamp bug on MS-Windows (Bug#13149).
1076         * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1077         as FAT32 doesn't update time stamps when truncating them.
1078         Also, check that a file time stamp is not a multiple of 100 ns;
1079         this should catch all instances of the problem on MS-Windows,
1080         as its native file system resolution is 100 ns or worse, and
1081         checking for a non-multiple of 100 ns should impose only a small
1082         overhead on systems with ns resolution.
1084 2013-02-02  Eli Zaretskii  <eliz@gnu.org>
1086         Avoid encoding file names on MS-Windows when they need to be run
1087         through dostounix_filename.
1088         * w32.c (normalize_filename): Accept an additional argument
1089         MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1090         downcase it even if w32-downcase-file-names is non-nil.
1091         (dostounix_filename): Accept an additional argument MULTIBYTE and
1092         pass it to normalize_filename.
1093         (emacs_root_dir): Adjust.
1095         * msdos.h (dostounix_filename): Adjust prototype.
1097         * w32.h (dostounix_filename): Adjust prototype.
1099         * msdos.c (dostounix_filename): Accept an additional argument and
1100         ignore it.
1101         (init_environment): Adjust callers of dostounix_filename.
1103         * fileio.c (Ffile_name_directory, file_name_as_directory)
1104         (directory_file_name, Fexpand_file_name)
1105         (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1106         dostounix_filename.
1107         [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1108         non-nil.
1109         (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1110         variables, as egetenv is case-insensitive for DOS_NT.
1112         * dired.c (file_name_completion): Don't call Fdirectory_file_name
1113         with an encoded file name.
1115         * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1116         Adjust calls to dostounix_filename.
1118         * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1120         * unexw32.c (unexec): Adjust call to dostounix_filename.
1122         * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1124         * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1125         dostounix_filename.
1127         * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1128         dostounix_filename.
1130         * callproc.c (Fcall_process): Make sure program name in PATH and
1131         new_argv[0] is encoded, if needed.  Otherwise, un-encoded string
1132         is passed to exec/spawnve, which fails unless the file-name
1133         encoding is UTF-8.
1135         * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1136         even if w32-quote-process-args is nil.
1138 2013-02-01  Paul Eggert  <eggert@cs.ucla.edu>
1140         Fix timestamp bug when write-region appends nothing (Bug#13149).
1141         * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1142         the file's time stamp doesn't change if Emacs happens to write nothing
1143         to the file, and on a buggy file system this could cause Emacs to
1144         incorrectly infer that the file system doesn't have the bug.
1145         Avoid this problem by inhibiting the inference in this case.
1147 2013-02-01  Dmitry Antipov  <dmantipov@yandex.ru>
1149         * window.h (struct window): Convert base_line_number, base_line_pos
1150         and column_number_displayed members from Lisp_Object to ptrdiff_t.
1151         Convert region_showing member from Lisp_Object to bitfield.
1152         Remove sequence_number member.  Adjust comments.
1153         * window.c (sequence_number): Remove.
1154         (make_window): Initialize column_number_displayed.
1155         * print.c (print_object): Follow the printed representation of
1156         frames and print window pointer to distinguish between windows.
1157         (adjust_window_count): Invalidate base_line_pos.  Adjust comment.
1158         * xdisp.c (wset_base_line_number, wset_base_line_pos)
1159         (wset_column_number_displayed, wset_region_showing): Remove.
1160         (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1161         (try_scrolling, try_cursor_movement, redisplay_window)
1162         (try_window_reusing_current_matrix, try_window_id, display_line)
1163         (display_mode_lines, decode_mode_spec): Adjust users.
1164         * .gdbinit (pwinx): Do not print sequence_number.
1166 2013-02-01  Paul Eggert  <eggert@cs.ucla.edu>
1168         Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1169         * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1170         * dired.c: Include <fcntl.h>.
1171         (open_directory): New function, which uses open and fdopendir
1172         rather than opendir.  DOS_NT platforms still use opendir, though.
1173         (directory_files_internal, file_name_completion): Use it.
1174         (file_attributes): New function, with most of the old Ffile_attributes.
1175         (directory_files_internal, Ffile_attributes): Use it.
1176         (file_attributes, file_name_completion_stat): First arg is now fd,
1177         not dir name.  All uses changed.  Use fstatat rather than lstat +
1178         stat.
1179         (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1180         * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1181         (emacs_readlinkat): New function, with much of the old
1182         Ffile_symlink_p, but with an fd argument for speed.
1183         It uses readlinkat rather than careadlinkatcwd, so that it
1184         need not assume the working directory.
1185         (Ffile_symlink_p): Use it.
1186         * filelock.c (current_lock_owner): Use emacs_readlinkat
1187         rather than emacs_readlink.
1188         * lisp.h (emacs_readlinkat): New decl.
1189         (READLINK_BUFSIZE, emacs_readlink): Remove.
1190         * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1191         (emacs_norealloc_allocator, emacs_readlink): Remove.
1192         This stuff is moved to fileio.c.
1193         * w32.c (fstatat, readlinkat): New functions.
1194         (careadlinkat): Don't check that fd == AT_FDCWD.
1195         (careadlinkatcwd): Remove; no longer needed.
1197 2013-01-31  Glenn Morris  <rgm@gnu.org>
1199         * fileio.c (choose_write_coding_system): Make it callable from Lisp.
1200         (Fwrite_region): Update for new choose_write_coding_system args.
1201         Move the last piece of choose_write_coding_system here.  (Bug#13522)
1202         (syms_of_fileio): Add choose-write-coding-system.
1204 2013-01-30  Eli Zaretskii  <eliz@gnu.org>
1206         * w32.c (sys_open): Zero out the flags for the new file descriptor.
1207         (sys_close): Zero out the flags for the file descriptor before
1208         closing it.  (Bug#13546)
1210         * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
1211         (logon_network_drive, stat_worker, symlink, chase_symlinks):
1212         Use CharNextExA and CharPrevExA to iterate over file names encoded in
1213         DBCS.  (Bug#13553)
1215         * w32.c (w32_get_long_filename, init_environment, readlink):
1216         Support file names encoded in DBCS codepages.
1217         (readlink): Use the current file-name-coding-system, not the ANSI
1218         codepage, to decode and handle targets of symlinks.
1220 2013-01-28  Eli Zaretskii  <eliz@gnu.org>
1222         * w32.c (opendir): Now accepts a 'const char *'.
1224 2013-01-28  Dmitry Antipov  <dmantipov@yandex.ru>
1226         Remove obsolete redisplay code.  See the discussion at
1227         http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1228         * dispnew.c (preemption_period, preemption_next_check): Remove.
1229         (Vredisplay_preemption_period): Likewise.
1230         (update_frame, update_single_window, update_window, update_frame_1):
1231         Adjust users.  Always assume that PERIODIC_PREEMPTION_CHECKING is not
1232         used, following the 2012-06-22 change.
1234 2013-01-25  Eli Zaretskii  <eliz@gnu.org>
1236         * w32notify.c (Fw32notify_add_watch): Doc fix.  (Bug#13540)
1238 2013-01-25  Dmitry Antipov  <dmantipov@yandex.ru>
1240         * font.c (num_fonts): Remove the leftover from old
1241         debugging code.  Adjust comment style here and there.
1242         * insdel.c (insert_1): Remove.
1243         * lisp.h (insert_1): Remove prototype.
1244         * xdisp.c (message_dolog): Adjust users to call insert_1_both.
1246 2013-01-25  Eli Zaretskii  <eliz@gnu.org>
1248         * w32.c (max_filename_mbslen): New function.
1249         (normalize_filename, readdir): Use it to detect locales where ANSI
1250         encoding of file names uses a double-byte character set (DBCS).
1251         If a DBCS encoding is used, advance by characters using
1252         CharNextExA, instead of incrementing a 'char *' pointer.
1253         Use _mbslwr instead of _strlwr.  (Bug#13515)
1255         * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1256         request of memory reservation to 1.7GB.  (Bug#13065)
1258 2013-01-25  Andreas Schwab  <schwab@linux-m68k.org>
1260         * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1261         at check_extra_latin label.  (Bug#13505)
1263 2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
1265         * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1266         Avoid redundant calls to strlen.
1268 2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
1270         Drop async_visible and async_iconified fields of struct frame.
1271         This is possible because async input is gone; for details, see
1272         http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1273         * frame.h (struct frame): Remove async_visible and async_iconified
1274         members, convert garbaged to unsigned bitfield.  Adjust comments.
1275         (FRAME_SAMPLE_VISIBILITY): Remove.  Adjust all users.
1276         (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1277         * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1278         Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1279         FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1280         * w32term.c: Ditto.
1281         (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1282         properly.  Likewise for obscured.
1283         * xterm.c: Ditto.
1284         (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
1285         properly.
1286         * nsterm.m: Ditto.
1287         (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1289 2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
1291         * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1292         in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1294 2013-01-23  Stefan Monnier  <monnier@iro.umontreal.ca>
1296         * xdisp.c (message2, message2_nolog): Remove functions.
1297         (message3, message3_nolog): Extract nbytes and multibyteness directly
1298         from the string.  Change all callers.
1299         (message3_nolog): Don't set message_enable_multibyte since set_message
1300         will reset it anyway.
1301         (message1, message1_nolog): Use message3.
1302         (vmessage): Use a stack allocated buffer rather than f->message_buf.
1303         (with_echo_area_buffer): Remove last two arguments.  Update all callers.
1304         (set_message): Drop all but the second arg, which has to be a string.
1305         (set_message_1): Simplify now that we know that a1 is NULL and the
1306         second arg is a string.
1307         * frame.h (struct frame): Remove `message_buf' field.
1308         Use glyphs_initialized_p instead.
1309         (FRAME_MESSAGE_BUF): Remove macro.
1310         * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1311         * lisp.h (message2, message2_nolog): Remove declarations.
1312         (message3, message3_nolog): Update declarations.
1313         * keyboard.c (read_char_minibuf_menu_text)
1314         (read_char_minibuf_menu_width): Remove vars.
1315         (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1316         to correctly handle multibyte strings.
1317         * frame.c (delete_frame): Don't free message_buf any more.
1318         * editfns.c (message_text, message_length): Remove vars.
1319         (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1320         * fileio.c (auto_save_error): Use message3 instead of message2.
1321         * dispnew.c (adjust_frame_message_buffer): Remove function.
1323 2013-01-23  Eli Zaretskii  <eliz@gnu.org>
1325         * w32term.c (w32fullscreen_hook): Account correctly for the screen
1326         real estate used for the tool bar and the menu bar.
1328 2013-01-23  Dmitry Antipov  <dmantipov@yandex.ru>
1330         * insdel.c (prepare_to_modify_buffer): Force redisplay if
1331         hidden buffer is prepared to modification (Bug#13164).
1333 2013-01-22  Dmitry Antipov  <dmantipov@yandex.ru>
1335         * window.h (struct window): Change window_end_valid member from
1336         Lisp_Object to a bitfield.  Adjust comments.
1337         (wset_window_end_valid): Remove.
1338         * window.c (adjust_window_count): Clear window_end_valid.
1339         (Fwindow_end): Adjust user.  Remove ancient #if 0 code.
1340         (Fwindow_line_height, set_window_buffer, Frecenter)
1341         (Fsplit_window_internal, Fdelete_other_windows_internal)
1342         (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1343         * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1344         * xdisp.c (check_window_end, reconsider_clip_changes)
1345         (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1346         (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1347         (find_first_unchanged_at_end_row, try_window_id): Likewise.
1349 2013-01-22  Dmitry Antipov  <dmantipov@yandex.ru>
1351         * xdisp.c (mark_window_display_accurate): Simplify the loop
1352         assuming that the only one of vchild, hchild or buffer window
1353         slots is non-nil.  Call mark_window_display_accurate_1 for
1354         the leaf windows only.
1355         (mark_window_display_accurate_1): Always assume leaf window.
1356         Adjust comment.
1358 2013-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1360         * emacs.c (Qkill_emacs_hook): Now static.
1362         * fileio.c (Finsert_file_contents): Simplify.
1363         Remove unnecessary assignments and tests.
1365 2013-01-21  Eli Zaretskii  <eliz@gnu.org>
1367         * w32.c (acl_set_file): Don't test for errors unless
1368         set_file_security returns FALSE.  Avoids spurious errors when
1369         saving files.
1371 2013-01-21  Dmitry Antipov  <dmantipov@yandex.ru>
1373         * fileio.c (Finsert_file_contents): Revert code introduced at
1374         2013-01-18 in favor of the simpler and generally better fix.
1375         Save stack space by removing 'buffer' and reusing 'read_buf'
1376         where appropriate.
1378 2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
1380         * lisp.h (eabs): Define unconditionally (Bug#13419).
1381         The old "#if !defined (eabs)" was an unnecessary revenant of back
1382         when this macro was called "abs".  Document 'eabs' better.
1384 2013-01-19  Glenn Morris  <rgm@gnu.org>
1386         * fns.c (Frandom): Doc fix.
1388 2013-01-19  Eli Zaretskii  <eliz@gnu.org>
1390         * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1391         segfault when there are lots of overlays.
1393         * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
1394         when there are lots of overlays.
1395         See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
1396         for the details and a way to reproduce.
1398 2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
1400         * fileio.c: Use O_APPEND to append.
1401         This corresponds better to the natural interpretation of "append",
1402         and avoids the need to open the output file twice, or to invoke
1403         lseek when APPEND is neither nil nor a number.
1404         This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1405         (Fwrite_region): Simplify.  Use O_APPEND instead of opening the
1406         file possibly twice, and lseeking to its end; this avoids the
1407         need to lseek on non-regular files.  Do not use O_EXCL and O_TRUNC
1408         at the same time: the combination is never needed and apparently
1409         it doesn't work with DOS_NT.
1411         Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1412         * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1414         Allow floating-point file offsets.
1415         Problem reported by Vitalie Spinu in
1416         <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1417         * fileio.c (emacs_lseek): Remove.
1418         (file_offset): New function.
1419         (Finsert_file_contents, Fwrite_region): Use it.
1421 2013-01-19  Chong Yidong  <cyd@gnu.org>
1423         * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1424         aborting on Fsignal (Bug#13289).
1426 2013-01-19  Eli Zaretskii  <eliz@gnu.org>
1428         * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1429         set_file_security as failure due to insufficient privileges.
1430         Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1431         (fstat): Return owner and group like 'stat' and 'lstat' do.
1433 2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
1435         Work around bug in CIFS and vboxsf file systems (Bug#13149).
1436         The bug was observed on Ubuntu operating inside a virtual machine,
1437         editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1438         The workaround introduces a race condition on non-buggy hosts,
1439         but it's an unlikely race and anyway there's a nearly identical
1440         nearby race that can't be fixed.
1441         * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1442         New static vars.
1443         (Fwrite_region): Test for file system time stamp bug.
1444         (init_fileio): New function.
1445         * lisp.h (init_fileio): Declare it.
1446         * emacs.c (main): Call it.
1448         * fileio.c (Finsert_file_contents): Simplify new diagnostic
1449         and make it more consistent with other stat-failure diagnostics.
1451 2013-01-18  Dmitry Antipov  <dmantipov@yandex.ru>
1453         Fix crash when inserting data from non-regular files.
1454         See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
1455         for the error description produced by valgrind.
1456         * fileio.c (read_non_regular): Rename to read_contents.
1457         Free Lisp_Save_Value object used to pass parameters.
1458         (read_non_regular_quit): Rename to read_contents_quit.
1459         (Finsert_file_contents): Redesign internal file reading loop to adjust
1460         gap and end positions after each read and so help make_gap to work
1461         properly.  Do not signal an I/O error too early and so do not leave
1462         not yet decoded characters in a buffer, which was the reason of
1463         redisplay crash.  Use list2 to build return value.  Adjust comments.
1465 2013-01-17  Paul Eggert  <eggert@cs.ucla.edu>
1467         Close a race when statting and reading files (Bug#13149).
1468         * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1469         This avoids a race if the file is renamed between stat and open.
1470         This race is not the problem originally noted in Bug#13149;
1471         see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1473 2013-01-17  Dmitry Antipov  <dmantipov@yandex.ru>
1475         * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1476         objects, related functions and macros.
1477         (make_save_value): Adjust prototype.
1478         (make_save_pointer): New prototype.
1479         (SAFE_NALLOCA): Fix indentation.  Use make_save_pointer.
1480         (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1481         * alloc.c (format_save_value): Rename to make_save_value.
1482         (make_save_pointer): New function.
1483         (record_xmalloc): Use make_save_pointer.
1484         * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1485         * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1486         Change users of make_save_value to make_save_pointer.
1487         Likewise for format_save_value and make_save_value.
1489 2013-01-17  Dmitry Antipov  <dmantipov@yandex.ru>
1491         * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1492         (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1493         * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1494         debugging stubs.
1496 2013-01-15  Paul Eggert  <eggert@cs.ucla.edu>
1498         * alloc.c (free_save_value): Now static.
1500 2013-01-15  Dmitry Antipov  <dmantipov@yandex.ru>
1502         * keymap.c (map_keymap_internal): Use format_save_value.
1503         (map_keymap_char_table_item): Adjust accordingly.
1504         * fileio.c (non_regular_fd, non_regular_inserted)
1505         (non_regular_nbytes): Remove.
1506         (Finsert_file_contents): Convert trytry to ptrdiff_t.
1507         Use format_save_value to pass parameters to read_non_regular.
1508         (read_non_regular): Use XSAVE_ macros to extract parameters.
1509         Adjust comment.
1510         * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1511         format_save_value.
1512         (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1514 2013-01-15  Dmitry Antipov  <dmantipov@yandex.ru>
1516         * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1517         extraction from any Lisp_Save_Value slot.  Add type checking.
1518         * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1519         * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1520         * xselect.c: All users changed.
1522 2013-01-15  Dmitry Antipov  <dmantipov@yandex.ru>
1524         Some convenient bits to deal with Lisp_Save_Values.
1525         * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1526         (allocate_misc): Remove prototype.
1527         (format_save_value): New prototype.
1528         * alloc.c (allocate_misc): Revert back to static.
1529         (format_save_value): New function to build Lisp_Save_Value
1530         object with the specified internal structure.
1531         (make_save_value): Reimplement using format_save_value.
1532         * editfns.c (save_excursion_save): Use format_save_value.
1533         (save_excursion_restore): Use XSAVE_OBJECT.
1535 2013-01-14  Paul Eggert  <eggert@cs.ucla.edu>
1537         Avoid needless casts with XSAVE_POINTER.
1538         * alloc.c (mark_object) [GC_MARK_STACK]:
1539         * dired.c (directory_files_internal_unwind):
1540         * fileio.c (do_auto_save_unwind):
1541         * gtkutil.c (pop_down_dialog):
1542         * keymap.c (map_keymap_char_table_item):
1543         * lread.c (load_unwind):
1544         * nsmenu.m (pop_down_menu):
1545         * print.c (print_object) [GC_MARK_STACK]:
1546         * xfns.c (clean_up_file_dialog):
1547         * xmenu.c (cleanup_widget_value_tree):
1548         Omit casts between XSAVE_POINTER and a pointer type.
1550 2013-01-14  Dmitry Antipov  <dmantipov@yandex.ru>
1552         Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1553         * eval.c (eval_sub): Protect `form' from being GCed before its
1554         car and cdr becomes protected with the backtrace entry.
1556 2013-01-14  Dmitry Antipov  <dmantipov@yandex.ru>
1558         Make Lisp_Save_Value more versatile storage for up to four objects.
1559         * lisp.h (toplevel): Enumeration to describe types of saved objects.
1560         (struct Lisp_Save_Value): New layout.  Adjust comments.
1561         (XSAVE_POINTER): New macro.
1562         (XSAVE_INTEGER): Likewise.
1563         (allocate_misc): Add prototype.
1564         (free_misc): Likewise.
1565         * alloc.c (allocate_misc): Now global.
1566         (free_misc): Likewise.  Adjust comment.
1567         (make_save_value): Use new Lisp_Save_Value layout.  Adjust comment.
1568         (free_save_value): Likewise.
1569         (mark_object): Likewise.
1570         * editfns.c (save_excursion_save): Pack everything within
1571         Lisp_Save_Value and so avoid xmalloc.
1572         (save_excursion_restore): Adjust to match new layout.  Use free_misc
1573         because we do not allocate extra memory any more.  Add eassert.
1574         * print.c (print_object): New code to print Lisp_Save_Value.  Do not
1575         rely on valid_lisp_object_p if !GC_MARK_STACK.  Adjust comments.
1576         * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1577         * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1578         Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1580 2013-01-13  Jan Djärv  <jan.h.d@swipnet.se>
1582         * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1583         (nsfont_draw): Remove disabling of LCD smoothing.
1584         (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
1585         Bug#11484 with LCD smoothing on.
1587 2013-01-13  Paul Eggert  <eggert@cs.ucla.edu>
1589         Fix SIGDANGER handlers, for AIX (Bug#13408).
1590         * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1591         Move handlers here from emacs.c; they were out of place.
1593 2013-01-11  Jan Djärv  <jan.h.d@swipnet.se>
1595         * xterm.c (syms_of_xterm): Adjust documentation for
1596         scroll-bar-adjust-thumb-portion.
1598 2012-12-31  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
1600         * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1601         determine whether scroll bar thumb size should be adjusted or
1602         not. Use variable for MOTIF.
1604         * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1605         GTK.
1607 2013-01-13  Jan Djärv  <jan.h.d@swipnet.se>
1609         * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1610         event is generated.
1611         (doCommandBySelector:): Set processingCompose to NO.
1613         * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1614         Remove check for fkeys count > zero, block/unblock fixes the real bug.
1615         (nsfont_list_family): Add block/unblock_input calls.
1616         (nsfont_open): Move block_input earlier.  Add unblock_input before early
1617         return.
1618         (nsfont_draw): Add block/unblock_input calls.
1620 2013-01-12  Dmitry Antipov  <dmantipov@yandex.ru>
1622         * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1623         for old_charpos and old_bytepos.
1625 2013-01-12  Paul Eggert  <eggert@cs.ucla.edu>
1627         Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1628         * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1629         Clear tzvalbuf_in_environ if this workaround is in effect.
1630         Problem and fix reported by Kazuhiro Ito.
1632 2013-01-11  Aaron S. Hawley  <Aaron.Hawley@vtinfo.com>
1634         * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1635         Fix ambiguous doc string cross-reference(s).
1637         * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1638          doc string cross-reference(s).
1640         * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1641          string cross-reference(s).
1643 2013-01-11  Dmitry Antipov  <dmantipov@yandex.ru>
1645         Avoid unnecessary byte position calculation for the gap movement.
1646         Since all users of move_gap do CHAR_TO_BYTE for other purposes
1647         anyway, all of them should use move_gap_both instead.
1648         * lisp.h (move_gap): Remove prototype.
1649         * insdel.c (move_gap): Remove.
1650         (move_gap_both): Add eassert.
1651         * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1652         * xml.c (parse_region): Likewise.
1654 2013-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1656         emacsclient -t should not suspend Emacs server (Bug#13387)
1657         * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1658         New functions.
1659         * term.c (init_tty): Use them instead of rolling our own code.
1660         * sysdep.c (tcsetpgrp_without_stopping): Likewise.  Here, this
1661         switches from 'signal' to 'pthread_sigmask', which is safer in
1662         multithreaded applications.
1663         * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1664         which has already arranged for that.
1665         (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1666         This is the main part of the bug fix.
1668 2013-01-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>  (tiny change)
1670         * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1671         x_last_font_name (Bug#13403).
1673 2013-01-10  Dmitry Antipov  <dmantipov@yandex.ru>
1675         Omit buffer_slot_type_mismatch and use generic predicates to enforce
1676         the type of per-buffer values where appropriate.
1677         * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1678         predicate, which is how it's really used now.  Adjust comment.
1679         * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1680         * buffer.c (buffer_slot_type_mismatch): Remove.
1681         (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1682         predicate.  Adjust comment.
1683         (syms_of_buffer): Use Qsymbolp for major-mode.  Use Qintegerp for
1684         fill-column, left-margin, tab-width, buffer-saved-size,
1685         left-margin-width, right-margin-width, left-fringe-width,
1686         right-fringe-width, scroll-bar-width and buffer-display-count.
1687         Use Qstringp for default-directory, buffer-file-name,
1688         buffer-file-truename and buffer-auto-save-file-name.  Use Qfloatp for
1689         scroll-up-aggressively and scroll-down-aggressively.  Use Qnumberp for
1690         line-spacing.
1691         * data.c (store_symval_forwarding): Adjust to call the predicate.
1693 2013-01-09  Juanma Barranquero  <lekktu@gmail.com>
1695         * w32.c (get_name_and_id, acl_set_file):
1696         * w32term.c (w32fullscreen_hook): Remove unused local variables.
1698 2013-01-09  Dmitry Antipov  <dmantipov@yandex.ru>
1700         * lisp.h (make_gap_1): New prototype.
1701         * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1702         gap size values.
1703         * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1704         naming convention.
1705         (syms_of_editfns): Adjust defsubr.  Drop commented-out obsolete code.
1706         * insdel.c (make_gap_larger): Use GAP_BYTES_DFL.  Adjust comment.
1707         (make_gap_smaller): Use GAP_BYTES_MIN.  Adjust comment.
1708         (make_gap_1): New function to adjust the gap of any buffer.
1709         * coding.c (coding_alloc_by_making_gap): Use it.
1710         * buffer.c (compact_buffer): Likewise.  Use BUF_Z_BYTE, BUF_GAP_SIZE,
1711         GAP_BYTES_DFL and GAP_BYTES_MIN.  Adjust comment.
1713 2013-01-08  Juri Linkov  <juri@jurta.org>
1715         * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1716         of (supports :underline (:style wave)).  (Bug#13000)
1718 2013-01-08  Aaron S. Hawley  <aaron.s.hawley@gmail.com>
1720         * undo.c (Fprimitive_undo): Move to simple.el.
1721         (syms_of_undo): Remove declarations for Sprimitive_undo.
1723 2013-01-08  Stefan Monnier  <monnier@iro.umontreal.ca>
1725         * keyboard.c (echo_add_key): Rename from echo_add_char.
1727 2013-01-06  Chong Yidong  <cyd@gnu.org>
1729         * keyboard.c (echo_add_char): New function, factored out from
1730         echo_char.  Don't add a space if the previous echo string was
1731         empty (Bug#13255).
1732         (echo_char): Use it.
1733         (read_key_sequence): When echoing mock input, ensure that the
1734         trailing dash is properly added.
1736 2013-01-05  Eli Zaretskii  <eliz@gnu.org>
1738         * xdisp.c (dump_glyph): Align glyph data better.  Use "pD" instead
1739         of a non-portable "t" to print ptrdiff_t values.  Allow up to 9
1740         digits for buffer positions, before misalignment starts.
1741         Display "0" for integer "object" field.
1742         (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1743         Display the newline glyph more unambiguously.
1745 2013-01-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
1747         * nsterm.m (ns_draw_underwave):
1748         * w32term.c (w32_draw_underwave):
1749         * xterm.c (x_draw_underwave): Make underwave look more triangular
1750         and also degrade gracefully for small fonts.  (Bug#13000)
1752         * nsterm.m (ns_draw_text_decoration):
1753         * w32term.c (x_draw_glyph_string):
1754         * xterm.c (x_draw_glyph_string): Don't use previous underline
1755         thickness and position if previous underline type is underwave.
1757 2013-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
1759         * fileio.c (Ffile_acl): Undocument return format.
1761 2013-01-02  Glenn Morris  <rgm@gnu.org>
1763         * keymap.c (Fkey_description): Doc fix.  (Bug#13323)
1765 2013-01-02  Paul Eggert  <eggert@cs.ucla.edu>
1767         Simplify via eabs.
1768         * dired.c (file_name_completion):
1769         * doc.c (get_doc_string):
1770         * floatfns.c (round2):
1771         * font.c (font_score, font_delete_unmatched):
1772         * fringe.c (compute_fringe_widths):
1773         * lread.c (read_list):
1774         * minibuf.c (Ftry_completion):
1775         * term.c (tty_ins_del_lines):
1776         * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1777         Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1779 2012-12-31  Eli Zaretskii  <eliz@gnu.org>
1781         * w32.c (unsetenv): Set up the string passed to _putenv
1782         correctly.
1783         See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
1784         for the bug this caused.
1786 2012-12-30  Paul Eggert  <eggert@cs.ucla.edu>
1788         * coding.c (Qmac): Now static.
1790 2012-12-30  Jan Djärv  <jan.h.d@swipnet.se>
1792         * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1793         (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1794         handlebox_widget.  Set toolbar_in_hbox to false/true, set
1795         toolbar_is_packed to true.
1796         (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1797         (update_frame_tool_bar): Check toolbar_is_packed for packing.
1798         Show all on TOOLBAR_TOP_WIDGET.
1799         (free_frame_tool_bar): Check toolbar_is_packed.  Use widget returned
1800         by TOOLBAR_TOP_WIDGET.
1801         (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1802         Check toolbar_is_packed.
1803         (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1804         HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1805         (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1806         false.
1807         (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1808         (xg_update_menubar): Update title only if
1809         HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1810         (xg_update_submenu): Skip tearoff only if
1811         HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1812         (xg_initialize): Initialize xg_detached_menus only if
1813         HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1815         * xterm.h (struct x_output): Surround handlebox_widget with
1816         #ifdef HAVE_GTK_HANDLE_BOX_NEW.  toolbar_is_packed is new,
1817         toolbar_in_hbox is bool.
1819 2012-12-30  Andreas Schwab  <schwab@linux-m68k.org>
1821         * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1822         (LIBS_GNUSTEP): Define.
1823         (LIBES): Add $(LIBS_GNUSTEP).
1824         (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1826 2012-12-30  Eli Zaretskii  <eliz@gnu.org>
1828         * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1829         continuation glyph on a TTY with an indication of an empty line.
1830         (Bug#13277)
1832 2012-12-29  Eli Zaretskii  <eliz@gnu.org>
1834         * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1835         file's SELinux context or ACLs successfully set, nil otherwise.
1836         (Bug#13298)
1837         (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
1839         * w32proc.c (reader_thread): Avoid passing NULL handles to
1840         SetEvent and WaitForSingleObject.
1842 2012-12-28  Paul Eggert  <eggert@cs.ucla.edu>
1844         Port EXTERNALLY_VISIBLE to Clang 3.2.
1845         * conf_post.h (__has_attribute): New macro.
1846         (EXTERNALLY_VISIBLE): Use it.  This ports to Clang 3.2.
1848 2012-12-27  Glenn Morris  <rgm@gnu.org>
1850         * cygw32.c (Fcygwin_convert_file_name_to_windows)
1851         (Fcygwin_convert_file_name_from_windows): Doc fixes.
1853 2012-12-27  Eli Zaretskii  <eliz@gnu.org>
1855         * fileio.c (file_name_as_directory, directory_file_name):
1856         Accept an additional argument MULTIBYTE to indicate whether the input C
1857         came from a multibyte or a unibyte Lisp string; all callers
1858         adjusted.  Don't assume the input string is always multibyte.
1859         (Bug#13262)
1860         (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
1861         don't ENCODE_FILE them, and return a unibyte string if the input
1862         was unibyte.
1863         (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
1864         don't assume the input strings will always be multibyte.  If the
1865         input strings are multibyte, decode strings obtained from C
1866         library functions.
1868 2012-12-26  Dmitry Antipov  <dmantipov@yandex.ru>
1870         * lisp.h (toplevel): Add two notices to the comment about
1871         defining a new Lisp data type.
1872         * print.c (print_object): If Lisp_Save_Value object's pointer
1873         is the address of a memory area containing Lisp_Objects, try
1874         to print them.
1875         * alloc.c (valid_lisp_object_p): Adjust comment.
1877 2012-12-26  Dmitry Antipov  <dmantipov@yandex.ru>
1879         * keyboard.c (record_asynch_buffer_change): Initialize an event
1880         only if it's really needed.
1881         * frame.h (enum output_method): Remove output_mac member since
1882         it's a leftover from the deleted code.
1883         * frame.c (Fframep): Adjust user here ...
1884         * terminal.c (Fterminal_live_p): ... and here.
1885         * coding.c (Qmac): Now here because it's only used to denote
1886         end-of-line encoding type.
1887         (syms_of_coding): DEFSYM it.
1888         * frame.h (Qmac): Remove duplicated declaration.
1890 2012-12-26  Paul Eggert  <eggert@cs.ucla.edu>
1892         * window.c (select_window_1): Now static, since it's used only here.
1894 2012-12-25  Eli Zaretskii  <eliz@gnu.org>
1896         * window.c (window_body_cols): Subtract display margins from the
1897         window body width on TTYs as well.  See
1898         http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
1899         for the original report.
1901 2012-12-25  Dmitry Antipov  <dmantipov@yandex.ru>
1903         * xdisp.c (redisplay_window): Remove inner local variable
1904         because the outer shadowed one has the same meaning.
1905         * xterm.h (struct x_output): Remove toolbar_detached member since it's
1906         set but never used.
1907         * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1908         (xg_create_tool_bar): Adjust users.
1910 2012-12-24  Dmitry Antipov  <dmantipov@yandex.ru>
1912         * buffer.h (BUF_COMPACT): New macro to follow the common style.
1913         * buffer.c (Fget_buffer_create): Use it to set compact field of
1914         struct buffer_text to avoid accessing an uninitialized value
1915         when compact_buffer is called for the first time.
1916         (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
1917         (Fset_buffer_modified_p): Use buffer_window_count to check
1918         whether the buffer is displayed in some window.
1919         * xdisp.c (message_dolog): Likewise.
1921 2012-12-23  Eli Zaretskii  <eliz@gnu.org>
1923         * w32.c (acl_set_file): If setting the file security descriptor
1924         fails, and the new DACL is identical to the existing one, silently
1925         return success.  This fixes problems for users backing up their
1926         own files without having the necessary privileges for setting
1927         security descriptors.
1929         * w32proc.c (reader_thread): Do not index fd_info[] with negative
1930         values.
1931         (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
1932         after WaitForSingleObject returns normally.  This expedites reader
1933         thread shutdown when delete_child triggers it.
1934         (reap_subprocess): More accurate commentary for why we call
1935         delete_child only when cp->fd is negative.
1937         * w32.c (sys_close): Do not call delete_child on a subprocess
1938         whose handle is not yet closed.  Instead, set its file descriptor
1939         to a negative value, so that reap_subprocess will call
1940         delete_child on that subprocess when its SIGCHLD arrives.
1941         This avoids closing handles used for communications between sys_select
1942         and reader_thread, which doesn't give sys_select a chance to
1943         notice that the process exited and invoke the SIGCHLD handler for
1944         it.
1946 2012-12-23  Jan Djärv  <jan.h.d@swipnet.se>
1948         * nsfns.m (Fns_do_applescript): Run event loop until script has
1949         been executed (Bug#12969).
1950         (ns_run_ascript): Chech as_script for nil, set to nil after
1951         executing script.
1953 2012-12-22  Martin Rudalics  <rudalics@gmx.at>
1955         * window.c (Fselect_window): Reword doc-string (Bug#13248).
1957 2012-12-22  Eli Zaretskii  <eliz@gnu.org>
1959         * w32term.c (w32fullscreen_hook): New function.
1960         (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
1962 2012-12-21  Eli Zaretskii  <eliz@gnu.org>
1964         * fileio.c (Finsert_file_contents): Doc fix.
1966         * w32proc.c (new_child, delete_child, find_child_pid): For a
1967         subprocess, consider its slot being in use as long as its process
1968         handle (procinfo.hProcess) is not NULL.  This avoids reusing the
1969         slot when a new process is started immediately after killing
1970         another one, without waiting enough time for the first process to
1971         be reaped and resources allocated for it be orderly freed.
1972         (Bug#13086)
1973         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1975 2012-12-21  Chong Yidong  <cyd@gnu.org>
1977         * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
1979         * fns.c (Fcompare_strings): Doc fix (Bug#13081).
1981 2012-12-21  Eli Zaretskii  <eliz@gnu.org>
1983         * w32.c (get_name_and_id): Always pass NULL as the first argument
1984         of lookup_account_sid.  Avoids crashes with UNC file names that
1985         refer to DFS domains, not to specific machine names.  (Bug#12621)
1986         Remove now unused argument FNAME; all callers changed.
1987         (get_file_owner_and_group): Remove now unused argument FNAME; all
1988         callers changed.
1990 2012-12-21  Chong Yidong  <cyd@gnu.org>
1992         * editfns.c (Finsert_char): Since read-char-by-name now signals an
1993         error for invalid chars, don't check for a nil return value.
1995 2012-12-20  Dmitry Antipov  <dmantipov@yandex.ru>
1997         Avoid calls to CHAR_TO_BYTE if byte position is known.
1998         * editfns.c (make_buffer_string_both): Use move_gap_both.
1999         (Fbuffer_string): Use make_buffer_string_both.
2000         * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2001         Adjust comment.
2002         (buf_bytepos_to_charpos): Likewise.
2003         (charpos_to_bytepos): Remove.
2004         * fileio.c (Finsert_file_contents): Use move_gap_both.
2005         * search.c (Freplace_match): Likewise.
2006         * process.c (process_send_region): Likewise.  Use convenient
2007         names for byte positions.
2008         * lisp.h (charpos_to_bytepos): Remove prototype.
2009         * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2010         * insdel.c (move_gap): Likewise.
2012 2012-12-20  Paul Eggert  <eggert@cs.ucla.edu>
2014         * xdisp.c (redisplay_internal): Remove now-unused local.
2016 2012-12-20  Stefan Monnier  <monnier@iro.umontreal.ca>
2018         * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2019         (redisplay_internal): Don't bother selecting the frame to get the
2020         proper value of frame-local variables (bug#13225).
2022 2012-12-20  Dmitry Antipov  <dmantipov@yandex.ru>
2024         * textprop.c (set_text_properties_1): Do not allow NULL interval.
2025         Rename 4th argument since it may be buffer or string.  Adjust comment.
2026         * intervals.c (graft_intervals_info_buffer): Find an interval here.
2028 2012-12-19  Dmitry Antipov  <dmantipov@yandex.ru>
2030         * coding.c (Fdetect_coding_region): Do not check start and end with
2031         CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2032         (code_convert_region): Likewise.
2034 2012-12-18  Eli Zaretskii  <eliz@gnu.org>
2036         * w32.c (acl_get_file, acl_set_file): Run the file name through
2037         map_w32_filename, and resolve any symlinks in the file name, like
2038         Posix platforms do.
2039         (acl_set_file): Call revert_to_self, if any privileges were
2040         enabled.
2042 2012-12-17  Juanma Barranquero  <lekktu@gmail.com>
2044         * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2045         ($(BLD)/w32.$(O)): Update dependencies.
2047 2012-12-17  Stefan Monnier  <monnier@iro.umontreal.ca>
2049         * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2050         propagate redisplay's scrolling (if any) to the right window.
2051         (redisplay_internal): Use ensure_selected_frame.
2052         (display_mode_lines): Complete last fix.
2053         * window.c (select_window_1): New func, extracted from select_window.
2054         (select_window): Use it.
2055         * window.h (select_window_1): Declare.
2057 2012-12-17  Eli Zaretskii  <eliz@gnu.org>
2059         Emulate Posix ACL APIs on MS-Windows.
2060         * w32.c: Include sddl.h and sys/acl.h.
2061         (SDDL_REVISION_1): Define if not already defined.
2062         (g_b_init_get_security_descriptor_dacl)
2063         (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2064         (g_b_init_is_valid_security_descriptor)
2065         (g_b_init_set_file_security): New static flags.
2066         (globals_of_w32): Initialize them to zero.
2067         (SetFileSecurity_Name): New string constant.
2068         (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2069         (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2070         (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2071         (IsValidSecurityDescriptor_Proc): New typedefs.
2072         (get_file_security, get_security_descriptor_owner)
2073         (get_security_descriptor_group): Set errno to ENOTSUP.
2074         (set_file_security, get_security_descriptor_dacl)
2075         (is_valid_security_descriptor, convert_sd_to_sddl)
2076         (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2077         (acl_free, acl_get_file, acl_set_file): New functions.
2079         * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2081 2012-12-17  Paul Eggert  <eggert@cs.ucla.edu>
2083         Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2084         With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2085         for some of that bug's symptoms can now cause Emacs to abort.
2086         Remove the workaround.
2087         * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2088         The bug that caused SIGCHLD to get lost has been fixed, and the
2089         workaround for it can now cause Emacs to abort.
2091 2012-12-16  Paul Eggert  <eggert@cs.ucla.edu>
2093         * sysdep.c (emacs_abort): Bump backtrace size to 40.
2094         Companion to the 2012-09-30 patch.  Suggested by Eli Zaretskii in
2095         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2097 2012-12-16  Romain Francoise  <romain@orebokech.com>
2099         * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2100         (Fcopy_file): Change last arg to `preserve_extended_attributes'
2101         and copy ACL entries of file in addition to SELinux context if set.
2102         (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2104         * Makefile.in (LIBACL_LIBS): New macro.
2105         (LIBES): Use it.
2107 2012-12-15  Paul Eggert  <eggert@cs.ucla.edu>
2109         * fileio.c (internal_delete_file): Use bool for boolean.
2111 2012-12-15  Eli Zaretskii  <eliz@gnu.org>
2113         Fix bug #13079 on MS-Windows with temp files not being deleted.
2114         * w32.h (_child_process): New members input_file and
2115         pending_deletion.
2116         (register_child): First argument is now pid_t.
2117         (record_infile, record_pending_deletion): New prototypes.
2119         * w32proc.c (new_child): Initialize input_file and
2120         pending_deletion members of the child.
2121         (delete_child): Delete the child's temporary input file, if any,
2122         that is pending deletion.
2123         (register_child): First argument is now pid_t.
2124         (record_infile, record_pending_deletion): New functions.
2125         (reap_subprocess): Fix a typo in DebPrint string.
2126         (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2128         * fileio.c (internal_delete_file): Return an int again: non-zero
2129         if delete-file succeeds, zero otherwise.
2131         * lisp.h (internal_delete_file): Adjust prototype.
2133         * callproc.c (Fcall_process): Don't overwrite infile with result
2134         of DECODE_FILE.
2135         [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2136         asynchronous subprocess, record the name of the input file name,
2137         if any.
2138         (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2139         delete the file, record it as pending deletion when the subprocess
2140         exits.
2142 2012-12-14  Eli Zaretskii  <eliz@gnu.org>
2144         * editfns.c [HAVE_PWD_H]: Include grp.h.
2146         * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2148 2012-12-14  Paul Eggert  <eggert@cs.ucla.edu>
2150         Fix permissions bugs with setgid directories etc. (Bug#13125)
2151         * dired.c (Ffile_attributes): Return t as the 9th attribute,
2152         to mark it as a placeholder.  The old value was often wrong.
2153         The only user of this attribute has been changed to use
2154         file-ownership-preserved-p instead, with its new group arg.
2155         * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2157 2012-12-14  Stefan Monnier  <monnier@iro.umontreal.ca>
2159         * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2160         Keep selected_window and selected_frame in sync.
2162 2012-12-14  Eli Zaretskii  <eliz@gnu.org>
2164         * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2165         try to get accurate owner and group information from NT file
2166         security APIs.  This is to make most callers of 'stat' and
2167         'lstat', which don't need that information, much faster.
2169         * dired.c (Ffile_attributes) [WINDOWSNT]:
2170         Set w32_stat_get_owner_group to a non-zero value, to request accurate
2171         owner and group information from 'lstat'.
2173 2012-12-13  Paul Eggert  <eggert@cs.ucla.edu>
2175         * fileio.c (Finsert_file_contents): Don't put tail into head area,
2176         as that confuses set-auto-coding, so insist on the head-read
2177         returning the full 1024 bytes.  Let lseek compute the tail offset;
2178         less work for us.  Do not ignore I/O errors when reading the tail.
2180         * xdisp.c: Minor style fixes.
2181         (init_iterator): Hoist assignment out of if-expression.
2182         (markpos_of_region): Callers now test for sign, not for -1.
2184 2012-12-13  Dmitry Antipov  <dmantipov@yandex.ru>
2186         Minor redisplay optimization when the region length is zero.
2187         * xdisp.c (markpos_of_region): New function.
2188         (init_iterator): Do not highlight the region of zero length.
2189         (redisplay_window): Check whether the region is of non-zero length.
2190         (try_cursor_movement): Allow if the region length is zero.
2191         (try_window_reusing_current_matrix, try_window_id): Likewise.
2193 2012-12-13  Eli Zaretskii  <eliz@gnu.org>
2195         * search.c (search_buffer): Check the inverse translations of each
2196         character in pattern when the buffer being searched is unibyte.
2197         (Bug#13084)
2199 2012-12-13  Paul Eggert  <eggert@cs.ucla.edu>
2201         * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2202         files, fixing a regression from 24.2.
2203         (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
2205 2012-12-13  Paul Eggert  <eggert@cs.ucla.edu>
2207         * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2208         fstat shouldn't fail, and if it does fail copy-file should not proceed.
2209         Remove unnecessary S_ISLNK test, as (contra the comments) this
2210         function can't copy symlinks.  Improve quality of error message
2211         when attempting to copy files that are neither regular files nor
2212         directories.
2214 2012-12-12  Dmitry Antipov  <dmantipov@yandex.ru>
2216         * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2217         * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2218         * window.c (Frecenter):
2219         * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2220         * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2222 2012-12-12  Daniel Colascione  <dancol@dancol.org>
2224         * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
2225         the dumped Emacs is not a sparse file, greatly improving Cygwin
2226         "make bootstrap" performance.
2228 2012-12-11  Michael Albinus  <michael.albinus@gmx.de>
2230         * inotify.c (inotify_callback): Generate an Emacs event for every
2231         incoming inotify event.
2233 2012-12-11  Eli Zaretskii  <eliz@gnu.org>
2235         * xdisp.c (handle_face_prop): Fix logic of computing
2236         it->start_of_box_run_p.
2237         (append_space_for_newline): If the glyph row is R2L, reset the
2238         iterator's end_of_box_run_p flag before prepending the space glyph.
2239         (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2240         iterator's start_of_box_run_p flag before prepending the stretch.
2241         (append_glyph, produce_image_glyph, append_composite_glyph)
2242         (append_stretch_glyph, append_glyphless_glyph): Reverse the
2243         left_box_line_p and right_box_line_p flags of the glyph for R2L
2244         glyph rows.  (Bug#13011)
2246 2012-12-11  Dmitry Antipov  <dmantipov@yandex.ru>
2248         * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2249         if changed buffer is not shown in a window.
2250         * insdel.c (prepare_to_modify_buffer): Likewise.
2251         * window.c (replace_buffer_in_windows_safely): Do nothing
2252         if buffer is not shown in a window.
2253         (Fforce_window_update): Likewise if string or buffer argument
2254         is passed.
2256 2012-12-11  Eli Zaretskii  <eliz@gnu.org>
2258         * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2259         encoded_file_name, which is what it is.
2261 2012-12-11  Dmitry Antipov  <dmantipov@yandex.ru>
2263         Consistently use marker_position and marker_byte_position.
2264         * fringe.c (Ffringe_bitmaps_at_pos):
2265         * indent.c (Fvertical_motion):
2266         * insdel.c (prepare_to_modify_buffer):
2267         * keyboard.c (make_lispy_position):
2268         * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2269         (window_scroll_pixel_based, displayed_window_lines)
2270         (Fset_window_configuration):
2271         * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2272         (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2273         Replace direct access to marker fields with calls
2274         to marker_position and/or marker_byte_position.
2276 2012-12-11  Juanma Barranquero  <lekktu@gmail.com>
2278         * makefile.w32-in (SIG2STR_H): New macro.
2279         (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2280         ($(BLD)/w32notify.$(O)): Update dependencies.
2282 2012-12-10  Daniel Colascione  <dancol@dancol.org>
2284         * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2285         Windows file notification functionality unless WINDOWSNT.
2287         * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2288         declarations.
2290         * w32fns.c (cache_system_info): Initialize the global hinst
2291         variable here so various initialization calls DTRT.
2293         * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
2294         (hinst): Remove unneeded extern declaration.
2295         (_start): Remove initialization of above variables; remove
2296         initialization of hinst, as cache_system_info now does that.
2298         * emacs.c (main): Call cache_system_info early in startup; we
2299         previously weren't calling it in Cygwin builds.
2301         * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2302         Teach the autoconf build system how to compile a Windows resource file
2303         and link it to Emacs.
2305 2012-12-10  Dmitry Antipov  <dmantipov@yandex.ru>
2307         Per-buffer window counters.
2308         * buffer.h (struct buffer): New member window_count.
2309         (buffer_window_count): New function.
2310         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2311         Initialize window_count.
2312         (Fkill_buffer): Verify window_count for the buffer being killed.
2313         (modify_overlay): Do not force redisplay if buffer is not shown
2314         in any window.
2315         (init_buffer_once): Initialize window_count for buffer_defaults
2316         and buffer_local_symbols.
2317         * window.h (buffer_shared): Remove declaration.
2318         (wset_buffer): Convert from inline ...
2319         * window.c (wset_buffer): ... to an ordinary function.
2320         (adjust_window_count): New function.
2321         (make_parent_window): Use it.
2322         * xdisp.c (buffer_shared): Remove.
2323         (redisplay_internal, redisplay_window): Adjust users.
2324         (buffer_shared_and_changed): Use per-buffer window counter.
2326 2012-12-10  Eli Zaretskii  <eliz@gnu.org>
2328         Support for filesystem notifications on MS-Windows.
2329         * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2330         and this is a TTY frame, signal the caller that keyboard input is
2331         available.
2333         * w32xfns.c (drain_message_queue): Now returns an int: an
2334         indication whether any WM_EMACS_FILENOTIFY messages were found in
2335         the queue.
2337         * w32inevt.c (handle_file_notifications): New function.
2338         (w32_console_read_socket): Call it to process file notifications.
2340         * w32console.c (initialize_w32_display): Record the main thread ID
2341         in dwMainThreadId.
2343         * deps.mk (inotify.o): New dependency list.
2345         * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2347         * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2348         (WM_EMACS_END): Bump value by 1.
2349         (notification_buffer_in_use, file_notifications)
2350         (notifications_size, notifications_desc): Declare.
2351         (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2352         Add prototypes.
2354         * w32term.c (lispy_file_action, queue_notifications): New functions.
2355         (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2356         <Qrenamed_to>: New symbols.
2357         (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2359         * w32notify.c: New file, implements file event notifications for
2360         MS-Windows.
2362         * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2363         by posting it to the w32_read_socket queue.
2365         * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2367         * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2368         (GLOBAL_SOURCES): Add w32notify.c
2369         ($(BLD)/w32notify.$(O)): New set of dependencies.
2371         * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2373         * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2374         Handle FILE_NOTIFY_EVENT.
2375         (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2376         (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2377         w32notify-handle-event by default.
2379         * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2380         syms_of_w32notify.
2382 2012-12-10  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
2384         Support for filesystem notifications on GNU/Linux via inotify.
2385         * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
2387         * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2389         * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2390         (syms_of_keyboard): DEFSYM it.
2391         (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2392         (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2393         Qfile_inotify events.
2394         (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2395         special-event-map to inotify-handle-event.
2397         * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2399         * Makefile.in (base_obj): Add inotify.o.
2401         * inotify.c: New file.
2403 2012-12-10  Jan Djärv  <jan.h.d@swipnet.se>
2405         * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2407 2012-12-10  Fabrice Popineau  <fabrice.popineau@gmail.com>
2409         * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2410         DWORD_PTR, for compatibility with 64-bit builds.
2412         * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
2413         (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2414         (system_process_attributes): Use SIZE_T rather than DWORD, for
2415         compatibility with 64-bit builds.
2417 2012-12-10  Christopher Schmidt  <christopher@ch.ristopher.com>
2419         * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2421 2012-12-10  Eli Zaretskii  <eliz@gnu.org>
2423         * indent.c (Fvertical_motion): If a display string will be
2424         displayed on the left or the right margin, don't consider it as a
2425         factor in cursor positioning.  (Bug#13108)
2427 2012-12-10  Martin Rudalics  <rudalics@gmx.at>
2429         * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2431 2012-12-10  Paul Eggert  <eggert@cs.ucla.edu>
2433         * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2434         for string length.
2436 2012-12-08  Eli Zaretskii  <eliz@gnu.org>
2438         * w32.c (unsetenv): Return 0 if the input string is too long.
2440 2012-12-08  Paul Eggert  <eggert@cs.ucla.edu>
2442         Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2443         * alloc.c (xputenv): New function.
2444         * dbusbind.c (Fdbus_init_bus):
2445         * emacs.c (main):
2446         * xterm.c (x_term_init):
2447         Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2448         * editfns.c (initial_tz): Move static var decl up.
2449         (tzvalbuf_in_environ): New static var.
2450         (init_editfns): Initialize these two static vars.
2451         (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2452         Save old TZ value on stack, if it's small.
2453         (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2454         instead, use xputenv+unsetenv to set and restore TZ.
2455         (environbuf): Remove static var.  All uses removed.
2456         (Fset_time_zone_rule): Do not save TZ and environ;
2457         no longer needed here.
2458         (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2459         Move to inside set_time_zone_rule; they don't need file scope any more.
2460         (set_time_zone_rule): Maintain the TZ=value string separately.
2461         (syms_of_editfns): Don't initialize initial_tz;
2462         init_editfns now does it.
2463         * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2464         * lisp.h (xputenv): New decl.
2466 2012-12-08  Fabrice Popineau  <fabrice.popineau@gmail.com>
2468         * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2470 2012-12-08  Eli Zaretskii  <eliz@gnu.org>
2472         * w32.c (unsetenv, sys_putenv): New functions.
2474 2012-12-08  Chong Yidong  <cyd@gnu.org>
2476         * editfns.c (Finsert_char): Make the error message more
2477         informative (Bug#12992).
2479 2012-12-08  Paul Eggert  <eggert@cs.ucla.edu>
2481         Simplify get_lim_data.
2482         * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2483         Remove USG and vlimit methods; no longer used these days.
2484         Add #error catchall just in case.
2486         Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2487         Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2488         SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2489         * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2490         (deleted_pid_list, Fdelete_process, create_process)
2491         (record_child_status_change, handle_child_signal, deliver_child_signal)
2492         (init_process_emacs, syms_of_process):
2493         Assume SIGCHLD is defined.
2494         (parse_signal): Remove.  All uses removed.
2495         (abbr_to_signal): New static function.
2496         (Fsignal_process): Use it to convert signal names to ints.
2497         * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2498         kill (getpgrp (), ...).
2499         (emacs_sigaction_init): Assume SIGCHLD is defined.
2500         (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2501         SIGPIPE, and SIGQUIT are defined.  Do not worry about SIGCLD any more.
2502         * syssignal.h (EMACS_KILLPG): Remove.
2503         All uses replaced by 'kill' with a negative pid.
2504         (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2505         * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2507 2012-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2509         * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2510         This will cause a production Emacs to dump core instead of
2511         infinite-looping.
2513 2012-12-07  Dmitry Antipov  <dmantipov@yandex.ru>
2515         * frame.c (make_frame): Do not set window's buffer to t.
2516         * window.c (Fsplit_window_internal): Likewise.  Previously it was
2517         used to indicate that the window is being set up.  Now we use
2518         set_window_buffer for all new windows, so the condition in ...
2519         (Fset_window_buffer): ... is always true and can be removed.
2521 2012-12-07  Dmitry Antipov  <dmantipov@yandex.ru>
2523         Convenient macro to check whether the buffer is hidden.
2524         * buffer.h (BUFFER_HIDDEN_P): New macro.
2525         * frame.c (make_frame): Use it.  Adjust comment.
2526         * buffer.c (candidate_buffer): New function.
2527         (Fother_buffer, other_buffer_safely): Use it.
2529 2012-12-06  Eli Zaretskii  <eliz@gnu.org>
2531         * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2532         if the child process is still running.  Instead, exit the wait
2533         loop and return zero.  (Bug#13086)
2535 2012-12-06  Dmitry Antipov  <dmantipov@yandex.ru>
2537         * frame.h (x_char_width, x_char_height): Remove prototypes.
2538         * w32term.h (x_char_width, x_char_height): Likewise.
2539         * xfns.c (x_char_width, x_char_height): Remove.
2540         * w32fns.c (x_char_width, x_char_height): Likewise.
2541         * nsfns.c (x_char_width, x_char_height): Likewise.
2542         * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2543         all window frames.
2544         (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2545         * keyboard.c (command_loop_1): Remove prototype.
2546         (command_loop_2, top_level_1): Add static to match prototype.
2548 2012-12-06  Paul Eggert  <eggert@cs.ucla.edu>
2550         Fix a recently-introduced delete-process race condition.
2551         * callproc.c, process.h (record_kill_process):
2552         New function, containing part of the old call_process_kill.
2553         (call_process_kill): Use it.
2554         This does not change call_process_kill's behavior.
2555         * process.c (Fdelete_process): Use record_kill_process to fix a
2556         race condition that could cause Emacs to lose track of a child.
2558 2012-12-06  Dmitry Antipov  <dmantipov@yandex.ru>
2560         Avoid code duplication between prev_frame and next_frame.
2561         * frame.c (candidate_frame): New function.  Add comment.
2562         (prev_frame, next_frame): Use it.  Adjust comment.
2564 2012-12-06  Eli Zaretskii  <eliz@gnu.org>
2566         * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2567         fails, signal an error instead of continuing with an empty
2568         string.  (Bug#13079)
2569         Encode expanded temp file pattern before passing it to mkstemp or
2570         mktemp.
2572         * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2573         Encode the file name before passing it to dostounix_filename, in
2574         case it will downcase it (under w32-downcase-file-names).
2575         (Bug#12933)
2577 2012-12-05  Paul Eggert  <eggert@cs.ucla.edu>
2579         Minor call-process cleanups.
2580         * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2581         at the same time as other platforms, to simplify analysis.
2582         No need for fd0_volatile since we have synch_process_fd.
2583         Avoid needless emacs_close; arg is always negative.
2585 2012-12-04  Andreas Schwab  <schwab@linux-m68k.org>
2587         * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2588         processes.
2590 2012-12-04  Dmitry Antipov  <dmantipov@yandex.ru>
2592         * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2593         member.  Adjust users.  Convert mouse_face_past_end, mouse_face_defer
2594         and mouse_face_hidden members to a bitfields.
2595         * frame.h (struct frame): Remove set-but-not-used space_width member.
2596         (FRAME_SPACE_WIDTH): Remove.
2597         * nsterm.m, w32term.c, xterm.c: Adjust users.
2598         * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2599         member.  Adjust users.  Convert term_initted, delete_in_insert_mode,
2600         costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2601         members to a bitfields.
2603 2012-12-03  Paul Eggert  <eggert@cs.ucla.edu>
2605         Don't let call-process be a zombie factory (Bug#12980).
2606         Fixing this bug required some cleanup of the signal-handling code.
2607         As a side effect, this change also fixes a longstanding rare race
2608         condition whereby Emacs could mistakenly kill unrelated processes,
2609         and it fixes a bug where a second C-g does not kill a recalcitrant
2610         synchronous process in GNU/Linux and similar platforms.
2611         The patch should also fix the last vestiges of Bug#9488,
2612         a bug which has mostly been fixed on the trunk by other changes.
2613         * callproc.c, process.h (synch_process_alive, synch_process_death)
2614         (synch_process_termsig, sync_process_retcode):
2615         Remove.  All uses removed, to simplify analysis and so that
2616         less consing is done inside critical sections.
2617         * callproc.c (call_process_exited): Remove.  All uses replaced
2618         with !synch_process_pid.
2619         * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2620         These take the role of what used to be in unwind-protect arg.
2621         All uses changed.
2622         (block_child_signal, unblock_child_signal):
2623         New functions, to avoid races that could kill innocent-victim processes.
2624         (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2625         (call_process_kill): Record killed processes as deleted, so that
2626         zombies do not clutter up the system.  Do this inside a critical
2627         section, to avoid a race that would allow the clutter.
2628         (call_process_cleanup): Fix code so that the second C-g works again
2629         on common platforms such as GNU/Linux.
2630         (Fcall_process): Create the child process in a critical section,
2631         to fix a race condition.  If creating an asynchronous process,
2632         record it as deleted so that zombies do not clutter up the system.
2633         Do unwind-protect for WINDOWSNT too, as that's simpler in the
2634         light of these changes.  Omit unnecessary call to emacs_close
2635         before failure, as the unwind-protect code does that.
2636         * callproc.c (call_process_cleanup):
2637         * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2638         * process.c (record_deleted_pid): New function, containing
2639         code refactored out of Fdelete_process.
2640         (Fdelete_process): Use it.
2641         (process_status_retrieved): Remove.  All callers changed to use
2642         child_status_change.
2643         (record_child_status_change): Remove, folding its contents into ...
2644         (handle_child_signal): ... this signal handler.  Now, this
2645         function is purely a handler for SIGCHLD, and is not called after
2646         a synchronous waitpid returns; the synchronous code is moved to
2647         wait_for_termination.  There is no need to worry about reaping
2648         more than one child now.
2649         * sysdep.c (get_child_status, child_status_changed): New functions.
2650         (wait_for_termination): Now takes int * status and bool
2651         interruptible arguments, too.  Do not record child status change;
2652         that's now the caller's responsibility.  All callers changed.
2653         Reimplement in terms of get_child_status.
2654         (wait_for_termination_1, interruptible_wait_for_termination):
2655         Remove.  All callers changed to use wait_for_termination.
2656         * syswait.h: Include <stdbool.h>, for bool.
2657         (record_child_status_change, interruptible_wait_for_termination):
2658         Remove decls.
2659         (record_deleted_pid, child_status_changed): New decls.
2660         (wait_for_termination): Adjust to API changes noted above.
2662         * bytecode.c, lisp.h (Qbytecode): Remove.
2663         No longer needed after 2012-11-20 interactive-p changes.
2665 2012-12-03  Eli Zaretskii  <eliz@gnu.org>
2667         * xdisp.c (redisplay_window): If the cursor is visible, but inside
2668         the scroll margin, move point outside the margin.  (Bug#13055)
2670 2012-12-03  Jan Djärv  <jan.h.d@swipnet.se>
2672         * gtkutil.c (my_log_handler): New function.
2673         (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2675 2012-12-03  Dmitry Antipov  <dmantipov@yandex.ru>
2677         * lisp.h (modify_region): Rename to...
2678         (modify_region_1): ...new prototype.
2679         * textprop.c (modify_region): Now static.  Adjust users.
2680         * insdel.c (modify_region): Rename to...
2681         (modify_region_1): ...new function to work with current buffer.
2682         Adjust comment and users.  Use true and false for booleans.
2684 2012-12-03  Dmitry Antipov  <dmantipov@yandex.ru>
2686         * alloc.c (free_save_value): New function.
2687         (safe_alloca_unwind): Use it.
2688         * lisp.h (free_save_value): New prototype.
2689         * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2690         Add comment.
2691         (save_excursion_restore): Adjust to match saved data structure.
2692         Use free_save_value to offload some work from GC.  Drop obsolete
2693         #if 0 code.
2695 2012-12-03  Chong Yidong  <cyd@gnu.org>
2697         * fileio.c (Vauto_save_list_file_name): Doc fix.
2699 2012-12-03  Fabrice Popineau  <fabrice.popineau@gmail.com>
2701         * w32fns.c: Remove prototype of atof.
2702         (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
2703         builds.
2704         (file_dialog_callback): Make it UINT_PTR.
2706         * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2707         with 64-bit builds.
2709         * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2710         (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2711         defined.
2713 2012-12-03  Glenn Morris  <rgm@gnu.org>
2715         * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
2717 2012-12-02  Paul Eggert  <eggert@cs.ucla.edu>
2719         Fix xpalloc confusion after memory is exhausted.
2720         * alloc.c (xpalloc): Comment fix.
2721         * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2722         and signals an error, do not clear charset_table_size, as
2723         charset_table is still valid.
2724         * doprnt.c (evxprintf): Clear *BUF after freeing it.
2726         Use execve to avoid need to munge environ (Bug#13054).
2727         * callproc.c (Fcall_process):
2728         * process.c (create_process):
2729         Don't save and restore environ; no longer needed.
2730         * callproc.c (child_setup):
2731         Use execve, not execvp, to preserve environ.
2733 2012-12-01  Paul Eggert  <eggert@cs.ucla.edu>
2735         * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2737 2012-12-01  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2739         * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2740         display for sliced images (Bug#10500).
2742         * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2744 2012-11-30  Juanma Barranquero  <lekktu@gmail.com>
2746         * doc.c (Fdocumentation): Re-add handling of function-documentation,
2747         accidentally removed in revno:110851 (bug#13034).
2749 2012-11-29  Dmitry Antipov  <dmantipov@yandex.ru>
2751         * xdisp.c (window_outdated): Remove eassert since it hits
2752         some suspicious corner cases (see Bug#13007 and Bug#13012).
2753         (mode_line_update_needed): New function.
2754         (redisplay_internal, redisplay_window): Use it.
2755         (ensure_selected_frame): New function.
2756         (redisplay_internal, unwind_redisplay): Use it.
2757         (redisplay_internal): Move comment about buffer_shared...
2758         (buffer_shared_and_changed): ...near to its real use.
2760 2012-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2762         * callproc.c (Fcall_process): Don't misreport vfork failure.
2764 2012-11-28  Paul Eggert  <eggert@cs.ucla.edu>
2766         * callproc.c (Fcall_process): Fix vfork portability problems.
2767         Do not assume that fd[0], count, filefd, and save_environ survive
2768         vfork.  Fix bug whereby wrong errno value could be reported for
2769         pipe failure.  Some minor cleanups, too, as follows.  Move buf and
2770         bufsize to the context where they're needed.  Change new_argv to
2771         be of type char **, as this is more convenient and avoids casts.
2772         (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2773         Now local constants, not macros.
2775 2012-11-18  Kenichi Handa  <handa@gnu.org>
2777         * font.c (font_unparse_xlfd): Fix previous change.  Keep "const"
2778         for the variable "f".
2780 2012-11-13  Kenichi Handa  <handa@gnu.org>
2782         * font.c (font_unparse_xlfd): Exclude special characters from the
2783         generating XLFD name.
2785 2012-11-27  Paul Eggert  <eggert@cs.ucla.edu>
2787         Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2788         * dired.c (stat_uname, stat_gname):
2789         * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2791         Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2792         * dired.c (directory_files_internal, file_name_completion):
2793         Assume EAGAIN and EINTR are defined.
2795         * fileio.c (Fcopy_file): Assume EISDIR is defined.
2796         * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2797         * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2798         * lread.c (readbyte_from_file): Assume EINTR is defined.
2799         * process.c (wait_reading_process_output, send_process) [subprocesses]:
2800         Assume EIO and EAGAIN are defined.
2801         * unexcoff.c (write_segment): Assume EFAULT is defined.
2803 2012-11-27  Eli Zaretskii  <eliz@gnu.org>
2805         * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2806         (Bug#11964)
2808         * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2809         highlighting on the frame was cleared.  Prevents assertion
2810         violations when repeatedly clicking on the "Top" link of the
2811         "bread-crumbs" in Info buffers.
2813 2012-11-25  Paul Eggert  <eggert@cs.ucla.edu>
2815         * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2817 2012-11-24  Ken Brown  <kbrown@cornell.edu>
2819         * keyboard.c (HAVE_MOUSE):
2820         * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2821         were always defined.
2823 2012-11-24  Eli Zaretskii  <eliz@gnu.org>
2825         * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2826         between bpos_covered and bpos_max.  This fixes cursor display when
2827         several display strings follow each other.
2829         * .gdbinit (pgx): If the glyph's object is a string, display the
2830         pointer to string data, rather than the value of the string object
2831         itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2833         * indent.c (Fvertical_motion): If the starting position is covered
2834         by a display string, return to one position before that, to avoid
2835         overshooting it inside move_it_to.  (Bug#12930)
2837 2012-11-23  Dmitry Antipov  <dmantipov@yandex.ru>
2839         * frame.h (struct frame): Remove display_preempted member
2840         since all users are dead long ago.
2841         * nsterm.h (struct x_output): Use the only dummy member.
2842         * w32menu.c (pending_menu_activation): Remove since not
2843         really used.
2844         (set_frame_menubar): Adjust user.
2845         * w32term.h (struct x_output): Drop outdated #if 0 code.
2846         (struct w32_output): Use bitfields for explicit_parent,
2847         asked_for_visible and menubar_active members.
2848         Drop unused pending_menu_activation member.
2849         * xterm.h (struct x_output): Drop outdated #if 0 code.
2850         Use bitfields for explicit_parent, asked_for_visible,
2851         has_been_visible and net_wm_state_hidden_seen members.
2853 2012-11-23  Eli Zaretskii  <eliz@gnu.org>
2855         * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2856         of a literal "/".  (Bug#12955)
2857         (gl-stamp): Invoke fc.exe directly, not through cmd.
2859 2012-11-23  Paul Eggert  <eggert@cs.ucla.edu>
2861         Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
2862         * dired.c: Assume HAVE_DIRENT_H.
2863         (NAMLEN): Remove, replacing with ...
2864         (dirent_namelen): New function.  All uses changed.  Use the GNU macro
2865         _D_EXACT_NAMELEN if available, as it's faster than strlen.
2866         (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
2867         (DIRENTRY_NONEMPTY): Remove.  All callers now assume it's nonzero.
2868         * makefile.w32-in (DIR_H): Remove.  All uses replaced with
2869         $(NT_INC)/dirent.h.
2870         ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
2871         * ndir.h: Rename to ../nt/inc/dirent.h.
2872         * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
2873         Do not include <dirent.h>; no longer needed.
2874         * w32.c: Include <dirent.h> rather than "ndir.h".
2876 2012-11-23  Chong Yidong  <cyd@gnu.org>
2878         * xftfont.c (xftfont_open): Remove duplicate assignment.
2880 2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>
2882         * alloc.c (Fgarbage_collect): Unblock input after clearing
2883         gc_in_progress to avoid note_mouse_highlight glitch with GC.
2884         * frame.h (FRAME_MOUSE_UPDATE): New macro.
2885         * msdos.c (IT_frame_up_to_date): Use it here...
2886         * w32term.c (w32_frame_up_to_date): ...here...
2887         * xterm.c (XTframe_up_to_date): ...and here...
2888         * nsterm.m (ns_frame_up_to_date): ...but not here.
2889         * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
2890         Adjust users.
2891         * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
2892         Do not check whether GC is in progress.
2894 2012-11-22  Dmitry Antipov  <dmantipov@yandex.ru>
2896         * xdisp.c (window_buffer_changed): New function.
2897         (update_menu_bar, update_tool_bar): Use it to
2898         simplify large 'if' statements.
2899         (redisplay_internal): Generalize commonly used
2900         'tail' and 'frame' local variables.
2902 2012-11-22  Eli Zaretskii  <eliz@gnu.org>
2904         * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
2905         with Windows system header.
2907 2012-11-21  Paul Eggert  <eggert@cs.ucla.edu>
2909         Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
2910         * alloc.c: Assume unistd.h exists.
2911         * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
2912         * sysdep.c (get_current_dir_name): Assume getcwd exists.
2913         (getwd) [USG]: Remove; no longer needed.
2914         (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
2915         * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
2916         * w32.h (getcwd): Remove decl.
2918 2012-11-21  Stefan Monnier  <monnier@iro.umontreal.ca>
2920         * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
2921         Make it set selected_window as well.
2922         (update_tool_bar): Use it.
2924 2012-11-21  Ken Brown  <kbrown@cornell.edu>
2926         * emacs.c (main): Set the G_SLICE environment variable for all
2927         Cygwin builds, not just GTK builds.  See
2928         https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
2930 2012-11-21  Eli Zaretskii  <eliz@gnu.org>
2932         * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2933         (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
2934         Define for the MSVC compiler.
2936         * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
2938         * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
2939         (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
2940         dostounix_filename.  Prevents crashes down the road, because
2941         dostounix_filename assumes it gets a unibyte string.
2942         Reported by Michel de Ruiter <michel@sentient.nl>, see
2943         http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
2945 2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
2947         Conflate Qnil and Qunbound for `symbol-function'.
2948         * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
2949         * lread.c (init_obarray): Set `function' fields to Qnil.
2950         * eval.c (Fcommandp): Ignore Qunbound.
2951         (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
2952         * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
2953         Test NILP rather than Qunbound.
2954         (Ffmakunbound): Set to Qnil.
2955         (Fsymbol_function): Never signal an error.
2956         (Finteractive_form): Ignore Qunbound.
2958 2012-11-20  Paul Eggert  <eggert@cs.ucla.edu>
2960         * eval.c (interactive_p): Remove no-longer-used decl.
2962 2012-11-20  Dmitry Antipov  <dmantipov@yandex.ru>
2964         * xdisp.c (buffer_shared): Adjust comment.
2965         (buffer_shared_and_changed): New function.
2966         (prepare_menu_bars, redisplay_internal): Use it to
2967         decide whether all windows or frames should be updated.
2968         (window_outdated): New function.
2969         (text_outside_line_unchanged_p, redisplay_window): Use it.
2970         (redisplay_internal): Likewise.  Fix indentation.
2972 2012-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
2974         * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
2975         (syms_of_eval): Remove corresponding defsubr.
2976         * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
2978 2012-11-19  Daniel Colascione  <dancol@dancol.org>
2980         * w32fns.c (Fx_file_dialog):
2981         (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
2982         cygwin_convert_file_name*.
2984         * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
2985         Rename cygwin_convert_path* to cygwin_convert_file_name*.
2987 2012-11-18  Paul Eggert  <eggert@cs.ucla.edu>
2989         * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
2991 2012-11-18  Eli Zaretskii  <eliz@gnu.org>
2993         * w32select.c: Include w32common.h before w32term.h, so that
2994         windows.h gets included before w32term.h uses some of its
2995         features, see below.
2997         * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
2998         New typedefs.
2999         (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3000         New prototypes.
3001         (EnumSystemLocales) [_MSC_VER]: Define if undefined.  (Bug#12878)
3003 2012-11-18  Jan Djärv  <jan.h.d@swipnet.se>
3005         * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3006         (ns_select): Return at once if events are held (Bug#12834).
3008 2012-11-18  enami tsugutomo  <tsugutomo.enami@jp.sony.com>
3010         * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3011         Needed following 2012-10-20 change.  (Bug#12902)
3013 2012-11-18  Juanma Barranquero  <lekktu@gmail.com>
3015         * w32proc.c (waitpid): Remove unused label get_result.
3017 2012-11-17  Juanma Barranquero  <lekktu@gmail.com>
3019         * makefile.w32-in (SYSWAIT_H): New macro.
3020         ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3021         ($(BLD)/sysdep.$(O)): Update dependencies.
3023 2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>
3025         Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3026         * callproc.c (relocate_fd): Assume F_DUPFD.
3027         * emacs.c, term.c (O_RDWR): Remove.
3028         * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3029         O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3030         * nsterm.m: Assume <fcntl.h> exists.
3031         * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3032         (create_pty, Fmake_network_process, server_accept_connection)
3033         (wait_reading_process_output, init_process_emacs):
3034         Assume O_NONBLOCK.
3035         (wait_reading_process_output): Put in a special case for WINDOWSNT
3036         to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3037         It's not clear this is needed, but it's a more-conservative change.
3038         (create_process): Assume FD_CLOEXEC.
3039         (create_process, create_pty): Assume O_NOCTTY.
3040         * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3041         (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3042         Omit if not DOS_NT, since F_GETFL is not defined there.
3043         (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3044         * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3045         (O_NOCTTY): Remove.
3046         (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3047         lack it, since gnulib guarantees this.
3048         * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3050 2012-11-17  Eli Zaretskii  <eliz@gnu.org>
3052         * w32.c (faccessat): Pretend that directories have the execute bit
3053         set.  Emacs expects that, e.g., in files.el:cd-absolute.
3055         * w32proc.c (create_child): Don't clip the PID of the child
3056         process to fit into an Emacs integer, as this is no longer a
3057         restriction.
3058         (waitpid): Rename from sys_wait.  Emulate a Posix 'waitpid' by
3059         reaping only the process specified by PID argument, if that is
3060         positive.  Use PID instead of dead_child to know which process to
3061         reap.  Wait for the child to die only if WNOHANG is not in
3062         OPTIONS.
3063         (sys_select): Don't set dead_child.
3065         * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3066         as it is no longer needed.
3068         * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3069         no longer needed.
3070         (record_child_status_change): Remove the setting of
3071         record_at_most_one_child for the !WNOHANG case.
3073 2012-11-17  Paul Eggert  <eggert@cs.ucla.edu>
3075         Fix problems in ns port found by static checking.
3076         * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3077         (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3078         not to process group.
3079         (ns_select): Use emacs_write, not write, as that's more robust
3080         in the presence of signals.
3081         (fd_handler:): Check for read errors.
3083 2012-11-16  Glenn Morris  <rgm@gnu.org>
3085         * editfns.c (Fmessage): Mention message-log-max.  (Bug#12849)
3087 2012-11-16  Stefan Monnier  <monnier@iro.umontreal.ca>
3089         * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3091 2012-11-16  Eli Zaretskii  <eliz@gnu.org>
3093         * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3094         use the same value of thread handle.
3095         (start_timer_thread): If the timer thread exited (due to error),
3096         clean up by closing the two handles it used.  Duplicate the caller
3097         thread's handle here, so it gets duplicated only once, when
3098         launching the timer thread.  Set priority of the timer thread, not
3099         the caller thread.
3100         (getitimer): Don't duplicate the caller thread's handle here.
3101         (Bug#12832)
3103 2012-11-16  Jan Djärv  <jan.h.d@swipnet.se>
3105         * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3106         called (Bug#12834).
3108 2012-11-16  Paul Eggert  <eggert@cs.ucla.edu>
3110         Remove no-longer-used pty_max_bytes variable.
3111         * process.c (pty_max_bytes): Remove; unused.
3112         (send_process): Do not set it.
3114 2012-11-15  Juanma Barranquero  <lekktu@gmail.com>
3116         * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3117         Update dependencies.
3119 2012-11-15  Paul Eggert  <eggert@cs.ucla.edu>
3121         * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3122         This follows up on the 2012-09-29 patch that removed indirection
3123         for the 'function' field.  Reported by Sergey Vinokurov in
3124         <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3126 2012-11-14  Eli Zaretskii  <eliz@gnu.org>
3128         * w32.c (faccessat): Rename from sys_faccessat.  (No need to use a
3129         different name, as the MS runtime does not have such a function,
3130         and probably never will.)  All callers changed.  Ignore DIRFD
3131         value if PATH is an absolute file name, to match Posix spec
3132         better.  If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3133         symlinks.
3135 2012-11-14  Dmitry Antipov  <dmantipov@yandex.ru>
3137         * xdisp.c (echo_area_display, redisplay_internal):
3138         Omit redundant check whether frame_garbaged is set.
3140 2012-11-14  Paul Eggert  <eggert@cs.ucla.edu>
3142         Use faccessat, not access, when checking file permissions (Bug#12632).
3143         This fixes a bug that has been present in Emacs since its creation.
3144         It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3145         which must set some sort of record.  (Torek's bug report was against
3146         a predecessor of GNU Emacs, but GNU Emacs happened to have the
3147         same common flaw.)  See Torek's Usenet posting
3148         "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3149         Posted: Fri Apr  8 14:18:56 1983.
3150         * Makefile.in (LIB_EACCESS): New macro.
3151         (LIBES): Use it.
3152         * callproc.c (init_callproc):
3153         * charset.c (init_charset):
3154         * fileio.c (check_existing, check_executable, check_writable)
3155         (Ffile_readable_p):
3156         * lread.c (openp, load_path_check):
3157         * process.c (allocate_pty):
3158         * xrdb.c (file_p):
3159         Use effective UID when checking permissions, not real UID.
3160         * callproc.c (init_callproc):
3161         * charset.c (init_charset):
3162         * lread.c (load_path_check, init_lread):
3163         Test whether directories are accessible, not merely whether they exist.
3164         * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3165         * fileio.c (check_existing, check_executable, check_writable)
3166         (Ffile_readable_p):
3167         Use symbolic names instead of integers for the flags, as they're
3168         portable now.
3169         (check_writable): New arg AMODE.  All uses changed.
3170         Set errno on failure.
3171         (Ffile_readable_p): Use faccessat, not stat + open + close.
3172         (Ffile_writable_p): No need to call check_existing + check_writable.
3173         Just call check_writable and then look at errno.  This saves a syscall.
3174         dir should never be nil; replace an unnecessary runtime check
3175         with an eassert.  When checking the parent directory of a nonexistent
3176         file, check that the directory is searchable as well as writable, as
3177         we can't create files in unsearchable directories.
3178         (file_directory_p): New function, which uses 'stat' on most platforms
3179         but faccessat with D_OK (for efficiency) if WINDOWSNT.
3180         (Ffile_directory_p, Fset_file_times): Use it.
3181         (file_accessible_directory_p): New function, which uses a single
3182         syscall for efficiency.
3183         (Ffile_accessible_directory_p): Use it.
3184         * xrdb.c (file_p): Use file_directory_p.
3185         * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3186         * lread.c (openp): When opening a file, use fstat rather than
3187         stat, as that avoids a permissions race.  When not opening a file,
3188         use file_directory_p rather than stat.
3189         (dir_warning): First arg is now a usage string, not a format.
3190         Use errno.  All uses changed.
3191         * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3192         that merely introduced a race.
3193         * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3194         changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3195         and similarly for the other O_* flags.
3196         * w32.c (sys_faccessat): Rename from sys_access and switch to
3197         faccessat's API.  All uses changed.
3198         * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3199         (magic_db): Rename from magic_file_p.
3200         (magic_db, search_magic_path): Return an XrmDatabase rather than a
3201         char *, so that we don't have to test for file existence
3202         separately from opening the file for reading.  This removes a race
3203         fixes a permission-checking problem, and simplifies the code.
3204         All uses changed.
3205         (file_p): Remove; no longer needed.
3207 2012-11-13  Dmitry Antipov  <dmantipov@yandex.ru>
3209         Omit glyphs initialization at startup.
3210         * dispnew.c (glyphs_initialized_initially_p): Remove.
3211         (adjust_frame_glyphs_initially): Likewise.  Adjust users.
3212         (Fredraw_frame): Move actual code from here...
3213         (redraw_frame): ...to here.  Add eassert.  Adjust comment.
3214         (Fredraw_display): Use redraw_frame.
3215         * xdisp.c (clear_garbaged_frames): Likewise.
3217 2012-11-13  Eli Zaretskii  <eliz@gnu.org>
3219         * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3220         passed to pint2str and pint2hrstr to be at most the size of the
3221         frame's decode_mode_spec_buffer.  This avoids crashes with very
3222         large values of FIELD_WIDTH argument to decode_mode_spec.
3223         (Bug#12867)
3225 2012-11-13  Paul Eggert  <eggert@cs.ucla.edu>
3227         Fix a race with verify-visited-file-modtime (Bug#12863).
3228         Since at least 1991 Emacs has ignored an mtime difference of no
3229         more than one second, but my guess is that this was to work around
3230         file system bugs that were fixed long ago.  Since the race is
3231         causing problems now, let's remove that code.
3232         * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3233         whose time stamp is off by no more than a second.  Insist that the
3234         file time stamps match exactly.
3236 2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>
3238         * frame.h (struct frame): Convert external_tool_bar member to
3239         1-bit unsigned bitfield.
3240         * termhooks.h (struct terminal): Remove mouse_moved member since
3241         all users are long dead.  Adjust comment on mouse_position_hook.
3243 2012-11-12  Dmitry Antipov  <dmantipov@yandex.ru>
3245         Simplify by using FOR_EACH_FRAME here and there.
3246         * frame.c (next_frame, prev_frame, other_visible_frames)
3247         (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3248         * w32term.c (x_window_to_scroll_bar): Likewise.
3249         * window.c (window_list): Likewise.
3250         * xdisp.c (x_consider_frame_title): Likewise.
3251         * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3252         * xfns.c (x_window_to_frame, x_any_window_to_frame)
3253         (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3254         * xmenu.c (menubar_id_to_frame): Likewise.
3255         * xselect.c (frame_for_x_selection): Likewise.
3256         * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3257         (x_window_to_menu_bar): Likewise.
3258         * w32fns.c (x_window_to_frame): Likewise.  Adjust comment.
3260 2012-11-12  Paul Eggert  <eggert@cs.ucla.edu>
3262         * data.c (Qdefalias_fset_function): Now static.
3264         Another tweak to vectorlike_header change.
3265         * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3266         Remove, and replace all uses with ...
3267         (next_in_free_list, set_next_in_free_list):
3268         New functions, which respect C's aliasing rules better.
3270 2012-11-11  Paul Eggert  <eggert@cs.ucla.edu>
3272         * window.c (list4i): Rename from 'quad'.  All uses changed.
3273         Needed because <sys/types.h> defines 'quad' on Solaris 10.
3275 2012-11-11  Juanma Barranquero  <lekktu@gmail.com>
3277         * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3278         warning about mixing declarations and code in ISO C90.
3280 2012-11-10  Martin Rudalics  <rudalics@gmx.at>
3282         * window.c (Fsplit_window_internal): Set combination limit of
3283         new parent window to t iff Vwindow_combination_limit is t;
3284         fixing a regression introduced with the change from 2012-09-22.
3285         (Fset_window_combination_limit): Fix doc-string.
3287 2012-11-10  Eli Zaretskii  <eliz@gnu.org>
3289         * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3290         amount when the scroll margins are too large.  When scrolling
3291         backwards in the buffer, give up if cannot reach point or the
3292         scroll margin within a reasonable number of screen lines.
3293         Fixes point position in window under scroll-up/down-aggressively when
3294         point is positioned many lines beyond the window top/bottom.
3295         (Bug#12811)
3297         * ralloc.c (relinquish): If real_morecore fails to return memory
3298         to the system, don't crash; instead, leave the last heap
3299         unchanged and return.  (Bug#12774)
3301 2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
3303         * lisp.h (AUTOLOADP): New macro.
3304         * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3305         * data.c (Ffset): Remove special ad-advice-info handling.
3306         (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3307         (Fsubr_arity): CSE.
3308         (Finteractive_form): Simplify.
3309         (Fquo): Don't insist on having at least 2 arguments.
3310         (Qdefalias_fset_function): New var.
3312 2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>
3314         * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3316         * nsfont.m (Qcondensed, Qexpanded): New variables.
3317         (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3318         (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3320 2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>
3322         Fix recently introduced crash on MS-Windows (Bug#12839).
3323         * w32term.h (struct scroll_bar): Use convenient header.
3324         (SCROLL_BAR_VEC_SIZE): Remove.
3325         * w32term.c (x_scroll_bar_create): Use VECSIZE.
3327 2012-11-09  Dmitry Antipov  <dmantipov@yandex.ru>
3329         Tweak last vectorlike_header change.
3330         * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3331         vectorlike object on the free list.  This is introduced to avoid
3332         some (but not all) pointer casting and aliasing problems, see
3333         http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3334         * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3335         objects.
3336         (xvectype, xvecsize): Use them to examine Lisp_Object values.
3338 2012-11-09  Jan Djärv  <jan.h.d@swipnet.se>
3340         * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
3341         been removed, so remove them here also.
3343 2012-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
3345         * doc.c (Fdocumentation): Handle new property
3346         dynamic-docstring-function to replace the old ad-advice-info.
3348 2012-11-09  Paul Eggert  <eggert@cs.ucla.edu>
3350         * fns.c (Qeql, hashtest_eq): Now static.
3352 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3354         * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3355         * fns.c (hashfn_eq, hashfn_eql, sxhash):
3356         * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3357         * buffer.c (compare_overlays): Use XLI rather than XHASH.
3359 2012-11-08  Paul Eggert  <eggert@cs.ucla.edu>
3361         Use same hash function for hashfn_profiler as for hash_string etc.
3362         * fns.c (SXHASH_COMBINE): Remove.  All uses replaced by sxhash_combine.
3363         * lisp.h (sxhash_combine): New inline function, with the contents
3364         of the old SXHASH_COMBINE.
3365         * profiler.c (hashfn_profiler): Use it, instead of having a
3366         special hash function containing a comparison that always yields 1.
3368 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3370         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3371         (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3372         (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3373         Remove unused vars.
3375 2012-11-08  Jan Djärv  <jan.h.d@swipnet.se>
3377         * image.c (xpm_make_color_table_h): Fix compiler error because
3378         make_hash_table changed.
3380 2012-11-08  Thomas Kappler  <tkappler@gmail.com>  (tiny change)
3382         * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3384 2012-11-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3386         Use ad-hoc comparison function for the profiler's hash-tables.
3387         * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3388         (make_log): Use them.
3389         (handle_profiler_signal): Don't inhibit quit any longer since we don't
3390         call Fequal any more.
3391         (Ffunction_equal): New function.
3392         (cmpfn_profiler, hashfn_profiler): New functions.
3393         (syms_of_profiler): Initialize them.
3394         * lisp.h (struct hash_table_test): New struct.
3395         (struct Lisp_Hash_Table): Use it.
3396         * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3397         * fns.c (make_hash_table): Take a struct to describe the test.
3398         (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3399         (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3400         (hash_lookup, hash_remove_from_table): Move assertion checking of
3401         hashfn result here.  Check hash-equality before calling cmpfn.
3402         (Fmake_hash_table): Adjust call to make_hash_table.
3403         (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3404         (syms_of_fns): Initialize them.
3405         * emacs.c (main): Move syms_of_fns earlier.
3406         * xterm.c (syms_of_xterm):
3407         * category.c (hash_get_category_set): Adjust call to make_hash_table.
3408         * print.c (print_object): Adjust to new hash-table struct.
3409         * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3411 2012-11-08  Eli Zaretskii  <eliz@gnu.org>
3413         * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3414         value of w32-scroll-lock-modifier is neither nil nor one of the
3415         known key modifiers.  (Bug#12806)
3417 2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>
3419         Shrink struct vectorlike_header to the only size field.
3420         * lisp.h (enum pvec_type): Avoid explicit enum member values.
3421         Adjust comment.
3422         (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3423         PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3424         (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3425         (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3426         information from the vector header.  Adjust comment.
3427         (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3428         (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3429         layout.
3430         (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3431         (struct vectorlike_header): Remove next member.  Adjust comment.
3432         (struct Lisp_Subr): Add convenient header.  Adjust comment.
3433         (allocate_pseudovector): Adjust prototype.
3434         * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3435         (sweep_string, lisp_malloc): Remove useless prototypes.
3436         (enum mem_type): Adjust comment.
3437         (NEXT_IN_FREE_LIST): New macro.
3438         (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3439         (Fmake_bool_vector): Likewise.
3440         (struct large_vector): New type to represent allocation unit for
3441         the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3442         (large_vectors): Change type to struct large_vector.
3443         (allocate_vector_from_block): Simplify.
3444         (PSEUDOVECTOR_NBYTES): Replace with...
3445         (vector_nbytes): ...new function.  Adjust users.
3446         (sweep_vectors): Adjust processing of large vectors.
3447         (allocate_vectorlike): Likewise.
3448         (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3449         Add easserts.  Adjust XSETPVECTYPESIZE usage.
3450         (allocate_buffer): Use BUFFER_PVEC_INIT.
3451         (live_vector_p): Adjust to match large vector.
3452         * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3453         * buffer.h (struct buffer): Add next member.
3454         (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3455         New macros.
3456         (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3457         * fns.c (internal_equal): Adjust to match enum pvec_type change.
3458         (copy_hash_table): Adjust to match vector header change.
3459         * lread.c (defsubr): Use XSETPVECTYPE.
3460         * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3461         (xvectype): Likewise.  Print PVEC_NORMAL_VECTOR for regular vectors.
3462         (xvecsize): New command.
3464 2012-11-08  Dmitry Antipov  <dmantipov@yandex.ru>
3466         * keyboard.c (event_to_kboard): Do not dereference
3467         frame_or_window field of SELECTION_REQUEST_EVENT
3468         and SELECTION_CLEAR_EVENT events (Bug#12814).
3469         * xterm.h (struct selection_input_event): Adjust comment.
3471 2012-11-07  Eli Zaretskii  <eliz@gnu.org>
3473         * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3474         such as Scroll Lock, if the respective keys are treated as
3475         function keys, not as modifiers.  This avoids destroying non-ASCII
3476         keyboard input when Scroll Lock is toggled ON.  (Bug#12806)
3478 2012-11-07  Dmitry Antipov  <dmantipov@yandex.ru>
3480         * xfns.c (Fx_wm_set_size_hint): Use check_x_frame.  Adjust docstring.
3482 2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>
3484         Restore some duplicate definitions (Bug#12814).
3485         This undoes part of the 2012-11-03 changes.  Some people build
3486         with plain -g rather than with -g3, and they need the duplicate
3487         definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3488         * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3489         Define as macros, as well as as enums or as constants.
3491 2012-11-06  Jan Djärv  <jan.h.d@swipnet.se>
3493         * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3494         to keypad keys (Bug#12816).
3496 2012-11-06  Paul Eggert  <eggert@cs.ucla.edu>
3498         Minor adjustments of recently-changed frame functions.
3499         * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3500         known to be a frame (we're in the FRAMEP branch).
3501         * lisp.h (Qframep): Remove decl.  frame.h declares this.
3502         * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3503         since they're meant for Lisp fixnum values.
3505 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
3507         * window.c (Fwindow_combination_limit): Revert to the only
3508         required argument and adjust docstring as suggested in
3509         http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3510         by Martin Rudalics <rudalics@gmx.at>.
3512 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
3514         Widely used frame validity and checking functions.
3515         * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3516         * frame.c (decode_live_frame, decode_any_frame): New functions.
3517         (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3518         (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3519         (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3520         (Fframe_pointer_visible_p): Use decode_any_frame.
3521         (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3522         (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3523         (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3524         (Fframe_focus): Likewise.  Allow zero number of arguments.
3525         Adjust docstring.
3526         (frame_buffer_list, frame_buffer_predicate): Remove.
3527         * lisp.h (frame_buffer_predicate): Remove prototype.
3528         * buffer.c (Fother_buffer): Use decode_any_frame.
3529         * xdisp.c (Ftool_bar_lines_needed): Likewise.
3530         * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3531         * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3532         (Fclose_font, Ffont_info): Use decode_live_frame.
3533         * fontset.c (check_fontset_name): Likewise.
3534         * terminal.c (Fframe_terminal): Likewise.
3535         * w32fns.c (check_x_frame): Likewise.
3536         * window.c (Fminibuffer_window, Fwindow_at)
3537         (Fcurrent_window_configuration): Likewise.
3538         (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3539         Likewise.  Allow zero number of arguments.  Adjust docstring.
3540         * dispnew.c (Fredraw_frame): Likewise.
3541         * xfaces.c (frame_or_selected_frame): Remove.
3542         (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3543         (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3544         (Fframe_face_alist): Use decode_live_frame.
3545         * xfns.c (check_x_frame): Likewise.
3547 2012-11-06  Dmitry Antipov  <dmantipov@yandex.ru>
3549         * window.c (quad): New function.
3550         (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3551         (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3552         (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3553         (Fwindow_line_height): Use it.
3554         (Fwindow_fringes): Use list3.
3555         (Fwindow_scroll_bars): Use list4.
3556         (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3557         (Fwindow_combination_limit): Allow zero number of arguments.
3559 2012-11-05  Eli Zaretskii  <eliz@gnu.org>
3561         * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3563         * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
3564         (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
3565         file descriptor 2 for standard error.  (Bug#12805)
3567 2012-11-05  Chong Yidong  <cyd@gnu.org>
3569         * process.c (wait_reading_process_output): Revert previous change.
3571 2012-11-05  Paul Eggert  <eggert@cs.ucla.edu>
3573         Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3574         This removes code that has been obsolete since around 1990.
3575         * callproc.c (Fcall_process):
3576         * emacs.c (main):
3577         * process.c (create_process):
3578         * term.c (dissociate_if_controlling_tty):
3579         Assume setsid exists.
3580         * callproc.c (child_setup): Assume setpgid exists and behaves as
3581         per POSIX.1-1988 or later.
3582         * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3583         * emacs.c (shut_down_emacs):
3584         * sysdep.c (sys_suspend, init_foreground_group):
3585         Assume getpgrp behaves as per POSIX.1-1998 or later.
3586         * msdos.c (setpgrp): Remove.
3587         (tcgetpgrp, setpgid, setsid): New functions.
3588         * systty.h (EMACS_GETPGRP): Remove.  All callers now use getpgrp.
3589         * term.c (no_controlling_tty): Remove; unused.
3590         * w32proc.c (setpgrp): Remove.
3591         (setsid, tcgetpgrp): New functions.
3593         Simplify by assuming __fpending.
3594         * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3595         (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3596         Do not assume that __fpending's result fits in int.
3598 2012-11-04  Paul Eggert  <eggert@cs.ucla.edu>
3600         Remove EMACS_OUTQSIZE+sleep hack.
3601         * dispnew.c (update_frame_1): Remove hack for terminals slower
3602         than 2400 bps, which throttled Emacs by having it sleep.
3603         This code hasn't worked since at least 2007, when the multi-tty stuff
3604         was added, and anyway those old terminals are long dead.
3605         * systty.h (EMACS_OUTQSIZE): Remove; unused.  The macro isn't used even
3606         without the dispnew.c change, as dispnew.c doesn't include systty.h.
3608         Fix data-loss with --version (Bug#9574).
3609         * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3610         as we can't assume that emacs_strerror is initialized, and strerror
3611         is good enough here.
3612         (main): Invoke atexit earlier, to catch earlier instances of
3613         sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3615 2012-11-04  Michael Marchionna  <tralfaz@pacbell.net>
3617         * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3618         (keyDown): Remap keypad keys to X11 virtual key codes.
3620 2012-11-03  Paul Eggert  <eggert@cs.ucla.edu>
3622         Fix data-loss with --batch (Bug#9574).
3623         * emacs.c: Include <close-stream.h>.
3624         (close_output_streams): New function.
3625         (main): Pass it to atexit, so that Emacs closes stdout and stderr
3626         and handles errors appropriately.
3627         (Fkill_emacs): Don't worry about flushing, as close_output_stream
3628         does that now.
3630         Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3631         The symptom is a diagnostic "GLib-WARNING **: In call to
3632         g_spawn_sync(), exit status of a child process was requested but
3633         SIGCHLD action was set to SIG_IGN and ECHILD was received by
3634         waitpid(), so exit status can't be returned."  The diagnostic
3635         is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3636         The real bug is a race condition between Emacs and glib: Emacs
3637         does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3638         so that glib can't find it.  Work around the bug by invoking
3639         waitpid only on subprocesses that Emacs itself creates.
3640         * process.c (create_process, record_child_status_change):
3641         Don't use special value -1 in pid field, as the caller now must
3642         know the pid rather than having the callee infer it.
3643         The inference was sometimes incorrect anyway, due to another race.
3644         (create_process): Set new 'alive' member if child is created.
3645         (process_status_retrieved): New function.
3646         (record_child_status_change): Use it.
3647         Accept negative 1st argument, which means to wait for the
3648         processes that Emacs already knows about.  Move special-case code
3649         for DOS_NT (which lacks WNOHANG) here, from caller.  Keep track of
3650         processes that have already been waited for, by testing and
3651         clearing new 'alive' member.
3652         (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3653         now does this internally.
3654         (handle_child_signal): Let record_child_status_change do all
3655         the work, since we do not want to reap all exited child processes,
3656         only the child processes that Emacs itself created.
3657         * process.h (Lisp_Process): New boolean member 'alive'.
3659         Omit duplicate definitions no longer needed with gcc -g3.
3660         * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3661         (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3662         Define only as macros.  There's no longer any need to also define
3663         these symbols as enums or as constants, since we now assume
3664         gcc -g3 when debugging.
3666 2012-11-03  Eli Zaretskii  <eliz@gnu.org>
3668         * lisp.mk: Adjust comments to the fact that term/internal is now
3669         loaded from loadup.el.
3671         * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3672         (msdos_fatal_signal): New function.
3673         (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3674         its argument list.
3676         * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3677         for GCC versions before 4.
3678         (emacs_raise): Define to call msdos_fatal_signal.
3680         * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3681         iterator when starting in the middle of a display or overlay
3682         string.  (Bug#12745)
3684 2012-11-03  Chong Yidong  <cyd@gnu.org>
3686         * process.c (wait_reading_process_output): Clean up the last
3687         change.
3689 2012-11-03  Jim Paris  <jim@jtan.com>  (tiny change)
3691         * process.c (wait_reading_process_output): Avoid a race condition
3692         with SIGIO delivery (Bug#11536).
3694 2012-11-03  Chong Yidong  <cyd@gnu.org>
3696         * buffer.c (cursor_type): Untabify docstring.
3698 2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>
3700         * frame.h (struct frame): Drop can_have_scroll_bars member
3701         which is meaningless for a long time.  Adjust comments.
3702         (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3703         * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3705 2012-11-03  Dmitry Antipov  <dmantipov@yandex.ru>
3707         * window.c (decode_next_window_args): Update window arg after
3708         calling decode_live_window and so fix crash reported at
3709         http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3710         by Juanma Barranquero <lekktu@gmail.com>.
3711         (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3712         * font.c (Ffont_at): Likewise.
3714 2012-11-01  Jan Djärv  <jan.h.d@swipnet.se>
3716         * widget.c (resize_cb): New function.
3717         (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3718         (EmacsFrameResize): Check if all is up to date before changing frame
3719         size.
3721 2012-11-02  Eli Zaretskii  <eliz@gnu.org>
3723         Implement backtrace output for fatal errors on MS-Windows.
3724         * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3725         (BACKTRACE_LIMIT_MAX): New macro.
3726         (w32_backtrace): New function.
3727         (emacs_abort): Use w32_backtrace when the user chooses not to
3728         attach a debugger.  Update the text of the abort dialog.
3730 2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>
3732         Window-related stuff cleanup here and there.
3733         * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3734         Use decode_any_window.
3735         * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3736         * xdisp.c (Fformat_mode_line): Likewise.
3737         * font.c (Ffont_at): Use decode_live_window.
3738         * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3739         * window.c (decode_next_window_args): Likewise.
3740         (decode_any_window): Remove static.
3741         * window.h (decode_any_window): Add prototype.
3742         * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3743         * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3744         respectively.
3746 2012-11-02  Dmitry Antipov  <dmantipov@yandex.ru>
3748         Remove pad from struct input_event.
3749         * termhooks.h (struct input_event): Remove padding field.
3750         Adjust comment.
3751         * keyboard.c (event_to_kboard): Simplify because frame_or_window
3752         member is never cons for a long time.  Adjust comment.
3753         (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3754         SELECTION_CLEAR_EVENT has no Lisp_Objects to mark.  Add comment.
3755         * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3756         field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3758 2012-11-01  Eli Zaretskii  <eliz@gnu.org>
3760         * w32proc.c (getpgrp, setpgid): New functions.  (Bug#12776)
3762 2012-10-31  Paul Eggert  <eggert@cs.ucla.edu>
3764         Fix crash when using Emacs as commit editor for git (Bug#12697).
3765         * callproc.c (setpgrp): Remove macro, as we now use setpgid
3766         and it is configured in conf_post.h.
3767         (Fcall_process): Don't invoke both setsid and setpgid; the former
3768         is enough, if it exists.
3769         * callproc.c (Fcall_process, child_setup):
3770         * process.c (create_process): Use setpgid.
3771         * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3772         for the real thing.
3773         * dispnew.c (init_display): Initialize the foreground group
3774         if we are running a tty display.
3775         * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3776         * lisp.h (init_foreground_group): New decl.
3777         * sysdep.c (inherited_pgroup): New static var.
3778         (init_foreground_group, tcsetpgrp_without_stopping)
3779         (narrow_foreground_group, widen_foreground_group): New functions.
3780         (init_sys_modes): Narrow foreground group.
3781         (reset_sys_modes): Widen foreground group.
3783 2012-10-31  Michael Albinus  <michael.albinus@gmx.de>
3785         * dbusbind.c: Fix cut'n'waste error.  Use HAVE_DBUS_VALIDATE_INTERFACE.
3787 2012-10-31  Martin Rudalics  <rudalics@gmx.at>
3789         * minibuf.c (read_minibuf): Restore current buffer since
3790         choose_minibuf_frame calling Fset_frame_selected_window may
3791         change it (Bug#12766).
3793 2012-10-30  Jan Djärv  <jan.h.d@swipnet.se>
3795         * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3797 2012-10-30  Kenichi Handa  <handa@gnu.org>
3799         * font.c (Ffont_at): If WINDOW is specified and it is not
3800         displaying the current buffer, signal an error.
3802 2012-10-29  Daniel Colascione  <dancol@dancol.org>
3804         * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3805         In preparation for fixing bug#12739, move these functions from
3806         here...
3808         * coding.h, coding.c: ... to here, and compile them only when
3809         WINDOWSNT or CYGWIN.  Moving these functions out of cygw32 proper
3810         lets us write cygw32-agnostic code for the HAVE_NTGUI case.
3812 2012-10-28  Eli Zaretskii  <eliz@gnu.org>
3814         * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3815         (timer_loop, getitimer, setitimer): Use it instead of
3816         CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3817         'clock'.
3818         (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3819         literal 10000.
3821 2012-10-28  Jan Djärv  <jan.h.d@swipnet.se>
3823         * nsterm.m (NO_APPDEFINED_DATA): New define.
3824         (last_appdefined_event_data): New variable
3825         (last_appdefined_event): Remove.
3826         (ns_select): Initialize t from last_appdefined_event_data instead
3827         of [last_appdefined_event data1].
3828         (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3829         remove last_appdefined_event (Bug#12698).
3831 2012-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
3833         * frame.c (x_set_font): Catch internal error.
3835 2012-10-27  Eli Zaretskii  <eliz@gnu.org>
3837         Avoid overflow in w32 implementation of interval timers.
3838         When possible, for ITIMER_PROF count only times the main thread
3839         actually executes.
3840         * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
3841         'volatile ULONGLONG' types.  All the other data which was
3842         previously clock_t is now ULONGLONG.  'terminate' is 'volatile int'.
3843         (GetThreadTimes_Proc): New typedef.
3844         (w32_get_timer_time): New function, returns a suitable time value
3845         for the timer.
3846         (timer_loop): Enter critical section when accessing ULONGLONG
3847         values of the itimer_data struct, as these accesses are no longer
3848         atomic.  Call 'w32_get_timer_time' instead of 'clock'.
3849         Remove unused variable.
3850         (init_timers): Initialize s_pfn_Get_Thread_Times.
3851         (start_timer_thread): Don't assign itimer->caller_thread here.
3852         (getitimer): Assign itimer->caller_thread here.
3853         (setitimer): Always call getitimer to get the value of ticks_now.
3854         (sys_spawnve): Avoid compiler warning about format mismatch.
3856 2012-10-26  Eli Zaretskii  <eliz@gnu.org>
3858         * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3859         mouse movement events if the menu bar is active.  This avoids
3860         producing a busy "hour-glass" cursor by Windows if the mouse
3861         pointer is positioned over a tooltip shown for some menu item.
3863 2012-10-25  Paul Eggert  <eggert@cs.ucla.edu>
3865         Don't assume process IDs fit in int.
3866         * emacs.c (shut_down_emacs) [!DOS_NT]:
3867         * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
3868         * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
3869         Use pid_t, not int, to store process IDs, as 'int'
3870         is not wide enough on a few platforms (e.g., AIX and IRIX).
3872 2012-10-23  Kenichi Handa  <handa@gnu.org>
3874         The following change is to make face-font-rescale-alist work
3875         correctly for non-ASCII fonts.
3877         * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
3878         (font_open_for_lface): Handle Vface_font_rescale_alist.
3880 2012-10-23  Chong Yidong  <cyd@gnu.org>
3882         * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
3884 2012-10-21  Jan Djärv  <jan.h.d@swipnet.se>
3886         * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
3887         for screen font.
3888         (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
3890         * xterm.c (x_focus_changed): Check if daemonp when sending focus in
3891         event (Bug#12681).
3893 2012-10-21  Glenn Morris  <rgm@gnu.org>
3895         * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
3897 2012-10-20  Paul Eggert  <eggert@cs.ucla.edu>
3899         Port to OpenBSD 5.1.
3900         * frame.c (Fmouse_position, Fmouse_pixel_position):
3901         * xdisp.c (produce_stretch_glyph):
3902         Declare local vars only when they're needed.
3903         This is clearer and avoids a warning on OpenBSD about unused vars.
3904         * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
3905         This is safer, and avoids OpenBSD warnings about unused vars.
3906         * keyboard.c (record_menu_key): Remove unnecessary decl.
3907         (poll_timer): Define only if POLL_FOR_INPUT is defined.
3908         * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
3909         as our definition clashes with OpenBSD's.
3910         * xfaces.c (load_face_colors, check_lface_attrs)
3911         (get_lface_attributes_no_remap, get_lface_attributes)
3912         (lface_fully_specified_p, x_supports_face_attributes_p)
3913         (tty_supports_face_attributes_p, face_fontset, realize_face)
3914         (realize_x_face, realize_tty_face):
3915         Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
3916         merely Lisp_Object *.  This is more informative and avoids
3917         a warning on OpenBSD about accessing beyond an object's size.
3919 2012-10-20  Chong Yidong  <cyd@gnu.org>
3921         * lread.c (Fload): Doc fix (Bug#12592).
3923 2012-10-19  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
3925         * font.c (Ffont_at): Fix previous change.
3927 2012-10-19  Eli Zaretskii  <eliz@gnu.org>
3929         * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
3930         See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
3931         for the reasons.
3933         * alloc.c (NSTATICS): Decrease to 0x800.
3935 2012-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>
3937         * fns.c (Fnreverse): Include the problem element when signaling an
3938         error (bug#12677).
3940 2012-10-18  Jan Djärv  <jan.h.d@swipnet.se>
3942         * nsterm.m (ns_select): Check writefds before call to
3943         FD_ISSET (Bug#12668).
3945 2012-10-18  Daniel Colascione  <dancol@dancol.org>
3947         * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
3948         (staticpro): If we run out of staticpro slots, die with an
3949         informative error instead of just calling emacs_abort.
3951 2012-10-18  Martin Rudalics  <rudalics@gmx.at>
3953         Fix two flaws reported by Dmitry Antipov.
3954         * window.c (Ftemp_output_buffer_show): Remove.
3955         (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
3956         (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
3958 2012-10-17  Eli Zaretskii  <eliz@gnu.org>
3960         * makefile.w32-in ($(BLD)/w32.$(O)):
3961         ($(BLD)/vm-limit.$(O)):
3962         ($(BLD)/term.$(O)):
3963         ($(BLD)/unexw32.$(O)):
3964         ($(BLD)/fileio.$(O)):
3965         ($(BLD)/dispnew.$(O)): Update dependencies.
3967         * w32term.h (w32_initialize_display_info, initialize_w32_display):
3968         Add prototypes.
3970         * w32proc.c: Include ctype.h.
3972         * w32.h (init_environment, check_windows_init_file)
3973         (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
3974         (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
3975         (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
3976         (sys_link): Add prototypes.
3978         * w32.c: Include w32select.h.
3979         (sys_access, e_malloc, sys_select): Add prototypes.
3980         (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
3982         * vm-limit.c [WINDOWSNT]: Include w32heap.h.
3984         * unexw32.c: Include lisp.h and w32.h.
3986         * term.c [WINDOWSNT]: Include w32term.h.
3988         * process.c [WINDOWSNT]: Add prototype of sys_select.
3990         * fileio.c [WINDOWSNT]: Include w32.h.
3992         * dispnew.c [WINDOWSNT]: Include w32.h.
3994         * cygw32.c (Fcygwin_convert_path_to_windows)
3995         (Fcygwin_convert_path_from_windows): Use EQ to compare 2
3996         Lisp_Object values.  (Bug#12661)
3998         * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
3999         to Lisp_Object.  (Bug#12661)
4001 2012-10-17  Kenichi Handa  <handa@gnu.org>
4003         * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4004         invalidate.
4006 2012-10-17  Dmitry Antipov  <dmantipov@yandex.ru>
4008         * buffer.c (Fkill_buffer): When unchaining the marker,
4009         reset its buffer pointer to NULL (Bug#12652).
4011 2012-10-17  Dmitry Antipov  <dmantipov@yandex.ru>
4013         Do not verify indirection counters of killed buffers (Bug#12579).
4014         * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4015         * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4017 2012-10-16  Dmitry Antipov  <dmantipov@yandex.ru>
4019         * alloc.c (Fmake_byte_code): Fix typo in comment.
4020         * print.c (print_interval): Define as static to match prototype.
4021         * indent.c (disptab_matches_widthtab, recompute_width_table):
4022         Convert to eassert.
4024 2012-10-16  Dmitry Antipov  <dmantipov@yandex.ru>
4026         * editfns.c (get_system_name): Remove.
4027         * lisp.h (get_system_name): Remove prototype.
4028         * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4029         (get_environ_db): Use Vsystem_name.  Avoid call to strlen.
4031 2012-10-15  Daniel Colascione  <dancol@dancol.org>
4033         * dbusbind.c: Add comment explaining reason for previous change.
4035 2012-10-15  Martin Rudalics  <rudalics@gmx.at>
4037         * window.c (Fwindow_end): Rewrite check whether cached position
4038         can be used (Bug#12600).
4039         (resize_frame_windows, grow_mini_window, shrink_mini_window):
4040         Set windows_or_buffers_changed.
4042 2012-10-15  Daniel Colascione  <dancol@dancol.org>
4044         * dbusbind.c: Fix cygw32 build break when compiling with dbus
4045         enabled by undefining the symbol "interface", which the platform
4046         headers define to something incompatible.
4048 2012-10-14  Daniel Colascione  <dancol@dancol.org>
4050         * image.c (init_tiff_functions, init_imagemagick_functions)
4051         (init_svg_functions): Fix cygw32 build break by using these
4052         functions only when WINDOWSNT _and_ HAVE_NTGUI.
4054 2012-10-14  Jan Djärv  <jan.h.d@swipnet.se>
4056         * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4058 2012-10-13  Jan Djärv  <jan.h.d@swipnet.se>
4060         * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4062 2012-10-13  HANATAKA, Shinya  <bogytech@gmail.com>  (tiny change)
4064         * coding.c (detect_coding): Set coding->id before calling
4065         this->detector.
4067 2012-10-13  Andreas Schwab  <schwab@linux-m68k.org>
4069         * fileio.c: Formatting fixes.
4071 2012-10-13  Paul Eggert  <eggert@cs.ucla.edu>
4073         Fix some stat-related races.
4074         * fileio.c (Fwrite_region): Avoid race condition if a file is
4075         removed or renamed by some other process immediately after Emacs
4076         writes it but before Emacs stats it.  Do not assume that stat (or
4077         fstat) succeeds.
4078         * image.c (slurp_file): Resolve the file name with fopen + fstat
4079         rather than stat + fopen.
4080         (pbm_read_file) [0]: Remove unused code with stat race.
4081         * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4082         Remove ineffective code with stat race.
4084 2012-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
4086         * doc.c (get_doc_string): Don't signal an error if the file is missing.
4088 2012-10-12  Jan Djärv  <jan.h.d@swipnet.se>
4090         * nsterm.m (hold_event_q): New static variable.
4091         (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4092         ! q_event_ptr.
4093         (hold_event): New function.
4094         (ns_read_socket): If hold_event_q have events, store them and
4095         return (Bug#12384).
4096         (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4097         is zero (Bug#12384).
4099 2012-10-12  Juanma Barranquero  <lekktu@gmail.com>
4101         * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4103 2012-10-12  Eli Zaretskii  <eliz@gnu.org>
4105         * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4107         * fileio.c (check_existing): New function.
4108         (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4109         instead of calling 'stat', when what's needed is to check whether
4110         a file exists.  This avoids expensive system calls on MS-Windows.
4111         (Bug#12587)
4113         * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
4115         * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4116         determine whether a file exists and is not a directory.
4118         * lisp.h (check_existing): Add prototype.
4120 2012-10-12  Jan Djärv  <jan.h.d@swipnet.se>
4122         * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4124 2012-10-12  Glenn Morris  <rgm@gnu.org>
4126         * buffer.c (Fset_buffer): Doc fix.  (Bug#12624)
4128 2012-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
4130         * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4132         * eval.c (Fautoload): Remember previous autoload status in load-history.
4134 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
4136         lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4137         * lread.c (load_each_byte, new_backquote_flag, readchar)
4138         (read_filtered_event, lisp_file_lexically_bound_p)
4139         (safe_to_load_version, Fload, complete_filename_p, openp)
4140         (build_load_history, readevalloop, read_escape, read1)
4141         (string_to_number, read_vector, read_list):
4142         * macros.c (Fstart_kbd_macro):
4143         * marker.c (CONSIDER):
4144         * menu.c (parse_single_submenu, digest_single_submenu)
4145         (find_and_return_menu_selection, Fx_popup_menu):
4146         * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4147         (Ftry_completion):
4148         * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4149         (ns_menu_show):
4150         * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4151         (xmenu_show, xdialog_show):
4152         Use bool for booleans.
4153         * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4154         as it's not a predicate.  All uses changed.  Omit unnecessary
4155         buffer termination.
4157 2012-10-11  Dmitry Antipov  <dmantipov@yandex.ru>
4159         * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4160         (save_excursion_restore): Do not restore mark if it was not saved.
4162 2012-10-11  Paul Eggert  <eggert@cs.ucla.edu>
4164         * marker.c (cached_modiff): EMACS_INT, not int.
4166         * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4167         instead of having a wrong decl.
4168         * nsmenu.m (waiting_for_input): Remove wrong decl.
4170 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
4172         keyboard.c, keymap.c: Use bool for booleans.
4173         * dispnew.c (sit_for): Distinguish between 3-way display_option
4174         and boolean do_display.
4175         * keyboard.c (single_kboard, this_command_key_count_reset)
4176         (waiting_for_input, echoing, immediate_quit, input_pending)
4177         (interrupt_input, interrupts_deferred, pop_kboard)
4178         (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4179         (command_loop_1, adjust_point_for_property)
4180         (safe_run_hooks_error, input_polling_used, read_char):
4181         (help_char_p, readable_events, kbd_buffer_events_waiting)
4182         (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4183         (lucid_event_type_list_p, get_input_pending):
4184         (gobble_input, menu_separator_name_p, menu_bar_item)
4185         (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4186         (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4187         (keyremap_step, test_undefined, read_key_sequence)
4188         (detect_input_pending, detect_input_pending_ignore_squeezables)
4189         (detect_input_pending_run_timers, requeued_events_pending_p)
4190         (quit_throw_to_read_char, Fset_input_interrupt_mode):
4191         * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4192         (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4193         (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4194         (accessible_keymaps_1, Fkey_description, push_key_description):
4195         (shadow_lookup, struct where_is_internal_data)
4196         (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4197         (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4198         (describe_map, describe_vector):
4199         * menu.c (single_menu_item):
4200         * nsmenu.m (ns_update_menubar):
4201         * process.c (wait_reading_process_output):
4202         * search.c (scan_buffer, scan_newline):
4203         Use bool for boolean.
4204         * keyboard.c (timers_run, swallow_events)
4205         (detect_input_pending_run_timers):
4206         * process.c (wait_reading_process_output):
4207         Use unsigned for counter where wraparound-on-overflow is desired,
4208         since unsigned is guaranteed to have that behavior and signed is not.
4209         (read_char): Use ptrdiff_t for string length.
4210         (get_input_pending): Remove first argument, since it was always
4211         the same pointer-to-int (now pointer-to-boolean) &input_pending,
4212         and behave as if it had that value.  Return new value of
4213         input_pending.  All callers changed.
4214         * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4215         immediate_echo.  Use ptrdiff_t for echo_after_prompt, since it's
4216         a string length.
4217         * keymap.c (push_key_description): Omit last arg, which was always 1.
4218         All callers changed.
4220         * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4222 2012-10-10  Juanma Barranquero  <lekktu@gmail.com>
4224         * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4225         ($(BLD)/term.$(O)): Update dependencies.
4227 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
4229         * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4230         * lisp.h (enum pvec_type): Adjust comments and omit explicit
4231         initializer for PVEC_NORMAL_VECTOR.
4233 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
4235         Clean out old termopts cruft.
4236         * termopts.h (flow_control, meta_key): Remove unused decls.
4237         * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4238         Don't include termopts.h.
4240 2012-10-10  Dmitry Antipov  <dmantipov@yandex.ru>
4242         * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4244 2012-10-10  Paul Eggert  <eggert@cs.ucla.edu>
4246         * commands.h (immediate_quit): Remove duplicate decl.
4248 2012-10-09  Jan Djärv  <jan.h.d@swipnet.se>
4250         * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4251         caching.
4252         (nsfont_open): Remove setting of Vfonts_in_cache.
4253         (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
4255 2012-10-09  Eli Zaretskii  <eliz@gnu.org>
4257         * w32fns.c (w32_last_error): Change the return value to DWORD, to
4258         match what GetLastError returns.  Explain why the function is
4259         needed.
4261         * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4262         'is_tooltip_frame', to avoid confusion with its global namesake.
4264 2012-10-08  Daniel Colascione  <dancol@dancol.org>
4266         * xdisp.c (start_hourglass): Call w32_note_current_window when
4267         HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4268         build that caused Emacs to display the hourglass cursor forever.
4270         * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4271         which is broken under remote desktop, calculate the number of
4272         colors available for a display based on the display's number of
4273         planes and number of bits per pixel per plane.  (bug#10397).
4275 2012-10-08  Jan Djärv  <jan.h.d@swipnet.se>
4277         * nsfont.m (Vfonts_in_cache): New variable.
4278         (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4279         are used.  Add cached fonts to Vfonts_in_cache.
4280         (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4282 2012-10-08  Juanma Barranquero  <lekktu@gmail.com>
4284         * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4285         in nt/config.nt.
4286         (FONT_H): Define after FRAME_H.
4287         ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4288         Update dependencies.
4290         * w32term.c: Remove leftover declaration of keyboard_codepage.
4292 2012-10-08  Eli Zaretskii  <eliz@gnu.org>
4294         * makefile.w32-in (FONT_H): Add $(FRAME_H).
4295         (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4296         ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4297         (GLOBAL_SOURCES): Add cygw32.c.
4298         ($(BLD)/unexw32.$(O)):
4299         ($(BLD)/w32.$(O)):
4300         ($(BLD)/w32console.$(O)):
4301         ($(BLD)/w32fns.$(O)):
4302         ($(BLD)/w32heap.$(O)):
4303         ($(BLD)/w32menu.$(O)):
4304         ($(BLD)/w32proc.$(O)): Add w32common.h.
4306         * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4307         'const char *'.
4308         (x_to_w32_color): Don't modify the argument, modify a copy instead.
4310 2012-10-08  Daniel Colascione  <dancol@dancol.org>
4312         * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4313         (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4314         accidental message numbering hole.  Change other messages to
4315         match.
4317         * w32select.h (HAVE_W32SELECT): Remove.
4319         * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
4320         w32common.h instead of w32heap.h.
4322         * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4323         (get_allocation_unit, get_processor_type, get_w32_major_version)
4324         (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4325         (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4326         (OS_NT, os_subtype, cache_system_info): Move declarations to
4327         w32common.
4329         * w32heap.c: Include w32common.h.
4330         (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
4331         (w32_minor_version, w32_build_number, w32_subtype):
4332         Remove duplicate definitions.
4334         * w32fns.c: Include w32common.h; include w32heap.h only in
4335         WINDOWSNT.
4337         (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4338         Use `report_file_error' instead of `error' in order to better
4339         inform users of what went wrong.  Increase NTGUI_UNICODE file
4340         dialog box file name length to 32k, the maximum allowed by the NT
4341         kernel.
4343         * w32common.h: New file.
4344         (ROUND_UP, ROUND_DOWN, get_page_size)
4345         (get_allocation_unit, get_processor_type, get_w32_major_version)
4346         (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4347         (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4348         (OS_NT, os_subtype, cache_system_info): Move here.
4350         * unexw32.c, unexcw.c: Include w32common.h.
4352         * emacs.c (main): Use (defined (WINDOWSNT) || defined
4353         HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4354         to call syms_of_w32select.
4356         * cygw32.h: Remove obsolete EXFUN declarations.
4358         * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4360         * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4361         of w32inevt.o from SOME_MACHINE_OBJECTS.
4363 2012-10-08  Daniel Colascione  <dancol@dancol.org>
4365         * image.c: Permanent fix for JPEG compilation issue --- limit
4366         jpeglib `boolean' redefinition to Cygwin builds.
4368 2012-10-08  Eli Zaretskii  <eliz@gnu.org>
4370         * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4372         * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4373         Cygwin.
4375 2012-10-08  Daniel Colascione  <dancol@dancol.org>
4377         * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4378         w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4379         w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4380         w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4381         keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4382         emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4383         Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4384         operating system.  defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4385         now a supported configuration.
4387         * Makefile.in: consolidate image variables into LIBIMAGE; add
4388         W32_OBJ and W32_LIBS.  Compile new files.
4390         * conf_post.h:
4391         (_DebPrint) declare tracing facility for W32 debugging.  We need
4392         to unify tracing later.
4394         (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4395         unconditional use of W32 Unicode functions.  Cygwin runs only on
4396         100% Unicode operating systems.
4398         * cygw32.c: New file.  Define Cygwin-specific facilities.
4399         (Fcygwin_convert_path_to_windows)
4400         (Fcygwin_convert_path_from_windows): New user functions for
4401         accessing Cygwin path-munging routines.
4403         * cygw32.h: New file.
4404         (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4405         UTF-16LE strings temporarily inside non-Lisp-visible string
4406         objects.
4408         (w32_strerror): Just what it says on the tin.
4410         * emacs.c: Make the NS fork-then-exec code for daemon-launching
4411         also run for Cygwin; both systems have the same problem with using
4412         GUI facilities in a forked child.  Also call syms_of_cygw32,
4413         syms_of_w32select in correct places.
4415         (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4416         needs fork-then-exec for daemon launching.
4418         * font.h: Include frame.h.
4420         * image.c: Use the image library cache machinery only when we're
4421         compiling for native WINDOWSNT; Cygwin can use shared libraries
4422         like any other Unixlike system.
4424         * keyboard.c: Clarify a comment regarding the input loop.
4426         * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4427         functions directly instead of trying to detect at runtime that our
4428         host operating system supports them.  We make this change for two
4429         reasons: Cygwin lacks support for the multibyte character
4430         conversion functions used by the legacy menu code, and Cygwin
4431         never needs to rely on non-Unicode APIs.
4433         * unexw32.c (hinst): Declare extern.
4435         * w32.c: Change header order;
4436         (w32_strerror): Move to w32fns.c because we need it for
4437         non-WINDOWSNT builds.
4439         * w32.h: Add #error macro to make sure we don't include w32.h for
4440         Cygwin builds.  Remove w32select declarations.
4442         * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
4443         w32fns.c.  w32console.c is WINDOWSNT-only.
4445         * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4446         NTGUI_UNICODE tweaks.  (See above.) Change _snprintf to the more
4447         POSIXy alternative.
4448         (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4449         (w32_major_version, w32_minor_version, w32_build_number)
4450         (os_subtype, sound_type): Define here
4451         (w32_defined_color): Make color parameter const for consistency
4452         with other _defined_color functions.
4453         (w32_createwindow): Unconditionally call w32_init_class instead of
4454         doing so only when hprevinst is non-NULL.  Plumbing hprevinst
4455         through the code is complex and unnecessary because class
4456         registration is practically free.
4457         (w32_name_of_message): New EMACSDEBUG-only function.
4458         (Fset_message_beep): Move here
4459         (Fx_open_connection): Require that the display name for Windows be
4460         "w32" for consistency, emacsclient disambiguation, and maybe, one
4461         day, multi-window-system support.
4462         (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4463         Cygwin files for W32 GUI facilities, since these clearly don't
4464         expect Cygwin names.
4465         (_DebPrint): Define.
4466         (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4467         (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4468         (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4469         (w32_last_error): Remove.
4471         * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4473         * w32heap.c (syspage_mask): Declare here.
4474         (cache_system_info): Remove.
4476         * w32inevt.c (faked_key): Define globally, not statically.
4477         (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4478         (w32_console_toggle_lock_key): Move to w32fns.c.
4480         * w32menu.c: Include setjmp.h.  NTGUI_UNICODE changes throughout.
4482         * w32proc.c (_DebPrint): Move to w32fns.c.
4483         * w32select.c: Include string.h, stdio.h for Cygwin.
4484         * w32select.h: New File.
4486         * w32term.c: Include io.h for non-CYGWIN builds; needed for
4487         get_osfhandle.
4488         (w32_message_fd): New variable.  Under Cygwin, holds the file
4489         descriptor the system used to tell us about pending thread
4490         messages.
4492         (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4493         that prevented compilation under non-WINDOWSNT systems.
4495         (w32_initialize): Open /dev/windows and assign it to
4496         w32_message_fd.  Provide w32 feature.
4498         * w32term.h: Include frame.h, atimer.h.  Declare various frame functions.
4499         (WM_EMACS_INPUT_READY): add.
4500         (prepend_msg, w32_message_fd): Declare globally.
4502         * w32xfns.c:
4503         (keyboard_handle): Use only when WINDOWSNT.
4504         (notify_msg_ready): New function.  Posts a message to the main
4505         thread's message queue under CYGWIN, which wakes up the main
4506         thread from select(2) by making the /dev/windows file descriptor
4507         ready.  Under WINDOWSNT, it sets an event the same way the old
4508         code did.
4510         (post, prepend_msg): Actually call notify_msg_ready instead of
4511         setting the input event directly.
4513 2012-10-07  Eli Zaretskii  <eliz@gnu.org>
4515         * ralloc.c (relinquish): If a heap is ready to be relinquished,
4516         but it still has blocs in it, don't return it to the system,
4517         instead of aborting.  (Bug#12402)
4519 2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
4521         * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
4523         * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4524         MAC_OS_X_VERSION_10_6.
4525         (syms_of_nsterm): Remove comment about Panther and above for
4526         ns-antialias-text.
4527         * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4528         (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4529         (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4531         * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4532         MAC_OS_X_VERSION_10_4.
4534         * nsmenu.m (fillWithWidgetValue:): Remove code for <
4535         MAC_OS_X_VERSION_10_2.
4537         * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4539         * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4540         (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4542         * nsterm.m (ns_in_resize): Remove (Bug#12479).
4543         (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
4544         (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4545         Remove ns_in_resize check.
4546         (ns_clear_frame_area): Remove resize handle code.
4548         * nsfns.m (ns_in_resize): Remove.
4549         (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4550         Remove ns_in_resize check.
4552 2012-10-07  Paul Eggert  <eggert@cs.ucla.edu>
4554         Improve sys_siglist detection.
4555         * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4556         defined as a macro, as is done in Solaris.
4557         (sys_siglist_entries): New macro.
4558         (save_strsignal): Use it.
4559         * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4560         GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4562 2012-10-06  Jan Djärv  <jan.h.d@swipnet.se>
4564         * nsfns.m (Fx_create_frame): Call x_default_parameter with
4565         fullscreen/Fullscreen.
4567         * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4568         tobar_height is new.
4570         * nsterm.m (x_make_frame_visible): Check for fullscreen.
4571         (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4572         (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4573         (windowDidResize:): Check for correct window if old style fullscreen.
4574         Capitalize word in comment.  Remove incorrect comment.
4575         (initFrameFromEmacs:): tbar_height renamed tibar_height.
4576         (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4577         error in drawing background.
4578         (toggleFullScreen:): Remove comment.  Rearrange calls.
4579         Set toolbar values to zero, save old height in tobar_height.
4580         Restore tool bar height when leaving fullscreen.
4581         (canBecomeMainWindow): New function.
4583 2012-10-06  Paul Eggert  <eggert@cs.ucla.edu>
4585         * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4587 2012-10-05  Eli Zaretskii  <eliz@gnu.org>
4589         * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4591         * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
4592         that time stamps of directories could also be changed.
4593         Don't request the too broad GENERIC_WRITE, only the more restrictive
4594         FILE_WRITE_ATTRIBUTES access rights.
4596         * fileio.c (Fset_file_times): Special-case ignoring errors for
4597         directories only on MSDOS, not on MS-Windows.
4599 2012-10-05  Ikumi Keita  <ikumi@ikumi.que.jp>  (tiny change)
4601         * minibuf.c (Fcompleting_read): Doc fix.  (Bug#12555)
4603 2012-10-04  Eli Zaretskii  <eliz@gnu.org>
4605         * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4606         see whether CreateFile failed.
4608 2012-10-04  Paul Eggert  <eggert@cs.ucla.edu>
4610         * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4611         to avoid similar races.
4612         * keyboard.c (pending_signals): Now bool, not int.
4614         Port timers to OpenBSD, plus check for timer failures.
4615         OpenBSD problem reported by Han Boetes.
4616         * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4617         and/or setitimer.
4618         (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4619         * syssignal.h (HAVE_ITIMERSPEC): New macro.  This is for platforms
4620         like OpenBSD, which has timer_settime but does not declare it.
4621         OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4622         whether to use itimerspec-related primitives.  All uses of
4623         HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4625 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
4627         * profiler.c (handle_profiler_signal): Fix a malloc race
4628         that caused Emacs to hang on Fedora 17 when profiling Lisp.
4630 2012-10-02  Jan Djärv  <jan.h.d@swipnet.se>
4632         * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4634 2012-10-02  Eli Zaretskii  <eliz@gnu.org>
4636         * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4637         consistent with the change in return value of 'safe_strsignal'.
4639 2012-10-02  Paul Eggert  <eggert@cs.ucla.edu>
4641         Prefer plain 'static' to 'static inline' (Bug#12541).
4642         * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4643         (bidi_set_sor_type, bidi_push_embedding_level)
4644         (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4645         (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4646         (bidi_cache_search, bidi_cache_ensure_space)
4647         (bidi_cache_iterator_state, bidi_cache_find)
4648         (bidi_peek_at_next_level, bidi_set_paragraph_end)
4649         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4650         (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4651         Now 'static', not 'static inline'.
4653         Count overruns when profiling; change units to ns.
4654         * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4655         Give extra weight to samples after overruns, to attempt to count
4656         the time more accurately.
4657         (setup_cpu_timer): Change sampling interval units from ms to ns, since
4658         the underlying primitives nominally do ns.
4659         (Fprofiler_cpu_start): Document the change.  Mention that
4660         the sampling intervals are only approximate.
4662 2012-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
4664         * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4666         * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4667         case for the special 0 coding-system.
4669         * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4670         (Fmake_overlay): Remove redundant tests.
4671         (fix_start_end_in_overlays): Remove redundant recentering.
4673 2012-10-02  Juanma Barranquero  <lekktu@gmail.com>
4675         * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4676         Update dependencies.
4678 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
4680         Fix a malloc race condition involving strsignal.
4681         A signal can arrive in the middle of a malloc, and Emacs's signal
4682         handler can invoke strsignal, which can invoke malloc, which is
4683         not portable.  This race condition bug makes Emacs hang on GNU/Linux.
4684         Fix it by altering the signal handler so that it does not invoke
4685         strsignal.
4686         * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4687         * process.c (status_message): Use const pointer, in case strsignal
4688         is #defined to safe_strsignal.
4689         * sysdep.c (sys_siglist, init_signals): Always define and
4690         initialize a substitute sys_siglist if the system does not define
4691         one, even if HAVE_STRSIGNAL.
4692         (safe_strsignal): Rename from strsignal.  Always define,
4693         using sys_siglist.  Return a const pointer.
4694         * syssignal.h (safe_strsignal): New decl.
4695         (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4697 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
4699         * w32proc.c (timer_loop): Fix code that waits for timer
4700         expiration, to avoid high CPU usage.
4702 2012-10-01  Stefan Monnier  <monnier@iro.umontreal.ca>
4704         * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4705         (sweep_weak_table): Remove redundant prototypes.
4707 2012-10-01  Fabrice Popineau  <fabrice.popineau@gmail.com>
4709         * emacs.c: Move the inclusion of TERM_HEADER after including
4710         windows.h on WINDOWSNT.  This avoids compilation problems with
4711         MSVC.
4713 2012-10-01  Eli Zaretskii  <eliz@gnu.org>
4715         * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4716         (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4717         (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4718         as the previous version used 'void *'.
4720         * ralloc.c (ROUNDUP): Fix last change.
4721         (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4722         'size_t'.
4724         * w32proc.c <disable_itimers>: New static flag.
4725         (init_timers): Initialize it to zero, after creating the critical
4726         sections used by the timer threads.
4727         (term_timers): Set to 1 before deleting the critical sections.
4728         (getitimer, setitimer): If disable_itimers is non-zero, return an
4729         error indication without doing anything.  Reported by Fabrice
4730         Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4731         (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4732         return results.
4733         [!HAVE_SETITIMER]: Behave as the previous version that didn't
4734         support timers.
4736         * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4737         term_ntproc after all the other bookkeeping, to get timers working
4738         as long as possible.
4740 2012-10-01  Paul Eggert  <eggert@cs.ucla.edu>
4742         * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4743         Suggested by Juri Linkov in
4744         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4746         Prefer plain 'static' to 'static inline' (Bug#12541).
4747         With static functions, modern compilers inline pretty well by
4748         themselves; advice from programmers often hurts as much as it helps.
4749         On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4750         this change shrinks the text size of the Emacs executable by 1.1%
4751         without affecting CPU significantly in my benchmark.
4752         * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4753         (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4754         (mark_maybe_object, mark_maybe_pointer, bounded_number):
4755         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4756         (bset_auto_fill_function, bset_auto_save_file_format)
4757         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4758         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4759         (bset_cache_long_line_scans, bset_case_fold_search)
4760         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4761         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4762         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4763         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4764         (bset_header_line_format, bset_indicate_buffer_boundaries)
4765         (bset_indicate_empty_lines, bset_invisibility_spec)
4766         (bset_left_fringe_width, bset_major_mode, bset_mark)
4767         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4768         (bset_name, bset_overwrite_mode, bset_pt_marker)
4769         (bset_right_fringe_width, bset_save_length)
4770         (bset_scroll_bar_width, bset_scroll_down_aggressively)
4771         (bset_scroll_up_aggressively, bset_selective_display)
4772         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4773         (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4774         (set_buffer_overlays_after):
4775         * category.c (bset_category_table):
4776         * charset.c (read_hex):
4777         * coding.c (produce_composition, produce_charset)
4778         (handle_composition_annotation, handle_charset_annotation)
4779         (char_encodable_p):
4780         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4781         (assign_row, set_frame_matrix_frame, make_current)
4782         (add_row_entry):
4783         * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4784         * fns.c (maybe_resize_hash_table):
4785         * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4786         * gmalloc.c (register_heapinfo):
4787         * image.c (lookup_image_type):
4788         * intervals.c (set_interval_object, set_interval_left)
4789         (set_interval_right, copy_interval_parent, rotate_right)
4790         (rotate_left, balance_possible_root_interval):
4791         * keyboard.c (kset_echo_string, kset_kbd_queue)
4792         (kset_keyboard_translate_table, kset_last_prefix_arg)
4793         (kset_last_repeatable_command, kset_local_function_key_map)
4794         (kset_overriding_terminal_local_map, kset_real_last_command)
4795         (kset_system_key_syms, clear_event, set_prop):
4796         * lread.c (digit_to_number):
4797         * marker.c (attach_marker, live_buffer, set_marker_internal):
4798         * nsterm.m (ns_compute_glyph_string_overhangs):
4799         * process.c (pset_buffer, pset_command)
4800         (pset_decode_coding_system, pset_decoding_buf)
4801         (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4802         (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4803         (pset_status, pset_tty_name, pset_type, pset_write_queue):
4804         * syntax.c (bset_syntax_table, dec_bytepos):
4805         * terminal.c (tset_param_alist):
4806         * textprop.c (interval_has_some_properties)
4807         (interval_has_some_properties_list):
4808         * window.c (wset_combination_limit, wset_dedicated)
4809         (wset_display_table, wset_hchild, wset_left_fringe_width)
4810         (wset_left_margin_cols, wset_new_normal, wset_new_total)
4811         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4812         (wset_right_fringe_width, wset_right_margin_cols)
4813         (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4814         (wset_vertical_scroll_bar_type, wset_window_parameters):
4815         * xdisp.c (wset_base_line_number, wset_base_line_pos)
4816         (wset_column_number_displayed, wset_region_showing)
4817         (window_box_edges, run_window_scroll_functions)
4818         (append_glyph_string_lists, prepend_glyph_string_lists)
4819         (append_glyph_string, set_glyph_string_background_width)
4820         (append_glyph, append_composite_glyph)
4821         (take_vertical_position_into_account):
4822         * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4823         (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4824         (lface_hash, lface_same_font_attributes_p, lookup_face):
4825         * xml.c (libxml2_loaded_p):
4826         * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4827         (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4828         Now 'static', not 'static inline'.
4830         * bidi.c: Tune.
4831         (bidi_copy_it): Do the whole copy with a single memcpy.
4832         (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4834         Revert the FOLLOW-SYMLINKS change for file-attributes.
4835         Doing it right would require several changes to Tramp, and there's
4836         not enough time to get that tested before the freeze today.
4837         * dired.c (directory_files_internal, Ffile_attributes):
4838         Undo last change.
4840         * frame.c (x_report_frame_params): Port better to wider ints.
4841         Do not assume that EMACS_UINT is the same width as uprintmax_t,
4842         or that pointers can be printed in 15 decimal digits.
4843         Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4845 2012-09-30  Fabrice Popineau  <fabrice.popineau@supelec.fr>
4847         Support x64 build on MS-Windows.
4848         * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4849         (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4850         compatibility with x64.
4851         (x_get_focus_frame): Add prototype.
4853         * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4854         defining an XRectangle structure.
4856         * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4857         arithmetics for compatibility with x64.
4859         * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
4860         compatibility with x64.
4862         * w32heap.h: Adjust prototypes and declarations.
4864         * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
4865         (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
4866         DWORD, long, and unsigned long, for compatibility with x64.
4867         (allocate_heap) [_WIN64]: Reserve 32GB of memory.
4868         (sbrk): Argument is now of type ptrdiff_t.
4870         * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
4871         less than 0x0500.
4872         (w32_msg_pump): Use WPARAM type for 'result'.
4874         * w32.c (init_environment, get_emacs_configuration): Support AMD64
4875         architecture.
4876         (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
4877         compatibility with x64.
4879         * vm-limit.c (lim_data): Now size_t.
4880         (check_memory_limits): Adjust prototypes of real_morecore and
4881         __morecore to receive argument of type ptrdiff_t.  Use size_t for
4882         five_percent and data_size.
4884         * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
4885         variables, for compatibility with x64.
4886         (rva_to_section, offset_to_section, relocate_offset)
4887         (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
4888         (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
4889         (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
4890         for compatibility with x64.
4892         * sysdep.c (STDERR_FILENO): Define if not already defined.
4894         * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
4895         (__morecore): Argument type is now ptrdiff_t.
4896         (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
4897         (relinquish): Use ptrdiff_t type for 'excess'.
4898         (r_alloc_sbrk): Argument type is now ptrdiff_t.
4900         * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
4901         (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
4902         instead of a literal number.
4904         * gmalloc.c [WINDOWSNT]: Include w32heap.h.
4905         (min): Define only if not already defined.
4907         * frame.c (x_report_frame_params): Use EMACS_UINT for the return
4908         value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
4909         hosts.
4911         * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
4912         'bitmaps' is a pointer.
4914         * dispextern.h (x_bitmap_pixmap): Adjust prototype.
4916         * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
4918 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
4920         file-attributes has a new optional arg FOLLOW-SYMLINKS.
4921         * dired.c (directory_files_internal, Ffile_attributes):
4922         New arg follow_symlinks.  All uses changed.
4924 2012-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
4926         * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
4928 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
4930         Support atimers and CPU profiler via profile.c on MS-Windows.
4931         * w32proc.c (sig_mask, crit_sig): New static variables.
4932         (sys_signal): Support SIGALRM and SIGPROF.
4933         (sigemptyset, sigaddset, sigfillset, sigprocmask)
4934         (pthread_sigmask, setpgrp): Move here from w32.c.  sigaddset,
4935         sigfillset, and sigprocmask are no longer no-ops.
4936         (sigismember): New function.
4937         (struct itimer_data): New definition.
4938         (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
4939         (crit_prof): New static variables.
4940         (MAX_SINGLE_SLEEP): New definition.
4941         (timer_loop, stop_timer_thread, term_timers, init_timers)
4942         (start_timer_thread, getitimer, setitimer): New functions.
4943         (alarm): No longer a no-op, calls setitimer.
4945         * w32.c (term_ntproc): Call term_timers.
4946         (init_ntproc): Make sure all signals are unblocked at startup, to
4947         erase any traces of dumping.  Call init_timers.
4949         * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
4950         Windows-specific code to display the hourglass mouse pointer is no
4951         longer used.
4952         (w32_wnd_proc): Remove code that handled the WM_TIMER message due
4953         to hourglass timer expiration.
4954         (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
4955         Remove, no longer used.
4956         (w32_note_current_window, show_hourglass, hide_hourglass):
4957         New functions, in support of hourglass cursor display similar to other
4958         window systems.
4959         (syms_of_w32fns): Don't initialize hourglass_timer.
4961         * xdisp.c (start_hourglass, cancel_hourglass): Now used on
4962         WINDOWSNT as well.
4963         (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
4965         * w32.h (init_timers, term_timers): Add prototypes.
4967 2012-09-30  Kenichi Handa  <handa@gnu.org>
4969         * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
4970         to the buffer relocation which may be caused by ccl_driver.
4972 2012-09-30  Jan Djärv  <jan.h.d@swipnet.se>
4974         * xfns.c (Fx_file_dialog): Update comment.
4976         * w32fns.c (Fx_file_dialog): Update comment.
4978         * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
4979         Initialize panel name field if OSX >= 10.6.
4981         * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
4983         * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
4985         * nsterm.m (NEW_STYLE_FS): New define.
4986         (ns_fullscreen_hook, windowWillEnterFullScreen)
4987         (windowDidEnterFullScreen, windowWillExitFullScreen)
4988         (windowDidExitFullScreen, toggleFullScreen, handleFS)
4989         (setFSValue): New functions.
4990         (EmacsFSWindow): New implementation.
4991         (canBecomeKeyWindow): New function for EmacsFSWindow.
4992         (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
4993         (dealloc): Release nonfs_window if in fullscreen.
4994         (updateFrameSize:): Call windowDidMove to update top/left.
4995         (windowWillResize:toSize:): Check if frame is still maximized.
4996         (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
4997         next_maximized, maximized_width, maximized_height and nonfs_window.
4998         Call setCollectionBehavior if NEW_STYLE_FS.  Initialize bwidth and
4999         tbar_height.
5000         (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
5001         fullscreen.  Set maximized_width/height.  Act on next_maximized.
5003         * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5004         (EmacsView): Add variables for fullscreen.
5005         (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5006         (EmacsFSWindow): New interface for fullscreen.
5008 2012-09-30  Juanma Barranquero  <lekktu@gmail.com>
5010         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5012 2012-09-30  Chong Yidong  <cyd@gnu.org>
5014         * fns.c (Frandom): Doc fix.
5016 2012-09-30  Martin Rudalics  <rudalics@gmx.at>
5018         * window.c (Vwindow_combination_limit): New default value.
5019         (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5021 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
5023         * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5024         Suggested by Eli Zaretskii in
5025         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5027 2012-09-30  Eli Zaretskii  <eliz@gnu.org>
5029         * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5030         HAVE_TIMER_SETTIME is defined.
5032 2012-09-30  Paul Eggert  <eggert@cs.ucla.edu>
5034         Profiler improvements: more-accurate timers, overflow checks.
5035         * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5036         signal.h, setjmp.h.  Include systime.h instead.
5037         (saturated_add): New function.
5038         (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5039         (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5040         (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5041         New static vars.
5042         (enum profiler_cpu_running): New enum.
5043         (profiler_cpu_running): Now of that enum type, not bool.
5044         All uses changed to store the new value.
5045         (handle_profiler_signal): Rename from sigprof_handler_1,
5046         for consistency with other handlers.  Do not check whether
5047         cpu_log is a hash-table if garbage collecting, since it
5048         doesn't matter in that case.
5049         (deliver_profiler_signal): Rename from sigprof_handler,
5050         for consistency with other handlers.
5051         (setup_cpu_timer): New function, with much of what used to be in
5052         Fprofiler_cpu_start.  Check for out-of-range argument.
5053         Prefer timer_settime if available, and prefer
5054         thread cputime clocks, then process cputime clocks, then
5055         monotonic clocks, to the old realtime clock.  Use make_timeval
5056         to round more-correctly when falling back to setitimer.
5057         (Fprofiler_cpu_start): Use it.
5058         (Fprofiler_cpu_stop): Prefer timer_settime if available.
5059         Don't assume that passing NULL as the 2nd argument of setitimer
5060         is the same as passing a pointer to all-zero storage.
5061         Ignore SIGPROF afterwards.
5062         (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5063         * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5064         non-fatal signal handlers.  Ignore SIGPROF on startup.
5065         * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5066         in profiler.c, since sysdep.c now uses it.
5068         * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5069         Suggested by Eli Zaretskii in
5070         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5072 2012-09-29  Juanma Barranquero  <lekktu@gmail.com>
5074         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5076 2012-09-29  Stefan Monnier  <monnier@iro.umontreal.ca>
5078         * lisp.h (struct backtrace): Remove indirection for `function' field.
5079         * xdisp.c (redisplay_internal):
5080         * profiler.c (record_backtrace, sigprof_handler_1):
5081         * alloc.c (Fgarbage_collect):
5082         * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5083         (Fbacktrace_frame): Adjust accordingly.
5085 2012-09-28  Glenn Morris  <rgm@gnu.org>
5087         * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5088         (Frun_hook_with_args_until_failure): Doc fixes.
5090 2012-09-28  Eli Zaretskii  <eliz@gnu.org>
5092         * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5093         Qautomatic_redisplay and change the symbol name.  All users changed.
5095 2012-09-28  Tomohiro Matsuyama  <tomo@cx4a.org>
5097         * profiler.c (sigprof_handler): Fix race condition.
5099 2012-09-28  Glenn Morris  <rgm@gnu.org>
5101         * lread.c (lisp_file_lexically_bound_p): Handle #! lines.  (Bug#12528)
5103 2012-09-27  Paul Eggert  <eggert@cs.ucla.edu>
5105         Check more robustly for timer_settime.
5106         * Makefile.in (LIB_TIMER_TIME): New macro.
5107         (LIBES): Add it.
5108         * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5109         Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5110         call timer_settime.
5112 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
5114         * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5116 2012-09-26  Juanma Barranquero  <lekktu@gmail.com>
5118         * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5120 2012-09-26  Paul Eggert  <eggert@cs.ucla.edu>
5122         * character.h (MAYBE_UNIFY_CHAR): Remove.
5123         * charset.c, charset.h (maybe_unify_char): Now static.
5124         * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5125         Since this stuff is now private to charset.c, there's no need for
5126         a public macro and no need to inline by hand.
5128 2012-09-26  Tomohiro Matsuyama  <tomo@cx4a.org>
5129             Stefan Monnier  <monnier@iro.umontreal.ca>
5130             Juanma Barranquero  <lekktu@gmail.com>
5132         * profiler.c: New file.
5133         * Makefile.in (base_obj): Add profiler.o.
5134         * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5135         ($(BLD)/profiler.$(O)): New target.
5136         * emacs.c (main): Call syms_of_profiler.
5137         * alloc.c (Qautomatic_gc): New constant.
5138         (MALLOC_PROBE): New macro.
5139         (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5140         (total_bytes_of_live_objects): New function.
5141         (Fgarbage_collect): Use it.  Record itself in backtrace_list.
5142         Call malloc_probe for the memory profiler.
5143         (syms_of_alloc): Define Qautomatic_gc.
5144         * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5145         race condition.
5146         (struct backtrace): Move definition...
5147         * lisp.h (struct backtrace): ..here.
5148         (Qautomatic_gc, profiler_memory_running): Declare vars.
5149         (malloc_probe, syms_of_profiler): Declare functions.
5150         * xdisp.c (Qautomatic_redisplay): New constant.
5151         (redisplay_internal): Record itself in backtrace_list.
5152         (syms_of_xdisp): Define Qautomatic_redisplay.
5154 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
5155 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
5157         * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5159 2012-09-25  Paul Eggert  <eggert@cs.ucla.edu>
5161         Prefer POSIX timers if available.
5162         They avoid a race if the timer is too close to the current time.
5163         * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5164         (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
5165         (init_atimer) [SIGEV_SIGNAL]: Initialize them.
5167 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
5169         * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5170         CHAR_STRING_ADVANCE.
5171         (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5172         STRING_CHAR_ADVANCE.
5174 2012-09-25  Juanma Barranquero  <lekktu@gmail.com>
5176         Move Vlibrary_cache to emacs.c and reset before dumping.
5178         * lisp.h (reset_image_types): Declare.
5179         [WINDOWSNT] (Vlibrary_cache): Declare.
5181         * image.c (reset_image_types): New function.
5183         * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5184         (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5185         (Fdump_emacs): Reset Vlibrary_cache and image_types.
5187         * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5188         (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5190         * w32.h (Vlibrary_cache): Do not declare.
5192 2012-09-25  Eli Zaretskii  <eliz@gnu.org>
5194         * w32proc.c (sys_signal): Handle all signals defined by the
5195         MS-Windows runtime, not just SIGCHLD.  Actually install the signal
5196         handlers for signals supported by Windows.  Don't override
5197         term_ntproc as the handler for SIGABRT.
5198         (sigaction): Rewrite to call sys_signal instead of duplicating its
5199         code.
5200         (sys_kill): Improve commentary.
5202         * w32.c (term_ntproc): Accept (and ignore) one argument, for
5203         consistency with a signature of a signal handler.  All callers
5204         changed.
5205         (init_ntproc): Accept an argument DUMPING.  If dumping, don't
5206         install term_ntproc as a signal handler for SIGABRT, as that
5207         should be done by the dumped Emacs.
5209         * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5211         * w32select.c (term_w32select): Protect against repeated
5212         invocation by setting clipboard_owner to NULL after calling
5213         DestroyWindow.
5215         * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5216         and term_ntproc to their modified signatures.
5218         * character.c (char_string, string_char): Remove calls to
5219         MAYBE_UNIFY_CHAR.  See the discussion starting at
5220         http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5221         for the details.
5223 2012-09-25  Chong Yidong  <cyd@gnu.org>
5225         * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5227 2012-09-24  Stefan Monnier  <monnier@iro.umontreal.ca>
5229         * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5230         when encountering an unknown bytecode.
5232 2012-09-24  Paul Eggert  <eggert@cs.ucla.edu>
5234         image.c, indent.c: Use bool for booleans.
5235         * dispextern.h (struct image_type): Members valid_p, load, init
5236         now return bool, not int.  All uses changed.
5237         * image.c: Omit unnecessary static decls.
5238         (x_create_bitmap_mask, x_build_heuristic_mask):
5239         Return void, not int, since callers don't care about the return value.
5240         (x_create_bitmap_mask, define_image_type, valid_image_p)
5241         (struct image_keyword, parse_image_spec, image_spec_value)
5242         (check_image_size, image_background)
5243         (image_background_transparent, x_clear_image_1)
5244         (postprocess_image, lookup_image, x_check_image_size)
5245         (x_create_x_image_and_pixmap, xbm_image_p)
5246         (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5247         (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5248         (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5249         (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5250         (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5251         (png_image_p, init_png_functions, png_load_body, png_load)
5252         (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5253         (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5254         (init_gif_functions, gif_load, imagemagick_image_p)
5255         (imagemagick_load_image, imagemagick_load, svg_image_p)
5256         (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5257         (gs_load):
5258         * nsimage.m (ns_load_image):
5259         * nsterm.m (ns_defined_color):
5260         * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5261         * xfns.c (x_defined_color):
5262         * xterm.c (x_alloc_lighter_color_for_widget)
5263         (x_alloc_nearest_color_1, x_alloc_nearest_color)
5264         (x_alloc_lighter_color):
5265         * indent.c (disptab_matches_widthtab, current_column)
5266         (scan_for_column, string_display_width, indented_beyond_p)
5267         (compute_motion, vmotion, Fvertical_motion):
5268         Use bool for booleans.
5270 2012-09-24  Chong Yidong  <cyd@gnu.org>
5272         * chartab.c (Fset_char_table_default): Obsolete function removed.
5274 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
5276         Move pid_t related decls out of lisp.h.
5277         * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5278         (interruptible_wait_for_termination):
5279         Move these decls from lisp.h to syswait.h, since they use pid_t.
5280         Needed on FreeBSD; see Herbert J. Skuhra in
5281         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5282         * callproc.c: Include syswait.h.
5284         gnutls.c, gtkutil.c: Use bool for boolean.
5285         * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5286         (emacs_gnutls_handle_error):
5287         * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5288         (xg_hide_tooltip, xg_create_frame_widgets)
5289         (create_dialog, xg_uses_old_file_dialog)
5290         (xg_get_file_with_chooser, xg_get_file_with_selection)
5291         (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5292         (xg_item_label_same_p, xg_update_menubar)
5293         (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5294         (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5295         (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5296         (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5297         (update_frame_tool_bar, free_frame_tool_bar):
5298         * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5299         * nsmenu.m (ns_update_menubar):
5300         * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5301         * xfns.c (Fx_show_tip) [USE_GTK]:
5302         Use bool for boolean.
5303         * gtkutil.c (xg_update_frame_menubar):
5304         * xmenu.c (update_frame_menubar):
5305         Return void, not int, since caller ignores return value.
5306         * gtkutil.c (xg_change_toolbar_position):
5307         Return void, not 1.
5309 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
5311         * makefile.w32-in (BLOCKINPUT_H): Remove.
5312         (SYSSIGNAL_H): New macro.
5313         ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5314         ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5315         ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5316         ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5317         ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5318         ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5319         ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5320         ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5321         ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5322         ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5323         ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5324         ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5325         ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5326         ($(BLD)/w32xfns.$(O)): Update dependencies.
5328 2012-09-23  Eli Zaretskii  <eliz@gnu.org>
5330         * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5331         fatal_error_backtrace.
5333         * w32proc.c (sys_kill): Undo last change: don't do anything when
5334         invoked to deliver SIGABRT to our own process.  This is now
5335         handled by emacs_raise.
5337 2012-09-23  Juanma Barranquero  <lekktu@gmail.com>
5339         * w32term.c (w32_read_socket): Remove leftover reference to
5340         interrupt_input_pending.
5342 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
5344         Do not use SA_NODEFER.
5345         Problem reported by Dani Moncayo in
5346         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5347         * alloc.c (die):
5348         * sysdep.c (emacs_abort): Do not reset signal handler.
5349         * emacs.c (terminate_due_to_signal): Reset signal handler here.
5350         * sysdep.c (init_signals): Do not use SA_NODEFER.  It wasn't
5351         wanted even on POSIXish hosts, and it doesn't work on Windows.
5353 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
5355         * xterm.c (x_term_init): Call fixup_locale before and after calling
5356         gtk_init (Bug#12392).
5358 2012-09-23  Chong Yidong  <cyd@gnu.org>
5360         * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5361         Vdynamic_library_alist.
5363         * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5364         (Fgnutls_available_p): Caller changed.
5366         * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5367         (Flibxml_parse_xml_region): Likewise.
5369         * dispextern.h (struct image_type): Remove arg from init function.
5371         * image.c (Finit_image_library, lookup_image_type)
5372         (define_image_type): Remove now-unneeded second arg.
5373         (init_xpm_functions, init_png_functions, init_jpeg_functions)
5374         (init_tiff_functions, init_gif_functions, init_svg_functions):
5375         Arglist and w32_delayed_load calling convention changed.
5376         (gs_type): Remove init_gs_functions; there is no such function.
5377         (valid_image_p, make_image): Fix caller to lookup_image_type.
5379 2012-09-23  Paul Eggert  <eggert@cs.ucla.edu>
5381         Simplify and avoid signal-handling races (Bug#12471).
5382         * alloc.c (die):
5383         * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5384         Avoid recursive loop if there's a fatal error in the function itself.
5385         * atimer.c (pending_atimers):
5386         * blockinput.h: Don't include "atimer.h"; no longer needed.
5387         (interrupt_input_pending): Remove.  All uses removed.
5388         pending_signals now counts both atimers and ordinary interrupts.
5389         This is less racy than having three separate pending-signal flags.
5390         (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5391         (input_blocked_p):
5392         Rename from their upper-case counterparts BLOCK_INPUT,
5393         UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5394         INPUT_BLOCKED_P, and turn into functions.  All uses changed.
5395         This makes it easier to access volatile variables more accurately.
5396         (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
5397         (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5398         that's more reliable if the code is buggy and sets
5399         interrupt_input_blocked to a negative value.  All uses changed.
5400         * atimer.c (deliver_alarm_signal):
5401         Remove.  No need to deliver this to the parent; any thread can
5402         handle this signal now.  All uses replaced by underlying handler.
5403         * atimer.c (turn_on_atimers):
5404         * dispnew.c (handle_window_change_signal):
5405         * emacs.c (handle_danger_signal):
5406         * keyboard.c (kbd_buffer_get_event):
5407         Don't reestablish signal handler; not needed with sigaction.
5408         * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5409         (UNBLOCK_INPUT_TO):
5410         Rework to avoid unnecessary accesses to volatile variables.
5411         (UNBLOCK_INPUT_TO): Now a function.
5412         (totally_unblock_input, unblock_input): New decls.
5413         * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5414         (init_data): Remove.  Necessary stuff now done in init_signal.
5415         * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5416         * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5417         (fatal_error_code): Remove; no longer needed.
5418         (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5419         it doesn't always backtrace.  All uses changed.  No need to reset
5420         signal to default, since sigaction and/or die does that for us now.
5421         Use emacs_raise (FOO), not kill (getpid (), FOO).
5422         (main): Check more-accurately whether we're dumping.
5423         Move fatal-error setup to sysdep.c
5424         * floatfns.c: Do not include "syssignal.h"; no longer needed.
5425         * gtkutil.c (xg_get_file_name, xg_get_font):
5426         Remove no-longer-needed signal-mask manipulation.
5427         * keyboard.c, process.c (POLL_FOR_INPUT):
5428         Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5429         * keyboard.c (read_avail_input): Remove.
5430         All uses replaced by gobble_input.
5431         (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5432         (kbd_buffer_store_event_hold, gobble_input):
5433         (record_asynch_buffer_change) [USABLE_SIGIO]:
5434         (store_user_signal_events):
5435         No need to mess with signal mask.
5436         (gobble_input): If blocking input and there are terminals, simply
5437         set pending_signals to 1 and return.  All hooks changed to not
5438         worry about whether input is blocked.
5439         (process_pending_signals): Clear pending_signals before processing
5440         them, in case a signal comes in while we're processing.
5441         By convention callers now test pending_signals before calling us.
5442         (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5443         New functions, to support changes to blockinput.h.
5444         (handle_input_available_signal): Now extern.
5445         (reinvoke_input_signal): Remove.  All uses replaced by
5446         handle_async_input.
5447         (quit_count): Now volatile, since a signal handler uses it.
5448         (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5449         All callers changed.  Block SIGINT only if not already blocked.
5450         Clear sigmask reliably, even if Fsignal returns, which it can.
5451         Omit unnecessary accesses to volatile var.
5452         (quit_throw_to_read_char): No need to restore sigmask.
5453         * keyboard.c (gobble_input, handle_user_signal):
5454         * process.c (wait_reading_process_output):
5455         Call signal-handling code rather than killing ourselves.
5456         * lisp.h: Include <float.h>, for...
5457         (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5458         (pending_signals): Now volatile.
5459         (syms_of_data): Now const if IEEE floating point.
5460         (handle_input_available_signal) [USABLE_SIGIO]:
5461         (terminate_due_to_signal, record_child_status_change): New decls.
5462         * process.c (create_process): Avoid disaster if memory is exhausted
5463         while we're processing a vfork, by tightening the critical section
5464         around the vfork.
5465         (send_process_frame, process_sent_to, handle_pipe_signal)
5466         (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
5467         ignores SIGPIPE.
5468         (send_process): No need for setjmp/longjmp any more, since the
5469         SIGPIPE stuff is now gone.  Instead, report an error if errno
5470         is EPIPE.
5471         (record_child_status_change): Now extern.  PID and W are now args.
5472         Return void, not bool.  All callers changed.
5473         * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5474         Remove.  All uses removed.  This bug should be fixed now in a
5475         different way.
5476         (wait_for_termination_1): Use waitpid rather than sigsuspend,
5477         and record the child status change directly.  This avoids the
5478         need to futz with the signal mask.
5479         (process_fatal_action): Move here from emacs.c.
5480         (emacs_sigaction_flags): New function, containing
5481         much of what used to be in emacs_sigaction_init.
5482         (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
5483         caught by emacs, to make races less likely.
5484         (deliver_process_signal): Rename from handle_on_main_thread.
5485         All uses changed.
5486         (BACKTRACE_LIMIT_MAX): Now at top level.
5487         (thread_backtrace_buffer, threadback_backtrace_pointers):
5488         New static vars.
5489         (deliver_thread_signal, deliver_fatal_thread_signal):
5490         New functions, for more-accurate delivery of thread-specific signals.
5491         (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5492         (deliver_arith_signal): Handle in this thread, not
5493         in the main thread, since it's triggered by this thread.
5494         (maybe_fatal_sig): New function.
5495         (init_signals): New arg DUMPING so that we can be more accurate
5496         about whether we're dumping.  Caller changed.
5497         Treat thread-specific signals differently from process-general signals.
5498         Block all signals while handling fatal error; that's safer.
5499         xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5500         on IEEE hosts.
5501         When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5502         Ignore SIGPIPE unless batch.
5503         (emacs_backtrace): Output backtrace for the appropriate thread,
5504         which is not necessarily the main thread.
5505         * syssignal.h: Include <stdbool.h>.
5506         (emacs_raise): New macro.
5507         * xterm.c (x_connection_signal): Remove; no longer needed
5508         now that we use sigaction.
5509         (x_connection_closed): No need to mess with sigmask now.
5510         (x_initialize): No need to reset SIGPIPE handler here, since
5511         init_signals does this for us now.
5513 2012-09-23  Jan Djärv  <jan.h.d@swipnet.se>
5515         * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
5516         background rect may be larger (Bug#12245).
5518 2012-09-23  Chong Yidong  <cyd@gnu.org>
5520         * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5522 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
5524         * .gdbinit: Just stop at fatal_error_backtrace.
5525         See Stefan Monnier's request in
5526         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5527         Remove no-longer-used query of system type.
5529 2012-09-22  Chong Yidong  <cyd@gnu.org>
5531         * search.c (Freplace_match): Doc fix (Bug#12325).
5533         * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5535         * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5536         (Fline_end_position): Doc fix.
5538         * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5540 2012-09-22  Chong Yidong  <cyd@gnu.org>
5542         * dispextern.h (struct image_type): Add new slot, storing a type
5543         initialization function.
5545         * image.c (define_image_type): Call the image initializer function
5546         if it is defined.  Arguments and return value changed.
5547         (valid_image_p, make_image): Callers changed.
5548         (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
5549         (gif_type, imagemagick_type, svg_type, gs_type):
5550         Add initialization functions.
5551         (Finit_image_library): Call lookup_image_type.
5552         (CHECK_LIB_AVAILABLE): Macro deleted.
5553         (lookup_image_type): Call define_image_type here, rather than via
5554         Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5555         (syms_of_image): Move define_image_type calls for xbm_type and
5556         pbm_type to lookup_image_type.
5558 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
5560         * keyboard.c (timer_check_2): Move calculation of 'timers' and
5561         'idle_timers' from here ...
5562         (timer_check): ... to here.  Use Fcopy_sequence to copy the timer
5563         lists, to avoid infloops when the timer does something stupid,
5564         like reinvoke itself with the same or smaller time-out.
5565         (Bug#12447)
5567 2012-09-22  Martin Rudalics  <rudalics@gmx.at>
5569         * window.c (Fsplit_window_internal): Handle only Qt value of
5570         Vwindow_combination_limit separately.
5571         (Qtemp_buffer_resize): New symbol.
5572         (Vwindow_combination_limit): New default value.
5573         Rewrite doc-string.
5575 2012-09-22  Eli Zaretskii  <eliz@gnu.org>
5577         * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5578         the new overlay string.  (Bug#10159)
5580 2012-09-22  Paul Eggert  <eggert@cs.ucla.edu>
5582         * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5583         or that fprintf is async-signal-safe.  POSIX doesn't require
5584         either assumption.
5586 2012-09-22  Chong Yidong  <cyd@gnu.org>
5588         * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5589         (Bug#8207).
5591 2012-09-22  Kenichi Handa  <handa@gnu.org>
5593         * composite.c (composition_reseat_it): Handle the case that a
5594         grapheme cluster is not covered by a single font (Bug#12352).
5596 2012-09-21  Chong Yidong  <cyd@gnu.org>
5598         * image.c (define_image_type): Avoid adding duplicate types to
5599         image_types (Bug#12463).  Suggested by Jörg Walter.
5601 2012-09-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5603         * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5604         (print_load_command_name): Add case LC_DATA_IN_CODE.
5605         (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5607 2012-09-21  Glenn Morris  <rgm@gnu.org>
5609         * eval.c (Frun_hook_with_args_until_success)
5610         (Frun_hook_with_args_until_failure): Doc fixes.  (Bug#12393)
5612 2012-09-21  Andreas Schwab  <schwab@linux-m68k.org>
5614         * fileio.c (Ffile_selinux_context): Only call freecon when
5615         lgetfilecon succeeded.
5616         (Fset_file_selinux_context): Likewise.  (Bug#12444)
5618 2012-09-21  Eli Zaretskii  <eliz@gnu.org>
5620         * xdisp.c (try_window_reusing_current_matrix): Under bidi
5621         reordering, locate the cursor by calling set_cursor_from_row; if
5622         that fails, clear the desired glyph matrix before returning a
5623         failure indication to the caller.  Fixes leaving garbled display
5624         when fast scrolling with a down-key.  (Bug#12403)
5625         (compute_stop_pos_backwards): Fix a typo that caused crashes while
5626         scrolling through multibyte text.
5628 2012-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
5630         * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5631         calling mark_vectorlike since that's the one that marks the window.
5632         (mark_discard_killed_buffers): Mark the final cdr.
5633         * window.h (struct window): Move prev/next_buffers to the
5634         non-standard fields.
5635         * window.c (make_window): Initialize prev/next_buffers manually.
5637 2012-09-20  Paul Eggert  <eggert@cs.ucla.edu>
5639         Omit unused arg EXPECTED from socket hooks.
5640         * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5641         * nsterm.m (ns_term_init):
5642         * termhooks.h (struct terminal.read_socket_hook):
5643         * w32inevt.c (w32_console_read_socket):
5644         * w32term.c (w32_read_socket):
5645         * xterm.c (XTread_socket):
5646         Omit unused arg EXPECTED.  All callers changed.
5647         (store_user_signal_events): Return void, not int, since callers no
5648         longer care about the return value.  All uses changed.
5650 2012-09-20  Juanma Barranquero  <lekktu@gmail.com>
5652         * w32gui.h (XParseGeometry): Do not declare.
5654 2012-09-19  Paul Eggert  <eggert@cs.ucla.edu>
5656         * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
5657         Ignore 'expected'.  See Eli Zaretskii in
5658         <http://bugs.gnu.org/12471#8> (last line).
5660         * frame.c (read_integer): Remove.  All uses replaced by strtol/strtoul.
5661         (XParseGeometry): Now static.  Substitute extremal values for
5662         values that are out of range.
5664 2012-09-19  Jan Djärv  <jan.h.d@swipnet.se>
5666         * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5668         * nsfns.m (XParseGeometry): Remove.
5669         (Fx_create_frame): Call x_set_offset to correctly interpret
5670         top_pos in geometry.
5672         * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
5673         (Fx_parse_geometry): If there is a space in string, call
5674         Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5676 2012-09-17  Eli Zaretskii  <eliz@gnu.org>
5678         * search.c (scan_buffer): Use character positions in calls to
5679         region_cache_forward and region_cache_backward, not byte
5680         positions.  (Bug#12196)
5682         * w32term.c (w32_read_socket): Set pending_signals to 1, like
5683         xterm.c does.  Reported by Daniel Colascione <dancol@dancol.org>.
5685         * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5686         __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5687         emacs_blocked_malloc, now deleted.
5689 2012-09-17  Paul Eggert  <eggert@cs.ucla.edu>
5691         Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5692         The workaround was for improving performance on Solaris 2.4, but
5693         is getting in the way now.  Emacs will still work if someone is
5694         still running Solaris 2.4 in a museum somewhere; Sun dropped
5695         support for Solaris 2.4 in 2003.
5696         * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5697         * process.c (create_process) [HAVE_WORKING_VFORK]:
5698         Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5699         since Emacs no longer uses vfork on that platform.
5701 2012-09-17  Glenn Morris  <rgm@gnu.org>
5703         * emacs.c: Use COPYRIGHT.
5705 2012-09-16  Paul Eggert  <eggert@cs.ucla.edu>
5707         Remove configure's --without-sync-input option (Bug#12450).
5708         When auditing signal-handling in preparation for cleaning it up,
5709         I found that SYNC_INPUT has race conditions and would be a real
5710         pain to fix.  Since it's an undocumented and deprecated
5711         configure-time option, now seems like a good time to remove it.
5712         Also see <http://bugs.gnu.org/11080#16>.
5713         * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5714         (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5715         (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5716         (malloc_hysteresis):
5717         (check_depth) [XMALLOC_OVERRUN_CHECK]:
5718         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5719         (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5720         (dont_register_blocks, bytes_used_when_reconsidered)
5721         (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5722         (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5723         [!SYSTEM_MALLOC && !SYNC_INPUT]:
5724         Remove.  All uses removed.
5725         (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5726         implementation, one that depends on whether the new macro
5727         XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5728         is defined.
5729         * atimer.c (run_timers, handle_alarm_signal):
5730         * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5731         (handle_async_input, process_pending_signals)
5732         (handle_input_available_signal, init_keyboard):
5733         * nsterm.m (ns_read_socket):
5734         * process.c (wait_reading_process_output):
5735         * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5736         * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5737         (emacs_write):
5738         * xterm.c (XTread_socket):
5739         Assume SYNC_INPUT.
5740         * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5741         * eval.c (handling_signal): Remove.  All uses removed.
5742         * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5743         All uses replaced with the SYNC_INPUT version.
5744         (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5745         Remove decls.
5746         * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5747         Now static.
5749         * font.c (Ffont_shape_gstring): Remove unused local.
5751 2012-09-16  Glenn Morris  <rgm@gnu.org>
5753         * Makefile.in (clean): No longer run nextstep's clean.
5755         * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5756         (ns_frag): Remove.
5757         (ns-app): Move here from ns.mk, and simplify.
5758         (clean): Simplify nextstep entry.
5759         * ns.mk: Remove file.
5761 2012-09-17  Kenichi Handa  <handa@gnu.org>
5763         * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5764         not covert the last few charactes.
5766 2012-09-16  Kenichi Handa  <handa@gnu.org>
5768         * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5769         here, but just check the validity of glyphs in the glyph-string.
5771 2012-09-16  Martin Rudalics  <rudalics@gmx.at>
5773         * window.c (Fwindow_parameter, Fset_window_parameter):
5774         Accept any window as argument (Bug#12452).
5776 2012-09-16  Jan Djärv  <jan.h.d@swipnet.se>
5778         * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5779         to ns_term_init to avoid memory leak.
5781         * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5782         explicit retain/release.
5783         (ns_term_init): Only allow one display.  Initialize outerpool and
5784         ns_*_types.
5786 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
5788         Port _setjmp fix to POSIXish hosts as well as Microsoft.
5789         * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5790         it's needed on POSIXish hosts that lack _setjmp.  Attempt to solve
5791         the Microsoft problem in a different way, by altering ../nt/config.nt.
5793 2012-09-15  Eli Zaretskii  <eliz@gnu.org>
5795         * w32xfns.c:
5796         * w32uniscribe.c:
5797         * w32term.c:
5798         * w32select.c:
5799         * w32reg.c:
5800         * w32proc.c:
5801         * w32menu.c:
5802         * w32inevt.c:
5803         * w32heap.c:
5804         * w32font.c:
5805         * w32fns.c:
5806         * w32console.c:
5807         * w32.c:
5808         * w16select.c: Remove inclusion of setjmp.h, as it is now included
5809         by lisp.h.  This completes removal of setjmp.h inclusion
5810         erroneously announced in the previous commit.  (Bug#12446)
5812         * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5813         more accurate.
5815         * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5816         not defined as a macro.  The latter happens on MS-Windows.
5817         (Bug#12446)
5819 2012-09-15  Paul Eggert  <eggert@cs.ucla.edu>
5821         Port better to POSIX hosts lacking _setjmp (Bug#12446).
5822         * lisp.h: Include <setjmp.h> here, since we use its symbols here.
5823         Some instances of '#include <setjmp.h>' removed, if the
5824         only reason for the instance was because "lisp.h" was included.
5825         (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5826         Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5827         and _longjmp with the new symbols.  Emacs already uses _setjmp if
5828         available, so this change affects only POSIXish hosts that have
5829         sigsetjmp but not _setjmp, such as some versions of Solaris and
5830         Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
5831         * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5832         (png_load_body) [HAVE_PNG]:
5833         (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5834         (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5835         Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5836         since PNG requires jmp_buf.  This is the only exception to the
5837         general rule that we now use sys_setjmp and sys_longjmp.
5838         This exception is OK since this code does not change the signal
5839         mask or longjmp out of a signal handler.
5841 2012-09-14  Paul Eggert  <eggert@cs.ucla.edu>
5843         * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5844         Include "syssignal.h", for 'main_thread'.
5846 2012-09-14  Dmitry Antipov  <dmantipov@yandex.ru>
5848         Avoid out-of-range marker position (Bug#12426).
5849         * insdel.c (replace_range, replace_range_2):
5850         Adjust markers before overlays, as suggested by comments.
5851         (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5852         Remove redundant check before calling offset_intervals.
5854 2012-09-14  Martin Rudalics  <rudalics@gmx.at>
5856         * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5857         current buffer (Bug#12387).
5859 2012-09-14  Juanma Barranquero  <lekktu@gmail.com>
5861         * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
5863 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5865         Use a more backwards-compatible timer format (Bug#12430).
5866         * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
5867         vector element, not from the 4th, since PSECS is now at the end.
5868         (Fcurrent_idle_time): Doc fix.
5870 2012-09-13  Dmitry Antipov  <dmantipov@yandex.ru>
5872         Function to mark objects and remove killed buffers at once.
5873         * alloc.c (discard_killed_buffers): Rename to ...
5874         (mark_discard_killed buffers) ... new name.  Add marking
5875         of remaining objects.  Fix comment.  Adjust users.
5876         (mark_object): Do not touch frame buffer lists here.
5877         * frame.c (delete_frame): Reset frame buffer lists here.
5879 2012-09-13  Paul Eggert  <eggert@cs.ucla.edu>
5881         Better workaround for GNOME bug when --enable-gcc-warnings.
5882         * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
5883         Instead, disable -Wunused-local-typedefs.  See Dmitry Antipov in
5884         <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
5886         Simplify SIGIO usage (Bug#12408).
5887         The code that dealt with SIGIO was crufty and confusing, e.g., it
5888         played tricks like "#undef SIGIO" but these tricks were not used
5889         consistently.  Simplify mostly by not #undeffing standard symbols,
5890         e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
5891         or not as we please) rather than "defined SIGIO" (standard symbol
5892         that we probably shouldn't #undef).
5893         * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
5894         Modules that need it can include it.
5895         [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
5896         * dispextern.h (ignore_sigio): New decl.
5897         * emacs.c (shut_down_emacs): Invoke unrequest_sigio
5898         unconditionally, since it's now a no-op if !USABLE_SIGIO.
5899         * emacs.c (shut_down_emacs):
5900         * keyboard.c (kbd_buffer_store_event_hold):
5901         Use ignore_sigio rather than invoking 'signal' directly.
5902         * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
5903         for FIONREAD.
5904         (FIONREAD, SIGIO): Do not #undef.
5905         (tty_read_avail_input): Use #error rather than a syntax error.
5906         * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
5907         for I_PIPE, used by SETUP_SLAVE_PTY.
5908         (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
5909         * sysdep.c (croak): Remove; no longer needed.  This bit of
5910         temporary code, with Fred N. Fish's comment that it's temporary,
5911         has been in Emacs since at least 1992!
5912         (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
5913         Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
5914         * syssignal.h (croak): Remove decl.
5915         (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
5916         * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
5917         now that we're termios-only.
5918         (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
5919         * term.c (dissociate_if_controlling_tty): Use #error rather than
5920         a run-time error.
5922         Work around GCC and GNOME bugs when --enable-gcc-warnings.
5923         * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
5924         to work around GNOME bug 683906.
5925         * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
5926         (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
5927         This works around GCC bug 54561.
5929 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
5931         More fixes for 'volatile' and setjmp/longjmp.
5932         * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
5933         * image.c (struct png_load_context) [HAVE_PNG]: New type.
5934         (png_load_body) [HAVE_PNG]:
5935         (jpeg_load_body) [HAVE_JPEG]:
5936         New function, with most of the old parent function's body.
5937         (png_load) [HAVE_PNG]:
5938         (jpeg_load) [HAVE_JPEG]:
5939         Invoke the new function, to avoid longjmp munging our locals.
5940         (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
5941         (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
5942         longjmp is passed 2, as the C standard doesn't guarantee this.
5943         Instead, store the failure code into mgr->failure_code.
5945 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
5947         * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
5948         (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5949         (syms_of_keyboard): Remove support for unread-command-char.
5951 2012-09-12  Eli Zaretskii  <eliz@gnu.org>
5953         * w32proc.c (sys_kill): If PID is our process ID and the signal is
5954         SIGABRT, call emacs_abort.  Avoids silently exiting upon assertion
5955         violation.  (Bug#12426)
5957 2012-09-12  Paul Eggert  <eggert@cs.ucla.edu>
5959         * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
5961 2012-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
5963         * eval.c: Add `inhibit-debugger'.
5964         (Qinhibit_debugger): New symbol.
5965         (call_debugger): Bind it instead of Qdebug_on_error.
5966         (maybe_call_debugger): Test Vinhibit_debugger.
5967         (syms_of_eval): Define inhibit-debugger.
5968         * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
5969         (syms_of_xdisp): Remove inhibit-debug-on-message.
5971 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
5973         Avoid _setjmp/_longjmp problems with local nonvolatile variables.
5974         If a nonvolatile local variable is written before a _longjmp to
5975         the frame containing the variable, and is read after the _longjmp,
5976         the value read is indeterminate.  Some local variables of type
5977         'struct handler' and 'struct catchtag' are used in this way, so
5978         mark each of their slots as volatile if the slot can be set before
5979         _longjmp and read afterwards.
5980         * lisp.h (struct handler): var and chosen_clause are now volatile.
5981         (struct catchtag): val, next, and pdlcount are now volatile.
5983         * bidi.c (bidi_push_it, bidi_pop_it):
5984         * fns.c (copy_hash_table):
5985         * image.c (define_image_type):
5986         * keyboard.c (kbd_buffer_store_event_hold):
5987         * process.c (Fprocess_send_eof):
5988         * xfaces.c (x_create_gc) [HAVE_NS]:
5989         * xgselect.c (xg_select):
5990         Prefer assignment to memcpy when either will do.
5992         * alloc.c (discard_killed_buffers): Tune and simplify a bit.
5993         Use pointer-to-a-pointer to simplify and avoid a NILP check each
5994         time an item is removed.  No need to mark this function 'inline';
5995         the compiler knows better than we do.
5997 2012-09-11  Jan Djärv  <jan.h.d@swipnet.se>
5999         * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6000         (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6001         to change_frame_size (Bug#12388).
6002         (windowDidResize:): Pass YES to updateFrameSize.
6004         * nsterm.h: Add delay parameter to updateFrameSize.
6006 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
6008         Discard killed buffers from deleted window and frame objects.
6009         This reduces an amount of references to killed buffers and
6010         helps GC to reclaim them faster.
6011         * alloc.c (discard_killed_buffers): New function.
6012         (mark_object): Use it for deleted windows and frames.
6013         (mark_object): If symbol's value is set up for a killed buffer
6014         or deleted frame, restore its global binding.
6015         * data.c (swap_in_global_binding): Add GC notice.
6016         (swap_in_symval_forwarding): Use convenient set_blv_where.
6017         * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6018         * window.h: ... to here.
6020 2012-09-11  Dmitry Antipov  <dmantipov@yandex.ru>
6022         Convenient macro to check whether the buffer is live.
6023         * buffer.h (BUFFER_LIVE_P): New macro.
6024         * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6025         * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6027 2012-09-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
6029         * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6030         composition cases (Bug#12364).
6032         * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6033         overhang of succeeding glyphs overlapping box cursor.
6035         * w32term.c (x_draw_glyph_string): Likewise.
6037 2012-09-11  Paul Eggert  <eggert@cs.ucla.edu>
6039         Simplify, document, and port floating-point (Bug#12381).
6040         The porting part of this patch fixes bugs on non-IEEE platforms
6041         with frexp, ldexp, logb.
6042         * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6043         Now static.
6044         * floatfns.c: Simplify discussion of functions that Emacs doesn't
6045         support, by removing commented-out code and briefly listing the
6046         C89 functions excluded.  The commented-out stuff was confusing
6047         maintenance, e.g., we thought we needed cbrt but it was commented out.
6048         (logb): Remove decl; no longer needed.
6049         (isfinite): New macro, if not already supplied.
6050         (isnan): Don't replace any existing macro.
6051         (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6052         are present on all C89 platforms.
6053         (Ffrexp): Do not special-case zero, as frexp does the right thing
6054         for that case.
6055         (Flogb): Do not use logb, as it doesn't have the desired meaning
6056         on hosts that use non-base-2 floating point.  Instead, stick with
6057         frexp, which is C89 anyway.  Do not pass an infinity or a NaN to
6058         frexp, to avoid getting an unspecified result.
6060         * xdisp.c (Qinhibit_debug_on_message): Now static.
6062 2012-09-10  Jan Djärv  <jan.h.d@swipnet.se>
6064         * nsterm.m (ns_update_begin): Set clip path to whole view by using
6065         NSBezierPath (Bug#12131).
6067 2012-09-10  Chong Yidong  <cyd@gnu.org>
6069         * fns.c (Fdelq, Fdelete): Doc fix.
6071 2012-09-10  Paul Eggert  <eggert@cs.ucla.edu>
6073         * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6074         (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6076 2012-09-09  Stefan Monnier  <monnier@iro.umontreal.ca>
6078         * lisp.h (make_lisp_ptr): New macro to replace XSET.
6079         (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6080         Use it.
6082 2012-09-09  Eli Zaretskii  <eliz@gnu.org>
6084         * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6085         left fringe if the window has a left margin.  This avoids leaving
6086         traces of the cursor because its leftmost pixel is not drawn over.
6088         * dispnew.c (update_window_line): When the left margin area of a
6089         screen line is updated, set the redraw_fringe_bitmaps_p flag of
6090         that screen line.  (Bug#12277)
6092 2012-09-09  Paul Eggert  <eggert@cs.ucla.edu>
6094         Assume C89 or later for math functions (Bug#12381).
6095         This simplifies the code, and makes it a bit smaller and faster,
6096         and (most important) makes it easier to clean up signal handling
6097         since we can stop worring about floating-point exceptions in
6098         library code.  That was a problem before C89, but the problem
6099         went away many years ago on all practical Emacs targets.
6100         * data.c, image.c, lread.c, print.c:
6101         Don't include <math.h>; no longer needed.
6102         * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6103         might be autoconfigured, as that never happens.
6104         * data.c (fmod):
6105         * doprnt.c (DBL_MAX_10_EXP):
6106         * print.c (DBL_DIG):
6107         Remove.  C89 or later always defines these.
6108         * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6109         (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6110         (arith_error, domain_error, domain_error2):
6111         Remove all this pre-C89 cruft.  Do not include <errno.h> as that's
6112         no longer needed -- we simply return what C returns.  All uses removed.
6113         (IN_FLOAT, IN_FLOAT2): Remove.  All uses replaced with
6114         the wrapped code.
6115         (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6116         Remove.  All uses expanded, as these macros are no longer used
6117         more than once and are now more trouble than they're worth.
6118         (Ftan): Use tan, not sin / cos.
6119         (Flogb): Assume C89 frexp.
6120         (fmod_float): Assume C89 fmod.
6121         (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6122         (init_floatfns): Remove.  All uses removed.
6124 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
6126         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6127         compositeToPoint for OSX < 10.6 (Bug#12390).
6129 2012-09-08  Paul Eggert  <eggert@cs.ucla.edu>
6131         * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6132         This produces more-accurate results.
6134 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
6136         * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6137         changes (Bug#12088).
6139 2012-09-08  Chong Yidong  <cyd@gnu.org>
6141         * syntax.c (Fstring_to_syntax): Doc fix.
6143 2012-09-08  Jan Djärv  <jan.h.d@swipnet.se>
6145         * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6146         in the internal border.
6147         (x_set_window_size): Remove static variables and their usage.
6148         (ns_redraw_scroll_bars): Fix NSTRACE arg.
6149         (ns_after_update_window_line, ns_draw_fringe_bitmap):
6150         Remove fringe/internal border adjustment (Bug#11052).
6151         (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6152         (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6153         (ns_fix_rect_ibw): Remove.
6154         (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6155         (ns_dumpglyphs_box_or_relief): Ditto.
6156         (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6157         adjustment.
6158         (ns_dumpglyphs_image): Ditto.
6159         (ns_dumpglyphs_stretch): Fix coding style.  Remove fringe/internal
6160         border adjustment.
6161         (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6162         their usage.  Add fringe_extended_p and its use as in other terms.
6163         (ns_judge_scroll_bars): Code style fix.  Call updateFrameSize if
6164         scroll bar was removed.
6165         (updateFrameSize): New function.
6166         (windowDidResize): Move code to updateFrameSize and call it.
6168         * nsterm.h (EmacsView): Add updateFrameSize.
6170 2012-09-07  Chong Yidong  <cyd@gnu.org>
6172         * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6174         * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6176 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
6178         More signal-handler cleanup (Bug#12327).
6179         * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6180         Problem introduced when merging patches.  Noted by Eli Zaretskii in
6181         <http://bugs.gnu.org/12327#67>.
6182         * floatfns.c: Comment fix.
6183         * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6184         SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6185         and anyway the declaration is harmless even if SIGDANGER is not defined.
6186         * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6187         defined BROKEN_FIONREAD).  systty.h formerly did this, but other
6188         source files not surprisingly expected syssignal.h to define, or
6189         not define, SIGIO, and it's cleaner to do it that way, for consistency.
6190         Include <sys/ioctl.h>, for FIONREAD.
6191         * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6192         This eliminates a problem whereby other files mysteriously had
6193         to include "syssignal.h" before including "systty.h" if they
6194         wanted to use "#ifdef SIGIO".
6196 2012-09-07  Eli Zaretskii  <eliz@gnu.org>
6198         * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6200         * w32.c (sigemptyset): Empty the set.
6201         (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6203         * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6205 2012-09-07  Dmitry Antipov  <dmantipov@yandex.ru>
6207         * alloc.c (mark_buffer): Revert unsafe marking optimization.
6208         (mark_object): Likewise for frame objects.
6210 2012-09-07  Paul Eggert  <eggert@cs.ucla.edu>
6212         * syssignal.h (handle_on_main_thread): Always declare,
6213         even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6214         This ports to platforms without HAVE_PTHREAD.
6216 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
6218         Signal-handler cleanup (Bug#12327).
6219         Emacs's signal handlers were written in the old 4.2BSD style with
6220         sigblock and sigmask and so forth, and this led to some
6221         inefficiencies and confusion.  Rewrite these to use
6222         pthread_sigmask etc. without copying signal sets around.  Also,
6223         get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6224         'signal', and instead use functions that do not attempt to take
6225         over the system name space.  This patch causes Emacs's text
6226         segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6227         * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6228         Do not include <signal.h> or "syssignal.h", as these
6229         modules do not use signals.
6230         * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6231         * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6232         Do not include <signal.h>, as "syssignal.h" does that for us now.
6233         * atimer.c (sigmask_atimers): New function.
6234         (block_atimers, unblock_atimers): New functions,
6235         replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6236         All uses replaced.
6237         * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6238         no longer needed here.
6239         * emacs.c (main): Inspect existing signal handler with sigaction,
6240         so that there's no need to block and unblock SIGHUP.
6241         * sysdep.c (struct save_signal): New member 'action', replacing
6242         old member 'handler'.
6243         (save_signal_handlers, restore_signal_handlers):
6244         Use sigaction instead of 'signal' to save and restore.
6245         (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6246         New function.  All users of 'signal' modified to use set_sighandler
6247         if they're writeonly, and to use sys_signal if they're read+write.
6248         (emacs_sigaction_init, forwarded_signal): New functions.
6249         (sys_signal): Remove.  All uses replaced by calls to sigaction
6250         and emacs_sigaction_init, or by direct calls to 'signal'.
6251         (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6252         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6253         all uses replaced by pthread_sigmask etc. calls.
6254         * syssignal.h: Include <signal.h>.
6255         (emacs_sigaction_init, forwarded_signal): New decls.
6256         (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
6257         (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6258         (sigmask, sys_sigmask): Remove; no longer needed.
6259         (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
6260         (sigblock, sigunblock, sigfree):
6261         (sigsetmask) [!defined sigsetmask]:
6262         Remove.  All uses replaced by pthread_sigmask.
6263         (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
6264         no longer need to be replaced, and its typical old uses
6265         are now done via emacs_sigaction_init and sigaction.
6266         (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6267         (sys_sigdel): Remove; unused.
6268         (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
6270 2012-09-06  Eli Zaretskii  <eliz@gnu.org>
6272         * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6273         SIGCHLD handling on systems that don't have WNOHANG.  (Bug#12327)
6275 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
6277         Explicitly mark buffer_defaults and buffer_local_symbols.
6278         * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6279         mark_local_symbols here.
6280         (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6281         since special buffers aren't marked here any more.
6282         (allocate_buffer): Chain new buffer with all_buffers here...
6283         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6284         not here.
6285         (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6286         (syms_of_buffer): Remove staticpro of the above.
6287         (init_buffer_once): Set names for buffer_defaults and
6288         buffer_local_symbols.
6290 2012-09-06  Paul Eggert  <eggert@cs.ucla.edu>
6292         Use bool for booleans in font-related modules.
6293         * font.c (font_intern_prop, font_style_to_value)
6294         (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6295         (generate_otf_features, font_check_otf_features, font_check_otf)
6296         (font_match_p, font_list_entities, font_at):
6297         * fontset.c (fontset_id_valid_p, reorder_font_vector
6298         (fontset_find_font, Fset_fontset_font)
6299         (face_suitable_for_char_p) [0]:
6300         * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6301         (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6302         (m17n_flt_initialized, ftfont_shape_by_flt):
6303         * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6304         * nsfont.m (nsfont_draw):
6305         * w32font.c (w32font_draw):
6306         * w32term.c (x_draw_glyphless_glyph_string_foreground):
6307         Use bool for booleans.
6308         * font.h: Adjust to above API changes.
6309         (struct font, struct font_driver, struct font_driver_list):
6310         Use bool for booleans.
6311         (struct font): Remove useless member encoding_type.
6312         All users removed.
6313         * fontset.c, xftfont.c: Omit unnecessary static decls.
6315 2012-09-06  Dmitry Antipov  <dmantipov@yandex.ru>
6317         * alloc.c (mark_object): Revert window marking code
6318         since it's unsafe for the Fset_window_configuration.
6320 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
6322         Fix race conditions with signal handlers and errno (Bug#12327).
6323         Be more systematic about preserving errno whenever a signal
6324         handler returns, even if it's not in the main thread.  Do this by
6325         renaming signal handlers to distinguish between signal delivery
6326         and signal handling.  All uses changed.
6327         * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6328         * data.c (deliver_arith_signal): Rename from arith_error.
6329         * dispnew.c (deliver_window_change_signal): Rename from
6330         window_change_signal.
6331         * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6332         (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6333         * keyboard.c (deliver_input_available_signal): Rename from
6334         input_available_signal.
6335         (deliver_user_signal): Rename from handle_user_signal.
6336         (deliver_interrupt_signal): Rename from interrupt_signal.
6337         * process.c (deliver_pipe_signal): Rename from send_process_trap.
6338         (deliver_child_signal): Rename from sigchld_handler.
6339         * atimer.c (handle_alarm_signal):
6340         * data.c (handle_arith_signal):
6341         * dispnew.c (handle_window_change_signal):
6342         * emacs.c (handle_fatal_signal, handle_danger_signal):
6343         * keyboard.c (handle_input_available_signal):
6344         * keyboard.c (handle_user_signal, handle_interrupt_signal):
6345         * process.c (handle_pipe_signal, handle_child_signal):
6346         New functions, with the actual signal-handling code taken from the
6347         original respective signal handlers, sans the sporadic attempts to
6348         preserve errno, since that's now done by handle_on_main_thread.
6349         * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6350         * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6351         * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6352         Move to sysdep.c.
6353         (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6354         Move initialization of main_thread to sysdep.c's init_signals.
6355         * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6356         our usage, and simplifies the mainline code.
6357         (record_child_status_change): New static function, as a helper
6358         for handle_child_signal, and with most of the old child handler's
6359         contents.
6360         (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6361         (handle_child_signal): Use the above.
6362         * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6363         Moved here from emacs.c.
6364         (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6365         code moved here from emacs.c's main function.
6366         * sysdep.c, syssignal.h (handle_on_main_thread): New function,
6367         replacing the old SIGNAL_THREAD_CHECK.  All uses changed.
6368         This lets callers save and restore errno properly.
6370 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
6372         Remove redundant or unused things here and there.
6373         * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6374         * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6375         * editfns.c (Fcompare_buffer_substrings): Likewise.
6376         * frame.h (struct terminal, struct font_driver_list):
6377         Remove redundant declarations.
6378         * window.h (Qleft, Qright): Likewise.
6380 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
6382         Do not mark objects from deleted buffers, windows and frames.
6383         * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6384         (mark_object): Likewise for windows and frames.
6386 2012-09-05  Dmitry Antipov  <dmantipov@yandex.ru>
6388         * alloc.c (valid_lisp_object_p): Treat killed buffers,
6389         buffer_defaults and buffer_local_symbols as valid objects.
6390         Return special value to denote them.
6392 2012-09-05  Paul Eggert  <eggert@cs.ucla.edu>
6394         * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6395         * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6396         (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6397         (file_name_absolute_p, Fsubstitute_in_file_name):
6398         (check_executable, check_writable, Ffile_accessible_directory_p)
6399         (Fset_file_selinux_context, Fdefault_file_modes)
6400         (Finsert_file_contents, choose_write_coding_system)
6401         (Fwrite_region, build_annotations, a_write, e_write)
6402         (Fdo_auto_save):
6403         * filelock.c (boot_time_initialized, get_boot_time)
6404         (get_boot_time_1, lock_file_1, within_one_second):
6405         * floatfns.c (in_float):
6406         * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6407         (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6408         (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6409         * lisp.h (struct Lisp_Hash_Table.cmpfn):
6410         * window.c (compare_window_configurations):
6411         Use bool for booleans.
6412         * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6413         (Fdefault_file_modes): Now mode_t, not int, for modes.
6414         (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6415         (internal_delete_file): Now returns void, not a (boolean) int,
6416         since nobody was looking at the return value.
6417         * lisp.h, window.h: Adjust to above API changes.
6419         * xdisp.c (set_message): Simplify and reindent last change.
6421 2012-09-05  Juanma Barranquero  <lekktu@gmail.com>
6423         * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6425 2012-09-04  Lars Ingebrigtsen  <larsi@gnus.org>
6427         * eval.c (call_debugger): Make the function non-static so that we
6428         can call it from set_message.
6430         * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6431         (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6433 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
6435         Give more-useful info on a fatal error (Bug#12328).
6436         * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6437         (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6438         of doing the work ourselves.
6439         * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6440         do most of the work.
6441         (fatal_error_backtrace): New function, taken from the guts
6442         of the old fatal_error_signal, but with a new option to output
6443         a backtrace.
6444         (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6445         info about the signal than just its number.
6446         * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6447         * sysdep.c: Include <execinfo.h>
6448         (emacs_backtrace): New function, taken partly from the previous
6449         code of the 'die' function.
6450         (emacs_abort): Call fatal_error_backtrace rather than abort.
6452 2012-09-04  Stefan Monnier  <monnier@iro.umontreal.ca>
6454         * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6455         eager (load-time) macro-expansion.
6456         * lisp.mk (lisp): Add macroexp.
6458 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
6460         Simplify redefinition of 'abort' (Bug#12316).
6461         Do not try to redefine the 'abort' function.  Instead, redo
6462         the code so that it calls 'emacs_abort' rather than 'abort'.
6463         This removes the need for the NO_ABORT configure-time macro
6464         and makes it easier to change the abort code to do a backtrace.
6465         * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6466         * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6467         Remove; sysdep.c's emacs_abort now takes its place.
6468         * lisp.h (emacs_abort): New decl.  All calls from Emacs code to
6469         'abort' changed to use 'emacs_abort'.
6470         * msdos.c (dos_abort) [defined abort]: Remove; not used.
6471         (abort) [!defined abort]: Rename to ...
6472         (emacs_abort): ... new name.
6473         * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6474         the place of the old 'abort' in emacs.c.
6475         * w32.c, w32fns.c (abort): Do not #undef.
6476         * w32.c (emacs_abort): Rename from w32_abort.
6478 2012-09-04  Eli Zaretskii  <eliz@gnu.org>
6480         * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6481         offsets[j].dv, since the y axis of the screen coordinates points
6482         down, while the y axis of the font definition coordinates points
6483         up.  This fixes display of Arabic diacritics such as KASRA and
6484         KASRATAN.  (Bug#11860)
6486 2012-09-04  Paul Eggert  <eggert@cs.ucla.edu>
6488         Be more systematic about _setjmp vs setjmp.
6489         * alloc.c (test_setjmp, mark_stack):
6490         * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6491         (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6492         (png_load, my_error_exit, jpeg_load):
6493         * process.c (send_process_trap, send_process):
6494         Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6495         The underscored versions are up to 30x faster on some hosts.
6496         Formerly, the code used setjmp+longjmp sometimes and
6497         _setjmp+_longjmp at other times, with no particular reason to
6498         prefer setjmp+longjmp.
6500 2012-09-03  Paul Eggert  <eggert@cs.ucla.edu>
6502         Fix minor problem found by static checking.
6503         * buffer.c (Fdelete_all_overlays): Return nil.
6505 2012-09-03  Martin Rudalics  <rudalics@gmx.at>
6507         * buffer.c (Fdelete_all_overlays): New function.
6509 2012-09-03  Chong Yidong  <cyd@gnu.org>
6511         * gtkutil.c: Add extern decl for Qxft.
6513 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
6515         * emacs.c, eval.c: Use bool for boolean.
6516         * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6517         (malloc_using_checking) [DOUG_LEA_MALLOC]:
6518         (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6519         (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6520         (main, decode_env_path, Fdaemon_initialized):
6521         * eval.c (call_debugger, Finteractive_p, interactive_p):
6522         (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6523         (maybe_call_debugger, Fbacktrace):
6524         * process.c (read_process_output, exec_sentinel):
6525         Use bool for booleans.
6526         * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6527         All callers changed.
6528         * eval.c (interactive_p): Omit always-true boolean argument
6529         EXCLUDE_SUBRS_P.  All callers changed.
6530         * dispextern.h, lisp.h: Reflect above API changes.
6531         * firstfile.c (dummy): Use the address of 'main', whose signature
6532         won't change, instead of the address of 'initialize', whose
6533         signature just changed from int to bool.
6534         * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6535         * msdos.c (fatal_error_in_progress): ... from here.
6536         * xdisp.c (redisplaying_p): Now a boolean.  Set it to 1 instead
6537         of incrementing it.
6538         (redisplay_internal, unwind_redisplay): Simply clear
6539         REDISPLAYING_P when unwinding, instead of saving its previous,
6540         always-false value and then restoring it.
6542         Clean up some extern decls.
6543         Mostly, this hoists extern decls out of .c files and into .h files.
6544         That way, we're more likely to catch errors if the interfaces change.
6545         * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6546         declare xg_mark_data.
6547         * dispextern.h (x_frame_parm_handlers):
6548         * font.h (Qxft):
6549         * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6550         (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6551         (Qultra_bold, Qoblique, Qitalic):
6552         Move extern decl here from .c file.
6553         * alloc.c (xg_mark_data) [USE_GTK]:
6554         * doc.c (Qclosure):
6555         * eval.c (Qlexical_binding):
6556         * fns.c (time) [!HAVE_UNISTD_H]:
6557         * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6558         (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6559         * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6560         * lread.c (Qinternal_interpreter_environment):
6561         * minibuf.c (Qbuffer):
6562         * process.c (QCfamily, QCfilter):
6563         * widget.c (free_frame_faces):
6564         * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6565         * xfont.c (x_clear_errors):
6566         * xterm.c (x_frame_parm_handlers):
6567         Remove now-redundant extern decls.
6568         * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6569         * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6570         Now static.
6571         * xfaces.c: Remove unnecessary static decls.
6572         * xterm.c (updating_frame): Remove decl of nonexistent object.
6574         * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6575         when building globals.h, as the objects that are not built on
6576         this host are not needed to compile C files on this host.
6578 2012-09-02  Jan Djärv  <jan.h.d@swipnet.se>
6580         * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6582         * frame.h: Add missing prototype for x_wm_set_size_hint.
6584 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
6586         * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6587         * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6588         (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6589         (Fsubstitute_command_keys):
6590         * editfns.c (region_limit, find_field, Fconstrain_to_field)
6591         (save_excursion_save, save_excursion_restore)
6592         (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6593         (format_time_string, general_insert_function)
6594         (make_buffer_string, make_buffer_string_both)
6595         (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6596         * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6597         (copy_text, insert_1, insert_1_both, insert_from_string)
6598         (insert_from_string_before_markers, insert_from_string_1)
6599         (insert_from_buffer, insert_from_buffer_1, replace_range)
6600         (replace_range_2, del_range_1, del_range_byte, del_range_both)
6601         (del_range_2, modify_region):
6602         * intervals.c (intervals_equal, balance_possible_root_interval)
6603         (adjust_intervals_for_insertion, merge_properties_sticky)
6604         (graft_intervals_into_buffer, lookup_char_property)
6605         (adjust_for_invis_intang, set_point_both)
6606         (get_property_and_range, compare_string_intervals)
6607         (set_intervals_multibyte_1, set_intervals_multibyte):
6608         * keyboard.c (decode_timer):
6609         Use bool for boolean.
6610         * intervals.h, lisp.h, systime.h: Reflect above API changes.
6611         * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6613 2012-09-02  Chong Yidong  <cyd@gnu.org>
6615         * keymap.c (push_key_description): Print M-TAB as C-M-i
6616         (Bug#11758).
6618 2012-09-02  Juanma Barranquero  <lekktu@gmail.com>
6620         * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6621         (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6622         ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6623         ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6624         ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6625         ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6626         ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6628 2012-09-01  Eli Zaretskii  <eliz@gnu.org>
6630         * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6631         more than one grapheme cluster passed to the shaper: compute the
6632         offset adjustment values separately for each cluster.  (Bug#11860)
6634         * image.c: Restore mistakenly removed inclusion of w32.h.  Without
6635         it, GCC doesn't see prototypes of w32_delayed_load, and complains
6636         about implicit conversions from integer to pointer.
6638 2012-09-01  Daniel Colascione  <dancol@dancol.org>
6640         * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6641         system used too early.
6643 2012-09-01  Paul Eggert  <eggert@cs.ucla.edu>
6645         Better seed support for (random).
6646         * emacs.c (main): Call init_random.
6647         * fns.c (Frandom): Set the seed from a string argument, if given.
6648         Remove long-obsolete Gentzel cruft.
6649         * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6650         (init_random): New function.
6652 2012-09-01  Daniel Colascione  <dancol@dancol.org>
6654         * xterm.h: Add header guards.  Declare x_menubar_window_to_frame.
6655         Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6656         x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6657         x_wm_set_size_hint, x_query_colors, x_real_positions,
6658         x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6659         x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6660         all of which have been moved to common code.
6662         * xfaces.c: Include TERM_HEADER instead of listing all possible
6663         window-system headers.
6665         * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6666         to match header.
6668         * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6669         directly accessing frame internals.
6671         * w32font.h: Include font.h.  Define syms_of_w32font and
6672         globals_of_w32font.
6674         * process.c: Include TERM_HEADER instead of listing all possible
6675         window-system headers.
6677         * nsterm.h: Remove declarations now in frame.h.
6678         Define FRAME_X_SCREEN, FRAME_X_VISUAL.
6680         * menu.c: Include TERM_HEADER instead of listing all possible
6681         window-system headers.
6683         * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6684         window system.
6686         * keyboard.c: Include TERM_HEADER instead of listing all possible
6687         window-system headers.
6689         * image.c: Include TERM_HEADER instead of listing all possible
6690         window-system headers.  Declare Vlibrary_cache when compiling for
6691         Windows.
6693         * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6694         window system declarations.
6696         * frame.h: Move common functions here: set_frame_menubar,
6697         x_set_window_size, x_sync, x_get_focus_frame,
6698         x_set_mouse_position, x_set_mouse_pixel_position,
6699         x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6700         x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6701         x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6702         x_activate_menubar, x_real_positions, x_bitmap_icon,
6703         x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6704         and x_query_colors.
6706         * frame.c: Include TERM_HEADER instead of listing all possible
6707         window-system headers.
6709         * font.c: Include TERM_HEADER instead of listing all possible
6710         window-system headers.
6712         * emacs.c: Include TERM_HEADER.
6714         * dispnew.c: Include TERM_HEADER instead of listing all possible
6715         window-system headers.
6717         * ccl.h: Include character.h.
6719         * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6720         the current window system; include in list of objects to link into
6721         Emacs.
6723 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
6725         Remove mark_ttys function and fix tty_display_info initialization.
6726         * lisp.h (mark_ttys): Remove prototype.
6727         * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6728         to mark_ttys because all possible values of 'top_frame' slot are
6729         the frames which are reachable from Vframe_list.
6730         * term.c (mark_ttys): Remove.
6731         (init_tty): Safely initialize 'top_frame' slot with Qnil.
6733 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
6735         Change struct frame bitfields from unsigned char to unsigned.
6736         * frame.h (struct frame): Change type of 'display_preempted',
6737         'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6738         'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6739         'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6740         bitfields from unsigned char to unsigned.
6742 2012-08-31  Dmitry Antipov  <dmantipov@yandex.ru>
6744         Remove unused member of struct x_output and struct w32_output.
6745         * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6746         * w32term.h (struct w32_output): Likewise.
6748 2012-08-30  Jan Djärv  <jan.h.d@swipnet.se>
6750         * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6751         does not become zero (Bug#12234).
6753 2012-08-30  Paul Eggert  <eggert@cs.ucla.edu>
6755         * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6756         for GCC 4.7.1 x86-64.
6758 2012-08-30  Glenn Morris  <rgm@gnu.org>
6760         * lread.c (init_lread): For out-of-tree builds, only add the
6761         source directory's site-lisp dir to the load-path if it exists,
6762         consistent with in-tree builds.  (Bug#12302)
6764 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
6766         * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
6767         button_values to NULL.  Call setStykeMask so dialogs get a close button.
6768         (windowShouldClose:): Set window_closed.
6769         (dealloc): New member, free button_values.
6770         (process_dialog:): Make member function.  Remove window argument,
6771         replace window with self.  Count buttons and allocate and store values
6772         in button_values.
6773         (addButton:value:row:): value is int with the name tag.  Call setTag
6774         with tag.  Remove return self, declare return value as void.
6775         (addString:row:): Remove return self, declare return value as void.
6776         (addSplit): Remove return self, declare return value as void.
6777         (clicked:): Remove return self, declare return value as void.
6778         Set dialog_return to button_values[seltag].  Code formatting change.
6779         (initFromContents:isQuestion:): Adjust call to process_dialog.
6780         Code formatting change.
6781         (timeout_handler:): Set timer_fired to YES.
6782         (runDialogAt:): Set timer_fired to NO.
6783         Handle click on close button as quit.
6785         * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6786         Add window_closed and button_values.  Add void as return value for
6787         add(Button|String|Split).  addButton takes int instead of Lisp_Object.
6788         Add process_dialog as new member.
6790 2012-08-28  Eli Zaretskii  <eliz@gnu.org>
6792         * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6793         is not one of the heaps we manage.  (Bug#12242)
6795 2012-08-28  Glenn Morris  <rgm@gnu.org>
6797         * eval.c (Fcalled_interactively_p): Doc fix.  (Bug#11747)
6799 2012-08-28  Martin Rudalics  <rudalics@gmx.at>
6801         * window.c (Fset_window_configuration): Remove handling of
6802         auto-buffer-name window parameter.  Install revision of reverted
6803         fix.
6805 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
6807         Do not allow to set major mode for a dead buffer.
6808         * buffer.c (Fset_buffer_major_mode): Signal an error
6809         if the buffer is dead.
6810         (Fother_buffer, other_buffer_safely): Remove redundant
6811         nested declaration.
6813 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
6815         Always use set_buffer_if_live to restore original buffer at unwind.
6816         * buffer.h (record_unwind_current_buffer): New function.
6817         * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6818         * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6819         * undo.c, window.c: Adjust users.
6820         * buffer.c (set_buffer_if_live): Fix comment.
6822 2012-08-28  Dmitry Antipov  <dmantipov@yandex.ru>
6824         Fix usage of set_buffer_internal.
6825         * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6826         * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6827         * coding.c (decode_coding): Omit redundant test.
6828         * fileio.c (decide_coding_unwind): Likewise.
6829         * fns.c (secure_hash): Likewise.
6830         * insdel.c (modify_region): Likewise.
6831         * keyboard.c (command_loop_1): Likewise.
6832         * print.c (PRINTFINISH): Likewise.
6833         * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6835 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
6837         * dispnew.c: Use bool for boolean.
6838         (frame_garbaged, display_completed, delayed_size_change)
6839         (fonts_changed_p, add_window_display_history)
6840         (add_frame_display_history, verify_row_hash)
6841         (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6842         (row_equal_p, realloc_glyph_pool)
6843         (allocate_matrices_for_frame_redisplay)
6844         (showing_window_margins_p)
6845         (adjust_frame_glyphs_for_frame_redisplay)
6846         (build_frame_matrix_from_leaf_window, make_current)
6847         (mirrored_line_dance, mirror_line_dance, update_frame)
6848         (update_window_tree, update_single_window)
6849         (check_current_matrix_flags, update_window, update_text_area)
6850         (update_window_line, set_window_update_flags, scrolling_window)
6851         (update_frame_1, scrolling, buffer_posn_from_coords)
6852         (do_pending_window_change, change_frame_size)
6853         (change_frame_size_1, sit_for):
6854         Use bool for boolean.
6855         (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6856         and remove last int (actually boolean) argument, which was always 0.
6857         All callers changed.
6858         * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6859         * dispextern.h (struct composition_it): Use bool for boolean.
6860         (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
6861         (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
6862         * dired.c (file_name_completion):
6863         Use bool for boolean.  (This was missed in an earlier change.)
6865 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
6867         * window.c (Fset_window_configuration): Revert first part of
6868         last change.
6870 2012-08-27  Jan Djärv  <jan.h.d@swipnet.se>
6872         * nsterm.h (NSPanel): New class variable dialog_return.
6874         * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
6875         Initialize dialog_return.
6876         (windowShouldClose:): Use stop instead of stopModalWithCode.
6877         (clicked:): Ditto, and also set dialog_return (Bug#12258).
6878         (timeout_handler:): Use stop instead of abortModal.  Send a dummy
6879         event.
6880         (runDialogAt:): Make ret Lisp_Object.  Set it from dialog_return when
6881         modal loop returns.
6883 2012-08-27  Paul Eggert  <eggert@cs.ucla.edu>
6885         * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
6886         * composite.c (find_composition, composition_gstring_p)
6887         (composition_reseat_it, find_automatic_composition):
6888         * data.c (let_shadows_buffer_binding_p)
6889         (let_shadows_global_binding_p, set_internal, make_blv)
6890         (Fmake_variable_buffer_local, Fmake_local_variable)
6891         (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
6892         (cons_to_signed, arith_driver):
6893         * dbusbind.c (xd_in_read_queued_messages):
6894         * dired.c (directory_files_internal, file_name_completion):
6895         Use bool for booleans.
6896         * dired.c (file_name_completion):
6897         * process.h (fd_callback):
6898         Omit int (actually boolean) argument.  It wasn't being used.
6899         All uses changed.
6900         * composite.h, lisp.h: Reflect above API changes.
6902         * cmds.c, coding.c: Use bool for booleans.
6903         * cmds.c (move_point, Fself_insert_command):
6904         * coding.h (struct composition status, struct coding_system):
6905         * coding.c (detect_coding_utf_8, encode_coding_utf_8)
6906         (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
6907         (emacs_mule_char, decode_coding_emacs_mule)
6908         (encode_coding_emacs_mule, detect_coding_iso_2022)
6909         (decode_coding_iso_2022, encode_invocation_designation)
6910         (encode_designation_at_bol, encode_coding_iso_2022)
6911         (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
6912         (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
6913         (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
6914         (encode_coding_raw_text, detect_coding_charset)
6915         (decode_coding_charset, encode_coding_charset, detect_eol)
6916         (detect_coding, get_translation_table, produce_chars)
6917         (consume_chars, reused_workbuf_in_use)
6918         (make_conversion_work_buffer, code_conversion_save)
6919         (decode_coding_object, encode_coding_object)
6920         (detect_coding_system, char_encodable_p)
6921         (Funencodable_char_position, code_convert_region)
6922         (code_convert_string, code_convert_string_norecord)
6923         (Fset_coding_system_priority):
6924         * fileio.c (Finsert_file_contents):
6925         Use bool for booleans.
6926         * coding.h, lisp.h: Reflect above API changes.
6927         * coding.c: Remove unnecessary static function decls.
6928         (detect_coding): Use unsigned, not signed, to copy an unsigned field.
6929         (decode_coding, encode_coding, decode_coding_gap): Return 'void',
6930         not a boolean 'int', since callers never look at the return value.
6931         (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
6932         * coding.h (decoding_buffer_size, encoding_buffer_size)
6933         (emacs_mule_string_char): Remove unused extern decls.
6934         (struct iso_2022_spec, struct coding_system):
6935         Use 'unsigned int : 1' for boolean fields, since there's more than one.
6936         (struct emacs_mule_spec): Remove unused field 'full_support'.
6937         All initializations removed.
6938         * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
6940 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
6942         Fix spare memory change (Bug#12286).
6943         * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
6944         (valid_lisp_object_p): Likewise.
6946 2012-08-27  Martin Rudalics  <rudalics@gmx.at>
6948         * window.c (Fset_window_configuration): Record any window's old
6949         buffer if it's replaced (see Bug#8789).  If the new current
6950         buffer doesn't appear in the selected window, go to its old
6951         point (Bug#12208).
6953 2012-08-27  Dmitry Antipov  <dmantipov@yandex.ru>
6955         Special MEM_TYPE_SPARE to denote reserved memory.
6956         * alloc.c (enum mem_type): New memory type.
6957         (refill_memory_reserve): Use new type for spare memory.
6958         This prevents live_cons_p and live_string_p from incorrect
6959         detection of uninitialized objects from spare memory as live.
6961 2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
6963         Spelling fixes.
6964         * Makefile.in (.PHONY): versioclean -> versionclean.
6966         Remove unused external symbols.
6967         * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
6968         * window.c (Qwindow_valid_p, decode_valid_window):
6969         Now static, not extern.
6970         * data.c (Qinterval): Remove; unused.
6971         (syms_of_data): Do not define 'interval'.
6972         * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
6973         * window.h (decode_valid_window):
6974         Remove decls.
6976         * character.c, charset.c, chartab.c: Use bool for booleans.
6977         * character.c (lisp_string_width, string_count_byte8)
6978         (string_escape_byte8):
6979         * charset.c (charset_map_loaded, load_charset_map, read_hex):
6980         (load_charset_map_from_file, map_charset_chars)
6981         (Fdefine_charset_internal, define_charset_internal)
6982         (Fdeclare_equiv_charset, find_charsets_in_text)
6983         (Ffind_charset_region, char_charset, Fiso_charset):
6984         * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
6985         (sub_char_table_set, sub_char_table_set_range)
6986         (char_table_set_range, optimize_sub_char_table)
6987         (map_sub_char_table):
6988         Use bool for boolean.
6989         * character.c (str_to_unibyte): Omit last boolean argument; it was
6990         always 0.  All callers changed.
6991         * character.h, charset.h: Adjust to match previous changes.
6992         * character.h (char_printable_p): Remove decl of nonexistent function.
6993         * charset.h (struct charset): Members code_linear_p, iso_chars_96,
6994         ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
6995         are all boolean, so make them single-bit bitfields.
6997         * lisp.h (ASET): Remove attempt to detect side effects.
6998         It was meant to be temporary and it often doesn't work,
6999         because when IDX has side effects the behavior of IDX==IDX
7000         is undefined.  See Stefan Monnier in
7001         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7003 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
7005         * lisp.h (functionp): New function (extracted from Ffunctionp).
7006         (FUNCTIONP): Use it.
7007         * eval.c (Ffunctionp): Use it.
7009 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
7011         * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7012         as that's faster and simpler than static storage.  Don't bother
7013         with the g_main_context_query overhead if g_main_context_pending
7014         says no events are pending.
7015         (gfds, gfds_size): Remove these static vars.
7016         (xgselect_initialize): Remove; no longer needed.
7017         All uses and decls removed.
7019         * emacs.c (fatal_error_signal_hook): Remove.
7020         All uses removed.  This leftover from old code was always 0.
7022         * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7023         * casefiddle.c (casify_object, casify_region):
7024         * casetab.c (set_case_table):
7025         * category.c, category.h (word_boundary_p):
7026         * category.h (CHAR_HAS_CATEGORY):
7027         Use bool for booleans, instead of int.
7029 2012-08-25  Eli Zaretskii  <eliz@gnu.org>
7031         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7033 2012-08-25  Paul Eggert  <eggert@cs.ucla.edu>
7035         On assertion failure, print backtrace if available.
7036         * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7037         (die) [ENABLE_CHECKING]: Print a backtrace if available.
7038         * Makefile.in (LIB_EXECINFO): New macro.
7039         (LIBES): Use it.
7041         * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7042         * bytecode.c (exec_byte_code):
7043         * callint.c (check_mark, Fcall_interactively):
7044         * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7045         (getenv_internal, sync_process_alive, call_process_exited):
7046         * lisp.h (USE_SAFE_ALLOCA):
7047         Use bool for booleans, instead of int.
7048         * lisp.h, process.h: Adjust prototypes to match above changes.
7049         * callint.c (Fcall_interactively): Don't assume the mark's
7050         offset fits in 'int'.
7052 2012-08-24  Paul Eggert  <eggert@cs.ucla.edu>
7054         * buffer.c, buffer.h: Use bool for boolean.
7055         * buffer.c (reset_buffer_local_variables)
7056         (buffer_lisp_local_variables, Fset_buffer_modified_p)
7057         (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7058         (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7059         (overlay_touches_p, overlay_strings, Foverlay_put)
7060         (report_overlay_modification, call_overlay_mod_hooks):
7061         (mmap_enlarge, mmap_set_vars):
7062         * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7063         Use bool for booleans, instead of int.
7064         * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7065         since the 1-or-0 return value is always ignored anyway.
7066         (mmap_initialized_p):
7067         * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7068         * buffer.h, lisp.h: Adjust prototypes to match above changes.
7070 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
7072         * bidi.c: Use bool for boolean.
7073         This is a bit more readable, and makes the text segment of bidi.o
7074         0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7075         Presumably it's faster too.
7076         (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7077         Now bool.
7078         (bidi_cache_find_level_change, bidi_cache_iterator_state)
7079         (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7080         (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7081         (bidi_explicit_dir_char, bidi_level_of_next_char)
7082         (bidi_find_other_level_edge, bidi_move_to_visually_next):
7083         Use bool for booleans, instead of int.
7084         * dispextern.h (bidi_init_it, bidi_paragraph_init)
7085         (bidi_unshelve_cache): Adjust decls to match code.
7087 2012-08-23  Martin Rudalics  <rudalics@gmx.at>
7089         * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7090         argument.
7092 2012-08-23  Paul Eggert  <eggert@cs.ucla.edu>
7094         * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7095         * atimer.h: Include <stdbool.h>.
7097 2012-08-22  Dan Nicolaescu  <dann@gnu.org>
7099         * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7100         compile time tests instead of run time tests on systems that do
7101         not use them.
7102         (FRAME_MAC_P): Remove leftover from deleted code.
7103         * frame.c (syms_of_frame): Remove leftover from deleted code.
7105 2012-08-22  Jan Djärv  <jan.h.d@swipnet.se>
7107         * nsterm.m (insertText:): Don't clear modifiers if code is space.
7109 2012-08-22  Paul Eggert  <eggert@cs.ucla.edu>
7111         * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7112         Otherwise, the compiler complains about (A?B:C) where B is void
7113         and C is Lisp_Object.  This fixes an incompatibility with Sun C 5.12.
7114         (fontset_add): Return void, for FONTSET_ADD.
7116 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
7118         * alloc.c: Use bool for booleans.
7119         (gc_in_progress, abort_on_gc)
7120         (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7121         (dont_register_blocks) [GC_MALLOC_CHECK]:
7122         (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7123         (check_string_bytes, make_specified_string, memory_full)
7124         (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7125         (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7126         (mark_stack, valid_pointer_p, make_pure_string)
7127         (Fgarbage_collect, survives_gc_p, gc_sweep):
7128         Use bool for booleans, instead of int.
7129         (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7130         Remove unused local.
7131         * alloc.c (PURE_POINTER_P):
7132         * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7133         * editfns.c (Fformat):
7134         * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7135         (Fdo_auto_save):
7136         * fns.c (sweep_weak_table):
7137         * lisp.h (suppress_checking, push_message, survives_gc_p)
7138         (make_pure_string, gc_in_progress, abort_on_gc):
7139         * lread.c (readchar, read1):
7140         * print.c (Fprin1_to_string):
7141         * xdisp.c (push_message):
7142         Use bool for booleans affected directly or indirectly by
7143         alloc.c's changes.
7145         Make recently-introduced setters macros.
7146         * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7147         (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7148         (set_fontset_default, set_fontset_fallback): Rename from their
7149         upper-case counterparts, and make them functions rather than macros.
7150         This is more consistent with the other recently-introduced setters.
7151         These don't need to be inline, since they're local.
7153 2012-08-21  Jan Djärv  <jan.h.d@swipnet.se>
7155         * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7156         the loop (Bug#12247).
7158 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
7160         * lisp.h (vcopy): Use memcpy rather than our own loop.
7161         This fixes a performance regression introduced by the recent
7162         addition of vcopy.  This means 'vcopy' will need to be modified
7163         for a copying collector, but that's OK.  Also, tighten the
7164         checking in the assertion.
7166 2012-08-21  Eli Zaretskii  <eliz@gnu.org>
7168         * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7169         components for RTL text (Bug#11860).  Adjust X-OFFSET of each
7170         non-base glyph for the width of the base character, according to
7171         what x_draw_composite_glyph_string_foreground expects.
7172         Generate WADJUST value according to composition_gstring_width's
7173         expectations, to produce correct width of the composed character.
7174         Reverse the sign of the DU offset produced by ScriptPlace.
7176 2012-08-21  Paul Eggert  <eggert@cs.ucla.edu>
7178         * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7180 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
7182         Avoid direct writes to contents member of struct Lisp_Vector.
7183         * lisp.h (vcopy): New function to copy data into vector.
7184         * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7185         * fns.c (Ffillarray): Use ASET.
7186         * keyboard.c (timer_check_2): Use AREF and ASET.
7187         (append_tool_bar_item, Frecent_keys): Use vcopy.
7188         * lread.c (read_vector): Use ASET.
7189         * msdos.c (Frecent_doskeys): Use vcopy.
7190         * xface.c (Finternal_copy_lisp_face): Use vcopy.
7191         (Finternal_merge_in_global_face): Use ASET and vcopy.
7192         * xfont.c (xfont_list_pattern): Likewise.
7194 2012-08-21  Martin Rudalics  <rudalics@gmx.at>
7196         * window.c (Fwindow_point): For the selected window always return
7197         the position of its buffer's point.
7198         (Fset_window_point): For the selected window always go in its
7199         buffer to the specified position.
7201 2012-08-21  Dmitry Antipov  <dmantipov@yandex.ru>
7203         Setter macros for fontsets.
7204         * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7205         (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7206         (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7207         Adjust users.
7209 2012-08-20  Glenn Morris  <rgm@gnu.org>
7211         * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7212         Don't assume that `ln -f' works.
7214 2012-08-20  Eli Zaretskii  <eliz@gnu.org>
7216         * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7217         and later about non-assignments with no effect.  See discussion at
7218         http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7219         details.
7221 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
7223         Inline setter functions for Lisp_Objects slots of struct specbinding.
7224         * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7225         Adjust users.
7227 2012-08-20  Martin Rudalics  <rudalics@gmx.at>
7229         * window.c (select_window): Always make selected window's buffer
7230         current.
7232 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
7234         Use AREF and ASET for docstrings of category tables.
7235         * category.h (CATEGORY_DOCSTRING): Use AREF.
7236         (SET_CATEGORY_DOCSTRING): Use ASET.
7237         * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7239 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
7241         Inline setter functions for hash table members.
7242         * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7243         (set_hash_hash, set_hash_index): Rename with _slot suffix.
7244         (set_hash_key_and_value, set_hash_index, set_hash_next)
7245         (set_hash_hash): New functions.
7246         * charset.c, fns.c: Adjust users.
7248 2012-08-20  Dmitry Antipov  <dmantipov@yandex.ru>
7250         Inline getter and setter functions for per-buffer values.
7251         * buffer.h (per_buffer_default, set_per_buffer_default)
7252         (per_buffer_value, set_per_buffer_value): New functions.
7253         (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7254         * buffer.c, data.c: Adjust users.
7256 2012-08-20  Juanma Barranquero  <lekktu@gmail.com>
7258         * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7260 2012-08-19  Paul Eggert  <eggert@cs.ucla.edu>
7262         Rely on <config.h> + <unistd.h> to declare 'environ',
7263         as gnulib does this if the system doesn't.
7264         * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
7265         Remove declaration.  MS-Windows declares it on stdlib.h which is
7266         included by conf_post.h.
7267         * emacs.c (environ) [DOUG_LEA_MALLOC]:
7268         * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7269         * vm-limit.c: Include <unistd.h>, for 'environ'.
7271         * unexaix.c, unexcoff.c: Include "mem-limits.h".
7272         (start_of_data): Remove decl; mem-limits.h provides it.
7274         * xdisp.c (handle_invisible_prop): Make it a bit faster
7275         and avoid a gcc -Wmaybe-uninitialized diagnostic.
7277 2012-08-19  Chong Yidong  <cyd@gnu.org>
7279         * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7280         ends (Bug#3874).
7282 2012-08-19  Andreas Schwab  <schwab@linux-m68k.org>
7284         * .gdbinit: Use call instead of set when calling a function in the
7285         inferior.
7287         * data.c (set_internal): Don't use set_blv_found.
7288         (Fkill_local_variable): Likewise.
7290 2012-08-18  Alp Aker  <alp.tekin.aker@gmail.com>
7292         * nsfont.m (ns_ascii_average_width): Ensure the string
7293         ascii_printable is initialized with a null-terminated character
7294         array.  Otherwise, it can contain undesired extra characters.
7296 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
7298         port new setting code to Sun C 5.8 2005/10/13
7299         * chartab.c, lisp.h (char_table_set, char_table_set_range):
7300         Return void, not Lisp_Object.  Otherwise, the compiler
7301         complains about (A?B:C) where B is void and C is Lisp_Object
7302         when compiling CHAR_TABLE_SET, due to the recent change to
7303         the API of sub_char_table_set_contents.
7305 2012-08-18  Chong Yidong  <cyd@gnu.org>
7307         * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7308         for the string case (Bug#3874).
7310 2012-08-18  Paul Eggert  <eggert@cs.ucla.edu>
7312         * buffer.h (BSET): Remove (Bug#12215).
7313         Replace all uses with calls to new setter functions.
7314         (bset_bidi_paragraph_direction, bset_case_canon_table)
7315         (bset_case_eqv_table, bset_directory, bset_display_count)
7316         (bset_display_time, bset_downcase_table)
7317         (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7318         (bset_last_selected_window, bset_local_var_alist)
7319         (bset_mark_active, bset_point_before_scroll, bset_read_only)
7320         (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7321         (bset_width_table):
7322         * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7323         (bset_auto_fill_function, bset_auto_save_file_format)
7324         (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7325         (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7326         (bset_cache_long_line_scans, bset_case_fold_search)
7327         (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7328         (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7329         (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7330         (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7331         (bset_header_line_format, bset_indicate_buffer_boundaries)
7332         (bset_indicate_empty_lines, bset_invisibility_spec)
7333         (bset_left_fringe_width, bset_major_mode, bset_mark)
7334         (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7335         (bset_name, bset_overwrite_mode, bset_pt_marker)
7336         (bset_right_fringe_width, bset_save_length)
7337         (bset_scroll_bar_width, bset_scroll_down_aggressively)
7338         (bset_scroll_up_aggressively, bset_selective_display)
7339         (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7340         (bset_word_wrap, bset_zv_marker):
7341         * category.c (bset_category_table):
7342         * syntax.c (bset_syntax_table):
7343         New setter functions.
7345         * process.h (PSET): Remove (Bug#12215).
7346         Replace all uses with calls to new setter functions.
7347         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7348         (PROCESS_INLINE): New macro.
7349         (pset_childp): New setter function.
7350         (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7351         * process.c (PROCESS_INLINE):
7352         Define to EXTERN_INLINE, so that the corresponding functions
7353         are compiled into code.
7354         (pset_buffer, pset_command, pset_decode_coding_system)
7355         (pset_decoding_buf, pset_encode_coding_system)
7356         (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7357         (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7358         (pset_type, pset_write_queue): New setter functions.
7360         * window.h (WSET): Remove (Bug#12215).
7361         Replace all uses with calls to new setter functions.
7362         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7363         (WINDOW_INLINE): New macro.
7364         (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7365         (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7366         (wset_total_lines, wset_vertical_scroll_bar)
7367         (wset_window_end_pos, wset_window_end_valid)
7368         (wset_window_end_vpos): New setter functions.
7369         * window.c (WINDOW_INLINE):
7370         Define to EXTERN_INLINE, so that the corresponding functions
7371         are compiled into code.
7372         (wset_combination_limit, wset_dedicated, wset_display_table)
7373         (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7374         (wset_new_normal, wset_new_total, wset_next_buffers)
7375         (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7376         (wset_prev_buffers, wset_right_fringe_width)
7377         (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7378         (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7379         (wset_window_parameters):
7380         * xdisp.c (wset_base_line_number, wset_base_line_pos)
7381         (wset_column_number_displayed, wset_region_showing):
7382         New setter functions.
7384         * termhooks.h (TSET): Remove (Bug#12215).
7385         Replace all uses with calls to new setter functions.
7386         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7387         (TERMHOOKS_INLINE): New macro.
7388         (tset_charset_list, tset_selection_alist): New setter functions.
7389         * terminal.c (TERMHOOKS_INLINE):
7390         Define to EXTERN_INLINE, so that the corresponding functions
7391         are compiled into code.
7392         (tset_param_alist): New setter function.
7394 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
7396         * keyboard.h (KSET): Remove (Bug#12215).
7397         Replace all uses with calls to new setter functions.
7398         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7399         (KEYBOARD_INLINE): New macro.
7400         (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7401         (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7402         (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7403         New setter functions.
7404         * keyboard.c (KEYBOARD_INLINE):
7405         Define to EXTERN_INLINE, so that the corresponding functions
7406         are compiled into code.
7407         (kset_echo_string, kset_kbd_queue)
7408         (kset_keyboard_translate_table, kset_last_prefix_arg)
7409         (kset_last_repeatable_command, kset_local_function_key_map)
7410         (kset_overriding_terminal_local_map, kset_real_last_command)
7411         (kset_system_key_syms): New setter functions.
7413         * frame.h (FSET): Remove (Bug#12215).
7414         Replace all uses with calls to new setter functions.
7415         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7416         (FRAME_INLINE): New macro.
7417         (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7418         (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7419         (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7420         (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7421         (fset_param_alist, fset_root_window, fset_scroll_bars)
7422         (fset_selected_window, fset_title, fset_tool_bar_items)
7423         (fset_tool_bar_position, fset_tool_bar_window): New functions.
7424         * frame.c (FRAME_INLINE):
7425         Define to EXTERN_INLINE, so that the corresponding functions
7426         are compiled into code.
7427         (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7429         A few more naming-convention fixes for getters and setters.
7430         * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7431         and rename from buffer_overlays_set_before.
7432         (set_buffer_overlays_after): Move here from buffer.h, and rename
7433         from buffer_overlays_set_after.
7434         * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7435         All uses changed.
7436         (set_buffer_intervals): Rename from buffer_set_intervals.
7437         * intervals.c (set_interval_object): Move here from intervals.h,
7438         and rename from interval_set_object.
7439         (set_interval_left): Move here from intervals.h, and rename from
7440         interval_set_left.
7441         (set_interval_right): Move here from intervals.h, and rename from
7442         interval_set_right.
7443         (copy_interval_parent): Move here from intervals.h, and rename from
7444         interval_copy_parent.
7445         * intervals.h (set_interval_parent): Rename from interval_set_parent.
7446         (set_interval_plist): Rename from interval_set_plist.
7447         Return void, not Lisp_Object, since no caller uses the result.
7448         * lisp.h (string_intervals): Rename from string_get_intervals.
7449         (set_string_intervals): Rename from string_set_intervals.
7451         * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7452         (set_char_table_contents): Rename from char_table_set_contents.
7453         (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
7454         All uses changed.  See the end of
7455         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7457         * lisp.h (CSET): Remove (Bug#12215).
7458         (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7459         (set_char_table_purpose): New functions,
7460         replacing CSET.  All uses changed.  For example, replace
7461         "CSET (XCHAR_TABLE (char_table), parent, parent);" with
7462         "set_char_table_parent (char_table, parent);".
7463         The old version was confusing because it used the same name
7464         'parent' for two different things.
7466 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
7468         Functions to get and set Lisp_Object fields of buffer-local variables.
7469         * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7470         (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7471         (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7472         * data.c, eval.c, frame.c: Adjust users.
7474 2012-08-17  Chong Yidong  <cyd@gnu.org>
7476         * xfaces.c (merge_face_vectors): If the target font specfies a
7477         font spec, make the font's attributes take precedence over
7478         directly-specified attributes.
7479         (merge_face_ref): Recognize :font.
7481 2012-08-17  Dmitry Antipov  <dmantipov@yandex.ru>
7483         Do not use memcpy for copying intervals.
7484         * intervals.c (reproduce_interval): New function.
7485         (reproduce_tree, reproduce_tree_obj): Use it.
7486         (reproduce_tree_obj): Remove prototype.
7488 2012-08-17  Paul Eggert  <eggert@cs.ucla.edu>
7490         * lisp.h (duration_to_sec_usec): Remove unused decl.
7492 2012-08-17  Alp Aker  <alp.tekin.aker@gmail.com>
7494         * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7495         to an allocated instance of NSString, not to the class itself.
7497 2012-08-17  Juanma Barranquero  <lekktu@gmail.com>
7499         * makefile.w32-in (C_CTYPE_H): New macro.
7500         (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7501         ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7502         ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7504 2012-08-16  Paul Eggert  <eggert@cs.ucla.edu>
7506         Use ASCII tests for character types.
7507         * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7508         * xfns.c, xterm.c:
7509         Don't include <ctype.h>; was not needed.
7510         * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7511         * sysdep.c, xfaces.c:
7512         Include <c-ctype.h> instead of <ctype.h>.
7513         * nsterm.m: Include <c-ctype.h>.
7514         * charset.c (read_hex):
7515         * doc.c (Fsnarf_documentation):
7516         * fileio.c (IS_DRIVE) [WINDOWSNT]:
7517         (DRIVE_LETTER) [DOS_NT]:
7518         (Ffile_name_directory, Fexpand_file_name)
7519         (Fsubstitute_in_file_name):
7520         * font.c (font_parse_xlfd, font_parse_fcname):
7521         * frame.c (x_set_font_backend):
7522         * gtkutil.c (xg_get_font):
7523         * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7524         * nsimage.m (hexchar):
7525         * nsterm.m (ns_xlfd_to_fontname):
7526         * sysdep.c (system_process_attributes):
7527         * xfaces.c (hash_string_case_insensitive):
7528         Use C-locale tests instead of locale-specific tests for character
7529         types, since we want the ASCII interpretation here, not the
7530         interpretation suitable for whatever happens to be the current locale.
7532 2012-08-16  Martin Rudalics  <rudalics@gmx.at>
7534         Consistently check windows for validity/liveness
7535         (Bug#11984, Bug#12025, Bug#12026).
7536         * lisp.h (CHECK_VALID_WINDOW): New macro.
7537         * window.c (decode_window): Rename to decode_live_window.
7538         (decode_valid_window, Fwindow_valid_p): New functions.
7539         (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7540         (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7541         (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7542         (Fwindow_prev_sibling, Fwindow_combination_limit)
7543         (Fset_window_combination_limit, Fwindow_use_time)
7544         (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7545         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7546         (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7547         (Fwindow_hscroll, Fset_window_hscroll)
7548         (Fwindow_redisplay_end_trigger)
7549         (Fset_window_redisplay_end_trigger, Fwindow_edges)
7550         (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7551         (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7552         (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7553         (Fwindow_end, Fset_window_point, Fset_window_start)
7554         (Fpos_visible_in_window_p, Fwindow_line_height)
7555         (Fwindow_dedicated_p, Fset_window_dedicated_p)
7556         (Fwindow_prev_buffers, Fset_window_prev_buffers)
7557         (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7558         (Fset_window_parameter, Fwindow_display_table)
7559         (Fset_window_display_table, Fdelete_other_windows_internal)
7560         (Fset_window_buffer, Fset_window_new_total)
7561         (Fset_window_new_normal, Fdelete_window_internal)
7562         (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7563         (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7564         (Fwindow_scroll_bars): Check whether argument window is a valid or
7565         live window.  Update doc-strings.
7566         (syms_of_window): New symbol Qwindow_valid_p.
7567         * keyboard.c (Fposn_at_x_y): Check whether argument
7568         frame_or_window denotes a valid window.
7570 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
7572         Fix previous char table change.
7573         * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7574         * chartab.c (optimize_sub_char_table): Likewise.
7576 2012-08-16  Chong Yidong  <cyd@gnu.org>
7578         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7580         * xfont.c (xfont_open):
7581         * xftfont.c (xftfont_open): Set the font's max_width field.
7583         * nsfont.m (nsfont_open): Similar to the Xft backend, set
7584         min_width to space_width and average_width to the average over
7585         printable ASCII characters.
7586         (ns_char_width): Code cleanup.
7587         (ns_ascii_average_width): New utility function.
7589         * font.h (struct font): Update comments.
7591 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
7593         Simple interface to set Lisp_Object fields of character tables.
7594         * lisp.h (CSET): New macro.
7595         (char_table_set_extras, char_table_set_contents)
7596         (sub_char_table_set_contents): New function.
7597         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7598         * syntax.c: Adjust users.
7600 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
7602         * eval.c (eval_sub): Bind lexical-binding.
7603         * lread.c (Qlexical_binding): Make non-static.
7605 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
7607         * nsmenu.m (popupSession): Remove.
7608         (pop_down_menu): Remove endModalSession.
7609         (timeout_handler:): New method.
7610         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
7611         Call runModalForWindow.  Check timer_fired when it returns.
7612         If not set, cancel timer and break out of loop.
7613         Otherwise loop again, with a new timeout.
7615         * nsterm.m: Include fcntl.h if present.
7616         (fd_entry, t_readfds, inNsSelect): Remove.
7617         (select_writefds, select_valid, select_timeout, selfds)
7618         (select_mutex, apploopnr): Add.
7619         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7620         Otherwise call kbd_buffer_store_event.
7621         (ns_send_appdefined): Remove release of fd_entry.
7622         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
7623         Increment and decrement apploopnr.
7624         (ns_select): If no file descriptors, just do a NSTimer.
7625         Otherwise copy read/write masks and start select thread (fd_handler).
7626         Start main loop and wait for application defined event.
7627         Inform select thread to stop selecting after main loop is exited.
7628         (ns_term_init): Create selfds pipe and set non-blocking.
7629         Initialize select_mutex.  Start the select thread (fd_handler).
7630         (fd_handler:): Loop forever, wait for info from the main thread
7631         to either start or stop selecting.  When select returns, send
7632         and appdefined event.
7633         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7634         If not call kbd_buffer_store_event.
7636         * nsterm.h (EmacsApp): fd_handler takes id argument.
7637         (EmacsDialogPanel): Add timer_fired and timeout_handler.
7639         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7641 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
7643         * region-cache.c (move_cache_gap): Update gap_len using the actual
7644         growth of the boundaries array.  Do not change cache_len.
7645         (Bug#12196)
7647 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
7649         Generalize and cleanup font subsystem checks.
7650         * font.h (FONT_DEBUG, font_assert): Remove.
7651         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7652         Change font_assert to eassert.  Use eassert where appropriate.
7654 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
7656         * gtkutil.c (xg_get_font): Use pango_units_to_double.
7658 2012-08-15  Chong Yidong  <cyd@gnu.org>
7660         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7661         When using the new font chooser, use gtk_font_chooser_get_font_desc to
7662         extract the font descriptor instead of just the font name.
7663         In that case, return a font spec instead of a string.
7664         (x_last_font_name): Move to this file from xfns.c.
7666         * xfns.c (Fx_select_font): The return value can also be a font
7667         spec.  Move x_last_font_name management to gtkutil.c.
7669         * xfaces.c: Make font weight and style symbols non-static.
7671 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
7673         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7674         (bug#12117).
7676 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
7678         * alloc.c (Fgarbage_collect): Use plural form consistently.
7680 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
7682         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7683         iteration through the command loop.  Fixes a problem whereby mouse
7684         movements are ignored until the first mouse click.
7686 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
7688         Use bool, not int, for Lisp booleans.
7689         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7690         makes Emacs a bit smaller and presumably a bit faster.
7691         * lisp.h: Include <stdbool.h>.
7692         (struct Lisp_Boolfwd, defvar_bool):
7693         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7694         * regex.c [!emacs]: Include <stdbool.h>.
7695         (false, true): Remove; <stdbool.h> does this for us now.
7697 2012-08-14  Chong Yidong  <cyd@gnu.org>
7699         * character.c (Fcharacterp): Doc fix (Bug#12076).
7701         * data.c (Findirect_variable): Doc fix (Bug#11040).
7703         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7705         * editfns.c (Fformat): Doc fix (Bug#12059).
7706         (Fsave_current_buffer): Doc fix (Bug#11542).
7708 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
7710         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7711         (bug#12022).
7713 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
7715         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7716         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7717         * minibuf.c (choose_minibuf_frame, read_minibuf):
7718         * w32fns.c (x_create_tip_frame):
7719         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7720         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7722 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
7724         * intervals.c (offset_intervals): Remove obsolete comment.
7726 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
7728         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7730 2012-08-14  Gergely Risko  <gergely@risko.hu>
7732         * coding.c (decode_coding): Record buffer modification before
7733         disabling undo_list (Bug#11773).
7735 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
7737         Revert and cleanup some recent overlay changes.
7738         * buffer.h (enum overlay_type): Remove.
7739         (buffer_get_overlays, buffer_set_overlays): Likewise.
7740         (buffer_set_overlays_before, buffer_set_overlays_after):
7741         New function.  Adjust users.
7742         (unchain_both): Add eassert.
7744 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
7746         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7748 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
7750         * gtkutil.c (xg_mark_data): Don't assume C99.
7752 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
7754         * gtkutil.c (xg_frame_tb_info): New struct.
7755         (TB_INFO_KEY): New define.
7756         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7757         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7758         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7759         if not present.
7760         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
7761         is up to date.  Otherwise store new data.
7762         (free_frame_tool_bar): Free xg_frame_tb_info if present.
7764 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
7766         Use KSET for write access to Lisp_Object members of struct kboard.
7767         * keyboard.h (KSET): New macro.
7768         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7769         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7770         * xterm.c: Adjust users.
7772 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
7774         Use BSET for write access to Lisp_Object members of struct buffer.
7775         * buffer.h (BSET): New macro.
7776         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7777         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7778         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7779         * window.c, xdisp.c, xfns.c: Adjust users.
7781 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
7783         * lread.c (syms_of_lread): Initialize Vlexical_binding.
7785 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
7787         * nsterm.m (not_in_argv): New function.
7788         (application:openFile, application:openTempFile:):
7789         (application:openFileWithoutUI:, application:openFiles:): Open file
7790         if not_in_argv returns non-zero (bug#12171).
7792         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
7793         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7794         Define for Gtk+ versions less than 3.2.
7795         (xg_get_font_name): Use those functions/macros here.
7796         Reported by Frans Oilinki <moilinki@gmail.com>.
7798 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
7800         * unexmacosx.c (copy_data_segment): Copy initialized data in
7801         statically linked libraries from input file rather than memory.
7803         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7804         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7805         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7807 2012-08-10  Glenn Morris  <rgm@gnu.org>
7809         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7810         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7812 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
7814         Fix last change to allow compilation with low optimization levels.
7815         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7816         Reported by Jan Djärv <jan.h.d@swipnet.se>.
7818 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
7820         Use common inline syntax in intervals.h.
7821         * intervals.h (INTERVALS_INLINE): New macro.
7822         Change all users from LISP_INLINE.
7824 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
7826         Define Qnone once for all platforms.
7827         * frame.c (Qnone): Define here.
7828         (syms_of_frame): DEFSYM it.
7829         * lisp.h (Qnone): New declaration.
7830         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7831         * xfns.c: Remove duplication.  Adjust users.
7833 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
7835         Remove unused macros from intervals.h.
7836         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7837         * intervals.c: Adjust comment.
7839 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
7841         * w32fns.c <w32_unicode_gui>: New static variable.
7842         (globals_of_w32fns): Initialize it according to os_subtype.
7843         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7844         testing os_subtype.
7846 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
7847             Eli Zaretskii  <eliz@gnu.org>
7849         Fix bug #10299 with Unicode characters sent by customized
7850         keyboards created by MSKLC.
7851         * w32fns.c (INIT_WINDOW_CLASS): New macro.
7852         (w32_init_class): Use it to initialize the Emacs class with either
7853         ANSI or Unicode API calls.
7854         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7855         later.
7856         (w32_wnd_proc): If the character code sent by WM_CHAR or
7857         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7858         original message.  Call DefWindowProcW on NT and later.
7860 2012-08-10  Glenn Morris  <rgm@gnu.org>
7862         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
7864         * lisp.h (DIRECTORY_SEP): Let configure set it.
7866 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
7868         Use TSET for write access to Lisp_Object slots of struct terminal.
7869         * termhooks.h (TSET): New macro.
7870         * coding.c, terminal.c, xselect.c: Adjust users.
7872 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
7874         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
7875         the failing expression, include them in the error message.
7876         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
7877         * lisp.h (internal_condition_case_n): Update declaration.
7879 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
7881         Inline functions to examine and change buffer overlays.
7882         * buffer.c (unchain_both): New function.
7883         * buffer.h (buffer_get_overlays, buffer_set_overlays):
7884         (buffer_has_overlays): New function.
7885         (enum overlay_type): New enum.
7886         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
7887         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
7889 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
7891         Inline functions to examine and change buffer intervals.
7892         * alloc.c (mark_interval_tree): Remove.
7893         (MARK_INTERVAL_TREE): Simplify.
7894         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
7895         * intervals.c (buffer_balance_intervals): New function.
7896         (graft_intervals_into_buffer): Adjust indentation.
7897         (set_intervals_multibyte): Simplify.
7898         * buffer.h (BUF_INTERVALS): Remove.
7899         (buffer_get_intervals, buffer_set_intervals): New function.
7900         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
7901         * intervals.c, textprop.c: Adjust users.
7903 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
7905         Inline functions to examine and change string intervals.
7906         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
7907         (string_get_intervals, string_set_intervals): New function.
7908         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7909         * lread.c, print.c, textprop.c: Adjust users.
7911 2012-08-08  Glenn Morris  <rgm@gnu.org>
7913         * lisp.mk (lisp): Remove language/persian.elc.
7915 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
7917         Cleanup intervals.
7918         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
7919         (NULL_INTERVAL_P): Likewise.  Adjust users.
7920         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
7921         Adjust comment.  Move under #if 0.
7922         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
7923         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
7925 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
7927         Check total length of intervals with eassert.
7928         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
7929         * intervals.c: Change all users to eassert.
7931 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
7933         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
7934         Rename fields to match removal of FGET and WGET and disuse of
7935         INTERNAL_FIELD in Lisp_Cons.
7937 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
7939         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
7940         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
7941         name since all xname users are fixed long time ago.  Do not
7942         use INTERNAL_FIELD.
7943         (set_symbol_name, set_symbol_function, set_symbol_plist):
7944         (set_symbol_next, set_overlay_plist): New function.
7945         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
7946         (struct Lisp_Overlay): Likewise.
7947         (CVAR, MVAR, SVAR): Remove.
7948         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
7949         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
7950         * xterm.c: Adjust users.
7951         * .gdbinit: Change to use name field of struct Lisp_Symbol
7952         where appropriate.
7954 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
7956         Basic functions to set Lisp_Object and pointer slots of intervals.
7957         * intervals.h (interval_set_parent, interval_set_object):
7958         (interval_set_left, interval_set_right, interval_set_plist):
7959         (interval_copy_parent): New function.
7960         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
7961         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
7962         Adjust indentation.
7963         (INTERVAL_SIZE): Remove.  Adjust users.
7964         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
7966 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
7968         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
7969         * process.h (PGET): Remove.
7970         (struct Lisp_Process): Do not use INTERNAL_FIELD.
7971         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
7973 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
7975         Drop WGET and revert read access to Lisp_Objects slots of struct window.
7976         * window.h (WGET): Remove.
7977         (struct window): Do not use INTERNAL_FIELD.
7978         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
7979         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
7980         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
7981         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
7982         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
7983         Adjust users.
7985 2012-08-07  Chong Yidong  <cyd@gnu.org>
7987         * window.c (Fwindow_edges, Fwindow_pixel_edges)
7988         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
7989         (Fdelete_window_internal): Signal an error if the window is not on
7990         a live frame (Bug#12025).
7992 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
7994         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
7995         * frame.h (FGET): Remove.
7996         (struct frame): Do not use INTERNAL_FIELD.
7997         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
7998         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
7999         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8000         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8002 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
8004         * w32.c: Silence compiler warnings.
8005         (map_w32_filename): Remove unused variable `is_fat'.
8006         (chase_symlinks): Add parentheses around expression.
8008 2012-08-06  Glenn Morris  <rgm@gnu.org>
8010         * sysdep.c: Respect BROKEN_GETWD.
8012         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8013         Let configure handle it.
8014         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8016 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8018         Use GCALIGNMENT where appropriate.
8019         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8020         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8021         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8023 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
8025         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8026         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
8028 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
8030         * buffer.h (struct buffer): Revert `indirections' to a simple int;
8031         that should be sufficient for everyone.
8033 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
8035         * keyboard.c (timer_check_2): Add break so timer_check returns next
8036         timeout.
8038 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8040         Fix Windows build errors introduced after converting to WGET and WSET.
8041         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8042         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8044 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
8046         * nsterm.m (ns_frame_rehighlight): Use FSET.
8048         * nsmenu.m (ns_update_menubar): Use FSET.
8050 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8052         Separate read and write access to Lisp_Object slots of Lisp_Process.
8053         * process.h (PGET, PSET): New macros similar to AREF and ASET.
8054         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8056 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8058         Separate read and write access to Lisp_Object slots of struct window.
8059         * window.h (WGET, WSET): New macros similar to AREF and ASET.
8060         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8061         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8062         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8063         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8064         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8065         Adjust users.
8067 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8069         Fix Windows build errors introduced after converting to FGET and FSET.
8070         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8071         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8072         (w32_judge_scroll_bars): Change to use FSET.
8073         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8075 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8077         Fix replacement typo.
8078         * window.c (replace_window): Set root_window instead of
8079         selected_window.  This fixes a total window subsystem
8080         malfunction reported by Bastien Guerry <bzg@gnu.org>.
8082 2012-08-06  Glenn Morris  <rgm@gnu.org>
8084         * lisp.mk (lisp): Add language/persian.elc.
8086 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
8088         Separate read and write access to Lisp_Object slots of struct frame.
8089         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8090         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8091         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8092         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8093         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8095 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
8097         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8099 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
8101         Generalize common compile-time constants.
8102         * lisp.h (header_size, bool_header_size, word_size): Now here.
8103         (struct Lisp_Vector): Add comment.
8104         (struct Lisp_Bool_Vector): Move up to define handy constants.
8105         (VECSIZE, PSEUDOVECSIZE): Simplify.
8106         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
8107         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8108         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8109         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8110         * xfont.c, xmenu.c: Use word_size where appropriate.
8112 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
8114         * search.c (Freplace_match): Treat \? in the replacement text
8115         literally (Bug#8161).
8117 2012-08-05  Chong Yidong  <cyd@gnu.org>
8119         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8120         * frame.c (Vdelete_frame_functions):
8121         * emacs.c (Vkill_emacs_hook): Doc fix.
8123 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
8125         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8126         --with-x-toolkit=no builds.
8127         Reported by Carsten Mattner <carstenmattner@gmail.com>.
8129 2012-08-04  Chong Yidong  <cyd@gnu.org>
8131         * syntax.c (Fmodify_syntax_entry): Doc fix.
8133 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
8135         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
8136         * w32.c (init_environment): Change the default values of many
8137         environment variables in dflt_envvars[] to NULL, to avoid pushing
8138         them into environment when they were not already defined.
8139         Remove the code that deletes site-lisp subdirectories from the default
8140         value of EMACSLOADPATH, as it is no longer needed.
8141         (check_windows_init_file): Now external, not static.
8142         Use Vload_path as is, without adding anything, as this function is now
8143         called when Vload_path is already set up.
8145         * w32.h (check_windows_init_file): Add prototype.
8147         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8148         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8149         compatibility with Posix platforms.
8150         (main): Move the call to check_windows_init_file to here from
8151         w32.c.
8152         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8153         any, in the DEFALT argument into the root of the Emacs build or
8154         installation tree, as appropriate.
8156         * callproc.c (init_callproc_1): Call decode_env_path instead of
8157         doing its equivalent by hand.
8158         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8159         the code that sets Vexec_path run on MS-Windows.
8161         * lread.c (init_lread): Add comments to #ifdef's.
8163         * msdos.c (dos_set_window_size, IT_update_begin)
8164         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8165         instead of direct references.
8167 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
8169         Export DEFAULT_REHASH_* to GDB.
8170         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8171         Now constants, not macros.
8173 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
8175         Remove unnecessary casts involving pointers.
8176         These casts are no longer needed now that we assume C89 or later,
8177         since they involve casting to or from void *.
8178         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8179         (make_pure_float, make_pure_vector):
8180         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8181         * macros.c (Fstart_kbd_macro):
8182         * menu.c (find_and_return_menu_selection):
8183         * minibuf.c (read_minibuf_noninteractive):
8184         * sysdep.c (closedir):
8185         * xdisp.c (x_produce_glyphs):
8186         * xfaces.c (compare_fonts_by_sort_order):
8187         * xfns.c (x_real_positions, select_visual):
8188         * xselect.c (x_stop_queuing_selection_requests)
8189         (x_get_window_property, x_get_window_property_as_lisp_data):
8190         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8191         Remove unnecessary pointer casts.
8192         * alloc.c (record_xmalloc): New function.
8193         * lisp.h (record_xmalloc): New decl.
8194         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8195         more like a function.  This is because the pointer cast is not
8196         needed.  All uses changed.
8197         * print.c (print_string, print_error_message): Avoid length recalc.
8199         Improve fix for macroexp crash with debugging (Bug#12118).
8200         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8201         ARRAY_MARK_FLAG when checking subscripts, because ASET is
8202         not supposed to be invoked from the garbage collector.
8203         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8204         (gc_aset): New function, which is like ASET but can be
8205         used in the garbage collector.
8206         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8207         (set_hash_index): Use it instead of ASET.
8209 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
8211         Support symlinks on latest versions of MS-Windows.
8212         * w32.c: Include winioctl.h and aclapi.h.
8213         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8214         (revert_to_self): Forward declarations of static functions.
8215         <static BOOL g_b_init_get_security_info>:
8216         <g_b_init_create_symbolic_link>: New static flags.
8217         (globals_of_w32): Initialize them to zero.
8218         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8219         (map_w32_filename): Improve commentary.  Simplify switch.
8220         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8221         headers (most versions of MinGW w32api don't).
8222         (get_security_info, create_symbolic_link)
8223         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8224         New functions.
8225         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8226         in the argument file name.
8227         (sys_access): Call unc_volume_file_attributes only if
8228         GetFileAttributes fails with network-related error codes.
8229         (sys_rename): Diagnose renaming of a symlink when the user doesn't
8230         have the required privileges.
8231         (get_file_security_desc_by_name): Rename from
8232         get_file_security_desc.
8233         (stat_worker): New function, with most of the guts of 'stat', and
8234         with addition of handling of symlinks and support for 'lstat'.
8235         If possible, get file's attributes and security information by
8236         handle, not by name.  Produce S_IFLNK bit for symlinks, when
8237         called from 'lstat'.
8238         (stat, lstat): New functions, call 'stat_worker'.
8239         (symlink, readlink, careadlinkat): Rewritten to create and resolve
8240         symlinks when the underlying filesystem supports them.
8242 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
8244         Fix macroexp crash on Windows with debugging (Bug#12118).
8245         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8246         checking subscripts; problem introduced with the recent
8247         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8248         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8249         since it's used in non-static inline functions now.
8251         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8252         Don't assume buffer size fits in 'int'.  Remove unused local.
8254         Use C99-style 'extern inline' if available.
8255         * buffer.h (BUFFER_INLINE):
8256         * category.h (CATEGORY_INLINE):
8257         * character.h (CHARACTER_INLINE):
8258         * charset.h (CHARSET_INLINE):
8259         * composite.h (COMPOSITE_INLINE):
8260         * dispextern.h (DISPEXTERN_INLINE):
8261         * lisp.h (LISP_INLINE):
8262         * systime.h (SYSTIME_INLINE):
8263         New macro, replacing 'static inline' in this header.
8264         * buffer.h, category.h, character.h, charset.h, composite.h:
8265         * dispextern.h, lisp.h, systime.h:
8266         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8267         * alloc.c (LISP_INLINE):
8268         * buffer.c (BUFFER_INLINE):
8269         * category.c (CATEGORY_INLINE):
8270         * character.c (CHARACTER_INLINE):
8271         * charset.c (CHARSET_INLINE):
8272         * composite.c (COMPOSITE_INLINE):
8273         * dispnew.c (DISPEXTERN_INLINE):
8274         * sysdep.c (SYSTIME_INLINE):
8275         Define to EXTERN_INLINE, so that the corresponding functions
8276         are compiled into code.
8277         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8278         (INLINE_HEADER_END): New macros.
8279         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8280         since it's used in non-static inline functions now.
8281         (VALMASK) [!USE_LSB_TAG]: Likewise.
8283 2012-08-02  Glenn Morris  <rgm@gnu.org>
8285         * s/: Remove empty directory.
8287         * s/ms-w32.h: Move to ../nt/inc.
8288         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8289         Update for new ms-w32.h location.
8291 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
8293         Port to Solaris 8.
8294         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8296 2012-08-02  Glenn Morris  <rgm@gnu.org>
8298         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8299         hard-coding the path separator.
8301 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
8303         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8304         This how ASET and AREF are supposed to work, and makes
8305         it easier to think about future improvements.  See
8306         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8307         * charset.h (set_charset_attr): New function.
8308         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8309         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8310         (aref_addr): New function.  All uses of &AREF(...) changed.
8311         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8312         (set_hash_index): New functions.  All lvalue-style uses of
8313         HASH_KEY etc. changed.
8314         * keyboard.c (set_prop): New function.  All lvalue-style uses
8315         of PROP changed.
8317 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
8319         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8320         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
8321         (EmacsScroller-dealloc): Adjust to use WVAR.  (Bug#12114)
8322         * nsfns.m (ns_set_name_as_filename): Likewise.
8323         * nsmenu.m (ns_update_menubar): Likewise.
8324         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8326 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
8328         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8329         Adapt to latest changes in field names of the corresponding Lisp
8330         objects.
8332         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8334 2012-08-01  Glenn Morris  <rgm@gnu.org>
8336         * s/msdos.h: Remove file.
8337         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8338         * Makefile.in (S_FILE): Remove.
8339         (config_h): Remove S_FILE.
8341 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
8343         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8344         Remove; moved to nt/config.nt.
8346 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
8348         Use INTERNAL_FIELD for conses and overlays.
8349         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8350         Remove obsolete comment.
8351         (MVAR): New macro.
8352         (struct Lisp_Overlay): Use INTERNAL_FIELD.
8353         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8355 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
8357         Use INTERNAL_FIELD for symbols.
8358         * lisp.h (SVAR): New macro.  Adjust users.
8359         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8360         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8362 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
8364         Use INTERNAL_FIELD for processes.
8365         * process.h (PVAR): New macro.  Adjust style.
8366         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8367         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8369 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
8371         Use INTERNAL_FIELD for windows.
8372         * window.h (WVAR): New macro.
8373         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8374         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8375         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8376         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8377         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8378         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8380 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
8382         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8384 2012-08-01  Glenn Morris  <rgm@gnu.org>
8386         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8387         Move to configure.ac.
8389 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
8391         * makefile.w32-in (CONFIG_H): Update dependencies.
8392         (CONF_POST_H): New macro.
8394         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8396 2012-07-31  Glenn Morris  <rgm@gnu.org>
8398         * Makefile.in (S_FILE): No longer set by configure.
8400         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8401         is available.
8402         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8404         * process.h (NULL_DEVICE):
8405         * emacs.c (SEPCHAR):
8406         * editfns.c (USER_FULL_NAME): Let configure set them.
8408         * s/README, s/template.h: Remove files.
8410         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8412         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8413         Move to configure.ac.
8415 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
8417         * .gdbinit (xframe): Adapt to introduction of FVAR and the
8418         resulting renaming of 'struct frame' members.
8420         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8422         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8423         after introduction of FVAR.
8425 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
8427         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8429         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8430         instead of compositeToPoint.
8431         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8433         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
8435 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
8437         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8438         * lisp.h (INTERNAL_FIELD): New macro.
8439         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
8440         (BVAR): Change to use INTERNAL_FIELD.
8441         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8442         (KVAR): Change to use INTERNAL_FIELD.
8443         * frame.h (FVAR): New macro.
8444         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
8445         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8446         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8447         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8448         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8450 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
8452         Miscellaneous fixes for non-default X toolkits.
8453         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8454         * xterm.c (x_frame_of_widget): Remove redundant prototype.
8455         Move under #ifdef USE_LUCID.
8456         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8457         definition and usage to avoid warnings.
8459 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
8461         * nsterm.m (openFiles): Fix previous checkin.
8463 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
8465         * indent.c (compute_motion): Remove unused local.
8467 2012-07-31  Glenn Morris  <rgm@gnu.org>
8469         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8471         * conf_post.h [USG5_4]:
8472         Move remaining contents of s/usg5-4-common.h here.
8473         * s/usg5-4-common.h: Remove file.
8475         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8476         * s/irix6-5.h: Remove file.
8478         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8479         * s/darwin.h: Remove file.
8481         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8482         * s/hpux10-20.h: Remove file, which is now empty.
8484 2012-07-30  Glenn Morris  <rgm@gnu.org>
8486         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8487         * Makefile.in (config_h): Add conf_post.h.
8488         * makefile.w32-in (CONFIG_H): Add conf_post.h.
8490 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
8492         * nsterm.m (ns_do_open_file): New variable.
8493         (ns_term_init): Set ns_do_open_file to YES after run returns.
8494         (openFile, openTempFile, openFileWithoutUI, openFiles):
8495         Open files only if ns_do_open_file.
8497 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
8499         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
8500         This no-op macro hasn't been needed for many years.
8501         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8503         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8504         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8505         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8506         gdb_make_enums_visible.
8507         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8508         (DIRECTORY_SEP): Now a constant, not a macro.
8510 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
8512         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8513         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
8515         * w32term.c <w32_keyboard_codepage>: Renamed from
8516         keyboard_codepage and now external.  All users changed.
8518         * w32term.h: Add declaration of w32_keyboard_codepage.
8520         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8521         the codepage to translate keys to Unicode.  If this argument is
8522         -1, use the value returned by GetConsoleCP.  All callers changed.
8524 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
8526         Update .PHONY listings in makefiles.
8527         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8528         bootstrap-clean, distclean, maintainer-clean, versioclean,
8529         extraclean, frc.
8531         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8532         This is a bit clearer.  Fix some commentary typos.
8534 2012-07-30  Glenn Morris  <rgm@gnu.org>
8536         * s/netbsd.h: Let configure include signal.h if needed.
8537         Remove file, which is now empty.
8539         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8540         Let configure set them.
8541         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8542         No more need to undefine.
8544 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
8546         * keymap.c (Fkey_description): Don't remove 0x80 bit from
8547         non-single-byte char when adding meta modifier.  (Bug#12090)
8549 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
8551         Convert safe_call to use variable number of arguments.
8552         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
8553         (safe_call2): Fix comment.
8554         * lisp.h (safe_call): Adjust prototype.
8555         * coding.c (encode_coding_object): Change to use safe_call2.
8556         * xfaces.c (merge_face_heights): Change to use safe_call1.
8558 2012-07-30  Glenn Morris  <rgm@gnu.org>
8560         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
8561         does that unconditionally.  Remove file, which is now empty.
8563         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8564         Remove empty files.
8566 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
8568         Export to GDB most of lisp.h's remaining object-like macros.
8569         * lisp.h (min, max): Move earlier, because they're used earlier now.
8570         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8571         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8572         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8573         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8574         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8575         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8576         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8577         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8578         Now constants, for GDB.  They need not be macros.
8579         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8580         Now constants, for GDB, as well as macros, for static initializers.
8581         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8582         Move to after the definition of struct Lisp_Char_Table,
8583         since the former now needs that type defined.
8584         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8585         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8586         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8587         New enums, for gdb_make_enums_visible.
8588         (GLYPH_MODE_LINE_FACE): Remove; unused.
8589         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
8590         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8591         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8592         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8593         enum maxargs, enum MAX_ALLOCA.
8594         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8595         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8596         no longer needed, now that they are done in lisp.h.
8598 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
8600         Cleanup string bytes checking.
8601         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
8602         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8603         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8604         (check_sblock, compact_small_strings): Simplify.
8606 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
8608         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8609         These macros are confusing and no longer need to be defined, as
8610         the enum values now suffice.  All uses replaced with definiens.
8611         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8613 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
8615         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8616         ($(BLD)/w32console.$(O)): Update dependencies.
8618 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
8620         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8621         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8622         time.  Adjust users.
8623         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
8625 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
8627         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8628         setting sitelisp (Bug#12010).
8630 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
8632         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
8634         * w32heap.c (cache_system_info):
8635         * w32.c (sys_rename):
8636         * w32proc.c (find_child_console, sys_kill): All users changed.
8638 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
8640         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8642 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
8644         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8646 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
8648         Cleanup statistics calculation in Fgarbage_collect.
8649         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8650         Fix zombies percentage calculation.  Simplify elapsed time calculation.
8652 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
8654         Generalize marker debugging code under MARKER_DEBUG and use eassert.
8655         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8656         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8657         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8658         (replace_range, replace_range_2, del_range_2): Change to eassert.
8659         * marker.c (byte_char_debug_check): Adjust style.
8661 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
8663         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8664         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8665         long-ago-commented-out code that talks about "WIN32".
8666         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8667         All uses changed.
8669 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
8671         Use Gnulib stdalign module (Bug#9772, Bug#9960).
8672         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8673         Simplify by using alignof.
8674         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8675         * lisp.h: Include <stdalign.h>.
8676         (GCALIGNMENT): New macro and constant.
8677         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
8678         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8679         (stdalign): New macro, if not already defined.
8681 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
8683         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
8684         * w32inevt.c: Include w32inevt.h.
8685         (w32_read_console_input): New inline function, calls either
8686         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8687         w32_console_unicode_input.
8688         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8689         (w32_kbd_patch_key, key_event): Use the codepage returned by
8690         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8691         (key_event): use uChar.UnicodeChar only if
8692         w32_console_unicode_input is non-zero.
8694         * w32console.c: Include w32heap.h.
8695         <w32_console_unicode_input>: New global variable.
8696         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8697         family of Windows, zero otherwise.
8699         * w32inevt.h: Declare w32_console_unicode_input.
8701         * xdisp.c (init_iterator): Don't reference tip_frame in a build
8702         --without-x.  (Bug#11742)
8704 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
8706         Adjust GDB to reflect pvec_type changes (Bug#12036).
8707         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
8708         2012-07-04 changes to pseudovector representation.
8709         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
8711 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
8713         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8714         bus address.
8715         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8717 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
8719         * alloc.c (listn): Fix the order the arguments are consed onto the
8720         list.
8722         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8723         enumeration constants, as PURE and HEAP are too general, and clash
8724         with other headers and sources, such as gmalloc.c and the
8725         MS-Windows system headers.  All users changed.
8727 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
8729         Revert last save_excursion_save and save_excursion_restore changes.
8730         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8731         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8733 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
8735         Fix recently-introduced typos in Windows port.
8736         Reported by Martin Rudalics <rudalics@gmx.at>.
8737         * w32.c (init_environment): Replace comma with semicolon.
8738         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
8740 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
8742         Improve GDB symbol export (Bug#12036).
8743         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8744         arms of an 'if', not using conditional expressions; otherwise GDB
8745         complains about the types in the unevaluated arm when the argument
8746         is an integer literal.
8747         (xgetint): Simplify expression.
8748         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
8749         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
8750         Zaretskii in <http://bugs.gnu.org/12036#13>.
8751         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
8752         needed now that we have gdb_make_enums_visible.
8753         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8754         (enum enum_USE_LSB_TAG):
8755         New enum types, packaging up enums that need to be exported to GDB.
8757 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
8759         Utility function to make a list from specified amount of objects.
8760         * lisp.h (enum constype): New datatype.
8761         (listn): New prototype.
8762         * alloc.c (listn): New function.
8763         (Fmemory_use_count, syms_of_alloc): Use it.
8764         * buffer.c (syms_of_buffer): Likewise.
8765         * callint.c (syms_of_callint): Likewise.
8766         * charset.c (define_charset_internal): Likewise.
8767         * coding.c (syms_of_coding): Likewise.
8768         * keymap.c (syms_of_keymap): Likewise.
8769         * search.c (syms_of_search): Likewise.
8770         * syntax.c (syms_of_syntax): Likewise.
8771         * w32.c (init_environment): Likewise.
8772         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8773         * xdisp.c (syms_of_xdisp): Likewise.
8774         * xfns.c (syms_of_xfns): Likewise.
8776 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
8778         Fast save_excursion_save and save_excursion_restore.
8779         * lisp.h (struct Lisp_Excursion): New data type.
8780         (PVEC_EXCURSION): New pseudovector type.
8781         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8782         to deal with it.  Adjust comments.
8783         (init_marker, attach_marker): New prototype.
8784         (unchain_marker): Adjust prototype.
8785         * marker.c (attach_marker): Change to global.
8786         (init_marker): New function.
8787         * alloc.c (Fmake_marker, build_marker): Use it.
8788         (build_marker): More easserts.
8789         (mark_object): Handle struct Lisp_Excursion.
8790         * editfns.c (save_excursion_save, save_excursion_restore):
8791         Reimplement to use struct Lisp_Excursion.  Add comments.
8793 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
8795         Fix export of symbols to GDB (Bug#12036).
8796         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8797         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8798         emacs.c, as this is a more-suitable home.  Had this been done earlier
8799         the fix for 12036 would have avoided some of the problems noted in
8800         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8801         would have been more obvious.
8802         * emacs.c: Do not include <verify.h>; no longer needed.
8803         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
8804         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8805         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8806         Remove; now done in lisp.h.
8807         * lisp.h (PUBLISH_TO_GDB): New macro.
8808         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8809         (DATA_SEG_BITS): Use it.
8810         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8811         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8812         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8813         not be usable in #if.  This simplifies things.
8815 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
8817         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8819 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
8821         Simplify export of symbols to GDB (Bug#12036).
8822         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8823         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8824         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8825         Adjust to changes in lisp.h and emacs.c, by using
8826         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8827         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8828         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8829         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8830         instead of gdb_valbits.
8831         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8832         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8833         instead of gdb_array_mark_flag.
8834         (xboolvector): Get size from $->size, not $->header.size.
8835         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8836         (xreload, hook-run, hookpost-run): Remove.
8837         * emacs.c: Include <verify.h>.
8838         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8839         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8840         Remove.
8841         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8842         (gdb_USE_LSB_TAG): New enum constants.
8843         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8844         Also define these as enum constants, so they're visible to GDB.
8845         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8846         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8847         as constants, so they're visible to GDB.
8848         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8849         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8850         Now enum constants, not macros, so they're visible to GDB.
8851         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8852         more convenient now.  All uses changed.
8853         (VALMASK) [USE_LSB_TAG]: Also define in this case.
8854         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8856 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
8858         Explicitly free restriction data that are not needed anymore.
8859         * editfns.c (save_restriction_restore): Free restriction data.
8861 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
8863         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
8864         add argument, tune behavior, and adjust all callers.
8866 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
8868         Use typedef for EMACS_INT, EMACS_UINT.
8869         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
8870         than macros.  This simplifies debugging in the usual case, since
8871         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
8872         and it allows expressions involving EMACS_INT casts.
8873         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
8875 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
8877         * nsterm.m (ns_read_socket): Return early if there is a modal
8878         window (Bug#12043).
8880 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
8882         * frame.c (Fredirect_frame_focus): In doc-string don't mention
8883         that FOCUS-FRAME can be omitted.
8885 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
8887         Adjust buffer text indirection counters at the end of Fkill_buffer.
8888         * buffer.c (Fkill_buffer): Adjust indirection counters when the
8889         buffer is definitely dead.  This should really fix an issue reported
8890         by Christoph Scholtes again.  (Bug#12007).
8891         (init_buffer_once): Initialize indirection counters of
8892         buffer_defaults and buffer_local_symbols (for sanity and safety).
8894 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
8896         * xdisp.c (init_iterator): Don't compute dimensions of truncation
8897         and continuation glyphs on tooltip frames, leave them at zero.
8898         Avoids continued lines in tooltips.  (Bug#11832)
8900 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
8902         Simplify copy_overlay.
8903         * buffer.c (copy_overlay): Simplify.  Use build_marker.
8904         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
8906 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
8908         * print.c (print_object): Don't crash when a frame's name is nil
8909         or invalid.  (Bug#12025)
8911         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
8912         it signals an error when a tooltip frame is being created.
8914 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
8916         Cleanup miscellaneous objects allocation and initialization.
8917         * alloc.c (allocate_misc): Change to static.  Add argument to
8918         specify the subtype.  Adjust comment and users.
8919         (build_overlay): New function.
8920         * buffer.c (copy_overlays, Fmake_overlay): Use it.
8921         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
8922         (allocate_misc): Remove prototype.
8923         (build_overlay): Add prototype.
8925 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
8927         Swap buffer text indirection counters in Fbuffer_swap_text.
8928         * buffer.c (Fbuffer_swap_text): Swap indirections too.
8929         This avoids crash reported by Christoph Scholtes at
8930         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
8932 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
8934         * nsmenu.m (Popdown_data): New struct.
8935         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
8936         free Popdown_data.
8937         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
8938         (initWithContentRect): Make imgView and contentView non-static
8939         and autorelease them.  Also autorelease img and matrix (Bug#12005).
8940         (dealloc): Remove (Bug#12005).
8942 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
8944         Adjust consing_since_gc when objects are explicitly freed.
8945         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
8946         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
8947         (free_cons, free_misc): Subtract object size from consing_since_gc.
8949 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
8951         Simplify and cleanup markers positioning code.
8952         * marker.c (attach_marker): More useful eassert.
8953         (live_buffer, set_marker_internal): New function.
8954         (Fset_marker, set_marker_restricted): Use set_marker_internal.
8955         (set_marker_both, set_marker_restricted_both): Use live_buffer.
8957 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
8959         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
8960         as it's limited by the amount of memory, not by INT_MAX.
8962 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
8964         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
8965         in special-event-map.  See the discussion at
8966         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
8967         for the reasons.
8969         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
8970         info.dwItemData.  Fixes crashes on 64-bit Windows.
8971         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
8973 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
8975         * nsterm.m (accessibilityAttributeValue): New function.  (Bug#11134).
8976         (conversationIdentifier): Return value is NSInteger.
8977         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
8979 2012-07-21  Chong Yidong  <cyd@gnu.org>
8981         * window.c (decode_any_window): Signal an error if the window is
8982         on a dead frame (Bug#11984).
8984 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
8986         Add indirection counting to speed up Fkill_buffer.
8987         * buffer.h (struct buffer): New member.
8988         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
8989         (Fmake_indirect_buffer): Set indirection counter to -1, increment
8990         base buffer indirection counter.
8991         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
8992         (Fkill_buffer): Adjust indirection counters as needed, don't walk
8993         through buffer list if indirection counter is 0.
8995 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
8997         Extend the value returned by Fgarbage_collect with heap statistics.
8998         * alloc.c (Qheap): New symbol.
8999         (syms_of_alloc): DEFSYM it.
9000         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9001         (Fmemory_free): Remove.
9002         (syms_of_alloc): Don't defsubr it.
9003         * buffer.c (Fcompact_buffer): Remove.
9004         (syms_of_buffer): Don't defsubr it.
9006 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
9008         Make maybe_gc inline.
9009         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9010         * lisp.h (consing_since_gc, gc_relative_threshold)
9011         (memory_full_cons_threshold): Revert declaration.
9012         (maybe_gc): Remove prototype, define as inline.
9013         * alloc.c: Remove old commented-out code.
9014         (consing_since_gc, gc_relative_threshold)
9015         (memory_full_cons_threshold): Revert to global.
9016         (maybe_gc): Remove.
9018 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
9020         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9021         * lisp.h (build_unibyte_string): New function.
9022         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9023         * sysdep.c, w32fns.c, xfns.c: Use it.
9024         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9025         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9026         Adjust users accordingly.
9027         * font.h (font_open_by_name): Adjust prototype.
9029 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
9031         Cleanup calls to Fgarbage_collect.
9032         * lisp.h (maybe_gc): New prototype.
9033         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9034         Remove declarations.
9035         * alloc.c (maybe_gc): New function.
9036         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9037         Make them static.
9038         * bytecode.c (MAYBE_GC): Use maybe_gc.
9039         * eval.c (eval_sub, Ffuncall): Likewise.
9040         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
9041         to avoid dependency from auto-save feature.
9043 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
9045         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9046         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9047         'for_each_per_buffer_object_at'.
9048         All uses changed.  It's better to use upper-case for macros that
9049         cannot be implemented as functions, to give the reader a clue
9050         that they're special.
9052 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
9054         * alloc.c (Fgarbage_collect): Tweak docstring.
9056 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
9058         Tweak the value returned from Fgarbage_collect again.
9059         * alloc.c (Fgarbage_collect): New return value, as confirmed in
9060         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9061         Adjust documentation.
9062         (total_vector_bytes): Rename to total_vector_slots, adjust
9063         accounting.
9064         (total_free_vector_bytes): Rename to total_free_vector_slots,
9065         adjust accounting.
9066         (Qstring_bytes, Qvector_slots): New symbols.
9067         (syms_of_alloc): DEFSYM them.
9069 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
9071         Buffer compaction primitive which may be used from Lisp.
9072         * buffer.c (compact_buffer, Fcompact_buffer): New function.
9073         (syms_of_buffer): Register Fcompact_buffer.
9074         * alloc.c (Fgarbage_collect): Use compact_buffer.
9075         * buffer.h (compact_buffer): New prototype.
9076         (struct buffer_text): New member.
9078 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
9080         New macro to iterate over all buffers, miscellaneous cleanups.
9081         * lisp.h (all_buffers): Remove declaration.
9082         * buffer.h (all_buffers): Add declaration, with comment.
9083         (for_each_buffer): New macro.
9084         * alloc.c (Fgarbage_collect, mark_object): Use it.
9085         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9086         (init_buffer): Likewise.
9087         * data.c (Fset_default): Likewise.
9088         * coding.c (code_conversion_restore): Remove redundant check
9089         for dead buffer.
9090         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
9092 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
9094         Fix bug that created negative-length intervals.
9095         * intervals.c (merge_interval_right, merge_interval_left):
9096         Do not zero out this interval if it is absorbed by its children,
9097         as this interval's total length doesn't change in that case.  See
9098         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9100 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
9102         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9103         when invoking (make-bool-vector N t) and N is a positive
9104         multiple of 8 -- the last 8 bits were mistakenly cleared.
9106         Remove some struct layout assumptions in bool vectors.
9107         * alloc.c (bool_header_size): New constant.
9108         (header_size, word_size): Move earlier, as they're now used earlier.
9109         Use 'word_size' in a few more places, where it's appropriate.
9110         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9111         padding before the data member of a bool vector.
9112         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9113         than doing the check by hand with an abort ().
9115 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
9117         * eval.c (Fdefvar): Don't check constants since we only set the var if
9118         it's not yet defined anyway (bug#11904).
9120         * lisp.h (last_undo_boundary): Declare new var.
9121         * keyboard.c (command_loop_1): Set it.
9122         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9123         were auto-added by the command loop (bug#11774).
9125 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
9127         * w32font.c (Qsymbol): Remove local definition.
9128         (syms_of_w32font): Don't DEFSYM it.
9130 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
9132         Fix sweep_vectors to handle large bool vectors correctly.
9133         * alloc.c (sweep_vectors): Account total_vector_bytes for
9134         bool vectors larger than VBLOCK_BYTES_MAX.
9136 2012-07-18  Chong Yidong  <cyd@gnu.org>
9138         * frame.c (x_set_frame_parameters): Revert bogus change introduced
9139         in 2012-05-25 commit by Paul Eggert (Bug#11738).
9141 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
9143         Return more descriptive data from Fgarbage_collect.
9144         Suggested by Stefan Monnier in
9145         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9146         * alloc.c (bounded_number): New function.
9147         (total_buffers, total_vectors): New variable.
9148         (total_string_size): Rename to total_string_bytes, adjust users.
9149         (total_vector_size): Rename to total_vector_bytes, adjust users.
9150         (sweep_vectors): Account total_vectors and total_vector_bytes.
9151         (Fgarbage_collect): New return value.  Adjust documentation.
9152         (gc_sweep): Account total_buffers.
9153         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9154         (VECTOR_SIZE): Remove.
9155         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9156         (Qinterval, Qmisc): New symbols.
9157         (syms_of_data): Initialize them.
9158         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9159         (Qcons, Qbuffer): New declarations.
9161 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
9163         * alloc.c (Fmemory_free): Account for memory-free's own storage.
9164         Round up, not down.  Improve doc.
9166 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9168         Restore old code in allocate_string_data to avoid Faset breakage.
9169         Reported by Julien Danjou <julien@danjou.info> in
9170         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9171         * alloc.c (allocate_string_data): Restore old code with minor
9172         adjustments, fix comment to explain this subtle issue.
9174 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
9176         Remove FILE_SYSTEM_CASE.
9177         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9179         * fileio.c (FILE_SYSTEM_CASE): Don't define.
9180         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9181         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9182         call-process-region passes it through expand-file-name.
9184         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9186 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
9188         Fix crash when creating indirect buffer (Bug#11917)
9189         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9190         Don't handle unbound variables specially if non-zero.
9191         (Fbuffer_local_variables): Pass zero.
9192         (clone_per_buffer_values): Pass non-zero.
9194 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
9196         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
9197         to make the loop interruptible.
9199 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
9201         * gnutls.c (emacs_gnutls_handshake): Only retry if
9202         GNUTLS_E_INTERRUPTED.
9204 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9206         Cleanup and convert miscellaneous checks to eassert.
9207         * alloc.c (mark_interval): Fix comment, partially rephrase
9208         old comment from intervals.h (see below).
9209         * intervals.c (find_interval, adjust_intervals_for_insertion)
9210         (delete_interval, adjust_intervals_for_deletion)
9211         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9212         Convert to eassert.
9213         (adjust_intervals_for_insertion, make_new_interval):
9214         Remove obsolete and unused code.
9215         * intervals.h (struct interval): Remove obsolete comment.
9216         * textprotp.c (erase_properties): Remove unused code.
9217         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9218         (Fremove_list_of_text_properties): Convert to eassert.
9220 2012-07-17  Chong Yidong  <cyd@gnu.org>
9222         * editfns.c (Finsert_char): Doc fix.
9224 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9226         Fix previous change to make Fmemory_free always accurate.
9227         * alloc.c (make_interval): Update total_free_intervals.
9228         (make_float): Likewise for total_free_floats.
9229         (free_cons, Fcons): Likewise for total_free_conses.
9230         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9231         Likewise for total_free_vector_bytes.
9232         (Fmake_symbol): Likewise for total_free_symbols.
9233         (bytes_free): Remove.
9235 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9237         Simple free memory accounting feature.
9238         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9239         (sweep_vectors): Accumulate size of free vectors.
9240         (Fgarbage_collect): Setup bytes_free.
9241         (Fmemory_free): New function.
9242         (syms_of_alloc): Register it.
9244 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
9246         Cleanup overlays checking.
9247         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9248         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9249         eassert and OVERLAYP.
9250         (sort_overlays): Change to use OVERLAYP.
9252 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
9254         * editfns.c (Finsert_char): Make it interactive, and make the
9255         second arg optional.  Copy interactive spec and docstring from
9256         ucs-insert.
9258 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
9260         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9261         Unlike the other wrapped functions, fabs has an unspecified
9262         effect on errno.
9264 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
9266         * nsterm.m (keyDown): Interpret flags without left/right bits
9267         as the left key (Bug#11670).
9269 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
9271         Remove empty and useless init functions.
9272         * lisp.h (init_character_once, init_fns, init_image)
9273         (init_filelock, init_sound): Remove prototype.
9274         * character.c (init_character_once): Remove.
9275         * filelock.c (init_filelock): Likewise.
9276         * fns.c (init_fns): Likewise.
9277         * image.c (init_image): Likewise.
9278         * sound.c (init_sound): Likewise.
9279         * emacs.c (main): Adjust accordingly.
9281 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
9283         * gtkutil.h: Tiny cleanups.
9284         (use_old_gtk_file_dialog): Remove useless declaration.
9285         (xg_uses_old_file_dialog): Add suggested const attribute.
9287 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
9289         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9290         (bidi_paragraph_init): Use it to limit search forward for a strong
9291         directional character in abnormally large paragraphs full of
9292         neutral or weak characters.  (Bug#11943)
9294 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
9296         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9297         the toolbar (Bug#9451).
9298         (xg_make_tool_item): Give the widget event box a transparent
9299         background.
9301 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
9303         Cleanup basic allocation variables and functions.
9304         * alloc.c (ignore_warnings, init_intervals, init_float)
9305         (init_cons, init_symbol, init_marker): Remove.
9306         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9307         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9308         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9309         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9310         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9311         (staticidx, init_alloc_once, init_strings, free_ablock):
9312         Remove redundant initialization.
9313         * fns.c (init_weak_hash_tables): Remove.
9314         * lisp.h (init_weak_hash_tables): Remove prototype.
9316 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
9318         Use zero_vector where appropriate.
9319         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
9320         accordingly.
9321         * lisp.h (zero_vector): New declaration.
9322         * font.c (null_vector): Remove.
9323         (syms_of_font): Remove initialization and staticpro.
9324         (font_list_entities, font_find_for_lface): Change to use zero_vector.
9325         * keymap.c (Faccessible_keymaps): Likewise.
9327 2012-07-15  Leo Liu  <sdl.web@gmail.com>
9329         * fringe.c: Fix typo in comments.
9331 2012-07-14  Leo Liu  <sdl.web@gmail.com>
9333         * fringe.c: Add a new bitmap exclamation-mark.
9335 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
9337         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9339         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9340         (HAVE_MENUS): Don't define, defined by editing config.in with
9341         msdos/sed2v2.inp.
9342         (GMALLOC_INHIBIT_VALLOC): Don't define.
9343         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9345 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
9347         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9349 2012-07-14  Glenn Morris  <rgm@gnu.org>
9351         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9352         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9353         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9355 2012-07-13  Glenn Morris  <rgm@gnu.org>
9357         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9359         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9360         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9362 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
9364         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9365         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9366         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9367         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9368         where appropriate.
9369         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9370         as boolean expression.
9371         (x_set_window_size): Remove unused variable toolbar.
9372         (ns_get_color_default, ns_mod_to_lisp): Remove.
9373         (ns_mouse_position): Remove unused variables xchar and ychar.
9374         (ns_compute_glyph_string_overhangs): Remove unused variable face.
9375         (ns_set_vertical_scroll_bar): Remove unused variable count.
9376         (ns_delete_terminal): Remove unused variable i.
9377         (ns_term_init): Remove unused variables r, g and b.
9378         (mouseDown): Remove unused variable window.
9379         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9380         (initFrameFromEmacs): Remove unused variable vbextra.
9381         (mouseEntered): Remove unused variables p and dpyinfo.
9382         (mouseExited): Remove unused variables p and r.
9383         (ns_define_frame_cursor, ns_clear_frame_area)
9384         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9385         (menuDown): Assign [sender tag] to variable and cast the variable.
9387         * nsterm.h (menuDown): Add id as type to argument sender.
9388         (ns_display_info_for_name): Add Lisp_Object argument.
9389         (ns_term_init): Add Lisp_Object argument.
9390         (ns_map_event_to_object): Add void argument.
9391         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9392         prototype with arguments and only declare if __OBJC__.
9393         (nxatoms_of_nsselect): Add void argument.
9394         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9395         (ns_alloc_autorelease_pool): Add void argument.
9396         (ns_release_autorelease_pool): Add void* argument.
9397         (ns_get_defaults_value): Add const char* argument.
9399         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9400         (initFromContents): Use SSDATA where appropriate.
9401         (ns_update_menubar): Add braces to ambigous if-else.
9402         (initWithTitle): Put () around assignment in if statement.
9403         (ns_menu_show): Remove unused variables window and keymap.
9404         (update_frame_tool_bar): Remove unused variable selected_p.
9405         (initWithContentRect): Remove unused variable this_cmd_name.
9407         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9408         appropriate.
9409         (setXBMColor): Remove unused variable len.
9410         (setPixmapData): Put () around assignment in loop statement.
9412         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9413         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9414         where appropriate.
9415         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9416         around assignment in loop statement.
9417         (nsfont_open): Remove unused variable i.
9418         (nsfont_open): Remove unused variable len.
9419         (nsfont_draw): Remove unused variable cs.
9421         * nsfns.m (x_set_icon_name, ns_set_name_internal)
9422         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9423         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9424         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9425         (Fns_font_name, Fns_perform_service)
9426         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9427         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9428         (ns_set_name): Remove unused variable view.
9429         (x_set_menu_bar_lines): Remove unused variable olines.
9430         (x_set_tool_bar_lines): Remove unused variable root_window.
9431         (Fns_list_colors): Put () around assignment in while statement.
9432         (Fns_perform_service): Remove unused variable len.
9433         (Fns_display_usable_bounds): Remove unused variable top.
9434         (syms_of_nsfns): Remove unused variable i.
9436         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9437         memcpy (Bug#11907).
9439 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
9441         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9442         and free it with DestroyExceptionInfo (Bug#11558).
9444 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
9446         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9447         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9448         Set here, not in nt/config.nt.
9450 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
9452         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9453         cursor overflow into the last glyph on display line when the right
9454         fringe is off.  (Bug#11832)
9456 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
9458         * xdisp.c (produce_special_glyphs): Now static.
9459         * dispextern.h (produce_special_glyphs): Remove decl.
9461 2012-07-13  Glenn Morris  <rgm@gnu.org>
9463         * s/bsd-common.h, s/cygwin.h: Remove empty files.
9464         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9466         * s/usg5-4-common.h (USG, USG5):
9467         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9468         * s/sol2-6.h (SOLARIS2):
9469         * s/irix6-5.h (IRIX6_5):
9470         * s/hpux10-20.h (USG, USG5, HPUX):
9471         * s/gnu-linux.h (USG, GNU_LINUX):
9472         * s/freebsd.h (BSD_SYSTEM):
9473         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9474         * s/cygwin.h (CYGWIN):
9475         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9476         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9478 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
9480         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
9482 2012-07-13  Glenn Morris  <rgm@gnu.org>
9484         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9486         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9488         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9489         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9491 2012-07-12  Glenn Morris  <rgm@gnu.org>
9493         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
9495         * process.c (init_process_emacs): Rename from init_process.
9496         The old name is also the name of a Mach system call.
9497         * lisp.h, emacs.c: Update for this name change.
9498         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9499         longer needed.
9501 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
9503         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9504         memmove call that removes glyphs covered by the left truncation
9505         glyph.  Improve commentary.
9506         (display_line): Fix display of continuation glyphs on GUI frames
9507         when the right fringe is turned off and variable-size fonts are
9508         used in the window.  Move the code that appends a stretch glyph to
9509         produce_special_glyphs, so that it could be used for truncation
9510         and continuation glyphs alike.
9511         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9512         glyph of a suitably computed width, to align the special glyphs at
9513         the window margin.  Code moved from display_line.  (Bug#11832)
9515 2012-07-12  Glenn Morris  <rgm@gnu.org>
9517         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9519         * s/gnu-linux.h, s/hpux10-20.h:
9520         Do not unconditionally define HAVE_XRMSETDATABASE.
9522         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9524 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
9526         Fix typos that broke OS X build.
9527         Reported by Randal L. Schwartz in
9528         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9529         * nsterm.m (ns_timeout): Add missing local decl.
9530         (ns_get_color): snprintf -> sprintf, to fix typo.
9532 2012-07-12  Glenn Morris  <rgm@gnu.org>
9534         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9535         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9536         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9537         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9539         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9540         Move PTY_OPEN to configure.
9542         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9543         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9544         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9546 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
9548         Use empty_unibyte_string where applicable.
9549         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9550         * lread.c (read1): Likewise.
9551         * xsettings.c (syms_of_xsettings): Likewise.
9553 2012-07-12  Glenn Morris  <rgm@gnu.org>
9555         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9556         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
9557         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9558         * s/hpux10-20.h (RUN_TIME_REMAP):
9559         * s/bsd-common.h (TABDLY): Move to configure.
9561         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9563         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9565         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9566         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
9568         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
9570         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9571         * s/template.h: Move NARROWPROTO to configure.
9573 2012-07-11  Glenn Morris  <rgm@gnu.org>
9575         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9576         unused since 2011-01-17 change to systty.h.
9578         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9579         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9580         Move HAVE_PTYS and HAVE_SOCKETS to configure.
9582 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
9584         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
9586 2012-07-11  Glenn Morris  <rgm@gnu.org>
9588         * s/darwin.h, s/gnu-linux.h, s/template.h:
9589         Move INTERRUPT_INPUT to configure.
9591 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
9593         Minor adjustments to interning code.
9594         * lisp.h (intern, intern_c_string): Redefine as static inline
9595         wrappers for intern_1 and intern_c_string_1, respectively.
9596         (intern_1, intern_c_string_1): Rename prototypes.
9597         * lread.c (intern_1, intern_c_string_1, oblookup):
9598         Simplify Vobarray checking.
9599         * font.c (font_intern_prop): Likewise.  Adjust comment.
9600         * w32font.c (intern_font_name): Likewise.
9602 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
9604         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9606         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9607         of Fcar/Fcdr if possible.
9608         * font.c (check_otf_features): Likewise.
9609         * fontset.c (Fnew_fontset): Likewise.
9610         * gnutls.c (Fgnutls_boot): Likewise.
9611         * minibuf.c (read_minibuf): Likewise.
9612         * msdos.c (IT_set_frame_parameters): Likewise.
9613         * xmenu.c (Fx_popup_dialog): Likewise.
9614         * w32menu.c (Fx_popup_dialog): Likewise.
9616 2012-07-11  Glenn Morris  <rgm@gnu.org>
9618         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9619         since nothing has defined it on these platforms.
9621         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9622         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9624         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9625         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9626         Move CLASH_DETECTION to configure.
9628         * s/gnu.h: Remove file, which is now empty.
9630         * s/gnu.h, s/gnu-linux.h:
9631         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9633 2012-07-11  John Wiegley  <johnw@newartisans.com>
9635         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9636         function attribute, so we only use it if it exists in the
9637         compiler.
9639 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
9641         Avoid call to strlen in fast_c_string_match_ignore_case.
9642         * search.c (fast_c_string_match_ignore_case): Change to use
9643         length argument.  Adjust users accordingly.
9644         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9646 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
9648         Assume mkdir, rmdir.
9649         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9650         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9652         Assume rename.
9653         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9655         Assume perror.
9656         * s/hpux10-20.h (HAVE_PERROR): Remove.
9657         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9658         Remove dummy definition, as this problem was obsolete long ago.
9660         Assume strerror.
9661         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9663 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
9665         Avoid calls to strlen in font processing functions.
9666         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
9667         (font_open_by_name): Change to use length argument.
9668         Adjust users accordingly.
9669         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9670         Adjust prototypes.
9671         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9672         Change to return ptrdiff_t.
9673         (xfont_list_pattern, xfont_match): Use length returned by
9674         xfont_decode_coding_xlfd.
9675         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9677 2012-07-11  Glenn Morris  <rgm@gnu.org>
9679         * s/darwin.h, s/freebsd.h, s/netbsd.h:
9680         Move DONT_REOPEN_PTY to configure.
9682         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9683         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9685 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
9687         Remove "#define unix" that is no longer needed (Bug#11905).
9688         * s/aix4-2.h (unix): Remove; no longer needed.
9690         EMACS_TIME simplification (Bug#11875).
9691         This replaces macros (which typically do not work in GDB)
9692         with functions, typedefs and enums, making the code easier to debug.
9693         The functional style also makes code easier to read and maintain.
9694         * systime.h: Include <sys/time.h> on all hosts, not just if
9695         WINDOWSNT, since 'struct timeval' is needed in general.
9696         (EMACS_TIME): Now a typedef, not a macro.
9697         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9698         not macros.
9699         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9700         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9701         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9702         (EMACS_TIME_LE): Now functions, not macros.
9703         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9704         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9705         which are not functions.  All uses rewritten to use:
9706         (make_emacs_time): New function.
9707         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9708         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9709         not functions.  All uses rewritten to use the following, respectively:
9710         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9711         (add_emacs_time, sub_emacs_time): New functions.
9712         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
9713         * fileio.c (Fcopy_file):
9714         * xterm.c (XTflash): Get the current time closer to when it's used.
9715         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9717         * bytecode.c (targets): Suppress -Woverride-init warnings.
9719         Simplify by avoiding confusing use of strncpy etc.
9720         * doc.c (Fsnarf_documentation):
9721         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9722         * frame.c (Fmake_terminal_frame):
9723         * gtkutil.c (get_utf8_string):
9724         * lread.c (openp):
9725         * nsmenu.m (ns_update_menubar):
9726         * regex.c (regerror):
9727         Prefer memcpy to strncpy and strncat when either will do.
9728         * fileio.c (Fsubstitute_in_file_name):
9729         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9730         (menu_separator_name_p):
9731         * nsmenu.m (ns_update_menubar):
9732         Prefer memcmp to strncmp when either will do.
9733         * nsterm.m: Include <ftoastr.h>.
9734         (ns_get_color):
9735         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9736         Prefer snprintf to strncpy.
9737         * nsterm.m (ns_term_init):
9738         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9739         * nsterm.m (ns_term_init):
9740         Avoid the need for strncpy, by using build_string or
9741         make_unibyte_string directly.  Use dtoastr, not snprintf.
9742         * process.c (Fmake_network_process): Diagnose service names that
9743         are too long, rather than silently truncating them or creating
9744         non-null-terminated names.
9745         (Fnetwork_interface_info): Likewise, for interface names.
9746         * sysdep.c (system_process_attributes) [GNU_LINUX]:
9747         Prefer sprintf to strncat.
9748         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9749         Prefer vsnprintf to vsprintf + strncpy.
9751 2012-07-10  Glenn Morris  <rgm@gnu.org>
9753         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9754         Clarify fallback case.
9756 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
9758         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9759         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9760         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
9761         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
9762         where argument type is known to be a Lisp_Cons.
9764 2012-07-10  Tom Tromey  <tromey@redhat.com>
9766         * bytecode.c (BYTE_CODE_THREADED): New macro.
9767         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
9768         (enum byte_code_op): New type.
9769         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9770         (exec_byte_code): Use them.  Use token threading when applicable.
9772 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
9774         Optimize pure C strings initialization.
9775         * lisp.h (make_pure_string): Fix prototype.
9776         (build_pure_c_string): New function, defined as static inline.  This
9777         provides a better opportunity to optimize away calls to strlen when
9778         the function is called with compile-time constant argument.
9779         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
9780         argument, adjust users accordingly.  Use build_pure_c_string where
9781         appropriate.
9782         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9783         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9784         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9786 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
9788         Avoid calls to strlen in miscellaneous functions.
9789         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9790         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
9791         * lread.c (openp): Likewise.
9793 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
9795         Avoid calls to strlen in path processing functions.
9796         * fileio.c (file_name_as_directory): Add comment.  Change to add
9797         srclen argument and return the length of result.  Adjust users
9798         accordingly.
9799         (directory_file_name): Fix comment.  Change to add srclen argument,
9800         swap 1st and 2nd arguments to obey the common convention.
9801         Adjust users accordingly.
9802         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9804 2012-07-10  Glenn Morris  <rgm@gnu.org>
9806         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9807         Move PENDING_OUTPUT_COUNT definition to configure.
9809         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9810         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9811         * s/gnu.h (DATA_START): Move definitions to configure.
9813         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9814         We include usg5-4-common.h, which defines them both.
9816         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9817         O_RDONLY already includes it).
9819         Stop ns builds setting the EMACSLOADPATH environment variable.
9820         * nsterm.m (ns_load_path): Rename from ns_init_paths.
9821         Now it does not set EMACSLOADPATH, just returns the load-path string.
9822         * nsterm.h: Update accordingly.
9823         * lread.c [HAVE_NS]: Include nsterm.h.
9824         (init_lread) [HAVE_NS]: Use ns_load_path.
9825         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9827 2012-07-09  Glenn Morris  <rgm@gnu.org>
9829         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9830         since the included bsd-common.h does so.
9832         Stop ns builds setting the EMACSPATH environment variable.
9833         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9834         (ns_init_paths): Do not set EMACSPATH.
9835         * nsterm.h (ns_exec_path): Add it.
9836         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9837         Use ns_exec_path.
9839         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9841 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
9843         * process.c (wait_reading_process_output): 'waitchannels' was unset
9844         when read_kbd || !NILP (wait_for_cell); fix this.
9846         Add GCC-style 'const' attribute to functions that can use it.
9847         * character.h (char_resolve_modifier_mask):
9848         * keyboard.h (make_ctrl_char):
9849         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9850         (init_character_once, next_almost_prime, init_fns, init_image)
9851         (flush_pending_output, init_sound):
9852         * mem-limits.h (start_of_data):
9853         * menu.h (finish_menu_items):
9854         Add ATTRIBUTE_CONST.
9855         * emacs.c (DEFINE_DUMMY_FUNCTION):
9856         Declare the dummy function with ATTRIBUTE_CONST.
9857         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9858         Add decls with ATTRIBUTE_CONST.
9860         Minor improvements to make_formatted_string.
9861         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
9862         where int is good enough, as vsprintf returns an int.
9863         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
9865 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
9867         Use make_formatted_string to avoid double length calculation.
9868         * lisp.h (make_formatted_string): New prototype.
9869         * alloc.c (make_formatted_string): New function.
9870         * buffer.c (Fgenerate_new_buffer_name): Use it.
9871         * dbusbind.c (syms_of_dbusbind): Likewise.
9872         * editfns.c (Fcurrent_time_zone): Likewise.
9873         * filelock.c (get_boot_time): Likewise.
9874         * frame.c (make_terminal_frame, set_term_frame_name)
9875         (x_report_frame_params): Likewise.
9876         * image.c (gs_load): Likewise.
9877         * minibuf.c (get_minibuffer): Likewise.
9878         * msdos.c (dos_set_window_size): Likewise.
9879         * process.c (make_process): Likewise.
9880         * xdisp.c (ensure_echo_area_buffers): Likewise.
9881         * xsettings.c (apply_xft_settings): Likewise.
9883 2012-07-09  Glenn Morris  <rgm@gnu.org>
9885         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
9886         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
9887         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
9888         * nsterm.h (ns_etc_directory): Add it.
9889         * callproc.c [HAVE_NS]: Include nsterm.h.
9890         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
9892 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
9894         Move marker debugging code under MARKER_DEBUG.
9895         * marker.c (MARKER_DEBUG): Move marker debugging code under
9896         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
9897         for bootstrap with --enable-checking (~3x slowdown reported
9898         by Juanma Barranquero <lekktu@gmail.com>).
9899         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
9901 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
9903         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
9904         See <http://bugs.gnu.org/11825#29>.
9906 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
9908         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
9909         has no font, use the frame's font.  (Bug#11813)
9910         (display_line): Add commentary about displaying truncation glyphs
9911         on GUI frames.
9912         (produce_special_glyphs): Move here from term.c.
9914         * term.c (produce_special_glyphs): Move to xdisp.c.
9916         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
9917         section.
9919 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
9921         * xdisp.c (display_line): Avoid warning about implicit declaration
9922         of FRAME_FONT.
9924         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
9926         * lisp.h: Remove empty conditional.
9928 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
9930         * lread.c (load_path_check): Now static.
9932         Fix some minor --with-ns problems found by static checking.
9933         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
9934         (x_set_font) [!HAVE_X_WINDOWS]:
9935         * image.c (xpm_load_image) [HAVE_NS]:
9936         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
9937         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
9938         Remove unused local.
9939         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
9940         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
9941         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
9942         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
9943         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
9944         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
9945         Fix pointer signedness problem.
9946         * xfaces.c (FRAME_X_FONT_TABLE):
9947         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
9949 2012-07-07  Glenn Morris  <rgm@gnu.org>
9951         * lread.c (load_path_check): New function, split from init_lread.
9952         (init_lread): Reorganize.  Motivation:
9953         If EMACSLOADPATH is set, check/warn about that rather than the
9954         defaults, which we are not going to use.  Hence we can remove
9955         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
9956         Don't warn if site-lisp directories are missing.
9957         If not installed, start from a blank load-path, since
9958         PATH_LOADSEARCH refers to the eventual installation directories.
9960 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
9962         Support truncation and continuation glyphs on GUI frames, when
9963         fringes are disabled.  (Bug#11832)
9964         * xdisp.c (init_iterator): Get dimensions of truncation and
9965         continuation glyphs even if on GUI frames.
9966         Adjust it->last_visible_x on GUI frames when the left or right fringes,
9967         or both, are absent.
9968         (start_display, move_it_in_display_line_to): Handle the case of a
9969         GUI frame without a fringe to display continuation or truncation
9970         glyphs.
9971         (insert_left_trunc_glyphs): Support GUI frames: make sure
9972         truncation glyphs overwrite enough glyphs from the current line to
9973         have sufficient space in pixels.
9974         (display_line): Support truncation and continuation glyphs on GUI
9975         frames.  If some spare pixels are left on the line after inserting
9976         the truncation glyphs, fill that space with a stretch glyph of a
9977         suitably computed width.
9979         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
9980         produce_glyphs, to support GUI sessions.
9982 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
9984         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
9986         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
9988         Do not require float-time's arg to fit in time_t (Bug#11825).
9989         This works better on hosts where time_t is unsigned, and where
9990         float-time is applied to the (negative) difference between two times.
9991         * editfns.c (decode_time_components): Last arg is now double *,
9992         not int *, and means to store all the result as a double, without
9993         worrying about whether the seconds part fits in time_t.
9994         All callers changed.
9995         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
9996         All callers changed.
9997         (Ffloat_time): Do not fail merely because the specified time falls
9998         outside of time_t range.
10000 2012-07-07  Glenn Morris  <rgm@gnu.org>
10002         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10003         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10004         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10006 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
10008         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10009         Update dependencies.
10011         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10013 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
10015         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10016         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10017         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10018         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10019         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10020         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10022         * xfont.c (compare_font_names): Redo to omit the need for casts.
10024 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
10026         * xfns.c (Fx_change_window_property): Doc fix.
10027         * w32fns.c (Fx_change_window_property): Doc fix.
10029         * w32fns.c (Fx_window_property): Accept the same arguments as the
10030         X Windows version.  Doc fix.
10031         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
10033 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
10034             Eli Zaretskii  <eliz@gnu.org>
10036         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10037         Windows-specific code from nt/config.nt moved here.
10038         Obsolete settings removed.
10040 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
10042         * process.c: Avoid unnecessary calls to gettime.
10043         (wait_reading_process_output): Don't get the time of day
10044         when gobbling data immediately and not waiting, as there's no need
10045         for it in that case.  This removes a FIXME.
10047 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
10049         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10050         is defined (Bug#11768).
10052 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10054         Fix marker debugging code.
10055         * marker.c (byte_char_debug_check): Do not perform the check
10056         if buffer is not multibyte.
10057         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10058         Call byte_char_debug_check with correct arguments.
10060 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10062         Compile marker debugging code only if ENABLE_CHECKING is defined.
10063         * marker.c (byte_char_debug_check, count_markers):
10064         Use only if ENABLE_CHECKING is defined.
10065         (byte_debug_flag): Remove.
10066         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10067         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10069 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10071         Avoid code repetition in marker-related functions.
10072         * marker.c (attach_marker): New function.
10073         (Fset_marker, set_marker_restricted, set_marker_both)
10074         (set_marker_restricted_both): Use it.
10075         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10076         Consistently rename charno to charpos.
10077         (marker_position): Add eassert.
10078         (marker_byte_position): Convert to eassert.
10080 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10082         Simplify list operations in unchain_overlay and unchain_marker.
10083         * buffer.c (unchain_overlay): Simplify.  Add comment.
10084         * marker.c (unchain_marker): Simplify.  Fix comments.
10086 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10088         Introduce fast path for the widely used marker operation.
10089         * alloc.c (build_marker): New function.
10090         * lisp.h (build_marker): New prototype.
10091         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10092         * composite.c (autocmp_chars): Likewise.
10093         * editfns.c (buildmark): Remove.
10094         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10095         (save_restriction_save): Use build_marker.
10096         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10097         * window.c (save_window_save): Likewise.
10099 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
10101         Do not use Fdelete_overlay in delete_all_overlays
10102         to avoid redundant calls to unchain_overlay.
10103         * buffer.c (drop_overlay): New function.
10104         (delete_all_overlays, Fdelete_overlay): Use it.
10105         * minibuf.c (get_minibuffer): Fix comment.
10107 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
10109         Port to OpenBSD 5.1 amd64.
10110         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10111         This is needed for OpenBSD, and should be harmless on all BSD systems.
10112         Also, include <sys/sysctl.h>, as it should be available on all
10113         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10114         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10115         use p_pid member, not kp_proc.pid.
10117 2012-07-06  Glenn Morris  <rgm@gnu.org>
10119         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10121 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
10123         More xmalloc and related cleanup.
10124         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10125         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10126         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10127         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10128         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10129         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10130         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10131         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10132         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10133         * xterm.c:
10134         Omit needless casts involving void * pointers and allocation.
10135         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10136         as the former is more robust if P's type is changed.
10137         Prefer xzalloc to xmalloc + memset 0.
10138         Simplify malloc-or-realloc to realloc.
10139         Don't worry about xmalloc returning a null pointer.
10140         Prefer xstrdup to xmalloc + strcpy.
10141         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10142         growing it.
10143         * keyboard.c (apply_modifiers_uncached): Prefer local array to
10144         alloca of a constant.
10146 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
10148         * xdisp.c (display_line): Fix horizontal pixel coordinates when
10149         hscroll is larger than the line width.  Fixes long and futile
10150         looping inside extend_face_to_end_of_line (on a TTY) producing
10151         glyphs that are not needed and thrown away.
10153 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
10155         * marker.c (set_marker_restricted_both): Simplify by using
10156         clip_to_bounds.
10158 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
10160         * editfns.c (region_limit): Simplify by using clip_to_bounds.
10162 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
10164         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10165         not defined (Bug#11768).
10166         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10167         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10168         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10169         followed by gtk_box_set_homogeneous (Bug#11768).
10170         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
10171         (update_theme_scrollbar_width, xg_create_scroll_bar):
10172         Use gtk_scrollbar_new (Bug#11768).
10173         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10174         (is_box_type): New function (Bug#11768).
10175         (xg_tool_item_stale_p): Call is_box_type.
10176         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
10177         with default display (Bug#11768).
10179 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
10181         * xdisp.c (window_hscroll_limited): New function.
10182         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10183         coordinates when window's hscroll is set to insanely large
10184         values.  (Bug#11857)
10186 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
10188         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10189         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10191 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
10193         Cleanup xmalloc.
10194         * lisp.h (xzalloc): New prototype.  Omit needless casts.
10195         * alloc.c (xzalloc): New function.  Omit needless casts.
10196         * charset.c: Omit needless casts.  Convert all calls to
10197         xmalloc with following memset to xzalloc.
10198         * dispnew.c: Likewise.
10199         * fringe.c: Likewise.
10200         * image.c: Likewise.
10201         * sound.c: Likewise.
10202         * term.c: Likewise.
10203         * w32fns.c: Likewise.
10204         * w32font.c: Likewise.
10205         * w32term.c: Likewise.
10206         * xfaces.c: Likewise.
10207         * xfns.c: Likewise.
10208         * xterm.c: Likewise.
10209         * atimer.c: Omit needless casts.
10210         * buffer.c: Likewise.
10211         * callproc.c: Likewise.
10212         * ccl.c: Likewise.
10213         * coding.c: Likewise.
10214         * composite.c: Likewise.
10215         * doc.c: Likewise.
10216         * doprnt.c: Likewise.
10217         * editfns.c: Likewise.
10218         * emacs.c: Likewise.
10219         * eval.c: Likewise.
10220         * filelock.c: Likewise.
10221         * fns.c: Likewise.
10222         * gtkutil.c: Likewise.
10223         * keyboard.c: Likewise.
10224         * lisp.h: Likewise.
10225         * lread.c: Likewise.
10226         * minibuf.c: Likewise.
10227         * msdos.c: Likewise.
10228         * print.c: Likewise.
10229         * process.c: Likewise.
10230         * region-cache.c: Likewise.
10231         * search.c: Likewise.
10232         * sysdep.c: Likewise.
10233         * termcap.c: Likewise.
10234         * terminal.c: Likewise.
10235         * tparam.c: Likewise.
10236         * w16select.c: Likewise.
10237         * w32.c: Likewise.
10238         * w32reg.c: Likewise.
10239         * w32select.c: Likewise.
10240         * w32uniscribe.c: Likewise.
10241         * widget.c: Likewise.
10242         * xdisp.c: Likewise.
10243         * xmenu.c: Likewise.
10244         * xrdb.c: Likewise.
10245         * xselect.c: Likewise.
10247 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
10249         * fileio.c (time_error_value): Check the right error number.
10250         Problem reported by Troels Nielsen in
10251         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10253 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10255         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10256         This should be fixed in a better way; see Eli Zaretskii in
10257         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10258         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10260         * fileio.c (time_error_value): Rename from special_mtime.
10261         The old name's problems were noted by Eli Zaretskii in
10262         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10264         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10265         This variable's comment says Emacs needs at least one GDB-visible
10266         symbol of type enum pvec_type, to work around GDB problems.
10267         The symbol's value doesn't matter.
10269         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10270         that causes compilation to fail on pre-C99 compilers.
10272 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
10274         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10275         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10277 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
10279         * buffer.c (init_buffer_once): Fix initialization of
10280         headers for buffer_defaults and buffer_local_symbols.
10281         Reported by Juanma Barranquero <lekktu@gmail.com>.
10283 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
10285         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10286         * lisp.h (enum pvec_type): Use fewer bits.
10287         (PSEUDOVECTOR_SIZE_BITS): New constant.
10288         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10289         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10290         change in pvec_type.
10291         (PSEUDOVECTOR_TYPEP): New macro.
10292         (TYPED_PSEUDOVECTORP): Use it.
10293         * fns.c (internal_equal): Adapt code to extract pvectype.
10294         * emacs.c (gdb_pvec_type): Update type.
10295         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10296         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10297         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10298         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10299         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
10300         abusing vector->header.next.nbytes.
10301         (live_vector_p): Use PVEC_TYPE.
10302         (mark_object): Adapt code to extract pvectype.  Use switch.
10304 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10306         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10307         Tighten new eassert a bit.
10309 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
10311         Fix compilation with --enable-gcc-warnings and -O1
10312         optimization level.
10313         * doprnt.c (doprnt): Change type of tem to int, initialize
10314         to avoid compiler warning.  Add eassert.
10315         * search.c (simple_search): Initialize match_byte to avoid
10316         compiler warning.  Add eassert.
10318 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10320         Avoid weird behavior with large horizontal scrolls.
10321         Without this change, for example, large hscroll values would
10322         mess up Emacs's display on Fedora 15 x86, presumably due to
10323         overflows in int calculations in the display code.
10324         Also, if buffers had long lines, Emacs would freeze.
10325         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10326         (set_window_hscroll): New function, containing the old guts of
10327         Fset_window_hscroll.  Return the clipped value.
10328         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10329         This avoids the need to check against PTRDIFF_MAX.
10331         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10333 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
10335         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10337 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10339         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
10340         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10341         since GCC 4.4.6 issues a bogus warning for them.
10343         Fix bugs in file timestamp newness comparisons.
10344         * fileio.c (Ffile_newer_than_file_p):
10345         * lread.c (Fload): Use full timestamp resolution of files,
10346         not just the 1-second resolution, so that files that are only
10347         slightly newer still count as newer.
10348         * fileio.c (Ffile_newer_than_file_p): Don't assume file
10349         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10351 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
10353         * fileio.c: Improve handling of file time marker.  (Bug#11852)
10354         (special_mtime): New function.
10355         (Finsert_file_contents, Fverify_visited_file_modtime):
10356         Use it to set special mtime values consistently.
10358 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
10360         * fileio.c (Finsert_file_contents): Properly handle st_mtime
10361         marker for non-existing file.  (Bug#11852)
10363 2012-07-03  Glenn Morris  <rgm@gnu.org>
10365         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10366         and did not make it into globals.h).
10368 2012-07-03  Tom Tromey  <tromey@redhat.com>
10370         * window.c (Fset_window_margins, Fset_window_fringes)
10371         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10372         * textprop.c (Fprevious_property_change): No longer static.
10373         * syntax.c (Fsyntax_table_p): No longer static.
10374         * process.c (Fget_process, Fprocess_datagram_address): No longer
10375         static.
10376         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10377         * keyboard.c (Fcommand_execute): No longer static.
10378         Remove EXFUN.
10379         * insdel.c (Fcombine_after_change_execute): No longer static.
10380         * image.c (Finit_image_library): No longer static.
10381         * fileio.c (Fmake_symbolic_link): No longer static.
10382         * eval.c (Ffetch_bytecode): No longer static.
10383         * editfns.c (Fuser_full_name): No longer static.
10384         * doc.c (Fdocumentation_property, Fsnarf_documentation):
10385         No longer static.
10386         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10387         static.
10388         * dired.c (Ffile_attributes): No longer static.
10389         * composite.c (Fcomposition_get_gstring): No longer static.
10390         * callproc.c (Fgetenv_internal): No longer static.
10392         * ccl.h: Remove EXFUNs.
10393         * buffer.h: Remove EXFUNs.
10394         * dispextern.h: Remove EXFUNs.
10395         * intervals.h: Remove EXFUNs.
10396         * fontset.h: Remove EXFUN.
10397         * font.h: Remove EXFUNs.
10398         * dosfns.c (system_process_attributes): Remove EXFUN.
10399         * keymap.h: Remove EXFUNs.
10400         * lisp.h: Remove EXFUNs.
10401         * w32term.h: Remove EXFUNs.
10402         * window.h: Remove EXFUNs.
10403         * xsettings.h: Remove EXFUN.
10404         * xterm.h: Remove EXFUN.
10406 2012-07-03  Glenn Morris  <rgm@gnu.org>
10408         * lisp.h (Frandom): Make it visible to C.
10409         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10410         buffer for invisible buffers.  (Bug#1229)
10412 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
10414         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10415         values which aren't power of 2.
10416         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
10417         Verify its value and the value of VECTOR_BLOCK_SIZE.  Adjust users
10418         accordingly.
10420 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
10422         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10424         * alloc.c (mark_object): Revert part of last patch to use `switch'.
10426 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
10428         * alloc.c (allocate_vector_block): Remove redundant
10429         calls to mallopt if DOUG_LEA_MALLOC is defined.
10430         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10431         avoid calls to mallopt if zero_vector is returned.
10433 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
10435         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10436         is enabled, avoid dereferencing NULL current_sblock if
10437         running undumped.
10439 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
10441         Cleanup basic buffer management.
10442         * buffer.h (struct buffer): Change layout to use generic vector
10443         marking code.  Fix some comments.  Change type of 'clip_changed'
10444         to bitfield.  Remove unused #ifndef old.
10445         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10446         (GET_OVERLAYS_AT): Fix indentation.
10447         (for_each_per_buffer_object_at): New macro.
10448         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10449         (Fbuffer_local_variables): Use it.
10450         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10451         * alloc.c (allocate_buffer): Adjust to match new layout of
10452         struct buffer.  Fix comment.
10453         (mark_overlay): New function.
10454         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
10455         Lisp area of struct buffer.
10456         (mark_object): Use it.  Adjust marking of misc objects
10457         and related comments.
10459 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
10461         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10462         wrapper that is not needed because the wrapped code is a no-op (zero
10463         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10464         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10466 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
10468         * alloc.c (mark_buffer): Simplify.  Remove prototype.
10469         (mark_object): Add comment.  Reorganize marking of vector-like
10470         objects.  Use CHECK_LIVE for all vector-like objects except buffers
10471         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10472         Avoid redundant calls to mark_vectorlike for bool vectors.
10474 2012-06-30  Glenn Morris  <rgm@gnu.org>
10476         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10478         * epaths.in (PATH_SITELOADSEARCH): New.
10479         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10480         This is rather than relying on --enable-locallisppath elements
10481         having "site-lisp" in their names.  (Bug#10208#25, 11658)
10483 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
10485         * w32proc.c (sys_select): Accept and ignore one more argument.
10487         * w32.c (emacs_gnutls_pull): Call select with one more argument.
10489         * sysselect.h [DOS_NT]: Don't include sys/select.h.
10490         (pselect) [!MS_DOS]: Redirect to sys_select.
10492         * sysdep.c: Don't include dos.h and dosfns.h.
10494         * process.c (sys_select):
10495         * msdos.c (sys_select): Accept one more argument and ignore it.
10497         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10498         adapt data types and code to that.
10500         * dosfns.c:
10501         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10502         which clashes with the gnulib function of the same name.
10504 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
10506         * font.c (font_style_to_value, font_style_symbolic)
10507         (font_prop_validate_style): Add type checks for values in
10508         font_style_table.
10510         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10511         argument.
10512         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10513         uses.
10515 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
10517         * xdisp.c (try_window_id): Undo last change.
10519         * w32.c (getwd): Adjust commentary about startup_dir.
10520         (init_environment): Always call sys_access, even in non-MSVC
10521         builds.  Don't chdir to the directory of the Emacs executable.
10522         This undoes code from 1997 which was justified by the need to
10523         "avoid conflicts when removing and renaming directories".  But its
10524         downside was that every relative file name was being interpreted
10525         relative to the directory of the Emacs executable, which can never
10526         be TRT.  In particular, it broke sys_access when called with
10527         relative file names.
10528         (sys_access): Map GetLastError to errno.
10530 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
10532         * window.h (struct window): Change type of 'fringes_outside_margins'
10533         to bitfield.  Fix comment.  Adjust users accordingly.
10534         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
10535         Adjust comment.
10536         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10537         to ptrdiff_t.
10539 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
10541         * gnutls.c (emacs_gnutls_handshake):
10542         Add QUIT to make the loop interruptible.
10544 2012-06-29  Glenn Morris  <rgm@gnu.org>
10546         * charset.c (init_charset): Make lack of etc/charsets fatal.
10548 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
10550         * editfns.c (region_limit): Fix type mismatch.
10552 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
10554         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10555         undefined.  Convert from xassert to eassert.
10556         * nsmenu.m: Convert from xassert to eassert.
10557         * nsterm.m: Likewise.
10559 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
10561         * editfns.c (region_limit): Clip to narrowing (bug#11770).
10563 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
10565         Avoid integer overflow on scroll-left and scroll-right.
10566         * window.c (HSCROLL_MAX): New macro.
10567         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10568         overflow when requested scroll falls outside ptrdiff_t range.
10570 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
10572         * window.h (struct window): Change type of 'hscroll',
10573         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10574         'last_modified' and 'last_overlay_modified' to EMACS_INT.
10575         Adjust users accordingly.
10576         * xdisp.c (try_cursor_movement): Replace type check with eassert.
10577         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10578         from EMACS_INT to ptrdiff_t.
10579         (make_window): Omit redundant initialization.
10581 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
10583         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10585 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
10587         * window.h (struct window): Change type of 'use_time' and
10588         'sequence_number' from Lisp_Object to int.
10589         * frame.c (make_frame): Adjust users accordingly.
10590         * print.c (print_object): Likewise.
10591         * window.c (select_window, Fwindow_use_time, make_parent_window)
10592         (make_window): Likewise.
10594 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
10596         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10597         enabled with --enable-checking=[all,glyphs] configure option.
10598         Fix GLYPH_DEBUG usage assuming that it may be undefined,
10599         adjust comments accordingly.
10600         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10601         undefined, adjust comments accordingly.
10602         * image.c: Likewise.
10603         * scroll.c: Likewise.
10604         * w32fns.c: Likewise.
10605         * w32term.c: Likewise.
10606         * xdisp.c: Likewise.
10607         * xfaces.c: Likewise.
10608         * xfns.c: Likewise.
10609         * xterm.c: Likewise.
10611 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
10613         Generalize run-time debugging checks.
10614         * dispextern.h (XASSERTS): Remove.
10615         * fontset.c (xassert): Remove.
10616         Convert from xassert to eassert.
10617         * alloc.c: Convert from xassert to eassert.
10618         * bidi.c: Likewise.
10619         * dispnew.c: Likewise.
10620         * fns.c: Likewise.
10621         * fringe.c: Likewise.
10622         * ftfont.c: Likewise.
10623         * gtkutil.c: Likewise.
10624         * image.c: Likewise.
10625         * keyboard.c: Likewise.
10626         * menu.c: Likewise.
10627         * process.c: Likewise.
10628         * scroll.c: Likewise.
10629         * sound.c: Likewise.
10630         * term.c: Likewise.
10631         * w32console.c: Likewise.
10632         * w32fns.c: Likewise.
10633         * w32term.c: Likewise.
10634         * window.c: Likewise.
10635         * xdisp.c: Likewise.
10636         * xfaces.c: Likewise.
10637         * xfns.c: Likewise.
10638         * xselect.c: Likewise.
10639         * xterm.c: Likewise.
10641 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
10643         * fns.c (maybe_resize_hash_table): Output message when growing the
10644         purify-hashtable.
10646 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
10648         * alloc.c (allocate_string_data): Remove dead code.
10649         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10650         avoid GCC warning about unused macro.
10652 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
10654         * alloc.c (allocate_string): Omit intervals initialization.
10655         * alloc.c (make_uninit_multibyte_string): Initialize intervals
10656         as in make_pure_string and make_pure_c_string.
10658 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
10660         * alloc.c (allocate_string): Fix last change.
10662 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
10664         * alloc.c (allocate_string): Remove two redundant calls
10665         to memset, add explicit initialization where appropriate.
10667 2012-06-27  Glenn Morris  <rgm@gnu.org>
10669         * lisp.mk (lisp): Remove paths.elc.
10671 2012-06-27  Chong Yidong  <cyd@gnu.org>
10673         * doc.c (Fsubstitute_command_keys): Fix punctuation.
10675 2012-06-26  John Wiegley  <johnw@newartisans.com>
10677         * unexmacosx.c (copy_data_segment): Add two section names used
10678         on Mac OS X Lion: __mod_init_func and __mod_term_func.
10680         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10681         when building with Clang.
10683 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
10685         * eval.c (Fapply): Allow calling it with a single argument.
10687 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
10689         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10690         _stricmp and _strnicmp.
10691         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10693 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
10695         * alloc.c (allocate_window): Zero out non-Lisp part of newly
10696         allocated window.
10697         (allocate_process): Likewise for new process.
10698         (allocate_terminal): Change to use offsetof.
10699         (allocate_frame): Likewise.
10700         * frame.c (make_frame): Omit redundant initialization.
10701         * window.c (make_parent_window): Use memset.
10702         (make_window): Omit redundant initialization.
10703         * process.c (make_process): Omit redundant initialization.
10704         * terminal.c (create_terminal): Likewise.
10706 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
10708         * term.c (delete_tty): Remove redundant call to memset.
10710 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
10712         * alloc.c: Remove build_string.
10713         * lisp.h: Define build_string as static inline.  This provides
10714         a better opportunity to optimize away calls to strlen when the
10715         function is called with compile-time constant argument.
10716         * image.c (imagemagick_error): Convert to build_string.
10717         * w32proc.c (sys_spawnve): Likewise.
10718         * xterm.c (x_term_init): Likewise.
10720 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
10722         Use sprintf return value instead of invoking strlen on result.
10723         In the old days this wasn't portable, since some sprintf
10724         implementations returned char *.  But they died out years ago and
10725         Emacs already assumes sprintf returns int.
10726         Similarly for float_to_string.
10727         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10728         * ccl.c (ccl_driver):
10729         * character.c (string_escape_byte8):
10730         * data.c (Fnumber_to_string):
10731         * doprnt.c (doprnt):
10732         * print.c (print_object):
10733         * xdisp.c (message_dolog):
10734         * xfns.c (syms_of_xfns):
10735         Use sprintf or float_to_string result to avoid need to call strlen.
10736         * data.c (Fnumber_to_string):
10737         Use make_unibyte_string, since the string must be ASCII.
10738         * lisp.h, print.c (float_to_string): Now returns int length.
10739         * term.c (produce_glyphless_glyph):
10740         Use sprintf result rather than recomputing it.
10742         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10743         * Makefile.in (ALL_CFLAGS):
10744         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10745         * gmalloc.c, regex.c: Include <config.h> unconditionally.
10747 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
10749         * dispextern.h (xstrcasecmp): Define to library function
10750         strcasecmp if available.
10751         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10753 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
10755         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10756         Avoid comma operator.
10757         * menu.c (push_submenu_start, push_submenu_end)
10758         (push_left_right_boundary, push_menu_pane): Likewise.
10759         * msdos.c (dos_rawgetc): Likewise.
10761 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
10763         * xfns.c (xic_create_fontsetname): Remove redundant calls
10764         to memset.
10766 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
10768         * gtkutil.c (get_utf8_string): Remove redundant assignment.
10769         sprintf already null-terminates its output.
10771         * xfns.c (x_window): Remove redundant cast.
10773 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
10775         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10776         `const char *' to `char *' to avoid compiler warning.
10778 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
10780         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10781         instead of truncating it to 63 (admittedly a generous limit).
10783         * process.c: Fix spelling and caps in comments.
10785 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
10787         * emacs.c (setpgrp): Remove definition, unused.
10788         * sysdep.c (setpgrp): Remove definition, not used in this file.
10790 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
10792         * makefile.w32-in: Update dependencies.
10794 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
10796         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10797         (SYSTIME_H): Add nt/inc/sys/time.h.
10799         * systime.h [WINDOWSNT]: Include sys/time.h.
10801         * s/ms-w32.h (struct timespec): Definition moved from
10802         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10804 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
10806         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10807         * buffer.h (buffer_slot_type_mismatch):
10808         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10809         * eval.c (unwind_to_catch):
10810         * image.c (my_png_error, my_error_exit):
10811         * keyboard.c (quit_throw_to_read_char, user_error)
10812         (Fexit_recursive_edit, Fabort_recursive_edit):
10813         * lisp.h (die, args_out_of_range, args_out_of_range_3)
10814         (wrong_type_argument, buffer_overflow, __executable_start)
10815         (memory_full, buffer_memory_full, string_overflow, Fthrow)
10816         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10817         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10818         (fatal):
10819         (child_setup) [!DOS_NT]:
10820         * lread.c (end_of_file_error, invalid_syntax):
10821         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10822         * puresize.h (pure_write_error):
10823         * search.c (matcher_overflow):
10824         * sound.c (sound_perror, alsa_sound_perror):
10825         * sysdep.c, syssignal.h (croak):
10826         * term.c (maybe_fatal, vfatal):
10827         * textprop.c (text_read_only):
10828         * undo.c (user_error):
10829         * unexmacosx.c (unexec_error):
10830         * xterm.c (x_ins_del_lines, x_delete_glyphs):
10831         Use _Noreturn rather than NO_RETURN.
10832         No need for separate decl merely because of _Noreturn.
10833         * sound.c (sound_warning, parse_sound):
10834         Remove unnecessary forward decls.
10836 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
10838         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10839         * lisp.h (WAIT_READING_MAX): New macro.
10840         * dispnew.c (Fsleep_for, sit_for):
10841         * keyboard.c (kbd_buffer_get_event):
10842         * process.c (Faccept_process_output):
10843         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10844         This improves on the previous patch, which introduced a bug
10845         when time_t is unsigned and as wide as intmax_t.
10846         See <http://bugs.gnu.org/9000#51>.
10848 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
10850         * dispnew.c (sit_for, Fsleep_for):
10851         * keyboard.c (kbd_buffer_get_event):
10852         * process.c (Faccept_process_output): Avoid compiler warnings when
10853         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10855 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
10857         * makefile.w32-in: Update dependencies.
10859         * w32.c (ltime): Add return type and declare static.
10860         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
10862 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
10864         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
10865         Privately reported by Herbert J. Skuhra.
10866         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
10867         All uses changed.
10868         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
10869         not make_lisp_timeval, when the argument is of type EMACS_TIME.
10871 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
10873         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
10874         last argument of make_unibyte_string.
10876         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
10877         language ID in the event parameters.
10879         * w32term.c (w32_read_socket): Put the new keyboard codepage into
10880         event.code, not the obscure "character set ID".
10882 2012-06-23  Chong Yidong  <cyd@gnu.org>
10884         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
10886 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
10888         Fix the MS-Windows build broken by revno 108687.
10889         * w32.c (fdutimens): New function.
10891         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
10893         * s/ms-w32.h (pselect): Redirect to sys_select.
10895         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
10897         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
10898         in the logic of incrementing and decrementing the value of
10899         use_relocatable_buffers.
10901 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
10903         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
10904         Privately reported by Herbert J. Skuhra.
10905         [__FreeBSD__]: Remove "*/" typo after "#include".
10906         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
10907         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
10908         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
10909         Don't assume EMACS_TIME and struct timeval are the same type.
10911 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
10913         Support higher-resolution time stamps (Bug#9000).
10914         The time stamps are only nanosecond-resolution at the C level,
10915         since that's the best that any real-world system supports now.
10916         But they are picosecond-resolution at the Lisp level, as that's
10917         easy, and leaves room for future OS improvements.
10919         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
10920         (LIBES): Use it.
10922         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
10923         Don't get current time unless it's needed.
10925         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
10926         now provides it if it's absent.
10927         (start_atimer): Port to higher-res time stamps.
10928         Check for time stamp overflow.  Don't get current time more
10929         often than is needed.
10931         * buffer.h (struct buffer): Buffer modtime now has high resolution.
10932         Include systime.h, not time.h.
10933         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
10935         * dired.c: Include stat-time.h.
10936         (Ffile-attributes): File times now have higher resolution.
10938         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
10939         (struct image): Timestamp now has higher resolution.
10941         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
10942         has at least microseconds now.  All uses removed.
10943         (update_frame, update_single_window, update_window, update_frame_1)
10944         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
10945         (duration_to_sec_usec): Remove; no longer needed.
10947         * editfns.c (time_overflow): Now extern.
10948         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
10949         (float-time, Fformat_time_string, Fcurrent_time_string)
10950         (Fcurrent_time_zone): Accept and generate higher-resolution
10951         time stamps.
10952         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
10953         (decode_time_components, lisp_seconds_argument): New functions.
10954         (make_time): Now static.
10955         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
10956         Report an error if the time is invalid, rather than having the caller
10957         do that.
10959         * fileio.c: Include <stat-time.h>
10960         (Fcopy_file): Copy higher-resolution time stamps.
10961         Prefer to set the time stamp via a file descriptor if that works.
10962         (Fset_file_times, Finsert_file_contents, Fwrite_region)
10963         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
10964         (Fvisited_file_modtime, Fset_visited_file_modtime):
10965         Support higher-resolution time stamps.
10967         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
10969         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
10971         * image.c (prepare_image_for_display, clear_image_cache)
10972         (lookup_image): Port to higer-resolution time stamps.
10974         * keyboard.c (start_polling, bind_polling_period):
10975         Check for time stamp overflow.
10976         (read_char, kbd_buffer_get_event, timer_start_idle)
10977         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
10978         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
10979         Port to higher-resolution time stamps.  Do not assume time_t is signed.
10980         (decode_timer): New function.  Timers are now vectors of length 9,
10981         not 8, to accommodate the picosecond component.
10982         (timer_check_2): Use it.
10984         * nsterm.m (select_timeout, timeval_subtract): Remove.
10985         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
10986         as they're a bit more accurate and handle overflow better.
10987         (ns_select): Change prototype to be compatible with pselect.
10988         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
10989         * nsterm.h (ns_select): Adjust prototype.
10991         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
10992         us-resolution time stamps.
10993         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
10995         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
10997         * lisp.h (time_overflow): New decl.
10998         (wait_reading_process_output): First arg is now intmax_t, not int,
10999         to accommodate larger waits.
11001         * process.h (struct Lisp_Process.read_output_delay):
11002         Now counts nanoseconds, not microseconds.
11003         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11004         EMACS_HAS_USECS.
11005         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11006         (wait_reading_process_output):
11007         Port to ns-resolution time stamps.
11008         (Faccept_process_output, wait_reading_process_output):
11009         Check for time stamp overflow.  Do not assume time_t is signed.
11010         (select_wrapper): Remove; we now use pselect.
11011         (Fprocess_attributes): Now generates ns-resolution time stamps.
11013         * sysdep.c: Include utimens.h.  Don't include utime.h
11014         or worry about struct utimbuf; gnulib does that for us now.
11015         (gettimeofday): Remove; gnulib provides a substitute.
11016         (make_timeval): New function.
11017         (set_file_times): Now sets ns-resolution time stamps.
11018         New arg FD; all uses changed.
11019         (time_from_jiffies, ltime_from_jiffies, get_up_time)
11020         (system_process_attributes):
11021         Now returns ns-resolution time stamp.  All uses changed.
11022         Check for time stamp overflow.
11024         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11025         provides a substitute now.
11027         * systime.h: Include timespec.h rather than sys/time.h and time.h,
11028         since it guarantees struct timespec.
11029         (EMACS_TIME): Now struct timespec, so that we can support
11030         ns-resolution time stamps.
11031         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11032         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11033         (EMACS_USECS): Remove.
11034         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11035         so multiply the arg by 1000 before storing it.
11036         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11037         New macros.
11038         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11039         Port to ns-resolution time stamps.
11040         (EMACS_TIME_NEG_P): Remove; replaced by....
11041         (EMACS_TIME_SIGN): New macro.
11042         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11043         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11044         (set_file_times, make_time, lisp_time_argument): Adjust signature.
11045         (make_timeval, make_lisp_time, decode_time_components): New decls.
11046         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
11047         that it mishandled time_t overflow.  You can't compare by subtracting!
11048         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11049         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11051         * term.c: Include <sys/time.h>.
11052         (timeval_to_Time): New function, for proper overflow wraparound.
11053         (term_mouse_position, term_mouse_click): Use it.
11055         * undo.c (record_first_change): Support higher-resolution time stamps
11056         in the undo buffer.
11057         (Fprimitive_undo): Use them when restoring time stamps.
11059         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11060         (w32_get_internal_run_time):
11061         Port to higher-resolution Emacs time stamps.
11062         (ltime): Now accepts single 64-bit integer, as that's more convenient
11063         for callers.
11065         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11067         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11068         for compatibility with pselect.  Support ns-resolution time stamps.
11070         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11072         * xselect.c (wait_for_property_change, x_get_foreign_selection):
11073         Check for time stamp overflow, and support ns-resolution time stamps.
11075         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11076         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11077         (timeval_subtract): Remove; no longer needed.
11078         (XTflash, XTring_bell, x_wait_for_event):
11079         Port to ns-resolution time stamps.  Don't assume time_t is signed.
11081 2012-06-22  Chong Yidong  <cyd@gnu.org>
11083         * xdisp.c (x_consider_frame_title): Revert last change.
11085 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
11087         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
11088         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11089         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
11090         staticidx goes up to 1597 out of 1600 = 0x640.)
11092 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
11094         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11095         Otherwise, the umask might be mistakenly 0 while handling input signals.
11097 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
11099         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11101 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
11103         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11104         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11105         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11106         access to `contents' member of Lisp_Vector objects with AREF and ASET
11107         where appropriate.
11109 2012-06-19  Chong Yidong  <cyd@gnu.org>
11111         * frame.c (delete_frame): When selecting a frame on a different
11112         text terminal, do not alter the terminal's top-frame.
11114         * xdisp.c (format_mode_line_unwind_data): Record the target
11115         frame's selected window and its terminal's top-frame.
11116         (unwind_format_mode_line): Restore them.
11117         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11118         Callers changed.
11119         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11120         since tty frames can be explicitly named.
11121         (prepare_menu_bars): Likewise.
11123         * term.c (Ftty_top_frame): New function.
11125 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
11127         Port byte-code-meter to modern targets.
11128         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11129         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
11130         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
11131         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11132         (METER_1, METER_2): Simplify.
11134 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
11136         * data.c (Fdefalias): Return `symbol' (bug#11686).
11138 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
11140         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
11141         gets killed during executing of this function (Bug#11665).
11142         Try to always return Qt when the buffer has been actually killed.
11143         (Vkill_buffer_query_functions): In doc-string say that functions
11144         run by this hook should not change the current buffer.
11146 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
11148         Fix recently-introduced process.c problems found by static checking.
11149         * process.c (write_queue_push, write_queue_pop, send_process):
11150         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11151         (write_queue_pop): Fix pointer signedness problem.
11152         (send_process): Remove unused local.
11154 2012-06-17  Chong Yidong  <cyd@gnu.org>
11156         * xdisp.c (redisplay_internal): No need to redisplay terminal
11157         frames that are not on top.
11159 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
11161         * process.c (make_process): Initialize write_queue.
11162         (write_queue_push, write_queue_pop): New functions.
11163         (send_process): Use them to maintain correct ordering of process
11164         writes (Bug#10815).
11166 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
11168         * lisp.h (eassert): Assume C89 or later.
11169         This removes the need for CHECK.
11170         (CHECK): Remove.  Its comments about always evaluating its
11171         argument were confusing, as 'eassert' typically does not evaluate
11172         its argument.
11174         * coding.c (produce_chars): Use ptrdiff_t, not int.
11176         * xterm.c (x_draw_underwave): Check for integer overflow.
11177         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11179 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
11181         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11182         referenced (Bug#11583).
11184 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
11186         Implement wave-style variant of underlining.
11187         * dispextern.h (face_underline_type): New enum.
11188         (face): Add field for underline type.
11189         * nsterm.m (ns_draw_underwave): New function.
11190         (ns_draw_text_decoration): Use it.
11191         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11192         New functions.
11193         (x_draw_glyph_string): Use them.
11194         * xfaces.c (Qline, Qwave): New Lisp objects.
11195         (check_lface_attrs, merge_face_ref)
11196         (Finternal_set_lisp_face_attribute, realize_x_face):
11197         Handle wave-style underline face attributes.
11198         * xterm.c (x_draw_underwave): New function.
11199         (x_draw_glyph_string): Use it.
11201 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
11203         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11204         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11205         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11206         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11207         ($(BLD)/w32select.$(O)): Update dependencies.
11209 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
11211         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11212         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11213         * character.c (_fetch_multibyte_char_p): Remove.
11214         * alloc.c: Include "character.h" before "buffer.h".
11215         * bidi.c: Likewise.
11216         * buffer.c: Likewise.
11217         * bytecode.c: Likewise.
11218         * callint.c: Likewise.
11219         * callproc.c: Likewise.
11220         * casefiddle.c: Likewise.
11221         * casetab.c: Likewise.
11222         * category.c: Likewise.
11223         * cmds.c: Likewise.
11224         * coding.c: Likewise.
11225         * composite.c: Likewise.
11226         * dired.c: Likewise.
11227         * dispnew.c: Likewise.
11228         * doc.c: Likewise.
11229         * dosfns.c: Likewise.
11230         * editfns.c: Likewise.
11231         * emacs.c: Likewise.
11232         * fileio.c: Likewise.
11233         * filelock.c: Likewise.
11234         * font.c: Likewise.
11235         * fontset.c: Likewise.
11236         * fringe.c: Likewise.
11237         * indent.c: Likewise.
11238         * insdel.c: Likewise.
11239         * intervals.c: Likewise.
11240         * keyboard.c: Likewise.
11241         * keymap.c: Likewise.
11242         * lread.c: Likewise.
11243         * macros.c: Likewise.
11244         * marker.c: Likewise.
11245         * minibuf.c: Likewise.
11246         * nsfns.m: Likewise.
11247         * nsmenu.m: Likewise.
11248         * print.c: Likewise.
11249         * process.c: Likewise.
11250         * regex.c: Likewise.
11251         * region-cache.c: Likewise.
11252         * search.c: Likewise.
11253         * syntax.c: Likewise.
11254         * term.c: Likewise.
11255         * textprop.c: Likewise.
11256         * undo.c: Likewise.
11257         * unexsol.c: Likewise.
11258         * w16select.c: Likewise.
11259         * w32fns.c: Likewise.
11260         * w32menu.c: Likewise.
11261         * window.c: Likewise.
11262         * xdisp.c: Likewise.
11263         * xfns.c: Likewise.
11264         * xmenu.c: Likewise.
11265         * xml.c: Likewise.
11266         * xselect.c: Likewise.
11268 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
11270         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11271         If all the glyphs of the glyph row came from strings, and we have no
11272         cursor positioning clues, put the cursor on the first glyph of the
11273         row.
11274         (handle_face_prop): Use chunk-relative overlay string index when
11275         indexing into it->string_overlays array.  (Bug#11653)
11276         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11277         the rightmost.  (Bug#11720)
11279 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
11281         * category.h (CHAR_HAS_CATEGORY): Define as inline.
11282         (CATEGORY_MEMBER): Enforce 1/0 value.
11283         * category.c (_temp_category_set): Remove.
11285 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
11287         * window.c (Fdelete_other_windows_internal)
11288         (Fdelete_window_internal): Don't access frame's mouse highlight
11289         info of the initial frame.  (Bug#11677)
11291 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
11293         * .gdbinit (xgetint): Fix recently-introduced paren typo.
11294         Assume USE_2_TAGS_FOR_INTS.
11295         (xreload): Adjust $tagmask width to match recent lisp.h change.
11297         Simplify lisp.h in minor ways that should not affect code.
11298         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11299         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11300         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11301         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11302         (INTTYPEBITS): New macro, for clarity.
11303         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
11304         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11305         Simplify now that USE_LSB_TAG is always defined.
11306         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11307         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11309 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
11311         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11313 2012-06-13  Glenn Morris  <rgm@gnu.org>
11315         * s/bsd-common.h (BSD4_3):
11316         * s/usg5-4-common.h (USG5_4): No longer define; unused.
11318 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
11320         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11321         instead of union.
11322         (XLI, XIL): Define.
11323         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11324         Use them.
11325         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
11326         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
11327         * alloc.c (widen_to_Lisp_Object): Remove.
11328         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11329         * frame.c (delete_frame): Remove outdated comment.
11330         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11331         USE_LISP_UNION_TYPE.
11332         (Fw32_unregister_hot_key): Likewise.
11333         (Fw32_toggle_lock_key): Likewise.
11334         * w32menu.c (add_menu_item): Likewise.
11335         (w32_menu_display_help): Use XIL instead of checking
11336         USE_LISP_UNION_TYPE.
11337         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11338         (init_heap): Likewise.
11339         * w32term.c (w32_read_socket): Update comment.
11341 2012-06-13  Glenn Morris  <rgm@gnu.org>
11343         * s/usg5-4-common.h, src/s/unixware.h:
11344         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11346         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11348 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
11350         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11351         * alloc.c (make_number) [!defined make_number]:
11352         Remove, as lisp.h always defines this now.
11353         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11354         (roundup_size): Verify that it is a power of 2.
11355         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11356         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11357         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11358         -DUSE_LSB_TAG=0, to override the automatically-selected default.
11359         USE_LSB_TAG now is always defined to be either 0 or 1.
11360         All uses changed.
11361         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11362         code works fine either way, and efficiency is not a concern here,
11363         as the union type is for debugging, not for production.
11364         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11365         Use an inline function on all platforms when using the union type,
11366         since this is simpler and 'static inline' can be used portably
11367         within Emacs now.
11368         (LISP_INITIALLY_ZERO): New macro.
11369         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11370         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11372 2012-06-12  Glenn Morris  <rgm@gnu.org>
11374         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11376         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
11378         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11379         Move BROKEN_SIGIO to configure.
11381         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11382         Move NO_TERMIO to configure.
11384 2012-06-12  Chong Yidong  <cyd@gnu.org>
11386         * image.c (imagemagick_load_image): Use MagickFlattenImage if
11387         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
11388         MagickExportImagePixels is undefined.
11390 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
11392         * image.c (imagemagick_load_image): Remove unused label.
11394 2012-06-11  Glenn Morris  <rgm@gnu.org>
11396         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11397         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11398         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11399         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11401 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
11403         * alloc.c (make_byte_code): New function.
11404         (Fmake_byte_code): Use it.  Don't purify here.
11405         * lread.c (read1): Use it as well to avoid extra allocation.
11407 2012-06-11  Chong Yidong  <cyd@gnu.org>
11409         * image.c (imagemagick_load_image): Implement transparency.
11411 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
11413         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11414         account for preceding backslashes.  (Bug#11663)
11416 2012-06-09  Chong Yidong  <cyd@gnu.org>
11418         * term.c: Support italics in capable terminals (Bug#9652).
11419         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11420         (turn_on_face): Output using TS_enter_italic_mode if available.
11421         Don't handle unused blinking and alt-charset cases.
11422         (turn_off_face): Handle italic case; discard unused tty_blinking_p
11423         and tty_alt_charset_p cases.
11424         (tty_capable_p, init_tty): Support italics.
11426         * termchar.h (struct tty_display_info): Add field for italics.
11427         Remove unused blink field.
11429         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11430         Handle slant.
11432         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11433         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11434         tty_alt_charset_p.  Add tty_italic_p.
11436 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
11438         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11439         dbus_type_is_basic if available.
11440         (xd_extract_signed, xd_extract_unsigned): Rename from
11441         extract_signed and extract_unsigned, respectively.  Adapt callers.
11443 2012-06-09  Chong Yidong  <cyd@gnu.org>
11445         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11447         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11448         case (Bug#9752).
11450 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
11452         * xdisp.c (vmessage): Treat frame message as multibyte.
11453         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11454         would generate the diagnostic "Making \302\247 buffer-local while
11455         let-bound!".
11457 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
11459         * dispnew.c (showing_window_margins_p): Undo last change, which
11460         was done due to an inadvertent commit.
11461         (adjust_frame_glyphs_for_frame_redisplay): Do call
11462         showing_window_margins_p.
11464 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
11466         * eval.c (Fmake_var_non_special): New primitive.
11467         (syms_of_eval): Defsubr it.
11468         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11470 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
11472         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11473         function warning (the only call is inside #if 0 since revno:108521).
11475 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
11477         * alloc.c (allocate_vectorlike): Fix last change.
11479 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
11481         Block-based vector allocation of small vectors.
11482         * lisp.h (struct vectorlike_header): New field `nbytes',
11483         adjust comment accordingly.
11484         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
11485         to denote vector blocks.  Adjust users (live_vector_p,
11486         mark_maybe_pointer, valid_lisp_object_p) accordingly.
11487         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11488         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11489         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11490         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11491         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11492         (roundup_size): New constant.
11493         (struct vector_block): New data type.
11494         (vector_blocks, vector_free_lists, zero_vector): New variables.
11495         (all_vectors): Rename to `large_vectors'.
11496         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11497         (sweep_vectors): New functions.
11498         (allocate_vectorlike): Return `zero_vector' as the only vector of
11499         0 items.  Allocate new vector from block if vector size is less than
11500         or equal to VBLOCK_BYTES_MAX.
11501         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11502         (init_alloc_once): Add call to init_vectors.
11504 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
11506         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11508 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
11510         * doprnt.c (doprnt): Truncate multibyte char correctly.
11511         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11512         would mishandle a string argument "Xc" if X was a multibyte
11513         character of length 2: it would truncate after X's first byte
11514         rather than including all of X.
11516 2012-06-06  Chong Yidong  <cyd@gnu.org>
11518         * buffer.c (word_wrap): Doc fix.
11520 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
11522         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11524 2012-06-03  Glenn Morris  <rgm@gnu.org>
11526         * xdisp.c (tool-bar-style): Doc fix.
11528 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
11530         * Makefile.in (PAXCTL): Define.
11531         (temacs$(EXEEXT)): Disable memory randomization for the temacs
11532         binary via PaX flags if the paxctl utility is available.
11533         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11534         Restore PaX flags to their default.  (Bug#11398)
11536 2012-06-03  Chong Yidong  <cyd@gnu.org>
11538         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11539         buffer (Bug#11226).
11541 2012-06-03  Chong Yidong  <cyd@gnu.org>
11543         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11544         (note_mode_line_or_margin_highlight): If there is no help echo,
11545         use mode-line-default-help-echo.  Handle the case where the mouse
11546         position is past the end of the mode line string.
11548         * buffer.c (buffer_local_value_1): New function, split from
11549         Fbuffer_local_value; can return Qunbound.
11550         (Fbuffer_local_value): Use it.
11551         (Vmode_line_format): Docstring tweaks.
11553 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
11555         * sysdep.c (system_process_attributes): Improve comment.
11557 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
11559         * keyboard.c: Export real-this-command to Elisp.
11560         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11561         and DEFVAR it.  Update all users.
11563 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
11565         * minibuf.c (Fassoc_string): Remove duplicate declaration.
11567         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11568         Convert pctcpu and pctmem to Lisp float properly.
11569         Let the compiler fold better, as 100.0/0x8000 is exact.
11571 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
11573         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11574         cons_block.
11576 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
11578         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11580 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
11582         For a 'struct window', replace some Lisp_Object fields to
11583         bitfields where appropriate, remove unused fields.
11584         * window.h (struct window): Remove unused 'last_mark_x' and
11585         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
11586         change its type from Lisp_Object to bitfield.
11587         Change type of 'force_start', 'optional_new_start',
11588         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
11589         fields from Lisp_Object to bitfield.  Adjust users accordingly.
11591 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
11593         Pacify gcc -Wdouble-precision when using Xaw.
11594         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11595         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11596         Use 'float' consistently, rather than 'float' in most places
11597         and 'double' in a couple of places.
11599 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
11601         * xdisp.c (handle_stop): Detect whether we have overlay strings
11602         loaded by testing it->current.overlay_string_index to be
11603         non-negative, instead of checking whether n_overlay_strings is
11604         positive.  (Bug#11587)
11606 2012-05-31  Chong Yidong  <cyd@gnu.org>
11608         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11610         * doc.c (Fsubstitute_command_keys): Doc fix.
11612 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
11614         * search.c (search_buffer): Remove calls to
11615         r_alloc_inhibit_buffer_relocation, as it is now called by
11616         maybe_unify_char, which was the cause of relocation of buffer text
11617         in bug#11519.
11619 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
11621         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11622         for the duration of call to load_charset, to avoid problems with
11623         callers of maybe_unify_char that access buffer text through C
11624         pointers.
11626         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11627         decrement the inhibition flag, instead of just setting or
11628         resetting it.
11630 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
11632         Remove obsolete '#define static' cruft.
11633         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11634         This #undef was "temporary" in 2000; it is no longer needed
11635         now that '#define static' has gone away.
11636         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11637         (gray_bitmap_bits): Remove; no longer needed.
11638         All uses replaced with definiens.
11639         * xterm.c: Include "bitmaps/gray.xbm".
11641 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
11643         Clean up __executable_start, monstartup when --enable-profiling.
11644         The following changes affect the code only when profiling.
11645         * dispnew.c (__executable_start): Rename from safe_bcopy.
11646         Define only on platforms that need it.
11647         * emacs.c: Include <sys/gmon.h> when profiling.
11648         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11649         (__executable_start): Remove decl, since lisp.h does it now.
11650         (safe_bcopy): Remove decl; no longer has that name.
11651         (main): Coalesce #if into single bit of code, for simplicity.
11652         Cast pointers to uintptr_t, since standard libraries want integers
11653         and not pointers.
11654         * lisp.h (__executable_start): New decl.
11656 2012-05-31  Glenn Morris  <rgm@gnu.org>
11658         * image.c (Fimagemagick_types): Doc fix.
11660 2012-05-30  Jim Meyering  <meyering@redhat.com>
11662         * callproc.c (Fcall_process_region): Include directory component
11663         in mkstemp error message (Bug#11586).
11665 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
11667         * alloc.c, lisp.h (make_pure_vector): Now static.
11669 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
11671         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11672         Move to byte-run.el.
11673         (Fautoload): Do the hash-doc more carefully.
11674         * data.c (Fdefalias): Purify definition, except for keymaps.
11675         (Qdefun): Move from eval.c.
11676         * lisp.h (Qdefun): Remove.
11677         * lread.c (read1): Tiny simplification.
11679 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
11681         Do not create empty overlays with the evaporate property (Bug#9642).
11682         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11683         Bug#9642, but explicitly check that the buffer the overlay would
11684         be moved to is live and rearrange lines to make sure that errors
11685         will not put the overlay in an inconsistent state.
11686         (Fdelete_overlay): Cosmetics.
11688 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
11690         * w32term.c (my_bring_window_to_top): New function.
11691         (x_raise_frame): Use handle returned by DeferWindowPos, which
11692         could be different from the original one.
11693         Call my_bring_window_to_top instead of my_set_foreground_window.
11694         (Bug#11513)
11696         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11697         by calling BringWindowToTop.
11699         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11700         (WM_EMACS_END): Increase by one.
11702 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
11704         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11705         This avoids undefined behavior that might cause the eassert
11706         to not catch an out-of-range value.
11708 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
11710         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11711         Update dependencies.
11713 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
11715         * bidi.c (bidi_mirror_char): Fix last change.
11717 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
11719         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11720         when referring to sectname field in printf format.
11722 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
11724         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11725         Only r_alloc_inhibit_buffer_relocation needed to be added;
11726         the others were already declared.
11728         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11729         before checking whether it's out of range.  Put the check inside
11730         eassert.  See
11731         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11733 2012-05-27  Ken Brown  <kbrown@cornell.edu>
11735         * callproc.c (Fcall_process): Restore a line that was accidentally
11736         commented out in the 2011-02-13 change (bug#11547).
11738 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
11740         * lisp.h [REL_ALLOC]: Add prototypes for external functions
11741         defined on ralloc.c.
11743         * buffer.c [REL_ALLOC]: Remove prototypes of
11744         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11745         they are now on lisp.h.
11747         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11749         * search.c (search_buffer): Use it to inhibit relocation of buffer
11750         text while re_search_2 is doing its job, because re_search_2 is
11751         passed C pointers to buffer text.  (Bug#11519)
11753         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11754         Update value to 24.
11756         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11757         state after an additional call to move_it_in_display_line_to, keep
11758         the values of it->max_ascent and it->max_descent found for the
11759         entire line.
11760         (pos_visible_p): Revert the comparison against bottom_y to what it
11761         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11762         (Bug#11464)
11764 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
11766         Fix coding-related core dumps with gcc -ftrapv.
11767         The code was computing A - B, where A and B are pointers, and B is
11768         random garbage.  This can lead to core dumps on platforms that
11769         have special pointer registers, and it also leads to core dumps on
11770         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
11771         A - B only when B is initialized properly.
11772         * coding.c (coding_set_source, coding_set_destination): Return void.
11773         (coding_change_source, coding_change_destinations): New functions,
11774         with the old behaviors of coding_set_source and coding_set_destination.
11775         All callers that need an offset changed to use these new functions.
11777 2012-05-26  Glenn Morris  <rgm@gnu.org>
11779         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
11781 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
11783         Extend mouse support on W32 text-mode console.
11784         * xdisp.c (draw_row_with_mouse_face):
11785         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
11787         * w32console.c: Include window.h.
11788         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11789         New functions.
11790         (initialize_w32_display): Initialize mouse-highlight data.
11792         * w32inevt.c: Include termchar.h and window.h.
11793         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
11794         moves, call note_mouse_highlight.  If help_echo changed, call
11795         gen_help_event to produce help-echo message in the echo area.
11796         Call clear_mouse_face if mouse_face_hidden is set in the mouse
11797         highlight info.
11799 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
11801         * lread.c (read1): Simplify slightly to avoid an overflow warning
11802         with GCC 4.7.0 on x86-64.
11804 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
11806         * bidi.c (bidi_mirror_char): Revert last change: an int is
11807         definitely wide enough here.
11809 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
11811         Fix integer width and related bugs (Bug#9874).
11812         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
11813         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11814         (string_bytes, check_sblock, allocate_string_data):
11815         (compact_small_strings, Fmake_bool_vector, make_string)
11816         (make_unibyte_string, make_multibyte_string)
11817         (make_string_from_bytes, make_specified_string)
11818         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11819         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11820         (mark_vectorlike):
11821         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11822         (allocate_pseudovector):
11823         Use int, not EMACS_INT, where int is wide enough.
11824         (inhibit_garbage_collection, Fgarbage_collect):
11825         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11826         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11827         int might not be wide enough.
11828         (bidi_cache_search, bidi_cache_find, bidi_init_it)
11829         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11830         (bidi_at_paragraph_end, bidi_find_paragraph_start)
11831         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11832         (bidi_level_of_next_char, bidi_move_to_visually_next):
11833         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11834         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11835         (Fkill_buffer, Fset_buffer_major_mode)
11836         (advance_to_char_boundary, Fbuffer_swap_text)
11837         (Fset_buffer_multibyte, overlays_at, overlays_in)
11838         (overlay_touches_p, struct sortvec, record_overlay_string)
11839         (overlay_strings, recenter_overlay_lists)
11840         (adjust_overlays_for_insert, adjust_overlays_for_delete)
11841         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11842         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11843         (Foverlay_recenter, last_overlay_modification_hooks_used)
11844         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11845         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11846         (validate_region): Omit unnecessary test for b <= e,
11847         since that's guaranteed by the previous test.
11848         (adjust_overlays_for_delete): Avoid pos + length overflow.
11849         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11850         (report_overlay_modification):
11851         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11852         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11853         Omit pointer cast, which isn't needed anyway, and doesn't work
11854         after the EMACS_INT -> ptrdiff_t change.
11855         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
11856         * buffer.h: Adjust decls to match defn changes elsewhere.
11857         (struct buffer_text, struct buffer):
11858         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11859         Use EMACS_INT, not int, where int might not be wide enough.
11860         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
11861         not int, to avoid needless 32-bit limit on 64-bit hosts.
11862         (exec_byte_code): Use tighter memory-full test, one that checks
11863         for alloca overflow.  Don't compute the address of the object just
11864         before an array, as that's not portable.  Use EMACS_INT, not
11865         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
11866         * callint.c (Fcall_interactively):
11867         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11868         * callproc.c (call_process_kill, Fcall_process):
11869         Don't assume pid_t fits into an Emacs fixnum.
11870         (call_process_cleanup, Fcall_process, child_setup):
11871         Don't assume pid_t fits into int.
11872         (call_process_cleanup, Fcall_process, delete_temp_file)
11873         (Fcall_process_region):
11874         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11875         (Fcall_process): Simplify handling of volatile integers.
11876         Use int, not EMACS_INT, where int will do.
11877         * casefiddle.c (casify_object, casify_region, operate_on_word)
11878         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
11879         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11880         (casify_object): Avoid integer overflow when overallocating buffer.
11881         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
11882         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
11883         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
11884         * category.h (CATEGORYP): Don't assume arg is nonnegative.
11885         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
11886         integers are now checked earlier.  All uses replaced with XINT.
11887         (ccl_driver):
11888         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11889         For CCL_MapSingle, check that content and value are in int range.
11890         (ccl_driver, Fregister_code_conversion_map):
11891         Check that Vcode_version_map_vector is a vector.
11892         (resolve_symbol_ccl_program): Check that vector header is in range.
11893         Always copy the vector, so that we can check its contents reliably
11894         now rather than having to recheck each instruction as it's being
11895         executed.  Check that vector words fit in 'int'.
11896         (ccl_get_compiled_code, Fregister_ccl_program)
11897         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
11898         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
11899         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
11900         contents are in range.
11901         (Fccl_execute_on_string): Check that status is in range.
11902         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
11903         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
11904         Accept and return EMACS_INT, not int, because callers can pass values
11905         out of 'int' range.
11906         (c_string_width, strwidth, lisp_string_width, chars_in_text)
11907         (multibyte_chars_in_text, parse_str_as_multibyte)
11908         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
11909         (str_as_unibyte, str_to_unibyte, string_count_byte8)
11910         (string_escape_byte8, Fget_byte):
11911         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11912         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
11913         avoid mishandling large integers.
11914         * character.h: Adjust decls to match defn changes elsewhere.
11915         * charset.c (load_charset_map_from_file, find_charsets_in_text)
11916         (Ffind_charset_region):
11917         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11918         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
11919         (load_charset_map_from_vector, Fdefine_charset_internal):
11920         Don't assume fixnum fits in int.
11921         (load_charset_map_from_vector, Fmap_charset_chars):
11922         Remove now-unnecessary CHECK_NATNUMs.
11923         (Fdefine_charset_internal): Check ranges here, more carefully.
11924         Don't rely on undefined behavior with signed left shift overflow.
11925         Don't assume unsigned int fits into fixnum, or that fixnum fits
11926         into unsigned int.  Don't require max_code to be a valid fixnum;
11927         that's not true for gb10830 4-byte on a 32-bit host.  Allow
11928         invalid_code to be a cons, for the same reason.  Require code_offset
11929         to be a character.  Avoid int overflow if max_char is close
11930         to INT_MAX.
11931         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
11932         this is intended anyway and avoids some undefined behavior.
11933         (load_charset_map): Pass unsigned, not int, as 2nd arg of
11934         INDEX_TO_CODE_POINT, as that's what it expects.
11935         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
11936         * charset.h (DECODE_CHAR): Return int, not unsigned;
11937         this is what was intended anyway, and it avoids undefined behavior.
11938         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
11939         integer-overflow issues.
11940         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
11941         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
11942         where the argument is EMACS_INT, and this behavior is not intended.
11943         * chartab.c (Fmake_char_table, Fset_char_table_range)
11944         (uniprop_get_decoder, uniprop_get_encoder):
11945         Don't assume fixnum fits in int.
11946         * cmds.c (move_point): New function, that does the gist of
11947         Fforward_char and Fbackward_char, but does so while checking
11948         for integer overflow more accurately.
11949         (Fforward_char, Fbackward_char): Use it.
11950         (Fforward_line, Fend_of_line, internal_self_insert)
11951         (internal_self_insert):
11952         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11953         Fix a FIXME, by checking for integer overflow when calculating
11954         target_clm and actual_clm.
11955         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
11956         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
11957         (ASSURE_DESTINATION, coding_alloc_by_realloc)
11958         (coding_alloc_by_making_gap, alloc_destination)
11959         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
11960         (encode_coding_utf_16, detect_coding_emacs_mule)
11961         (decode_coding_emacs_mule, encode_coding_emacs_mule)
11962         (detect_coding_iso_2022, decode_coding_iso_2022)
11963         (encode_invocation_designation, encode_designation_at_bol)
11964         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11965         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
11966         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
11967         (encode_coding_ccl, encode_coding_raw_text)
11968         (detect_coding_charset, decode_coding_charset)
11969         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
11970         (produce_composition, produce_charset, produce_annotation)
11971         (decode_coding, handle_composition_annotation)
11972         (handle_charset_annotation, consume_chars, decode_coding_gap)
11973         (decode_coding_object, encode_coding_object, detect_coding_system)
11974         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
11975         (code_convert_region, code_convert_string)
11976         (Fdefine_coding_system_internal)
11977         (coding_set_source, coding_set_destination):
11978         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11979         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
11980         (Fdefine_coding_system_internal):
11981         Don't assume fixnums fit in int.
11982         (decode_coding_gap, decode_coding_object, encode_coding_object)
11983         (Fread_coding_system, Fdetect_coding_region)
11984         (Funencodable_char_position, Fcheck_coding_systems_region)
11985         (get_translation, handle_composition_annotation, consume_chars):
11986         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11987         (consume_chars): Rewrite to not calculate an address outside buffer.
11988         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
11989         Don't access memory outside of the args array.
11990         (Fdefine_coding_system_internal): Check for charset-id overflow.
11991         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
11992         result of ENCODE_CHAR.
11993         * coding.h: Adjust decls to match defn changes elsewhere.
11994         (struct coding_system):
11995         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11996         * composite.c (get_composition_id, find_composition)
11997         (run_composition_function, update_compositions)
11998         (compose_text, composition_gstring_put_cache)
11999         (composition_gstring_p, composition_gstring_width)
12000         (fill_gstring_header, fill_gstring_body, autocmp_chars)
12001         (composition_compute_stop_pos, composition_reseat_it)
12002         (composition_update_it, struct position_record)
12003         (find_automatic_composition, composition_adjust_point)
12004         (Fcomposition_get_gstring, Ffind_composition_internal):
12005         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12006         (update_compositions):
12007         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12008         * composite.h: Adjust decls to match defn changes elsewhere.
12009         (struct composition):
12010         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12011         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12012         Do not attempt to compute the address of the object just before a
12013         buffer; this is not portable.
12014         (Faref, Faset):
12015         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12016         (Faset): Use int, not EMACS_INT, where int is wide enough.
12017         (Fstring_to_number): Don't assume fixnums fit in int.
12018         (Frem): Don't assume arg is nonnegative.
12019         * dbusbind.c (xd_append_arg): Check for integers out of range.
12020         (Fdbus_call_method): Don't overflow the timeout int.
12021         (extract_signed, extract_unsigned): New functions.
12022         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12023         (xd_get_connection_references): Return ptrdiff_t, not int.
12024         All uses changed.
12025         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12026         (xd_read_message_1):
12027         Use int, not unsigned, where the dbus API uses int.
12028         (Fdbus_message_internal): Don't overflow mtype.
12029         (syms_of_dbusbind): Allocate right-sized buffer for integers.
12030         * dired.c (directory_files_internal, file_name_completion, scmp)
12031         (file_name_completion_stat):
12032         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12033         (file_name_completion): Don't overflow matchcount.
12034         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12035         * dispextern.h: Adjust decls to match defn changes elsewhere.
12036         (struct text_pos, struct glyph, struct bidi_saved_info)
12037         (struct bidi_string_data, struct bidi_it, struct composition_it)
12038         (struct it):
12039         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12040         (struct display_pos, struct composition_it, struct it):
12041         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12042         * dispnew.c (increment_matrix_positions)
12043         (increment_row_positions, mode_line_string)
12044         (marginal_area_string):
12045         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12046         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
12047         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12048         (duration_to_sec_usec): New function, to check for overflow better.
12049         (Fsleep_for, sit_for): Use it.
12050         * doc.c (get_doc_string, store_function_docstring):
12051         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12052         (get_doc_string, Fsnarf_documentation):
12053         Use int, not EMACS_INT, where int is wide enough.
12054         (get_doc_string):
12055         Use SAFE_ALLOCA, not alloca.
12056         Check for overflow when converting EMACS_INT to off_t.
12057         * doprnt.c (doprnt):
12058         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12059         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12060         Don't assume uid_t fits into fixnum.
12061         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12062         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12063         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12064         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12065         (general_insert_function)
12066         (Finsert_char, make_buffer_string, make_buffer_string_both)
12067         (update_buffer_properties, Fbuffer_substring)
12068         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12069         (Fsubst_char_in_region, check_translation)
12070         (Ftranslate_region_internal, save_restriction_restore, Fformat)
12071         (transpose_markers, Ftranspose_regions):
12072         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12073         (clip_to_bounds): Move to lisp.h as an inline function).
12074         (Fconstrain_to_field): Don't assume integers are nonnegative.
12075         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12076         (Fsubst_char_in_region, Fsave_restriction):
12077         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12078         (Femacs_pid): Don't assume pid_t fits into fixnum.
12079         (lo_time): Use int, not EMACS_INT, when int suffices.
12080         (lisp_time_argument): Check for usec out of range.
12081         (Fencode_time): Don't assume fixnum fits in int.
12082         (Fuser_login_name, Fuser_full_name): Signal an error
12083         if a uid argument is out of range, rather than relying on
12084         undefined behavior.
12085         (Fformat_time_string): Remove now-unnecessary check.
12086         lisp_time_argument checks for out-of-range usec now.
12087         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
12088         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12089         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12090         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12091         (init_cmdargs, Fdump_emacs):
12092         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12093         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12094         the bottom (typically) 32 bits of the fixnum.
12095         * eval.c (specpdl_size, call_debugger):
12096         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12097         (when_entered_debugger, Fbacktrace_debug):
12098         Don't assume fixnum can fit in int.
12099         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12100         the object just before a buffer; this is not portable.
12101         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12102         (grow_specpdl, unbind_to):
12103         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12104         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12105         (grow_specpdl): Simplify allocation by using xpalloc.
12106         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
12107         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12108         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12109         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12110         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12111         (a_write, e_write):
12112         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12113         (Fcopy_file, non_regular_nbytes, read_non_regular)
12114         (Finsert_file_contents):
12115         Use int, not EMACS_INT, where int is wide enough.
12116         (READ_BUF_SIZE): Verify that it fits in int.
12117         (Finsert_file_contents): Check that counts are in proper range,
12118         rather than assuming fixnums fit into ptrdiff_t etc.
12119         Don't assume fixnums fit into int.
12120         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
12121         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12122         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
12123         (string_char_to_byte, string_byte_to_char)
12124         (string_make_multibyte, string_to_multibyte)
12125         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12126         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12127         (substring_both, Fdelete, internal_equal, Ffillarray)
12128         (Fclear_string, mapcar1)
12129         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12130         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12131         (larger_vector, make_hash_table, maybe_resize_hash_table)
12132         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12133         (Fmaphash, secure_hash):
12134         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12135         (concat): Check for string index and length overflow.
12136         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12137         (Frequire):
12138         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12139         (larger_vector): New API (vec, incr_min, size_max) replaces old
12140         one (vec, new_size, init).  This catches size overflow.
12141         INIT was removed because it was always Qnil.
12142         All callers changed.
12143         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12144         the upper bound on a hash table index size.
12145         (make_hash_table, maybe_resize_hash_table): Use it.
12146         (secure_hash): Computer start_byte and end_byte only after
12147         they're known to be in ptrdiff_t range.
12148         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12149         (Ffont_get_glyphs, Ffont_at):
12150         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12151         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12152         (Flist_fonts, Fopen_font):
12153         Don't assume fixnum can fit in int.
12154         (check_gstring): Don't assume index can fit in int.
12155         (font_match_p): Check that fixnum is a character, not a nonnegative
12156         fixnum, since the later code needs to stuff it into an int.
12157         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12158         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12159         conversion overflow issues.
12160         (Fopen_font): Check for integer out of  range.
12161         (Ffont_get_glyphs): Don't assume index can fit in int.
12162         * font.h: Adjust decls to match defn changes elsewhere.
12163         * fontset.c (reorder_font_vector): Redo score calculation to avoid
12164         integer overflow.
12165         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12166         printmax_t, where ptrdiff_t is wide enough.
12167         (Finternal_char_font):
12168         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12169         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12170         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12171         (Fset_frame_position, x_set_frame_parameters)
12172         (x_set_line_spacing, x_set_border_width)
12173         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12174         Check that fixnums are in proper range for system types.
12175         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12176         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12177         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12178         Use SAFE_ALLOCA_LISP, not alloca.
12179         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12180         intptr_t is wide enough.
12181         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12182         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12183         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12184         Check for fixnum out of range.
12185         * ftfont.c (ftfont_list): Don't assume index fits in int.
12186         Check that fixnums are in proper range for system types.
12187         (ftfont_shape_by_flt):
12188         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12189         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12190         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12191         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12192         Check that fixnums are in proper range for system types.
12193         * gnutls.h: Adjust decls to match defn changes elsewhere.
12194         * gtkutil.c (xg_dialog_run):
12195         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12196         (update_frame_tool_bar):
12197         Check that fixnums are in proper range for system types.
12198         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
12199         (lookup_image): Check that fixnums are in range for system types.
12200         * indent.c (last_known_column, last_known_column_point):
12201         (current_column_bol_cache):
12202         (skip_invisible, current_column, check_display_width):
12203         (check_display_width, scan_for_column, current_column_1)
12204         (Findent_to, Fcurrent_indentation, position_indentation)
12205         (indented_beyond_p, Fmove_to_column, compute_motion):
12206         (Fcompute_motion, Fvertical_motion):
12207         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12208         (last_known_column_modified): Use EMACS_INT, not int.
12209         (check_display_width):
12210         (Fcompute_motion):
12211         Check that fixnums and floats are in proper range for system types.
12212         (compute_motion): Don't assume index or fixnum fits in int.
12213         (compute_motion, Fcompute_motion):
12214         Use int, not EMACS_INT, when it is wide enough.
12215         (vmotion): Omit local var start_hpos that is always 0; that way
12216         we don't need to worry about overflow in expressions involving it.
12217         * indent.h: Adjust decls to match defn changes elsewhere.
12218         (struct position):
12219         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12220         Use int, not EMACS_INT, where int is wide enough.
12221         Remove unused members ovstring_chars_done and tab_offset;
12222         all uses removed.
12223         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12224         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12225         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12226         (make_gap, copy_text, insert, insert_and_inherit)
12227         (insert_before_markers, insert_before_markers_and_inherit)
12228         (insert_1, count_combining_before, count_combining_after)
12229         (insert_1_both, insert_from_string)
12230         (insert_from_string_before_markers, insert_from_string_1)
12231         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12232         (adjust_after_replace, adjust_after_insert, replace_range)
12233         (replace_range_2, del_range, del_range_1, del_range_byte)
12234         (del_range_both, del_range_2, modify_region)
12235         (prepare_to_modify_buffer, signal_before_change)
12236         (signal_after_change, Fcombine_after_change_execute):
12237         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12238         * intervals.c (traverse_intervals, rotate_right, rotate_left)
12239         (balance_an_interval, split_interval_right, split_interval_left)
12240         (find_interval, next_interval, update_interval)
12241         (adjust_intervals_for_insertion, delete_node, delete_interval)
12242         (interval_deletion_adjustment, adjust_intervals_for_deletion)
12243         (static_offset_intervals, offset_intervals)
12244         (merge_interval_right, merge_interval_left, make_new_interval)
12245         (graft_intervals_into_buffer, temp_set_point_both)
12246         (temp_set_point, set_point, adjust_for_invis_intang)
12247         (set_point_both, move_if_not_intangible, get_property_and_range)
12248         (get_local_map, copy_intervals, copy_intervals_to_string)
12249         (compare_string_intervals, set_intervals_multibyte_1):
12250         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12251         * intervals.h: Adjust decls to match defn changes elsewhere.
12252         (struct interval):
12253         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12254         * keyboard.c (this_command_key_count, this_single_command_key_start)
12255         (before_command_key_count, before_command_echo_length, echo_now)
12256         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12257         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12258         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12259         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12260         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12261         (last_non_minibuf_size, last_point_position, echo_truncate)
12262         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12263         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12264         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12265         (stuff_buffered_input):
12266         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12267         (last_auto_save, command_loop_1, read_char):
12268         Use EMACS_INT, not int, to avoid integer overflow.
12269         (record_char): Avoid overflow in total_keys computation.
12270         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12271         * keyboard.h: Adjust decls to match defn changes elsewhere.
12272         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12273         (Fkey_description, Fdescribe_vector, Flookup_key):
12274         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12275         (click_position): New function, to check that positions are in range.
12276         (Fcurrent_active_maps):
12277         (describe_command):
12278         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12279         (Faccessible_keymaps, Fkey_description):
12280         (preferred_sequence_p):
12281         Don't assume fixnum can fit into int.
12282         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12283         Check for integer overflow in size calculations.
12284         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12285         avoid mishandling large integers.
12286         * lisp.h: Adjust decls to match defn changes elsewhere.
12287         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12288         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12289         (struct Lisp_Marker):
12290         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12291         (clip_to_bounds): Now an inline function, moved here from editfns.c.
12292         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12293         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12294         All callers changed.
12295         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12296         Assume the arg has valid form, since it always does.
12297         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12298         unsigned integer system type.
12299         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12300         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12301         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12302         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12303         (duration_to_sec_usec): New decl.
12304         * lread.c (read_from_string_index, read_from_string_index_byte)
12305         (read_from_string_limit, readchar, unreadchar, openp)
12306         (read_internal_start, read1, oblookup):
12307         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12308         (Fload, readevalloop, Feval_buffer, Feval_region):
12309         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12310         (openp): Check for out-of-range argument to 'access'.
12311         (read1): Use int, not EMACS_INT, where int is wide enough.
12312         Don't assume fixnum fits into int.
12313         Fix off-by-one error that can read outside a buffer.
12314         (read_filtered_event): Use duration_to_sec_usec
12315         to do proper overflow checking on durations.
12316         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12317         in size calculation.
12318         (Fexecute_kbd_macro):
12319         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12320         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12321         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12322         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12323         (set_marker_both, set_marker_restricted_both, marker_position)
12324         (marker_byte_position, Fbuffer_has_markers_at):
12325         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12326         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
12327         * menu.c (ensure_menu_items): Rename from grow_menu_items.
12328         It now merely ensures that the menu is large enough, without
12329         necessarily growing it, as this avoids some integer overflow issues.
12330         All callers changed.
12331         (keymap_panes, parse_single_submenu, Fx_popup_menu):
12332         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12333         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12334         Use SAFE_ALLOCA_LISP, not alloca.
12335         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12336         to EMACS_INT.  Check that fixnums are in proper range for system types.
12337         * minibuf.c (minibuf_prompt_width, string_to_object)
12338         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12339         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12340         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12341         (get_minibuffer, read_minibuf_unwind):
12342         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12343         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12344         this simplifies overflow checking.  All callers changed.
12345         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12346         (Ftest_completion):
12347         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12348         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12349         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12350         Check that fixnums are in proper range for system types.
12351         (Fx_create_frame, Fx_show_tip):
12352         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12353         * nsfont.m (ns_findfonts, nsfont_list_family):
12354         Don't assume fixnum fits in long.
12355         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12356         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12357         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12358         wide enough.
12359         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
12360         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12361         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12362         (PRINTDECLARE, PRINTPREPARE):
12363         (strout, print_string):
12364         (print, print_preprocess, print_check_string_charset_prop)
12365         (print_object):
12366         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12367         (PRINTDECLARE):
12368         (temp_output_buffer_setup, Fprin1_to_string, print_object):
12369         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12370         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
12371         (printchar, strout): Use xpalloc to catch size calculation overflow.
12372         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
12373         (print_error_message): Use SAFE_ALLOCA, not alloca.
12374         (print_object): Use int, not EMACS_INT, where int is wide enough.
12375         (print_depth, new_backquote_output, print_number_index):
12376         Use ptrdiff_t, not int, where int might not be wide enough.
12377         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12378         (Fset_process_window_size, Fformat_network_address)
12379         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
12380         (sigchld_handler):
12381         Check that fixnums are in proper range for system types.
12382         (Fsignal_process): Simplify by avoiding a goto.
12383         Check for process-ids out of pid_t range rather than relying on
12384         undefined behavior.
12385         (process_tick, update_tick): Use EMACS_INT, not int.
12386         (Fformat_network_address, read_process_output, send_process)
12387         (Fprocess_send_region, status_notify):
12388         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12389         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12390         (wait_reading_process_output, read_process_output, exec_sentinel):
12391         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12392         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12393         (Faccept_process_output): Use duration_to_sec_usec to do proper
12394         overflow checking on durations.
12395         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12396         Don't assume pid_t fits in int.
12397         * process.h (struct Lisp_Process): Members tick and update_tick
12398         are now of type EMACS_INT, not int.
12399         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12400         configured --with-wide-int.
12401         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12402         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12403         * search.c (looking_at_1, string_match_1):
12404         (fast_string_match, fast_c_string_match_ignore_case)
12405         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12406         (scan_newline, find_before_next_newline, search_command)
12407         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12408         (set_search_regs, wordify):
12409         (Freplace_match):
12410         (Fmatch_data):
12411         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12412         (string_match_1, search_buffer, set_search_regs):
12413         (Fmatch_data):
12414         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12415         (wordify): Check for overflow in size calculation.
12416         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12417         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12418         Check that fixnums are in proper range for system types.
12419         * sound.c (struct sound_device)
12420         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12421         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12422         (Fplay_sound_internal):
12423         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12424         * syntax.c (struct lisp_parse_state, find_start_modiff)
12425         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12426         (Fparse_partial_sexp):
12427         Don't assume fixnums can fit in int.
12428         (struct lisp_parse_state, find_start_pos, find_start_value)
12429         (find_start_value_byte, find_start_begv)
12430         (update_syntax_table, char_quoted, dec_bytepos)
12431         (find_defun_start, prev_char_comend_first, back_comment):
12432         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12433         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12434         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12435         (Finternal_describe_syntax_value): Check that match_lisp is a
12436         character, not an integer, since the code stuffs it into int.
12437         (scan_words, scan_sexps_forward):
12438         Check that fixnums are in proper range for system types.
12439         (Fforward_word):
12440         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12441         (scan_sexps_forward):
12442         Use CHARACTERP, not INTEGERP, since the value must fit into int.
12443         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12444         * syntax.h: Adjust decls to match defn changes elsewhere.
12445         (struct gl_state_s):
12446         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12447         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12448         MOST_POSITIVE_FIXNUM.
12449         * sysdep.c (wait_for_termination_1, wait_for_termination)
12450         (interruptible_wait_for_termination, mkdir):
12451         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12452         (emacs_read, emacs_write):
12453         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12454         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12455         and double all fit in int.
12456         * term.c (set_tty_color_mode):
12457         Check that fixnums are in proper range for system types.
12458         * termhooks.h (struct input_event):
12459         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12460         * textprop.c (validate_interval_range, interval_of)
12461         (Fadd_text_properties, set_text_properties_1)
12462         (Fremove_text_properties, Fremove_list_of_text_properties)
12463         (Ftext_property_any, Ftext_property_not_all)
12464         (copy_text_properties, text_property_list, extend_property_ranges)
12465         (verify_interval_modification):
12466         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12467         (Fnext_single_char_property_change)
12468         (Fprevious_single_char_property_change):
12469         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12470         (copy_text_properties):
12471         Check for integer overflow in index calculation.
12472         * undo.c (last_boundary_position, record_point, record_insert)
12473         (record_delete, record_marker_adjustment, record_change)
12474         (record_property_change):
12475         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12476         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12477         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12478         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12479         (Fx_hide_tip, Fx_file_dialog):
12480         * w32menu.c (set_frame_menubar):
12481         Use ptrdiff_t, not int, for consistency with rest of code.
12482         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12483         (select_window, Fdelete_other_windows_internal)
12484         (window_scroll_pixel_based, window_scroll_line_based)
12485         (Frecenter, Fset_window_configuration):
12486         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12487         (Fset_window_hscroll, run_window_configuration_change_hook)
12488         (set_window_buffer, temp_output_buffer_show, scroll_command)
12489         (Fscroll_other_window, Frecenter):
12490         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12491         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12492         Don't assume fixnum fits in int.
12493         (Fset_window_scroll_bars):
12494         Check that fixnums are in proper range for system types.
12495         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12496         (string_pos, c_string_pos, number_of_chars, init_iterator)
12497         (in_ellipses_for_invisible_text_p, init_from_display_pos)
12498         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12499         (compute_display_string_end, handle_face_prop)
12500         (face_before_or_after_it_pos, handle_invisible_prop)
12501         (handle_display_prop, handle_display_spec, handle_single_display_spec)
12502         (display_prop_intangible_p, string_buffer_position_lim)
12503         (string_buffer_position, handle_composition_prop, load_overlay_strings)
12504         (get_overlay_strings_1, get_overlay_strings)
12505         (iterate_out_of_display_property, forward_to_next_line_start)
12506         (back_to_previous_visible_line_start, reseat, reseat_to_string)
12507         (get_next_display_element, set_iterator_to_next)
12508         (get_visually_first_element, compute_stop_pos_backwards)
12509         (handle_stop_backwards, next_element_from_buffer)
12510         (move_it_in_display_line_to, move_it_in_display_line)
12511         (move_it_to, move_it_vertically_backward, move_it_by_lines)
12512         (add_to_log, message_dolog, message_log_check_duplicate)
12513         (message2, message2_nolog, message3, message3_nolog
12514         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12515         (current_message_1, truncate_echo_area, truncate_message_1)
12516         (set_message, set_message_1, store_mode_line_noprop)
12517         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12518         (text_outside_line_unchanged_p, check_point_in_composition)
12519         (reconsider_clip_changes)
12520         (redisplay_internal, set_cursor_from_row, try_scrolling)
12521         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12522         (redisplay_window, find_last_unchanged_at_beg_row)
12523         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12524         (trailing_whitespace_p, find_row_edges, display_line)
12525         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12526         (display_mode_element, store_mode_line_string)
12527         (pint2str, pint2hrstr, decode_mode_spec)
12528         (display_count_lines, display_string, draw_glyphs)
12529         (x_produce_glyphs, x_insert_glyphs)
12530         (rows_from_pos_range, mouse_face_from_buffer_pos)
12531         (fast_find_string_pos, mouse_face_from_string_pos)
12532         (note_mode_line_or_margin_highlight, note_mouse_highlight):
12533         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12534         (safe_call, init_from_display_pos, handle_fontified_prop)
12535         (handle_single_display_spec, load_overlay_strings)
12536         (with_echo_area_buffer, setup_echo_area_for_printing)
12537         (display_echo_area, echo_area_display)
12538         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12539         (update_tool_bar, hscroll_window_tree, redisplay_internal)
12540         (redisplay_window, dump_glyph_row, display_mode_line)
12541         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
12542         (handle_display_spec, display_prop_string_p):
12543         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12544         (handle_single_display_spec, build_desired_tool_bar_string)
12545         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12546         (get_specified_cursor_type):
12547         Check that fixnums are in proper range for system types.
12548         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12549         (Flookup_image_map):
12550         Don't assume fixnums fit in int.
12551         (compare_overlay_entries):
12552         Avoid mishandling comparisons due to subtraction overflow.
12553         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12554         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12555         (handle_tool_bar_click):
12556         Use int, not unsigned, since we prefer signed and the signedness
12557         doesn't matter here.
12558         (get_next_display_element, next_element_from_display_vector):
12559         Use int, not EMACS_INT, when int is wide enough.
12560         (start_hourglass): Use duration_to_sec_usec to do proper
12561         overflow checking on durations.
12562         * xfaces.c (Fbitmap_spec_p):
12563         Check that fixnums are in proper range for system types.
12564         (compare_fonts_by_sort_order):
12565         Avoid mishandling comparisons due to subtraction overflow.
12566         (Fx_family_fonts, realize_basic_faces):
12567         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12568         (Fx_family_fonts):
12569         Don't assume fixnum fits in int.
12570         Use SAFE_ALLOCA_LISP, not alloca.
12571         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12572         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12573         (face_at_buffer_position, face_for_overlay_string)
12574         (face_at_string_position):
12575         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12576         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12577         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12578         (Fx_show_tip):
12579         Check that fixnums are in proper range for system types.
12580         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12581         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12582         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12583         (Fx_change_window_property): Don't assume fixnums fit in int.
12584         * xfont.c (xfont_chars_supported):
12585         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12586         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12587         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12588         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12589         * xml.c (parse_region):
12590         * xrdb.c (magic_file_p):
12591         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12592         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12593         (x_get_local_selection, x_reply_selection_request)
12594         (x_handle_selection_request, wait_for_property_change):
12595         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12596         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12597         short is wide enough.
12598         (x_send_client_event): Don't assume fixnum fits in int.
12599         * xterm.c (x_x_to_emacs_modifiers):
12600         Don't assume EMACS_INT overflows nicely into int.
12601         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12602         may come from Lisp.
12603         (handle_one_xevent): NATNUMP can eval its arg twice.
12604         (x_connection_closed):
12605         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12606         * xterm.h: Adjust decls to match defn changes elsewhere.
12607         (struct scroll_bar): Use struct vectorlike_header
12608         rather than rolling our own approximation.
12609         (SCROLL_BAR_VEC_SIZE): Remove; not used.
12611 2012-05-25  Glenn Morris  <rgm@gnu.org>
12613         * lisp.mk (lisp): Update for more files being compiled now.
12615 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
12617         * lread.c: Remove `read_pure' which makes no difference.
12618         (read_pure): Remove var.
12619         (unreadpure): Remove function.
12620         (readevalloop): Don't call read_list with -1 flag.
12621         (read1, read_vector): Don't test read_pure any more.
12622         (read_list): Simplify.
12624         * fileio.c, character.h: Minor style tweaks.
12626 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
12628         * window.h (clip_changed): Remove useless declaration.
12630 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
12632         * makefile.w32-in: Follow-up to revno:108341.
12633         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12635 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
12637         Remove src/m/*.
12638         This directory predates autoconf and is no longer needed nowadays.
12639         Move its few remaining bits of functionality to where they're needed.
12640         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12641         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12642         * m/template.h: Remove.
12643         * Makefile.in (M_FILE): Remove.  All uses removed.
12644         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12645         * lisp.h (USE_LSB_TAG):
12646         * mem-limits.h (EXCEEDS_LISP_PTR):
12647         Use VAL_MAX, not VALBITS, in #if.
12648         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12649         (EMACS_UINT): Define unconditionally now.
12650         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12651         (BITS_PER_EMACS_INT): New constants, replacing
12652         what used to be in config.h, but not useful in #if.
12653         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12654         define them any more.
12655         (VAL_MAX): New macro.
12656         (VALMASK): Use it.
12657         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12658         BITS_PER_EMACS_INT, in #if.
12659         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12660         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12661         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12662         * s/ms-w32.h (DATA_START):
12663         Move here from removed file m/intel386.h.
12664         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12665         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12667 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
12669         Assume C89 or later.
12670         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12671         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12672         (xrealloc):
12673         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12674         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12675         * textprop.c, tparam.c (NULL): Remove.
12676         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12677         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12678         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
12679         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12680         * xterm.c (input_signal_count): Assume volatile works.
12682 2012-05-21  Ken Brown  <kbrown@cornell.edu>
12684         * xgselect.c (xg_select): Fix first argument in call to 'select'
12685         (bug#11508).
12687 2012-05-20  Ken Brown  <kbrown@cornell.edu>
12689         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
12690         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
12692 2012-05-19  Ken Brown  <kbrown@cornell.edu>
12694         * xfns.c (x_in_use): Remove `static' qualifier.
12695         * xterm.h (x_in_use): Declare.
12696         * xgselect.c: Include xterm.h.
12697         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12698         and `display_arg' (bug#9754).
12700 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
12702         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12704         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12705         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12707 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
12709         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12711         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
12712         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
12714         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12715         reference to image_cache->refcount.
12716         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12718 2012-05-17  Juri Linkov  <juri@jurta.org>
12720         * search.c (Fword_search_regexp, Fword_search_backward)
12721         (Fword_search_forward, Fword_search_backward_lax)
12722         (Fword_search_forward_lax): Move functions to isearch.el
12723         (bug#10145, bug#11381).
12725 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
12727         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12729 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
12731         * lread.c (init_obarray): Declare Qt and Qnil as special.
12733 2012-05-14  Glenn Morris  <rgm@gnu.org>
12735         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
12736         Put "libexec" before "bin", for the sake of init_callproc_1.
12738 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
12740         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12742         * unexaix.c: Port to more-recent AIX compilers.
12743         (report_error, report_error_1, make_hdr, copy_sym)
12744         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12745         Make arguments const char *, not char *, to avoid violations of C
12746         standard and to fix some AIX warnings reported by Gilles Pion.
12748 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
12750         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12751         already have overlays loaded.
12752         (handle_single_display_spec): Before returning without displaying
12753         fringe bitmap, synchronize the bidi iterator with the main display
12754         iterator, by calling iterate_out_of_display_property.
12755         (iterate_out_of_display_property): Detect buffer iteration by
12756         testing that it->string is a Lisp string.
12757         (get_next_display_element): When the current object is exhausted,
12758         and there's something on it->stack, call set_iterator_to_next to
12759         proceed with what's on the stack, instead of returning zero.
12760         (set_iterator_to_next): If called at the end of a Lisp string,
12761         proceed to consider_string_end without incrementing string
12762         position.  Don't increment display vector index past the end of
12763         the display vector.  (Bug#11417)
12764         (pos_visible_p): Don't report a position visible when move_it_to
12765         stopped at the last line of window, which happens to be scanned
12766         backwards by the bidi iteration.  (Bug#11464)
12768 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
12770         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12771         and right-margin display specs even if the spec is invalid or we
12772         are on a TTY, and thus unable to display on the fringes.
12773         That's because the text with the property will not be displayed anyway,
12774         so we need to signal to the caller that this is a "replacing"
12775         display spec.  This fixes display when the spec is invalid or we
12776         are on a TTY.
12778 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
12780         * unexaix.c (make_hdr): Fix typo in prototype.
12781         This bug broke the build on AIX.  Problem reported by Gilles Pion.
12783 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
12785         * keyboard.c (kbd_buffer_get_event): Read special events also in
12786         batch mode.  (Bug#11415)
12788 2012-05-12  Glenn Morris  <rgm@gnu.org>
12790         * ns.mk: Update for ns_appbindir no longer having trailing "/".
12792 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
12794         * lisp.mk (lisp): Add newcomment.elc.
12796 2012-05-12  Glenn Morris  <rgm@gnu.org>
12798         * Makefile.in (MKDIR_P): New, set by configure.
12799         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12801 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
12803         Remove unused function hourglass_started.
12804         * dispextern.h (hourglass_started):
12805         * w32fns.c (hourglass_started):
12806         * xdisp.c (hourglass_started): Remove.
12808 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
12810         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12811         Update dependencies.
12813 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
12815         * xgselect.c (xg_select): Put maxfds+1 into a var.
12816         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12818         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12820 2012-05-10  Dave Abrahams  <dave@boostpro.com>
12822         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12823         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
12825 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
12827         * dbusbind.c (xd_registered_buses): New internal Lisp object.
12828         Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
12829         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12830         Initialize xd_registered_buses.
12832 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
12834         Untag more efficiently if USE_LSB_TAG.
12835         This is based on a proposal by YAMAMOTO Mitsuharu in
12836         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12837         For an admittedly artificial (nth 8000 longlist) benchmark on
12838         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
12839         Emacs's overall text size by 1%.
12840         * lisp.h (XUNTAG): New macro.
12841         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12842         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12843         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12844         * eval.c (Fautoload):
12845         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12846         * frame.h (XFRAME): Use XUNTAG.
12848         Port recent dbusbind.c changes to 32-bit --with-wide-int.
12849         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12850         Remove unportable assumptions about print widths of types like
12851         dbus_uint32_t.
12852         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12853         intptr_t when converting between pointer and integer, to avoid GCC
12854         warnings about wrong width.
12856 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
12858         * w32proc.c (new_child): Force Windows to reserve only 64KB of
12859         stack for each reader_thread, instead of defaulting to 8MB
12860         determined by the linker.  This avoids failures in creating
12861         subprocesses on Windows 7, see the discussion in this thread:
12862         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
12864 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
12866         Fix up display of the *Minibuf-0* buffer in the mini window.
12867         * keyboard.c (read_char): Don't clear the echo area if there's no
12868         message to clear.
12869         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
12870         contents of *Minibuf-0*) if there's no message displayed in its stead.
12872 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
12874         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
12875         batch mode.
12877 2012-05-06  Chong Yidong  <cyd@gnu.org>
12879         * lisp.mk (lisp): Update.
12881 2012-05-05  Jim Meyering  <meyering@redhat.com>
12883         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
12885 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
12887         * data.c (PUT_ERROR): New macro.
12888         (syms_of_data): Use it.  Add new error type `user-error'.
12889         * undo.c (user_error): New function.
12890         (Fprimitive_undo): Use it.
12891         * print.c (print_error_message): Adjust print style for `user-error'.
12892         * keyboard.c (user_error): New function.
12893         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
12895 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
12897         Do not limit current-time-string to years 1000..9999.
12898         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
12899         (Fcurrent_time_string): Support any year that is supported by the
12900         underlying localtime representation.  Don't use asctime, as it
12901         has undefined behavior for years outside the range -999..9999.
12903 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
12905         Fix race conditions involving setenv, gmtime, localtime, asctime.
12906         Without this fix, interrupts could mess up code that uses these
12907         nonreentrant functions, since setting TZ invalidates existing
12908         tm_zone or tzname values, and since most of these functions return
12909         pointers to static storage.
12910         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
12911         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
12912         Grow the critical sections to include not just invoking
12913         localtime/gmtime, but also accessing these functions' results
12914         including their tm_zone values if any, and any related TZ setting.
12915         (format_time_string): Last arg is now struct tm *, not struct tm **,
12916         so that the struct tm is saved in the critical section.
12917         All callers changed.  Simplify allocation of initial buffer, partly
12918         motivated by the fact that memory allocation needs to be outside
12919         the critical section.
12921 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
12923         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
12924         with RESET_INTERVAL.
12926         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12927         Remove duplicated buffer name initialization.
12929 2012-05-02  Jim Meyering  <jim@meyering.net>
12931         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
12933         * xfns.c (x_window): Use xstrdup (Bug#11375).
12935 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
12937         * xdisp.c (pos_visible_p): If already at a newline from the
12938         display string before the 'while' loop, don't walk back the glyphs
12939         from it3.glyph_row.  Solves assertion violation when the display
12940         string begins with a newline (egg.el).  (Bug#11367)
12942 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
12944         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
12945         Move to simple.el.
12947 2012-05-01  Glenn Morris  <rgm@gnu.org>
12949         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
12950         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
12951         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
12952         All were removed before 23.1.
12954         * dispnew.c: Remove HAVE_LIBNCURSES test;
12955         it is always true on relevant platforms.
12957         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
12958         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
12960         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
12962 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
12964         * .gdbinit (xpr): Remove checks for no longer existing misc types.
12965         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
12966         Remove.
12968 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
12970         Do not avoid creating empty evaporating overlays (Bug#9642).
12971         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
12972         That is, do not delete an evaporating overlay if it becomes
12973         empty after its bounds are adjusted to fit within its buffer.
12974         This fix caused other problems, and I'm reverting it until we get
12975         to the bottom of them.
12977 2012-04-27  Chong Yidong  <cyd@gnu.org>
12979         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
12981 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
12983         * xdisp.c (pos_visible_p): If the window start position is beyond
12984         ZV, start the display from buffer beginning.  Prevents assertion
12985         violation in init_iterator when the minibuffer window is scrolled
12986         via the scroll bar.
12988         * window.c (window_scroll_pixel_based): Likewise.
12990 2012-04-27  Chong Yidong  <cyd@gnu.org>
12992         * keymap.c (where_is_internal): Doc fix (Bug#10872).
12994 2012-04-27  Glenn Morris  <rgm@gnu.org>
12996         * fileio.c (Fcopy_file, Fset_file_selinux_context):
12997         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
12999 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
13001         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13002         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
13004 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
13006         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13007         display element, check also the underlying string or buffer
13008         character.  (Bug#11341)
13010         * w32menu.c: Include w32heap.h.
13011         (add_menu_item): If the call to AppendMenuW (via
13012         unicode_append_menu) fails, disable Unicode menus only if we are
13013         running on Windows 9X/Me.
13015 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
13017         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13018         (xgetint): Add missing shift for LSB tags.
13020 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
13022         * keyboard.c (read_char): Don't wipe echo area for select window
13023         events: These might get delayed via `mouse-autoselect-window'
13024         (Bug#11304).
13026 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
13028         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13029         manipulation of :loaded-from data.
13031 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
13033         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13034         now a cons (bug#11311).
13036 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
13038         Do not create empty overlays with the evaporate property (Bug#9642).
13039         * buffer.c (Fmove_overlay): Delete an evaporating overlay
13040         if it becomes empty after its bounds are adjusted to fit within
13041         its buffer.  Without this fix, in a nonempty buffer (let ((o
13042         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13043         yields an empty overlay that has the evaporate property, which is
13044         not supposed to happen.
13046         Fix minor GTK3 problems found by static checking.
13047         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13048         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13049         (struct _EmacsFixedClass, emacs_fixed_get_type):
13050         Move decls here from emacsgtkfixed.h, since they needn't be public.
13051         (emacs_fixed_get_type): Now static.
13052         (emacs_fixed_class_init): Omit unused local.
13053         (emacs_fixed_child_type): Remove; unused.
13054         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13055         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13056         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13057         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13058         (EMACS_FIXED_GET_CLASS): Remove; unused.
13059         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13061         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13062         Problem reported by Juanma Barranquero for Windows -Wunused-function.
13064 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
13066         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
13067         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
13068         (__malloc_size_t, __malloc_ptrdiff_t):
13069         Remove.  All uses removed, replaced by the definiens if needed,
13070         since we can assume C89 or better now.
13071         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13072         (protect_malloc_state, align, get_contiguous_space)
13073         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13074         (malloc_atfork_handler_child, malloc_enable_thread)
13075         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13076         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13077         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13078         (special_realloc, _realloc_internal_nolock, _realloc_internal)
13079         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13080         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13081         Define using prototypes, not old style.
13082         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13083         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13084         (align): Don't assume that signed integer overflow wraps around.
13085         Omit unused local var.
13086         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13087         (_free_internal_nolock, memalign, mallochook, reallochook):
13088         Omit no-longer-needed casts.
13089         (valloc): Use getpagesize, not __getpagesize.
13090         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13091         (struct hdr): The 'magic' member is now size_t, not unsigned long.
13093         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13095 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
13097         Move functions from C to Lisp.  Make non-blocking method calls
13098         the default.  Implement further D-Bus standard interfaces.
13100         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13101         (QCdbus_request_name_allow_replacement)
13102         (QCdbus_request_name_replace_existing)
13103         (QCdbus_request_name_do_not_queue)
13104         (QCdbus_request_name_reply_primary_owner)
13105         (QCdbus_request_name_reply_in_queue)
13106         (QCdbus_request_name_reply_exists)
13107         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13108         (QCdbus_registered_serial, QCdbus_registered_method)
13109         (QCdbus_registered_signal): New Lisp objects.
13110         (XD_DEBUG_MESSAGE): Use sizeof.
13111         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13112         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13113         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13114         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13115         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13116         (xd_signature, xd_append_arg): Allow float for integer types.
13117         (xd_get_connection_references): New function.
13118         (xd_get_connection_address): Rename from xd_initialize.
13119         Return cached address.
13120         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13121         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
13122         level.
13123         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
13124         Return number of refcounts.
13125         (Fdbus_get_unique_name): Make stronger parameter check.
13126         (Fdbus_message_internal): New defun.
13127         (Fdbus_call_method, Fdbus_call_method_asynchronously)
13128         (Fdbus_method_return_internal, Fdbus_method_error_internal)
13129         (Fdbus_send_signal, Fdbus_register_service)
13130         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13131         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13132         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13133         (Vdbus_compiled_version, Vdbus_runtime_version)
13134         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13135         (Vdbus_message_type_method_return, Vdbus_message_type_error)
13136         (Vdbus_message_type_signal): New defvars.
13137         (Vdbus_registered_buses, Vdbus_registered_objects_table):
13138         Adapt docstring.
13140 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
13142         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13143         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13144         Do not assume ptrdiff_t is the same width as 'int'.
13146         * alloc.c: Handle unusual debugging option combinations.
13147         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13148         since the two debugging options are incompatible.
13149         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13150         is defined.
13151         (mem_init, mem_insert, mem_insert_fixup):
13152         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13153         (NEED_MEM_INSERT): Remove; no longer needed.
13155 2012-04-22  Leo Liu  <sdl.web@gmail.com>
13157         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13159 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
13161         * sysdep.c [__FreeBSD__]: Minor cleanups.
13162         (list_system_processes, system_process_attributes) [__FreeBSD__]:
13163         Use Emacs indenting style more consistently.  Avoid some casts.
13164         Use 'double' consistently rather than mixing 'float' and 'double'.
13166 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
13168         * sysdep.c (list_system_processes, system_process_attributes):
13169         Add implementation for FreeBSD (Bug#5243).
13171 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
13173         * lisp.mk (lisp): Update.
13175 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
13177         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13178         It is never used otherwise.
13180 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
13182         * print.c (print_preprocess): Only check print_depth if print-circle
13183         is nil.
13184         (print_object): Check for cycles even when print-circle is nil and
13185         print-gensym is t, but only check print_depth if print-circle is nil.
13187 2012-04-20  Chong Yidong  <cyd@gnu.org>
13189         * process.c (wait_reading_process_output): If EIO occurs on a pty,
13190         set the status to "failed" and ensure that sentinel is run.
13192 2012-04-20  Glenn Morris  <rgm@gnu.org>
13194         * process.c (Fset_process_inherit_coding_system_flag)
13195         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
13196         (Fmake_network_process, Fmake_serial_process): Doc fix.
13198 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
13200         * xdisp.c (string_buffer_position_lim): Limit starting position to
13201         BEGV.
13202         (set_cursor_from_row): If called for a mode-line or header-line
13203         row, return zero immediately.
13204         (try_cursor_movement): If inside continuation line, don't back up
13205         farther than the first row after the header line, if any.
13206         Don't consider the header-line row as "partially visible", even if
13207         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
13209 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
13211         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13212         (bug#11238).
13214 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
13215 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
13217         configure: new option --enable-gcc-warnings (Bug#11207)
13218         * Makefile.in (C_WARNINGS_SWITCH): Remove.
13219         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13220         (ALL_CFLAGS): Use new macros rather than old.
13221         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13222         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
13223         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13224         -Wunused-result, -Wunused-variable.  This should go away once
13225         the Emacs and Gnulib regex code is merged.
13226         (xmalloc, xrealloc): Now static.
13228 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
13230         * dired.c (Fsystem_groups): Remove unused local.
13232 2012-04-17  Glenn Morris  <rgm@gnu.org>
13234         * dired.c (Fsystem_users): Doc fix.
13236 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
13238         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
13239         (syms_of_dired): Add them.
13241 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
13243         Fix minor alloc.c problems found by static checking.
13244         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13245         New extern decls, to avoid calling undeclared functions.
13246         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13247         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13248         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13249         (NEED_MEM_INSERT): New macro.
13250         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
13251         Remove one incorrect comment and fix another.
13253         Fix minor ralloc.c problems found by static checking.
13254         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13255         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13256         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13257         (r_alloc_sbrk): Now static.
13259         Improve ralloc.c interface checking.
13260         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13261         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13262         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13263         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13264         [REL_ALLOC]: ... to here, to check interface.
13265         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13266         Remove decls.  This fixes an "It stinks!".
13268         * alloc.c (which_symbols): Fix alignment issue / type clash.
13270 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
13272         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13273         (struct Lisp_Misc_Any): Likewise.
13274         (struct Lisp_Free): Likewise.
13275         * alloc.c (union aligned_Lisp_Symbol): Define.
13276         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13277         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13278         (union aligned_Lisp_Misc): Define.
13279         (MARKER_BLOCK_SIZE, struct marker_block): Use union
13280         aligned_Lisp_Misc instead of union Lisp_Misc.
13281         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
13283 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
13285         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13286         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13287         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13288         * s/netbsd.h, s/sol2-6.h:
13289         Remove definition of GC_MARK_STACK, since the default now works.
13290         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13291         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13292         no longer the default.
13293         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13295 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
13297         * lread.c (lisp_file_lexically_bound_p):
13298         Fix hang at ";-*-\n" (bug#11238).
13300 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
13302         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13303         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
13305 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
13307         * nsterm.m (constrainFrameRect): Always constrain when there is only
13308         one screen (Bug#10962).
13310 2012-04-13  Ken Brown  <kbrown@cornell.edu>
13312         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13314 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
13316         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13318 2012-04-11  Daniel Colascione  <dancol@dancol.org>
13320         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13321         against is gone.  It's better to use vfork now so that when Cygwin
13322         gains a new, working vfork, we use it automatically (bug#10398).
13324 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
13326         * window.c (save_window_save): Obey window-point-insertion-type.
13328 2012-04-11  Glenn Morris  <rgm@gnu.org>
13330         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13332 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
13334         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13336 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
13338         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13339         (force_quit_count): New var.
13340         (handle_interrupt): Use it.
13342 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
13344         * w32.c (w32_delayed_load): Record the full path of the library
13345         being loaded (bug#10424).
13347 2012-04-09  Glenn Morris  <rgm@gnu.org>
13349         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13350         not just in the obarray, before snarfing them.  (Bug#11036)
13352         * Makefile.in ($(leimdir)/leim-list.el):
13353         Pass EMACS rather than BUILT_EMACS.
13355 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
13357         * process.c (make_process):
13358         * process.h: Add integer `gnutls_handshakes_tried' member to
13359         process struct.
13361         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13362         Add convenience `GNUTLS_LOG2i' macro.
13364         * gnutls.c (gnutls_log_function2i): Convenience log function.
13365         (emacs_gnutls_read): Use new log functions,
13366         `gnutls_handshakes_tried' process member, and
13367         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13368         attempts per process (connection).
13370 2012-04-09  Chong Yidong  <cyd@gnu.org>
13372         * eval.c (Fuser_variable_p, user_variable_p_eh)
13373         (lisp_indirect_variable): Functions deleted.
13374         (Fdefvar): Caller changed.
13376         * callint.c (Finteractive, Fcall_interactively):
13377         * minibuf.c (Fread_variable): Callers changed.
13379 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
13381         * xdisp.c (set_cursor_from_row): If the display string appears in
13382         the buffer at position that is closer to point than the position
13383         after the display string, display the cursor on the first glyph of
13384         the display string.  Fixes cursor display when a 'display' text
13385         property immediately follows invisible text.  (Bug#11094)
13387 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
13389         composite.c: use 'double' consistently
13390         * composite.c (get_composition_id): Use 'double' consistently
13391         instead of converting 'float' to 'double' and vice versa; this is
13392         easier to understand and avoids a GCC warning.
13394 2012-04-09  Glenn Morris  <rgm@gnu.org>
13396         * Makefile.in: Generate leim-list with bootstrap-emacs, in
13397         preparation for dumping it with emacs.  (Bug#4789)
13398         (leimdir): New variable.
13399         ($(leimdir)/leim-list.el): New rule.
13400         (emacs$(EXEEXT)): Depend on leim-list.el.
13402         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
13403         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13404         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13406 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
13408         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13409         proper alignment.
13411 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
13413         * xml.c (init_libxml2_functions) [WINDOWSNT]:
13414         Remove unused local variable.
13416 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
13418         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13419         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13420         (mark_memory): Mark Lisp_Objects only if pointers might hide in
13421         objects, as mark_maybe_pointer will catch them otherwise.
13422         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13423         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13425 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
13427         Fix typo that broke non-Windows builds.
13428         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13430 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
13432         Support building on MS-Windows with libxml2.
13434         * makefile.w32-in (OBJ2): Add xml.$(O).
13435         (GLOBAL_SOURCES): Add xml.c.
13436         ($(BLD)/xml.$(O)): New dependency list.
13438         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13439         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13440         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13441         [!WINDOWSNT]: New macros.
13442         (init_libxml2_functions, libxml2_loaded_p): New functions.
13443         (parse_region): Call fn_xmlCheckVersion instead of using the macro
13444         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
13445         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13446         Calls xmlCleanupParser only if libxml2 was loaded (or statically
13447         linked in).
13448         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13449         Call init_libxml2_functions before calling libxml2 functions.
13450         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13452         * emacs.c: Don't include libxml/parser.h.
13453         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13454         xmlCleanupParser directly.
13456         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13458 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
13460         * indent.c (Fvertical_motion): If there is a display string at
13461         point, use it.vpos to compute how many lines to backtrack after
13462         move_it_to point.  (Bug#11133)
13464 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
13466         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13467         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13468         about subtle differences between FETCH_CHAR* and STRING_CHAR*
13469         macros related to unification of CJK characters.  For the details,
13470         see the discussion following the message here:
13471         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13473 2012-04-04  Chong Yidong  <cyd@gnu.org>
13475         * keyboard.c (Vdelayed_warnings_list): Doc fix.
13477 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
13479         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13480         instead of alloca.  (Bug#11138)
13482 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
13484         * w32menu.c (is_simple_dialog): Properly check lisp types.
13485         (Bug#11141)
13487 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
13489         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13490         position we get to after a call to move_it_to fails the
13491         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13492         only if we wind up in a string from display property.  (Bug#11063)
13494         * window.c (Fdelete_other_windows_internal): Invalidate the row
13495         and column information about mouse highlight, so that redisplay
13496         restores it after reallocating the glyph matrices.  (Bug#7464)
13498         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13499         string comes from a `display' text property, use the buffer
13500         position of that property as if we actually saw that position in
13501         the row's glyphs.
13502         (move_it_by_lines): Remove the assertion that
13503         "it->current_x == 0 && it->hpos == 0" which can be legitimately
13504         violated when there's a before-string at the beginning of a line.
13505         (Bug#11063)
13507 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
13509         * xdisp.c (append_space_for_newline): If the default face was
13510         remapped, use the remapped face for the appended newline.
13511         (extend_face_to_end_of_line): Use the remapped default face for
13512         extending the face to the end of the line.
13513         (display_line): Call extend_face_to_end_of_line when the default
13514         face was remapped.  (Bug#11068)
13516 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
13518         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13520 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
13522         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13524 2012-03-27  Glenn Morris  <rgm@gnu.org>
13526         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13527         Doc fixes.
13529 2012-03-26  Kenichi Handa  <handa@m17n.org>
13531         * dispextern.h (struct glyph): Fix previous change.  Change the
13532         bit length of glyphless.ch to 25 (Bug#11082).
13534 2012-03-26  Chong Yidong  <cyd@gnu.org>
13536         * keyboard.c (Vselection_inhibit_update_commands): New variable.
13537         (command_loop_1): Use it; inhibit selection update for
13538         handle-select-window too (Bug#8996).
13540 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
13542         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
13544 2012-03-25  Kenichi Handa  <handa@m17n.org>
13546         * dispextern.h (struct glyph): Change the bit length of
13547         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13549 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
13551         * s/ms-w32.h (tzname): Include time.h before redirecting to
13552         _tzname.  Fixes the MSVC build.  (Bug#9960)
13554 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
13556         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13557         characters.
13559         * xterm.c (XTread_socket): Only modify handling_signal if
13560         !SYNC_INPUT.  (Bug#11080)
13562 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
13564         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13565         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
13566         when fetching a multibyte character consumes more bytes than
13567         CHAR_BYTES returns, due to unification of CJK characters in
13568         string_char.  (Bug#11073)
13570 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
13572         * process.c (wait_reading_process_output): Handle pty disconnect
13573         by refraining from sending oneself a SIGCHLD (bug#10933).
13575 2012-03-22  Chong Yidong  <cyd@gnu.org>
13577         * dispextern.h (struct it): New member string_from_prefix_prop_p.
13579         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
13580         Mark string as coming from a prefix property.
13581         (handle_face_prop): Use default face for prefix strings (Bug#4281).
13582         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13584 2012-03-21  Chong Yidong  <cyd@gnu.org>
13586         * xfaces.c (Vface_remapping_alist): Doc fix.
13588 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
13590         * w32proc.c (Fw32_set_console_codepage)
13591         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13592         Doc fixes.
13594 2012-03-20  Chong Yidong  <cyd@gnu.org>
13596         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13597         to reflect default non-nil value of redisplay-dont-pause.
13599 2012-03-19  Kenichi Handa  <handa@m17n.org>
13601         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13602         it fit in a valid range (Bug#11003).
13604 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
13606         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13607         that is not from display property, accept the row as a "cursor
13608         row" if one of the string's character has a non-nil `cursor'
13609         property.  Fixes cursor positioning when there are newlines in
13610         overlay strings, e.g. in icomplete.el.  (Bug#11035)
13612 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
13614         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13616 2012-03-12  Chong Yidong  <cyd@gnu.org>
13618         * eval.c (inhibit_lisp_code): Rename from
13619         inhibit_window_configuration_change_hook; move from window.c.
13621         * xfns.c (unwind_create_frame_1, Fx_create_frame):
13622         * window.c (run_window_configuration_change_hook)
13623         (syms_of_window): Callers changed.
13625 2012-03-11  Chong Yidong  <cyd@gnu.org>
13627         * keymap.c (Fkey_description): Doc fix (Bug#9700).
13629         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13631 2012-03-10  Chong Yidong  <cyd@gnu.org>
13633         * frame.c (other_visible_frames): Don't assume the selected frame
13634         is visible (Bug#10955).
13636 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
13638         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13640 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
13642         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13643         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13644         zero (Bug#10954).
13646 2012-03-03  Glenn Morris  <rgm@gnu.org>
13648         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
13650 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
13652         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13653         position past the first glyph_row that ends at ZV.  (Bug#10902)
13654         (redisplay_window, next_element_from_string): Fix typos in
13655         comments.
13656         (redisplay_window): Pass to move_it_vertically the margin in
13657         pixels, not in screen lines.
13659 2012-03-02  Glenn Morris  <rgm@gnu.org>
13661         * buffer.c (buffer-list-update-hook): Doc fix.
13663 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
13665         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13666         push_it before setting up the iterator for the first overlay
13667         string, even if we have an empty string loaded.
13668         (next_overlay_string): If there's an empty string on the iterator
13669         stack, pop the stack.  (Bug#10903)
13671 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
13673         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13674         Suggested by Stefan Monnier in
13675         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13676         * alloc.c (widen_to_Lisp_Object): New static function.
13677         (mark_memory): Also mark Lisp_Objects by fetching pointer words
13678         and widening them to Lisp_Objects.  This would work even if
13679         USE_LSB_TAG is defined and wide integers are used, which might
13680         happen in a future version of Emacs.
13682 2012-02-25  Chong Yidong  <cyd@gnu.org>
13684         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13685         Doc fix.
13687         * xselect.c (Fx_selection_exists_p): Doc fix.
13688         (x_clipboard_manager_save_all): Print an informative message
13689         before saving to clipboard manager.
13691 2012-02-24  Chong Yidong  <cyd@gnu.org>
13693         * keyboard.c (process_special_events): Handle all X selection
13694         requests in kbd_buffer, not just the next one (Bug#8869).
13696 2012-02-23  Chong Yidong  <cyd@gnu.org>
13698         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13699         call when setting menu-bar-lines and tool-bar-lines parameters.
13700         (unwind_create_frame_1): New helper function.
13702         * window.c (inhibit_window_configuration_change_hook): New var.
13703         (run_window_configuration_change_hook): Obey it.
13704         (syms_of_window): Initialize it.
13706 2012-02-22  Chong Yidong  <cyd@gnu.org>
13708         * xterm.c (x_draw_image_relief): Add missing type check for
13709         Vtool_bar_button_margin (Bug#10743).
13711 2012-02-21  Chong Yidong  <cyd@gnu.org>
13713         * fileio.c (Vfile_name_handler_alist): Doc fix.
13715         * buffer.c (Fget_file_buffer): Protect against invalid file
13716         handler return value.
13718 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
13720         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13721         when computing $valmask.
13723         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13724         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13725         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13726         It's useless in that case, and it can cause problems on hosts
13727         that allocate halves of EMACS_INT values separately.
13728         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
13729         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13730         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13731         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
13732         it avoids undefined behavior on hosts where shifting right by more
13733         than the word width has undefined behavior.
13735 2012-02-19  Chong Yidong  <cyd@gnu.org>
13737         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13738         (Funhandled_file_name_directory, Ffile_name_as_directory)
13739         (Fdirectory_file_name, Fexpand_file_name)
13740         (Fsubstitute_in_file_name): Protect against invalid file handler
13741         return values (Bug#10845).
13743 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
13745         * .gdbinit (pitx): Fix incorrect references to fields of the
13746         iterator stack.
13748 2012-02-17  Chong Yidong  <cyd@gnu.org>
13750         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13752 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
13754         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13755         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13757 2012-02-15  Chong Yidong  <cyd@gnu.org>
13759         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13760         marked as special.  Also, starting docstrings with * is obsolete.
13762 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
13764         * gnutls.c (emacs_gnutls_write): Fix last change.
13766 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
13768         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13769         send_process.
13771 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
13773         * keymap.c (Fsingle_key_description): Handle char ranges.
13775 2012-02-12  Chong Yidong  <cyd@gnu.org>
13777         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13778         as that creates a dangerous corner case.
13780         * window.c (Fdelete_window_internal): Invalidate the mouse
13781         highlight (Bug#9904).
13783 2012-02-12  Glenn Morris  <rgm@gnu.org>
13785         * xselect.c (Fx_own_selection_internal)
13786         (Fx_get_selection_internal, Fx_disown_selection_internal)
13787         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13788         * nsselect.m (Fx_own_selection_internal)
13789         (Fx_disown_selection_internal, Fx_selection_exists_p)
13790         (Fx_selection_owner_p, Fx_get_selection_internal):
13791         Sync docs and argument specs with the xselect.c versions.
13793 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
13795         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13797 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
13799         * w32select.c (Fx_selection_exists_p): Sync doc string and
13800         argument list with xselect.c.  (Bug#10783)
13802         * w16select.c (Fx_selection_exists_p): Sync doc string and
13803         argument list with xselect.c.  (Bug#10783)
13805 2012-02-10  Glenn Morris  <rgm@gnu.org>
13807         * fns.c (Fsecure_hash): Doc fix.
13809 2012-02-09  Kenichi Handa  <handa@m17n.org>
13811         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13813 2012-02-07  Chong Yidong  <cyd@gnu.org>
13815         * buffer.c (Fbuffer_local_variables)
13816         (buffer_lisp_local_variables): Handle unbound vars correctly;
13817         don't let Qunbound leak into Lisp.
13819 2012-02-07  Glenn Morris  <rgm@gnu.org>
13821         * image.c (Fimagemagick_types): Doc fix.
13823         * image.c (imagemagick-render-type): Change it from a lisp object
13824         to an integer.  Move the doc here from the lisp manual.
13825         Treat all values not equal to 0 the same.
13827 2012-02-06  Chong Yidong  <cyd@gnu.org>
13829         * doc.c (store_function_docstring): Avoid applying docstring of
13830         alias to base function (Bug#2603).
13832 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
13834         * .gdbinit (pp1, pv1): Remove redundant defines.
13835         (pr): Use pp.
13837 2012-02-04  Chong Yidong  <cyd@gnu.org>
13839         * nsterm.m: Declare a global (Bug#10694).
13841 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
13843         * w32.c (get_emacs_configuration_options):
13844         Include --enable-checking, if specified, in the return value.
13846 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
13848         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13849         after rounding frame sizes.  (Bug#9723)
13851 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
13853         * keyboard.c (adjust_point_for_property): Don't position point
13854         before BEGV.  (Bug#10696)
13856 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
13858         Handle overflow when computing char display width (Bug#9496).
13859         * character.c (char_width): Return EMACS_INT, not int.
13860         (char_width, c_string_width): Check for overflow when
13861         computing the width; this is possible now that individual
13862         characters can have unbounded width.  Problem introduced
13863         by merge from Emacs 23 on 2012-01-19.
13865 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
13867         * dbusbind.c (Fdbus_register_method): Mention the return value
13868         :ignore in the docstring.
13870 2012-02-02  Glenn Morris  <rgm@gnu.org>
13872         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
13874         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13875         Unconditionally set to t.  (Bug#10673)
13876         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13877         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13878         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
13880 2012-02-02  Kenichi Handa  <handa@m17n.org>
13882         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
13883         0, do not call append_composite_glyph.
13885 2012-02-02  Kenichi Handa  <handa@m17n.org>
13887         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
13888         NULL (Bug#6988).
13889         (x_produce_glyphs): If the component of a composition is a null
13890         string, set it->pixel_width to 1 to avoid zero-width glyph.
13892 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
13894         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
13895         first 2 arguments are identical.  This makes inserting large
13896         output from a subprocess an order of magnitude faster on
13897         MS-Windows, where all sbrk'ed memory is always contiguous.
13899 2012-01-31  Glenn Morris  <rgm@gnu.org>
13901         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
13902         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
13903         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
13905 2012-01-29  Glenn Morris  <rgm@gnu.org>
13907         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
13909 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
13911         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
13913 2012-01-28  Chong Yidong  <cyd@gnu.org>
13915         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
13917 2012-01-26  Chong Yidong  <cyd@gnu.org>
13919         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
13921         * search.c (Fsearch_forward, Fsearch_backward): Document negative
13922         repeat counts (Bug#10507).
13924 2012-01-26  Glenn Morris  <rgm@gnu.org>
13926         * lread.c (syms_of_lread): Doc fix.
13928 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
13930         * coding.c (encode_designation_at_bol): Change return value to
13931         EMACS_INT.
13933 2012-01-25  Chong Yidong  <cyd@gnu.org>
13935         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
13937 2012-01-21  Chong Yidong  <cyd@gnu.org>
13939         * floatfns.c (Fcopysign): Make the second argument non-optional,
13940         since nil is not allowed anyway.
13942 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
13944         * process.c (read_process_output): Use p instead of XPROCESS (proc).
13945         (send_process): Likewise.
13947 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
13949         * window.c (save_window_save, Fcurrent_window_configuration)
13950         (Vwindow_persistent_parameters): Do not use Qstate.
13951         Rewrite doc-strings.
13953 2012-01-19  Kenichi Handa  <handa@m17n.org>
13955         * character.c (char_width): New function.
13956         (Fchar_width, c_string_width, lisp_string_width):
13957         Use char_width (Bug#9496).
13959 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
13961         * window.c (Vwindow_persistent_parameters): New variable.
13962         (Fset_window_configuration, save_window_save): Handle persistent
13963         window parameters.
13965 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
13967         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
13968         thrashing the stack of the thread.  (Bug#9087)
13970 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
13972         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
13974 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
13976         * xdisp.c (rows_from_pos_range): Handle the case where the
13977         highlight ends on a newline.  (Bug#10464)
13978         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
13979         he end column for display of highlight that ends on a newline
13980         before a R2L line.
13982 2012-01-11  Glenn Morris  <rgm@gnu.org>
13984         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
13985         from load-path also when installation-directory is nil.  (Bug#10208)
13987 2012-01-10  Glenn Morris  <rgm@gnu.org>
13989         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
13991         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
13992         Update template values to be closer to their typical values these days.
13994 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
13996         * xdisp.c (rows_from_pos_range): Accept additional argument
13997         DISP_STRING, and accept any glyph in a row whose object is that
13998         string as eligible for mouse highlight.  Fixes mouse highlight of
13999         display strings from overlays.  (Bug#10464)
14001 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
14003         emacs: fix an auto-save permissions race condition (Bug#10400)
14004         * fileio.c (auto_saving_dir_umask): New static var.
14005         (Fmake_directory_internal): Use it.
14006         (do_auto_save_make_dir): Set it, instead of invoking chmod after
14007         creating the directory.  The old code temporarily assigns
14008         too-generous permissions to the directory.
14009         (do_auto_save_eh): Clear it.
14010         (Fdo_auto_save): Catch all errors, not just file errors, so
14011         that the var is always cleared.
14013 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
14015         * search.c (scan_buffer): Pass character positions to
14016         know_region_cache, not byte positions.  (Bug#6540)
14018 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
14020         * w32.c (sys_rename): Report EXDEV when rename of a directory
14021         fails because the target is on another logical disk.  (Bug#10284)
14023 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
14025         * xterm.c (x_embed_request_focus): New function.
14027         * xterm.h: Add prototype.
14029         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14031 2012-01-05  Glenn Morris  <rgm@gnu.org>
14033         * emacs.c (emacs_copyright): Update short copyright year to 2012.
14035 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
14037         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14038         Load gnutls_transport_set_lowat only if GnuTLS version is below
14039         2.11.1.
14040         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14041         GnuTLS versions below 2.11.1.
14043 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
14045         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14046         to the doc string advising against its use for altering the way
14047         windows are scrolled.
14049 2011-12-28  Kenichi Handa  <handa@m17n.org>
14051         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14052         coding-system ASCII compatible only when it does not produce BOM
14053         on encoding (Bug#10383).
14055 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
14057         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14058         can scroll.
14059         (create_and_show_popup_menu): Always use menu_position_func for
14060         Gtk3 (Bug#10361).
14062 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
14064         * callint.c (Fcall_interactively): Don't truncate prompt string.
14066 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
14068         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14069         property that ends at ZV, so that the bidi iteration could be
14070         resumed from there (after widening).  (Bug#10360)
14072 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
14074         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14076 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
14078         * nsterm.m (x_free_frame_resources):
14079         Release f->output_data.ns->miniimage.
14080         (ns_index_color): Fix indentation.  Do not retain
14081         color_table->colors[i].
14083         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14084         before returning.
14086         * nsfns.m (x_set_background_color): Assign return value from
14087         ns_index_color to face-background instead of NSColor*.
14088         (ns_implicitly_set_icon_type): Fix indentation.
14089         Change assignment in for loop to comparison.
14091         * emacs.c (ns_pool): New variable.
14092         (main): Assign ns_pool.
14093         (Fkill_emacs): Call ns_release_autorelease_pool.
14095         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14096         autorelease fdesc, release fdAttrs and tdict.
14097         (ns_get_covering_families): Release charset.
14098         (ns_findfonts): Release NSFontDescriptor created with new.
14099         (ns_uni_to_glyphs): Fix indentation.
14100         (setString): Release attrStr before assigning new value.
14102 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
14104         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14105         and NS_IMPL_COCOA.
14106         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14107         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14109 2011-12-18  David Reitter  <reitter@cmu.edu>
14111         * nsterm.m (ns_term_init): Subscribe for notifications
14112         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14113         to method trackingNotification in EmacsMenu.
14115         * nsmenu.m (trackingMenu): New variable.
14116         (trackingNotification): New method (from Aquamacs).
14117         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
14118         from Aquamacs (Bug#7030).
14120 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
14122         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14123         (symbol_to_nsstring): Fix indentation.
14124         (ns_symbol_to_pb): New function.
14125         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14126         (Fns_rotate_cut_buffers_internal): Remove.
14127         (Fns_store_selection_internal): Rename from
14128         Fns_store_cut_buffer_internal.
14129         (ns_get_foreign_selection, Fx_own_selection_internal)
14130         (Fx_disown_selection_internal, Fx_selection_exists_p)
14131         (Fns_get_selection_internal, Fns_store_selection_internal):
14132         Use ns_symbol_to_pb and check if return value is nil.
14133         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
14134         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
14135         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14136         renamed to Sns_store_selection_internal.
14137         (ns_handle_selection_request): Move code to Fx_own_selection_internal
14138         and remove this function.
14139         (ns_handle_selection_clear): Remove, never used.
14140         (Fx_own_selection_internal): Move code from ns_handle_selection_request
14141         here.
14143 2011-12-17  Ken Brown  <kbrown@cornell.edu>
14145         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14146         GID is unknown (Bug#10257).
14148 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
14150         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14151         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14152         which caused a build failure on GNU/Linux IA-64.  This problem was
14153         introduced by my 2011-10-07 patch.
14155 2011-12-15  Juri Linkov  <juri@jurta.org>
14157         * image.c (imagemagick_error): New function.  (Bug#10112)
14158         (imagemagick_load_image): Comment out `MagickSetResolution' call.
14159         Use `imagemagick_error' where ImageMagick functions return
14160         `MagickFalse'.
14161         (Fimagemagick_types): Add `Fnreverse' to return the list in the
14162         proper order.
14164 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14166         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14167         fill background (Bug#8992).
14169 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
14171         * window.c (Vwindow_combination_resize)
14172         (Vwindow_combination_limit): Use t instead of non-nil in
14173         doc-strings.
14174         (Vrecenter_redisplay): Add first sentence of doc-string on
14175         separate line.
14176         (Frecenter): Fix doc-string typo.
14178 2011-12-11  Kenichi Handa  <handa@m17n.org>
14180         * coding.c (Funencodable_char_position): Pay attention to the
14181         buffer text relocation (Bug#9389).
14183 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
14185         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14186         gtk_init (Bug#10100).
14188 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
14190         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14191         IT->string is nil.  (Bug#10263)
14193 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
14195         * nsterm.h (x_free_frame_resources): Declare.
14197         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14198         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14200         * nsterm.h (ns_get_defaults_value): Declare.
14202         * nsterm.m (ns_default): Call ns_get_defaults_value.
14204 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
14206         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14207         (Bug#10170)
14209 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14211         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14212         that where the value of an _OBJC_* symbol points to is in the .bss
14213         section (Bug#10240).
14215 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
14217         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
14218         after the loop to call ccl_driver at least once (Bug#8619).
14220 2011-12-08  Kenichi Handa  <handa@m17n.org>
14222         * ftfont.c (get_adstyle_property): Fix previous change
14223         (Bug#10233).
14225 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
14227         * w32.c (init_environment): If no_site_lisp, remove site-lisp
14228         dirs from the default value of EMACSLOADPATH (bug#10208).
14230 2011-12-07  Glenn Morris  <rgm@gnu.org>
14232         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14233         installation and source directories as well.  (Bug#10208)
14235 2011-12-06  Chong Yidong  <cyd@gnu.org>
14237         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14239 2011-12-06  Glenn Morris  <rgm@gnu.org>
14241         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14242         as an error, not just -1.  (Bug#10217)
14244 2011-12-05  Chong Yidong  <cyd@gnu.org>
14246         * keyboard.c (process_special_events): New function.
14247         (swallow_events, Finput_pending_p): Use it (Bug#10195).
14249 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
14251         * coding.c (encode_designation_at_bol): Don't use uninitialized
14252         local variable (Bug#9318).
14254 2011-12-05  Kenichi Handa  <handa@m17n.org>
14256         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14257         return Qnil (Bug#8046, Bug#10193).
14259 2011-12-05  Kenichi Handa  <handa@m17n.org>
14261         * coding.c (encode_designation_at_bol): New args charbuf_end and
14262         dst.  Return the number of produced bytes.  Callers changed.
14263         (coding_set_source): Return how many bytes coding->source was
14264         relocated.
14265         (coding_set_destination): Return how many bytes
14266         coding->destination was relocated.
14267         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
14268         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
14270 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
14272         * coding.c (CODING_CHAR_CHARSET_P): New macro.
14273         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14274         macro (Bug#9318).
14276 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
14278         The following changes are to fix Bug#9318.
14280         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
14281         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14282         (encode_coding_iso_2022, encode_coding_sjis)
14283         (encode_coding_big5, encode_coding_charset): Use the above macros.
14285 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
14287         * lisp.h (process_quit_flag): Fix external declaration.
14289 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
14291         Don't macro-inline non-performance-critical code.
14292         * eval.c (process_quit_flag): New function.
14293         * lisp.h (QUIT): Use it.
14295 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
14297         * nsfns.m (get_geometry_from_preferences): New function.
14298         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14300 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
14302         * emacs.c (Qkill_emacs): Define.
14303         (syms_of_emacs): Initialize it.
14304         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14305         Qquit_flag to `kill-emacs' instead.
14306         (quit_throw_to_read_char): Add parameter `from_signal'.
14307         All callers changed.  Call Fkill_emacs if requested and safe.
14308         * lisp.h (QUIT): Call Fkill_emacs if requested.
14310 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
14312         * widget.c (update_wm_hints): Return if wmshell is null.
14313         (widget_update_wm_size_hints): New function.
14315         * widget.h (widget_update_wm_size_hints): Declare.
14317         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14318         widget_update_wm_size_hints (Bug#10104).
14320 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
14322         * xdisp.c (handle_invisible_prop): If the invisible text ends just
14323         before a newline, prepare the bidi iterator for consuming the
14324         newline, and keep the current paragraph direction.  (Bug#10183)
14325         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
14327 2011-12-02  Juri Linkov  <juri@jurta.org>
14329         * search.c (Fword_search_regexp): New Lisp function created from
14330         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
14331         (Fword_search_backward, Fword_search_forward)
14332         (Fword_search_backward_lax, Fword_search_forward_lax):
14333         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
14334         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
14336 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
14338         * fileio.c (Finsert_file_contents): Move after-change-function call
14339         to before the "handled:" label, since all "goto handled" appear in
14340         cases where the *-change-functions have already been properly called
14341         (bug#10117).
14343 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
14345         * keyboard.c (interrupt_signal): Don't call kill-emacs when
14346         waiting for input.  (Bug#10169)
14348 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
14350         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14351         verifies glyph row's hash code--we have just reallocated the
14352         glyphs, so their contents can be complete garbage.  (Bug#10164)
14354 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
14356         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14358 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
14360         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14361         attributes are tested _before_ calling verify_row_hash, to protect
14362         against GCC re-ordering of the tests.  (Bug#10164)
14364 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
14366         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14368         * xterm.c (handle_one_xevent): Only set async_visible and friends
14369         if net_wm_state_hidden_seen is non-zero (Bug#10002)
14370         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
14371         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14373 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
14375         Remove GCPRO-related macros that exist only to avoid shadowing locals.
14376         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14377         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
14378         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14379         All uses changed to use GCPRO1 etc.
14380         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14381         Revert to old implementation (i.e., before 2011-03-11).
14383 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14385         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14386         of scroll runs so as to avoid assigning disabled bogus rows and
14387         unnecessary graphics copy operations.
14389 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
14391         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14392         (snprintf) [_MSC_VER]: Redirect to _snprintf.
14393         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14394         (malloc, free, realloc, calloc): Redirect to e_* only when
14395         compiling Emacs.
14397         * lisp.h (GCTYPEBITS): Move before first use.
14398         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14399         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14400         this macro definition.
14402         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14403         _MSC_VER.
14405 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
14407         * gtkutil.c (xg_create_frame_widgets):
14408         Call gtk_window_set_has_resize_grip (FALSE) if that function is
14409         present with Gtk+ 2.0.
14411 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
14413         * fileio.c (Finsert_file_contents): Undo previous change; see
14414         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14416 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
14418         Rename locals to avoid shadowing.
14419         * fileio.c (Finsert_file_contents):
14420         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14421         * process.c (wait_reading_process_output):
14422         Rename inner 'proc' to 'p' to avoid shadowing.
14423         Indent for consistency with usual Emacs style.
14425 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
14427         * xdisp.c (redisplay_window): If cursor row is not fully visible
14428         after recentering, and scroll-conservatively is set to a large
14429         number, scroll window by a few more lines to make the cursor fully
14430         visible and out of scroll-margin.  (Bug#10105)
14431         (start_display): Don't move to the next line if the display should
14432         start at a newline that is part of a display vector or an overlay
14433         string.  (Bug#10119)
14435 2011-11-24  Juri Linkov  <juri@jurta.org>
14437         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14438         after the `MagickPingImage' call.  (Bug#10112)
14440 2011-11-23  Chong Yidong  <cyd@gnu.org>
14442         * window.c (Fcoordinates_in_window_p): Accept only live windows.
14444 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
14446         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14447         making another buffer current.  (Bug#10114)
14449 2011-11-23  Glenn Morris  <rgm@gnu.org>
14451         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
14453 2011-11-23  Chong Yidong  <cyd@gnu.org>
14455         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14456         using it (Bug#5984).
14458 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
14460         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14461         and header-lines, as they don't have one computed for them.
14462         (Bug#10098)
14464         * .gdbinit (prow): Make displayed values more self-explaining.
14465         Add row's hash code.
14467 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
14469         * process.c (wait_reading_process_output): Fix asynchrounous
14470         GnuTLS socket handling on some versions of the GnuTLS library.
14471         (wait_reading_process_output): Add comment and URL.
14473 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
14475         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14477 2011-11-21  Chong Yidong  <cyd@gnu.org>
14479         * window.c (Fnext_window, Fprevious_window): Doc fix.
14481 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
14483         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14485 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
14487         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14489 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
14491         * window.c (Fset_window_combination_limit): Rename argument
14492         STATUS to LIMIT.
14493         (Vwindow_combination_limit): Remove "status" from doc-string.
14495 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
14497         * m/ibms390.h: Remove.
14498         * m/ibms390x.h: Don't include "ibms390.h".
14500 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
14502         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14503         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14505 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
14507         * casetab.c (Fset_case_table):
14508         * charset.c (Fcharset_after): Fix typos.
14510 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
14512         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14513         Otherwise, valgrind does not work on some platforms.
14514         Problem reported by Andreas Schwab in
14515         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14516         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14517         is set, removing the need for VIRT_ADDRESS_VARIES.
14518         (PURE_P): Use a more-efficient implementation that needs just one
14519         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14520         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14521         to 4 (xorl, subq, cmpq, setbe).
14522         * alloc.c (pure): Always extern now, since that's the
14523         VIRT_ADDR_VARIES behavior.
14524         (PURE_POINTER_P): Use a single comparison, not two, for
14525         consistency with the new puresize.h.
14526         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14527         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14528         Remove VIRT_ADDR_VARIES no longer needed.
14530 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
14532         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14533         (erase_phys_cursor, update_window_cursor, show_mouse_face)
14534         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14535         behave as if the cursor position were at the window margin.
14537         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14538         and the cursor position is out of bounds, behave as if the cursor
14539         position were at the window margin.  (Bug#10075)
14541 2011-11-18  Chong Yidong  <cyd@gnu.org>
14543         * window.c (Fwindow_combination_limit): Make first argument
14544         non-optional, since it is meaningless for live windows like the
14545         selected window.
14547 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
14549         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14551 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
14553         * intervals.c: Fix grafting over the whole buffer (bug#10071).
14554         (graft_intervals_into_buffer): Simplify.
14556 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
14558         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14559         hash values of the two rows.
14560         (copy_row_except_pointers): Preserve the used[] arrays and the
14561         hash values of the two rows.  (Bug#10035)
14562         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
14564         * xdisp.c (row_hash): New function, body extracted from
14565         compute_line_metrics.
14566         (compute_line_metrics): Call row_hash, instead of computing the
14567         hash code inline.
14569         * dispnew.c (verify_row_hash): Call row_hash for computing the
14570         hash code of a row, instead of duplicating code from xdisp.c.
14572         * dispextern.h (row_hash): Add prototype.
14574 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
14576         * frame.c (delete_frame): Don't delete the terminal when the last
14577         X frame is closed if emacs is built with GTK toolkit.
14579 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
14581         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14583 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
14585         * window.c (Vwindow_splits): Rename to
14586         Vwindow_combination_resize.  Suggested by Juri Linkov.
14587         (Fsplit_window_internal): Use Vwindow_combination_resize instead
14588         of Vwindow_splits.
14590 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
14592         * nsfns.m (Fns_font_name):
14593         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
14595 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
14597         * window.h (window): Rename slot "nest" to "combination_limit".
14598         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14599         (Fset_window_nest): Rename to Fset_window_combination_limit.
14600         (Vwindow_nest): Rename to Vwindow_combination_limit.
14601         (recombine_windows, make_parent_window, make_window)
14602         (Fsplit_window_internal, saved_window)
14603         (Fset_window_configuration, save_window_save): Rename all
14604         occurrences of window_nest to window_combination_limit.
14606 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
14608         * image.c (imagemagick_load_image): Fix typo.
14610 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
14612         * xdisp.c (display_line): Move the call to
14613         highlight_trailing_whitespace before the call to
14614         compute_line_metrics, since the latter needs to see the final
14615         faces of all the glyphs to compute ROW's hash value.
14616         Fixes assertion violations in row_equal_p.  (Bug#10035)
14618 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
14620         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14621         just return (bug#10044).
14623 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
14625         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14626         with user-defined heap size.  Bump the default size of the temacs
14627         heap to 27MB, to avoid memory warning when running temacs.
14628         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14630         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14631         current_matrix and desired_matrix.  (Bug#9990)
14632         (verify_row_hash) [XASSERTS]: New function.
14633         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14634         that the hash value of glyph rows is correct.
14636 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
14638         * window.h (window): Remove splits slot.
14639         * window.c (Fwindow_splits, Fset_window_splits): Remove.
14640         (Fdelete_other_windows_internal, make_parent_window)
14641         (make_window, Fsplit_window_internal, Fdelete_window_internal)
14642         (Fset_window_configuration, save_window_save): Don't deal with
14643         split status of windows.
14644         (saved_window): Remove splits slot.
14645         (Vwindow_splits): Rewrite doc-string.
14647 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
14649         * xfns.c (unwind_create_frame):
14650         * nsfns.m (unwind_create_frame):
14651         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14652         Vframe_list (Bug#9999).
14654 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
14656         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
14658 2011-11-11  Kenichi Handa  <handa@m17n.org>
14660         * callproc.c (Fcall_process): Set the member dst_multibyte of
14661         process_coding.
14663 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
14665         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14666         avoid a crash (bug#9496).
14668 2011-11-09  Chong Yidong  <cyd@gnu.org>
14670         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14671         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14673 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
14675         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14677 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
14679         Avoid some portability problems by eschewing 'extern inline' functions.
14680         The trivial performance wins aren't worth the portability hassles; see
14681         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14682         et seq.
14683         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14684         (window_box_width, window_box_left, window_box_left_offset)
14685         (window_box_right, window_box_right_offset): Undo previous change,
14686         by removing the "extern"s.
14687         * intervals.c (adjust_intervals_for_insertion)
14688         (adjust_intervals_for_deletion): Undo previous change,
14689         making these static again.
14690         (offset_intervals, temp_set_point_both, temp_set_point)
14691         (copy_intervals_to_string): No longer inline.
14692         * xdisp.c (window_text_bottom_y, window_box_width)
14693         (window_box_height, window_box_left_offset)
14694         (window_box_right_offset, window_box_left, window_box_right)
14695         (window_box): No longer inline.
14697 2011-11-08  Chong Yidong  <cyd@gnu.org>
14699         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
14700         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14701         Signal an error if not a live window.
14702         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14703         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14705 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
14707         * lisp.h (syms_of_abbrev): Remove declaration.
14708         Reported by CHENG Gao <chenggao@royau.me>.
14710 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
14712         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14713         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
14714         of temacs in GUI mode.
14716 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
14718         * window.h: Declare delete_all_child_windows instead of
14719         delete_all_subwindows.
14720         * window.c (Fwindow_nest, Fset_window_nest)
14721         (Fset_window_new_total, Fset_window_new_normal)
14722         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14723         (delete_all_subwindows): Rename to delete_all_child_windows.
14724         (Fdelete_other_windows_internal, Fset_window_configuration):
14725         Call delete_all_child_windows instead of delete_all_subwindows.
14726         * frame.c (delete_frame): Call delete_all_child_windows instead
14727         of delete_all_subwindows.
14729 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
14731         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14732         This is also needed for porting to any host where GC_MARK_STACK is
14733         not GC_MAKE_GCPROS_NOOPS.
14734         (which_symbols): Use it.
14736 2011-11-07  Kenichi Handa  <handa@m17n.org>
14738         * coding.c (coding_set_destination): Check coding->src_pos only
14739         when coding->src_object is a buffer (bug#9910).
14741         * process.c (send_process): Set the member src_multibyte of coding
14742         to 0 (bug#9911) when sending a unibyte text.
14744         * callproc.c (Fcall_process): Set the member src_multibyte of
14745         process_coding to 0 (bug#9912).
14747 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
14749         * xmenu.c (cleanup_widget_value_tree): New function.
14750         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14751         calling free_menubar_widget_value_tree directly (Bug#9830).
14753 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
14755         Fix some portability problems with 'inline'.
14756         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14757         (window_box_width, window_box_left, window_box_left_offset)
14758         (window_box_right, window_box_right_offset): Declare extern.
14759         Otherwise, these inline functions do not conform to C99 and
14760         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
14761         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14762         * intervals.c (adjust_intervals_for_insertion)
14763         (adjust_intervals_for_deletion): Now extern, because otherwise the
14764         extern inline functions 'offset_intervals' couldn't refer to it.
14765         (static_offset_intervals): Remove.
14766         (offset_intervals): Rewrite using the old contents of
14767         static_offset_intervals.  The old version didn't conform to C99
14768         because an extern inline function contained a reference to an
14769         identifier with static linkage.
14771 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
14773         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14774         GC.
14776 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
14778         * xdisp.c (init_iterator, reseat_to_string): Don't set the
14779         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
14780         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14781         return Qleft_to_right.
14783 2011-11-06  Chong Yidong  <cyd@gnu.org>
14785         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14786         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14787         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14788         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14789         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14790         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14791         (Fwindow_vscroll): Doc fix.
14792         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14793         argument, since it makes no sense to pass a live window and for
14794         consistency with window-child.
14796 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
14798         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14799         support MSVC.
14801 2011-11-05  Jason Rumney  <jasonr@gnu.org>
14803         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14804         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14805         fonts (Bug#6029).
14806         (add_font_entity_to_list): Fix logic errors in mixed boolean and
14807         bitwise arithmetic preventing use of unicode-sip and non-truetype
14808         opentype fonts.
14810 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
14812         * s/ms-w32.h (fstat, stat, utime): Move redirections to
14813         "emacs"-only part.
14815         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14816         initialization code to keep similarity to xfns.c after changes
14817         from 2011-11-05.
14819 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
14821         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14822         (unwind_create_frame): New function (Bug#9943).
14823         (Fx_create_frame): Restructure code to be more similar to the one in
14824         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
14825         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14826         Move terminal->reference_count++ just before making the frame official
14827         (Bug#9943).
14829         * nsterm.m (x_free_frame_resources): New function.
14830         (x_destroy_window): Move code to x_free_frame_resources.
14832         * xfns.c (unwind_create_frame): Fix comment.
14833         (Fx_create_frame, x_create_tip_frame):
14834         Move terminal->reference_count++ just before making the frame
14835         official.  Move initialization of image_cache_refcount and
14836         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14838 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
14840         Support MSVC build with newer versions of Visual Studio.
14841         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14842         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
14843         nt/gmake.defs.
14845         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14846         which are not supported by MSVC.
14847         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14848         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14849         bitfields.
14850         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14851         types in bitfields.
14852         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14854         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14856 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
14858         Support MSVC build with newer versions of Visual Studio.
14859         * w32.c: Don't include w32api.h for MSVC.
14860         (init_environment) [_MSC_VER]: Call sys_access, not _access.
14862         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
14863         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
14864         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
14865         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
14866         e_* cousins.
14867         (alloca) [_MSC_VER]: Define to _alloca.
14869         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
14871         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
14873 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
14875         * xdisp.c (note_mouse_highlight): If either of
14876         previous/next-single-property-change returns nil, treat that as
14877         the beginning or the end of the buffer.  (Bug#9955)
14879 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
14881         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
14882         label is not null (Bug#9951).
14883         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
14884         may be NULL.
14886 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
14888         * window.c (Fwindow_body_size): Mention in the doc string that the
14889         return value is in frame's canonical units.  (Bug#9949)
14891 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
14893         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
14895         * w32fns.c (unwind_create_frame): If needed, free the glyph
14896         matrices of the partially constructed frame.  (Bug#9943)
14897         * xfns.c (unwind_create_frame): Likewise.
14899 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
14901         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
14902         Don't stop backward scan on the continuation glyph, even though
14903         its CHARPOS is positive.
14904         (mouse_face_from_buffer_pos, note_mouse_highlight):
14905         Rename cover_string to disp_string.
14907 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
14909         * window.c (temp_output_buffer_show): Don't use
14910         Vtemp_buffer_show_specifiers.
14911         (Vtemp_buffer_show_specifiers): Remove unused variable.
14913 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
14915         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
14916         past the beginning of the current glyph matrix.
14918 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
14920         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
14921         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
14922         HAVE_GTK3 (Bug#9869).
14924         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
14925         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
14927         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
14929         * xterm.c: Declare x_handle_net_wm_state to return int.
14930         (handle_one_xevent): Check if we are iconified but don't have
14931         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
14932         (get_current_wm_state): Return non-zero if not hidden,
14933         check for _NET_WM_STATE_HIDDEN (Bug#9893).
14934         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
14935         (x_handle_net_wm_state): Return what get_current_wm_state returns.
14936         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
14938 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
14940         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
14941         so that this new function doesn't get optimized away by a
14942         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
14944 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
14946         * frame.h (MOUSE_HL_INFO): Remove excess parens.
14948 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
14950         Fix the `xbytecode' command.
14951         * .gdbinit (xprintbytestr): New command.
14952         (xwhichsymbols): Rename from `which'; all callers changed.
14953         (xbytecode): Print the byte-code string as well.
14955 2011-10-29  Kim Storm  <storm@cua.dk>
14957         * alloc.c (which_symbols): New function.
14959 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
14961         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
14962         line.  (Bug#9903)
14964 2011-10-29  Glenn Morris  <rgm@gnu.org>
14966         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
14967         Not clear what it was for, and it causes various bugs.  (Bug#9839)
14969 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
14971         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
14972         possible random value that matches one of those tested as
14973         condition to clear the mouse face.
14975 2011-10-28  Chong Yidong  <cyd@gnu.org>
14977         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
14979 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
14981         * window.c (make_window): Initialize phys_cursor_on_p.
14983 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
14985         * lisp.h (struct Lisp_Symbol): Update comments.
14987 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
14989         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
14991 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
14993         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
14994         <oslsachem@gmail.com> for helping to debug this.
14996         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
14997         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
14998         (g_b_init_get_glyph_outline_w): New static variables.
14999         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15000         (GetGlyphOutlineW_Proc): New typedefs.
15001         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
15002         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15003         New functions.
15004         (w32font_open_internal, compute_metrics):
15005         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
15006         instead of calling the "wide" APIs directly.
15008         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15010         * w32.h (syms_of_w32font): Add prototype.
15012 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
15014         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15015         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15016         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15017         (Fmove_to_window_line): Doc fix.
15019 2011-10-27  Chong Yidong  <cyd@gnu.org>
15021         * process.c (make_process): Set gnutls_state to NULL.
15023         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15024         non-NULL, regardless of GNUTLS_INITSTAGE.
15025         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
15026         an error.  Set process slots as soon as we allocate them.
15028         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15030 2011-10-27  Chong Yidong  <cyd@gnu.org>
15032         * gnutls.c (emacs_gnutls_deinit): New function.
15033         Deallocate credentials structures as well as calling gnutls_deinit.
15034         (Fgnutls_deinit, Fgnutls_boot): Use it.
15036         * process.c (make_process): Initialize GnuTLS credentials to NULL.
15037         (deactivate_process): Call emacs_gnutls_deinit.
15039 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
15041         * image.c (x_create_x_image_and_pixmap):
15042         * w32.c (sys_rename, w32_delayed_load):
15043         * w32font.c (fill_in_logfont):
15044         * w32reg.c (x_get_string_resource): Silence compiler warnings.
15046 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
15048         * w32fns.c (w32_default_color_map): New function,
15049         extracted from Fw32_default_color_map.
15050         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
15052 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
15054         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15056 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
15058         * keyboard.c (test_undefined): New function (bug#9751).
15059         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15061 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
15063         * sysdep.c (init_sys_modes): Fix the check for the controlling
15064         terminal (Bug#6649).
15066 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
15068         * dispextern.h (struct bidi_it): New member next_en_type.
15070         * bidi.c (bidi_line_init): Initialize the next_en_type member.
15071         (bidi_resolve_explicit_1): When next_en_pos is valid for the
15072         current character, check also for next_en_type being WEAK_EN.
15073         (bidi_resolve_weak): Don't enter the expensive loop if the current
15074         position is before next_en_pos.  Record the bidi type of the first
15075         non-ET, non-BN character we find, in addition to its position.
15076         (bidi_level_of_next_char): Invalidate next_en_type when
15077         next_en_pos is over-stepped.
15079 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
15081         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15082         * editfns.c: Rewrite current-time-zone so that it invokes
15083         the equivalent of (format-time-string "%Z") to get the time zone name.
15084         This fixes a bug when the time zone name contains characters that
15085         need converting from the system time locale to Emacs internal format.
15086         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15087         that patch fixed format-time-string to do the conversion, but
15088         I forgot to fix current-time-zone.
15089         (format_time_string): New function, containing most of
15090         what Fformat_time_string used to contain.
15091         (Fformat_time_string): Rewrite in terms of format_time_string.
15092         This doesn't change this function's behavior.
15093         (current-time-zone): Rewrite to use format_time_string.
15094         This fixes the bug reported by Michael Schierl in
15095         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15096         Jason Rumney's 2007-06-07 change worked around this bug, but
15097         didn't fix it.
15098         * systime.h (tzname, timezone): Remove no-longer-used declarations.
15100 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
15102         * xdisp.c (start_display): If the character at POS is displayed
15103         via a display vector, reset IT->current.dpvec_index to zero.
15104         (try_window_reusing_current_matrix): If a line ends in a display
15105         vector or the next line starts in a display vector, continue
15106         redrawing the window even though the character position of
15107         start_row was reached.
15108         (Bug#9771, part 2)
15110 2011-10-18  Chong Yidong  <cyd@gnu.org>
15112         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15113         with nobreak-char-display too.
15115 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
15117         Fix part 3 of bug#9771.
15118         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15119         (bidi_resolve_neutral): Don't enter the expensive loop looking for
15120         non-neutral characters if the current character is a paragraph
15121         separator (a.k.a. Newline).  This avoids running the same
15122         expensive loop twice, once when we consume the preceding newline
15123         and the other time when the line actually needs to be displayed.
15124         Avoid the loop when we see neutrals on the base embedding level
15125         following a character whose directionality is the same as the
15126         paragraph's.  This avoids running the expensive loop when a line
15127         ends in a long sequence of neutrals, like control characters.
15128         Add assertion against STRONG_AL type.  Slightly rearrange code
15129         that determines the type of a neutral given the first non-neutral
15130         that follows it.
15131         (bidi_level_of_next_char): Set next_en_pos to zero when
15132         invalidating its info.
15134 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
15136         * xdisp.c (push_display_prop): Determine whether to record string
15137         or buffer position by IT->string, not by IT->method.  Allow
15138         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
15139         (move_it_vertically_backward): Don't look for character position
15140         immediately after the newline when in a continuation line.
15141         (Bug#9771, part 1)
15143 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
15145         * window.c (coordinates_in_window): Rewrite and delabelize
15146         vertical border check.  (Bug#5357) (Bug#9618)
15148 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
15150         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15151         errors in XSetWindowBorder (bug#9310).
15153 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
15155         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15156         avoid crash when xmalloc overrun checking is enabled.
15158 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
15160         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15161         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
15162         cursor motion with <left> and <right> arrow keys.
15164         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15165         some callers set that themselves.
15167 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
15169         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15170         display string and the previous row comes from the same string and
15171         is empty.  (Bug#9739)  (Bug#9738)
15173 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
15175         * doc.c (get_doc_string): Encode file name (bug#9735).
15177 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
15179         * bidi.c (bidi_level_of_next_char):
15180         * xdisp.c (get_visually_first_element): Remove old incorrect
15181         comments regarding the Unicode Line Separator character.
15183         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15185 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
15187         * alloc.c (Fgc_status): Do not access beyond zombies array
15188         boundary if nzombies > MAX_ZOMBIES.
15189         * alloc.c (dump_zombies): Add missing format specifier.
15191 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
15193         * xdisp.c (set_cursor_from_row): Simplify conditionals,
15194         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15196         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15197         Some packages use them to denote characters with modifiers.
15199 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
15201         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15202         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15203         matching a pp-number.  Rename parameter var to var1.
15205 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
15207         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15209 2011-10-08  Glenn Morris  <rgm@gnu.org>
15211         * callint.c (Fcall_interactively): Give a more explicit error for the
15212         'c' case with a non-character input.  (Bug#8479)
15214 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
15216         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15217         lines.
15218         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15219         lines that are hscrolled on the left.
15221         * dispnew.c (buffer_posn_from_coords): Account for a possible
15222         presence of header-line.  (Bug#4426)
15224 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
15226         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15227         Don't advertise functionality which we discourage or doesn't work.
15229 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
15231         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15232         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
15233         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15234         this makes Emacs dump core during garbage collection on rare
15235         occasions.  sizeof is obviously inferior to offsetof here, so
15236         stick with offsetof.
15237         (GC_POINTER_ALIGNMENT): New macro.
15238         (mark_memory): Omit 3rd (offset) arg; caller changed.
15239         Don't assume EMACS_INT alignment is the same as pointer alignment.
15241 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
15243         * keyboard.c (read_key_sequence_remapped): New var.
15244         (read_key_sequence): Compute remapping in the right buffer.
15245         (command_loop_1): Use read_key_sequence's remapping directly.
15247 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
15249         * dired.c (file_name_completion): Don't expand file name.
15250         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15251         before checking file name handler.
15253         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15254         they've been requested explicitly (bug#9591).
15256 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
15258         * keymap.c (Fsingle_key_description): Use make_specified_string
15259         instead of build_string to build string from push_key_description.
15260         (Bug#5193)
15262 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
15264         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15265         This fixes a Y2038 bug on 64-bit hosts.
15266         * buffer.c (reset_buffer):
15267         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15268         (Fclear_buffer_auto_save_failure):
15269         Use 0, not -1, to represent an unset failure time, since time_t
15270         might not be signed.
15272         Remove dependency on glibc malloc internals.
15273         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15274         Move back here from lisp.h, but with their new implementations.
15275         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15276         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15277         * charset.c (charset_table_init): New static var.
15278         (syms_of_charset): Use it instead of xmalloc.  This removes a
15279         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
15280         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15281         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15282         Move back to alloc.c.
15283         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15284         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15286 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
15288         * nsterm.m (windowDidResize): Call x_set_window_size only when
15289         ns_in_resize is true.  Otherwise set pixelwidth/height and
15290         call change_frame_size (Bug#9628).
15292 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
15294         Port --enable-checking=all to Fedora 14 x86-64.
15295         * charset.c (syms_of_charset): Also account for glibc malloc's
15296         internal overhead when calculating the initial malloc maximum.
15298         Port --enable-checking=all to Fedora 14 x86.
15299         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15300         Move to lisp.h.
15301         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15302         (overrun_check_realloc, overrun_check_free):
15303         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15304         That way, xmalloc returns a properly-aligned pointer even if
15305         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
15306         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15307         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15308         into account when calculating the initial malloc maximum.
15309         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15310         Move here from alloc.c, so that charset.c can use it too.
15311         Properly align; the old code wasn't right for common 32-bit hosts
15312         when configured with --enable-checking=all.
15313         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15314         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15316 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
15318         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
15319         use EDOM.
15321 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
15323         * xdisp.c (compute_display_string_end): If there's no display
15324         string at CHARPOS, return -1.
15326         * bidi.c (bidi_fetch_char): When compute_display_string_end
15327         returns a negative value, treat the character as a normal
15328         character not covered by a display string.  (Bug#9624)
15330 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
15332         * lread.c (Fread_from_string): Fix typo in docstring.
15334 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
15336         * xdisp.c (handle_invisible_prop): If invisible text ends on a
15337         newline, reseat the iterator instead of bidi-iterating there one
15338         character at a time.  (Bug#9610)
15339         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15340         TO_CHARPOS if the bidi iterator is at base embedding level.
15342 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
15344         * lread.c (readevalloop): Use correct code for NBSP.
15345         (read1): Likewise.  (Bug#9608)
15347 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
15349         * dbusbind.c (Fdbus_register_signal): When service is not
15350         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
15352 2011-09-25  Glenn Morris  <rgm@gnu.org>
15354         * buffer.c (truncate-lines): Doc fix.
15356 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
15358         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15359         (Fset_window_next_buffers): Doc fix.
15361 2011-09-24  Glenn Morris  <rgm@gnu.org>
15363         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
15365 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
15367         Fix minor problems found by static checking.
15368         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
15369         * indent.c (Fvertical_motion): Fix == vs = typo.
15371 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
15373         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15374         Default value is now t.  Doc fix.
15376         * indent.c (Fvertical_motion): Compute and apply the overshoot
15377         logic when moving up, not only when moving down.  Fix the
15378         confusing name and values of the it_overshoot_expected variable;
15379         logic changes accordingly.  (Bug#9254) (Bug#9549)
15381         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15382         CHARPOS is covered by a display string which includes newlines.
15383         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15384         is covered by a display string with embedded newlines.
15386 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
15388         * dbusbind.c (Fdbus_register_signal): Add match rule to
15389         Vdbus_registered_objects_table.  (Bug#9581)
15390         (Fdbus_register_method, Vdbus_registered_objects_table):
15391         Fix docstring.
15393 2011-09-24  Jim Meyering  <meyering@redhat.com>
15395         do not ignore write error for any output size
15396         The previous change was incomplete.
15397         While it makes emacs --batch detect the vast majority of stdout
15398         write failures, errors were still ignored whenever the output size is
15399         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
15400           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15401               && echo FAIL: ignored write error
15402           FAIL: ignored write error
15403           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15404               && echo FAIL: ignored write error
15405           FAIL: ignored write error
15406         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
15408 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
15410         * emacs.c (Fkill_emacs): In noninteractive mode exit
15411         non-successfully if a write error occurred on stdout.  (Bug#9574)
15413 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
15415         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15416         the xassert test.
15418         * dispextern.h (struct it): Update the comment documenting what
15419         can it->OBJECT be.
15421 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
15423         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15424         a display string, extend search for cursor position to end of row.
15425         (find_row_edges): If the row ends in a newline from a display
15426         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
15427         Handle the case of a display string with multiple newlines.
15428         (Fcurrent_bidi_paragraph_direction): Fix search for previous
15429         non-empty line.  Fixes confusing cursor motion with arrow keys at
15430         the beginning of a line that starts with whitespace.
15432 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15434         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15435         (bug#9493).
15437 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
15439         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15440         boolean (Bug#9154).
15442 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
15444         * xdisp.c (display_line): Record maximum and minimum buffer
15445         positions even if no glyphs were produced (e.g., by a zero-width
15446         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
15447         buffer positions that will be removed from the glyph row because
15448         they don't fit.
15449         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15450         column is beyond frame width: don't subtract 1 "pixel" when
15451         computing width of the stretch.
15452         (reseat_at_next_visible_line_start): Undo the change made on
15453         2011-09-17 that saved paragraph information and restored it after
15454         the call to `reseat'.  (Bug#9545)
15456 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15458         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15459         and turn window cursor on if cleared (Bug#9415).
15461 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
15463         * search.c (boyer_moore): Take unibyte characters from pattern
15464         literally.  (Bug#9458)
15466 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
15468         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15470 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
15472         Fix minor problem found by static checking.
15473         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15474         initialized, to pacify gcc -Wuninitialized.
15476         * fileio.c: Report proper errno when syscall falls.
15477         (Finsert_file_contents): Save and restore errno,
15478         so that report_file_error outputs the correct diagnostic.
15479         (Fwrite_region) [CLASH_DETECTION]: Likewise.
15481 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
15483         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15485 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
15487         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15488         2011-08-30 (revision 105619).  (Bug#9530)
15490 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
15492         * xdisp.c (reseat_at_next_visible_line_start): Keep information
15493         about the current paragraph and restore it after the call to reseat.
15495         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15496         (bidi_find_paragraph_start): Search back for paragraph beginning
15497         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15498         (bidi_move_to_visually_next): Only trigger paragraph-related
15499         computations when the last character is a newline or at EOB, not
15500         just any NEUTRAL_B.  (Bug#9470)
15502         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15503         truncated lines if point is covered by a display string.  (Bug#9524)
15505 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
15507         * xselect.c: Relax test for outgoing X longs (Bug#9498).
15508         (cons_to_x_long): New function.
15509         (lisp_data_to_selection_data): Use it.  Correct the test for
15510         short-versus-long data; it was negated.  Break out of vector
15511         loop, for efficiency, when a long datum is discovered.
15513 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
15515         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15517 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
15519         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15520         GCC PR/17406) by declaring this function with external scope.
15522 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
15524         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15525         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15527 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
15529         * editfns.c (Fformat): Correctly handle text properties on "%%".
15531 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
15533         * xterm.c (x_draw_composite_glyph_string_foreground):
15534         * w32term.c (x_draw_composite_glyph_string_foreground):
15535         * term.c (encode_terminal_code):
15536         * composite.c (composition_update_it, get_composition_id):
15537         * xdisp.c (get_next_display_element)
15538         (fill_composite_glyph_string): Add comments about special meaning
15539         of TAB characters in a composition.
15541 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
15543         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
15544         This occurs when processing a multibyte format.
15545         Problem reported by Wolfgang Jenker.
15547 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
15549         * xdisp.c (try_cursor_movement): Only check for exact match if
15550         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
15552 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
15554         Remove unused external symbols.
15555         * dispextern.h (calc_pixel_width_or_height): Remove decl.
15556         * xdisp.c (calc_pixel_width_or_height): Now static.
15557         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15558         * indent.c (check_display_width):
15559         * w32term.c: Fix comment to match code.
15560         * xterm.c, xterm.h (x_catching_errors): Remove.
15562 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
15564         * xselect.c: Use signed conversions more consistently (Bug#9498).
15565         (selection_data_to_lisp_data): Assume incoming selection data are
15566         signed integers, not unsigned.  This is to be consistent with
15567         outgoing selection data, which was modified to use signed integers
15568         in as part of the fix to Bug#9196 in response to Jan D.'s comment
15569         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15570         expects long, not unsigned long.
15572 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
15574         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15575         computation of loop end.  Reported by Johan Bockgård
15576         <bojohan@gnu.org>.
15578 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
15580         * frame.c (Fother_visible_frames_p): Function deleted.
15582 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
15584         * indent.c (compute_motion): Process display vector front to back
15585         rather than the other way around.  (Bug#2496)
15587 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
15589         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15591 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
15593         * minibuf.c (Fread_from_minibuffer): Doc fix.
15595 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
15597         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15598         2011-08-30 (revision 105619).  (Bug#9475)
15600 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15602         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15603         value for non-existent files.
15605 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
15607         * fileio.c (Finsert_file_contents): If the file cannot be opened,
15608         set its "size" to -1.  This will set the modtime_size field of
15609         the corresponding buffer to -1, which is what
15610         verify-visited-file-modtime expects for files that do not exist.
15611         (Bug#9139)
15613 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
15615         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15616         here ...
15617         * lisp.h: ... from here.  push_key_description is no longer
15618         defined in keyboard.c, so its declaration should not be in
15619         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15620         logically belongs with push_key_description.
15622 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
15624         * buffer.h: Include <sys/types.h> instead of <time.h>.
15625         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15626         Problem reported by Herbert J. Skuhra.
15628 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15630         * xml.c (parse_region): Make the parsing work for
15631         non-comment-starting XML files again (bug#9144).
15633 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
15635         * image.c (gif_load): Fix calculation of bottom and right corner.
15636         (Bug#9468)
15638 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
15640         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
15641         redisplay in small windows.
15643 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
15645         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15647 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
15649         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15650         Operate on live windows only.
15652 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
15654         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15656 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
15658         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15659         only under bidi iteration.
15661 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
15663         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15665 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
15667         isnan: Fix porting problem to Solaris 10 with bundled gcc.
15668         Without this fix, the command to link temacs failed due to an
15669         undefined symbol __builtin_isnan.  This is because
15670         /usr/include/iso/math_c99.h #defines isnan(x) to
15671         __builtin_isnan(x), but the bundled gcc, which identifies itself
15672         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15673         a __builtin_isnan.
15674         * floatfns.c (isnan): #undef, and then #define to a clone of
15675         what's in data.c.
15676         (Fisnan): Always define, since it's always available now.
15677         (syms_of_floatfns): Always define isnan at the Lisp level.
15679 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
15681         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15683 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
15685         * fileio.c: Fix bugs with large file offsets (Bug#9428).
15686         The previous code assumed that file offsets (off_t values) fit in
15687         EMACS_INT variables, which is not true on typical 32-bit hosts.
15688         The code messed up by falsely reporting buffer overflow in cases
15689         such as (insert-file-contents "big" nil 1 2) into an empty buffer
15690         when "big" contains more than 2**29 bytes, even though this
15691         inserts just one byte and does not overflow the buffer.
15692         (Finsert_file_contents): Store file offsets as off_t
15693         values, not as EMACS_INT values.  Check for overflow when
15694         converting between EMACS_INT and off_t.  When checking for
15695         buffer overflow or for overlap, take the offsets into account.
15696         Don't use EMACS_INT for small values where int suffices.
15697         When checking for overlap, fix a typo: ZV was used where
15698         ZV_BYTE was intended.
15699         (Fwrite_region): Don't assume off_t fits into 'long'.
15700         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15702 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
15704         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15706 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
15708         sprintf-related integer and memory overflow issues (Bug#9412).
15710         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
15711         (esprintf, exprintf, evxprintf): New functions.
15712         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
15713         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
15714         (modify_event_symbol): Do not assume that the length of
15715         name_alist_or_stem is safe to alloca and fits in int.
15716         (Fexecute_extended_command): Likewise for function name and binding.
15717         (Frecursion_depth): Wrap around reliably on integer overflow.
15718         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15719         since some callers pass EMACS_INT values.
15720         (Fsingle_key_description): Don't crash if symbol name contains more
15721         than MAX_ALLOCA bytes.
15722         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15723         (get_minibuffer): Arg is now EMACS_INT, not int.
15724         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
15725         (esprintf, exprintf, evxprintf): New decls.
15726         * window.h (command_loop_level, minibuf_level): Reflect API changes.
15728         * dbusbind.c (signature_cat): New function.
15729         (xd_signature, Fdbus_register_signal):
15730         Do not overrun buffer; instead, report string overflow.
15732         * dispnew.c (add_window_display_history): Don't overrun buffer.
15733         Truncate instead; this is OK since it's just a log.
15735         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15736         even if the time zone offset is outlandishly large.
15737         Don't mishandle offset == INT_MIN.
15739         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15740         when creating daemon; the previous buffer-overflow check was incorrect.
15742         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15743         which has the guts of the old verror function.
15745         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15746         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
15748         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15749         (font_unparse_xlfd): Don't blindly alloca long strings.
15750         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
15751         fits in int, when using sprintf.  Use single snprintf to count
15752         length of string rather than counting it via multiple sprintfs;
15753         that's simpler and more reliable.
15754         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15755         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15756         sprintf, in case result does not fit in int.
15758         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15759         (fontset_from_font): Print it.
15761         * frame.c (tty_frame_count): Now printmax_t, not int.
15762         (make_terminal_frame, set_term_frame_name): Print it.
15763         (x_report_frame_params): In X, window IDs are unsigned long,
15764         not signed long, so print them as unsigned.
15765         (validate_x_resource_name): Check for implausibly long names,
15766         and don't assume name length fits in 'int'.
15767         (x_get_resource_string): Don't blindly alloca invocation name;
15768         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
15769         not fit in int.
15771         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15772         (xg_check_special_colors, xg_set_geometry):
15773         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15775         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15776         Use esprintf, not sprintf, in case result does not fit in int.
15778         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15779         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15780         it as a large positive number.
15781         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15782         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15784         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15785         in case result does not fit in int.
15787         * print.c (float_to_string): Detect width overflow more reliably.
15788         (print_object): Make sprintf buffer a bit bigger, to avoid potential
15789         buffer overrun.  Don't assume list length fits in 'int'.  Treat
15790         print length of 0 as 0, not as infinity; to be consistent with other
15791         uses of print length in this function.  Don't overflow print length
15792         index.  Don't assume hash table size fits in 'long', or that
15793         vectorlike size fits in 'unsigned long'.
15795         * process.c (make_process): Use printmax_t, not int, to format
15796         process-name gensyms.
15798         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15800         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15801         to avoid potential buffer overrun.
15803         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15804         if X resource line is longer than 512 bytes.
15806         * xfns.c (x_window): Make sprintf buffer a bit bigger
15807         to avoid potential buffer overrun.
15809         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15811         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15813 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
15815         Integer overflow fixes for scrolling, etc.
15816         Without these, Emacs silently mishandles large integers sometimes.
15817         For example, "C-u 4294967297 M-x recenter" was treated as if
15818         it were "C-u 1 M-x recenter" on a typical 64-bit host.
15820         * xdisp.c (try_window_id): Check Emacs fixnum range before
15821         converting to 'int'.
15823         * window.c (window_scroll_line_based, Frecenter):
15824         Check that an Emacs fixnum is in range before assigning it to 'int'.
15825         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15826         values converted from Emacs fixnums.
15827         (Frecenter): Don't wrap around a line count if it is out of 'int'
15828         range; instead, treat it as an extreme value.
15829         (Fset_window_configuration, compare_window_configurations):
15830         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15832         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15833         that can exceed INT_MAX.  Check that EMACS_INT value is in range
15834         before assigning it to the (possibly-narrower) index.
15835         (match_limit): Don't assume that a fixnum can fit in 'int'.
15837         * print.c (print_object): Use ptrdiff_t, not int, for index that can
15838         exceed INT_MAX.
15840         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
15841         (Fvertical_motion): Don't wrap around LINES values that don't fit
15842         in 'int'.  Instead, treat them as extreme values.  This is good
15843         enough for windows, which can't have more than INT_MAX lines anyway.
15845 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
15847         * Require libxml/parser.h to avoid compilation warning.
15849         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15851         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15852         since this reportedly can destroy thread storage.
15854 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
15856         * syntax.c (find_defun_start): Update all cache variables if
15857         exiting early (Bug#9401).
15859 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
15861         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
15863         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
15864         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
15865         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
15867         * term.c (tty_append_glyph): New function.
15868         (produce_stretch_glyph): Static function and its prototype deleted.
15870         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
15871         Add prototypes.
15873 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
15875         * image.c (parse_image_spec): Check for nonnegative, not for positive,
15876         when checking :margin (Bug#9390).
15877         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
15878         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
15879         so that the name doesn't mislead.  All uses changed.
15881 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
15883         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
15884         set_tty_hooks.
15886 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
15888         * xdisp.c (move_it_to): Don't bail out early when reaching
15889         position beyond to_charpos, if we are scanning backwards.
15890         (move_it_vertically_backward): When DY == 0, make sure we get to
15891         the first character in the line after the newline.
15893 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
15895         * ccl.c: Improve and simplify overflow checking (Bug#9196).
15896         (ccl_driver): Do not generate an out-of-range pointer.
15897         (Fccl_execute_on_string): Remove unnecessary check for
15898         integer overflow, noted by Stefan Monnier in
15899         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
15900         Remove a FIXME that didn't need fixing.
15901         Simplify the newly-introduced buffer reallocation code.
15903 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
15905         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
15907 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
15909         Integer and memory overflow issues (Bug#9196).
15911         * doc.c (get_doc_string): Rework so that
15912         get_doc_string_buffer_size is the actual buffer size, rather than
15913         being 1 less than the actual buffer size; this makes xpalloc more
15914         convenient.
15916         * image.c (x_allocate_bitmap_record, cache_image):
15917         * xselect.c (Fx_register_dnd_atom):
15918         Simplify previous changes by using xpalloc.
15920         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
15921         since either will do and ptrdiff_t is convenient with xpalloc.
15923         * charset.c (charset_table_size)
15924         (struct charset_sort_data.priority): Now ptrdiff_t.
15925         (charset_compare): Don't overflow if priorities differ greatly.
15926         (Fsort_charsets): Don't assume list length fits in int.
15927         Check for size-calculation overflow when allocating sort data.
15928         (syms_of_charset): Allocate an initial charset table that is
15929         just under 64 KiB, to avoid problems with glibc malloc and mmap.
15931         * cmds.c (internal_self_insert): Check for size-calculation overflow.
15933         * composite.h (struct composition.glyph_len): Now int, not unsigned.
15934         The actual value is always <= INT_MAX, and leaving it unsigned made
15935         overflow checking harder.
15937         * dispextern.h (struct glyph_matrix.rows_allocated)
15938         (struct face_cache.size): Now ptrdiff_t, for convenience in use
15939         with xpalloc.  The values are still always <= INT_MAX.
15941         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
15943         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
15944         (SAFE_NALLOCA): New macro.
15946         * region-cache.c (struct boundary.pos, find_cache_boundary)
15947         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
15948         (set_cache_region, invalidate_region_cache)
15949         (revalidate_region_cache, know_region_cache, region_cache_forward)
15950         (region_cache_backward, pp_cache):
15951         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
15952         so that ptrdiff_t * can be passed to xpalloc.
15953         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
15954         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
15955         (pp_cache): Don't assume cache_len fits in int.
15956         * region-cache.h: Adjust extern decls to match.
15958         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
15959         EMACS_INT, since either will do, for xpalloc.
15961         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
15962         (xnmalloc, xnrealloc, xpalloc): New functions.
15964         * bidi.c (bidi_shelve_header_size): New constant.
15965         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
15966         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
15968         * bidi.c (bidi_cache_shrink):
15969         * buffer.c (overlays_at, overlays_in, record_overlay_string)
15970         (overlay_strings):
15971         Don't update size of array until after memory allocation succeeds,
15972         because xmalloc/xrealloc may not return.
15973         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
15974         now that we have proper integer overflow checking.
15975         (record_overlay_string, overlay_strings): Catch overflows when
15976         calculating size of overlay_str_buf.
15978         * callproc.c (Fcall_process): Check for size overflow when
15979         calculating size of args2.
15980         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
15981         Normally we prefer signed values, but sticking with ptrdiff_t would
15982         require adding more-complicated checks.
15984         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
15985         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
15986         Redo buffer-overflow calculations to avoid integer overflow.
15987         Add a FIXME comment where memory seems to be over-allocated.
15989         * character.c (Fstring): Check for size-calculation overflow.
15991         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
15992         unnecessary integer overflow.  Check for size overflow.
15993         (encode_coding_object): Don't update size until xmalloc succeeds.
15995         * composite.c (get_composition_id): Check for overflow in glyph
15996         length calculations.
15998         Integer and memory overflow fixes for display code.
15999         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16000         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16001         (scrolling_window): Check for overflow in size calculations.
16002         (line_draw_cost, realloc_glyph_pool, add_row_entry):
16003         Don't assume glyph table len fits in int.
16004         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16005         (row_table_size): Now ptrdiff_t, not int.
16006         (scrolling_window): Avoid overflow in size calculations.
16007         Don't update size until allocation succeeds.
16008         * fns.c (concat): Check for overflow in size calculations.
16009         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16010         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16011         (NEXT_ALMOST_PRIME_LIMIT): New constant.
16013         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16014         (get_doc_string): Check for size calculation overflow.
16015         Don't update size until allocation succeeds.
16016         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16017         EMACS_INT, where ptrdiff_t will do.
16018         (Fsubstitute_command_keys): Check for string overflow.
16020         * editfns.c (set_time_zone_rule): Don't assume environment length
16021         fits in int.
16022         (message_length): Now ptrdiff_t, not int.
16023         (Fmessage_box): Don't update size until allocation succeeds.
16024         Don't assume message length fits in int.
16025         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16027         * emacs.c (main): Do not reallocate argv, since there is a null at
16028         the end that can be overwritten, and this way there's no need to
16029         worry about size-calculation overflow.
16030         (sort_args): Check for size-calculation overflow.
16032         * eval.c (init_eval_once, grow_specpdl): Don't update size until
16033         alloc succeeds.
16034         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16036         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16037         (x_set_scroll_bar_width, x_figure_window_size):
16038         Check for integer overflow.
16039         (x_set_alpha): Do not assume XINT fits in int.
16041         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16042         This is for the members text_lines, text_cols, total_lines, total_cols,
16043         where the system imposes an 'int' limit.
16045         * fringe.c (Fdefine_fringe_bitmap):
16046         Don't update size until alloc works.
16048         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16049         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16051         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16052         Check for size-calculation overflow.
16053         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16054         do, as we prefer signed integers.
16055         (id_to_widget.max_size, id_to_widget.used)
16056         (xg_store_widget_in_map, xg_remove_widget_from_map)
16057         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16058         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16059         Use and return ptrdiff_t, not int.
16060         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16061         * gtkutil.h: Change prototypes to match the above.
16063         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16064         are duplicate now that they've been promoted to lisp.h.
16065         (x_allocate_bitmap_record, x_alloc_image_color)
16066         (make_image_cache, cache_image, xpm_load):
16067         Don't update size until alloc is done.
16068         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16069         (x_detect_edges):
16070         Check for size calculation overflow.
16071         (ct_colors_allocated_max): New constant.
16072         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16073         overflow.
16075         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16076         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16077         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16078         Use ptrdiff_t, not int, to count maps.
16079         (read_char_minibuf_menu_prompt): Check for overflow in size
16080         calculations.  Don't update size until allocation succeeds.
16081         Redo calculations to avoid overflow.
16082         * keyboard.h: Change prototypes to match the above.
16084         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16085         to count maps.
16086         (current_minor_maps): Check for size calculation overflow.
16087         * keymap.h: Change prototypes to match the above.
16089         * lread.c (read1, init_obarray): Don't update size until alloc done.
16091         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16092         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16094         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16095         Now ptrdiff_t, not int.
16096         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16097         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16099         * process.c (Fnetwork_interface_list): Check for overflow
16100         in size calculation.
16102         * region-cache.c (move_cache_gap): Check for size calculation overflow.
16104         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16105         overflow.  Don't bother calling xmalloc when xrealloc will do.
16107         * search.c (Freplace_match): Check for size calculation overflow.
16108         (Fset_match_data): Don't assume list lengths fit in 'int'.
16110         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16111         for command line length.  Do not attempt to address one before the
16112         beginning of an array, as that's not portable.
16114         * term.c (max_frame_lines): Remove; unused.
16115         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16116         not int.
16117         (encode_terminal_code, calculate_costs): Check for size
16118         calculation overflow.
16119         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16120         table lengths and related sizes.  Don't update size until alloc
16121         done.  Redo calculations to avoid overflow.
16122         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16124         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16125         subtracting pointers.
16126         (gobble_line): Check for overflow more carefully.  Don't update size
16127         until alloc done.
16129         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16130         Don't update size until alloc done.
16131         Redo size calculations to avoid overflow.
16132         Check for size calculation overflow.
16133         (main) [DEBUG]: Fix typo in invoking tparam1.
16135         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16136         Use ptrdiff_t, not int, for sizes.
16137         (store_mode_line_noprop_char): Don't update size until alloc done.
16139         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16140         Use ptrdiff_t, not int, for sizes.
16141         (Finternal_make_lisp_face, cache_face):
16142         Check for size calculation overflow.
16143         (cache_face): Treat size calculation overflows as if they were
16144         memory exhaustion (the usual treatment), rather than aborting.
16146         * xfns.c (x_encode_text, x_set_name_internal)
16147         (Fx_change_window_property): Use ptrdiff_t, not int, to count
16148         sizes, since they can exceed INT_MAX in size.  Check for size
16149         calculation overflow.
16151         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16152         (xg_select): Check for size calculation overflow.
16153         Don't update size until alloc done.
16155         * xrdb.c (get_environ_db): Don't assume path length fits in int,
16156         as sprintf is limited to int lengths.
16158         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16159         (X_LONG_MIN): New macros.
16160         Use them to make the following changes clearer.
16161         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16162         This change doesn't affect the value now, but it may help remind
16163         future maintainers not to raise the value too much later.
16164         (SELECTION_QUANTUM): Remove, replacing with ...
16165         (selection_quantum): ... new function, which avoids overflow.
16166         All uses changed.
16167         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16168         assumption that selection length fits in 'int'.
16169         (x_reply_selection_request, x_handle_selection_request)
16170         (x_get_window_property, receive_incremental_selection)
16171         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16172         (lisp_data_to_selection_data, clean_local_selection_data):
16173         Use ptrdiff_t, not int, to record length of selection.
16174         (x_reply_selection_request, x_get_window_property)
16175         (receive_incremental_selection, x_property_data_to_lisp):
16176         Redo calculations to avoid overflow.
16177         (x_reply_selection_request): When sending hint, ceiling it at
16178         X_LONG_MAX rather than relying on wraparound overflow to send
16179         something.
16180         (x_get_window_property, receive_incremental_selection)
16181         (lisp_data_to_selection_data, x_property_data_to_lisp):
16182         Check for size-calculation overflow.
16183         (x_get_window_property, receive_incremental_selection)
16184         (lisp_data_to_selection_data, Fx_register_dnd_atom):
16185         Don't store size until memory allocation succeeds.
16186         (x_get_window_property): Plug memory leak on memory exhaustion.
16187         Don't double-block input; malloc is safe here.  Don't assume 2**34
16188         - 4 fits in unsigned long.  Add an xassert to check
16189         XGetWindowProperty overflow.  Be more careful about overflow
16190         calculations, and distinguish size from memory overflow better.
16191         (receive_incremental_selection): When tracing, don't assume
16192         unsigned int is less than INT_MAX.
16193         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16194         harmful) conversions of unsigned short to int.
16195         (lisp_data_to_selection_data): Don't assume that integers
16196         in the range -65535 through -1 fit in an X unsigned short.
16197         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
16198         result parameters unless successful.  Rely on cons_to_unsigned
16199         to report problems with elements; the old code wasn't right anyway.
16200         (x_check_property_data): Check for int overflow; we cannot use
16201         a wider type due to X limits.
16202         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16204         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
16206         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16207         (x_term_init): Check for size calculation overflow.
16208         (x_color_cells): Don't store size until memory allocation succeeds.
16209         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
16210         Don't assume alloca size is less than MAX_ALLOCA.
16211         (x_term_init): Don't assume length fits in int (sprintf is limited
16212         to int size).
16214         Use ptrdiff_t for composition IDs.
16215         * character.c (lisp_string_width):
16216         * composite.c (composition_table_size, n_compositions)
16217         (get_composition_id, composition_gstring_from_id):
16218         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16219         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16220         * window.c (Frecenter):
16221         Use ptrdiff_t, not int, for composition IDs.
16222         * composite.c (get_composition_id): Check for integer overflow.
16223         * composite.h: Adjust prototypes to match the above changes.
16225         Use ptrdiff_t for hash table indexes.
16226         * category.c (hash_get_category_set):
16227         * ccl.c (ccl_driver):
16228         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16229         * coding.c (coding_system_charset_list, detect_coding_system):
16230         * coding.h (struct coding_system.id):
16231         * composite.c (get_composition_id, gstring_lookup_cache):
16232         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16233         * image.c (xpm_get_color_table_h):
16234         * lisp.h (hash_lookup, hash_put):
16235         * minibuf.c (Ftest_completion):
16236         Use ptrdiff_t for hash table indexes, not int (which is too
16237         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16238         32-bit --with-wide-int hosts).
16240         * charset.c (Fdefine_charset_internal): Check for integer overflow.
16241         Add a FIXME comment about memory leaks.
16242         (syms_of_charset): Don't assume xmalloc returns.
16244         Don't assume that stated character widths fit in int.
16245         * character.c (Fchar_width, c_string_width, lisp_string_width):
16246         * character.h (CHAR_WIDTH):
16247         * indent.c (MULTIBYTE_BYTES_WIDTH):
16248         Use sanitize_char_width to avoid undefined and/or bad behavior
16249         with outlandish widths.
16250         * character.h (sanitize_tab_width): Rename from sanitize_width,
16251         now that we have two such functions.  All uses changed.
16252         (sanitize_char_width): New inline function.
16254         Don't assume that tab-width fits in int.
16255         * character.h (sanitize_width): New inline function.
16256         (SANE_TAB_WIDTH): New macro.
16257         (ASCII_CHAR_WIDTH): Use it.
16258         * indent.c (sane_tab_width): Remove.  All uses replaced by
16259         SANE_TAB_WIDTH (current_buffer).
16260         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16262         * fileio.c: Integer overflow issues with file modes.
16263         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16265         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
16266         Remove unreachable code.
16267         (read_hex, load_charset_map_from_file): Check for integer overflow.
16269         * xterm.c: Don't go over XClientMessageEvent limit.
16270         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16271         (x_send_scroll_bar_event): Likewise.  Check that the size does not
16272         exceed limits imposed by XClientMessageEvent, as well as the usual
16273         ptrdiff_t and size_t limits.
16275         * keyboard.c: Overflow, signedness and related fixes.
16276         (make_lispy_movement): Use same integer type in forward decl
16277         that is used in the definition.
16278         (read_key_sequence, keyremap_step):
16279         Change bufsize argument back to int, undoing my 2011-03-30 change.
16280         We prefer signed types, and int is wide enough here.
16281         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16282         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
16283         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
16284         length, not size_t.  Use ptrdiff_t for index, not int.
16285         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16286         possibility of integer overflow.
16288         Overflow, signedness and related fixes for images.
16290         * dispextern.h (struct it.stack[0].u.image.image_id)
16291         (struct_it.image_id, struct image.id, struct image_cache.size)
16292         (struct image_cache.used, struct image_cache.ref_count):
16293         * gtkutil.c (update_frame_tool_bar):
16294         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16295         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16296         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16297         * nsmenu.m (update_frame_tool_bar):
16298         * xdisp.c (calc_pixel_width_or_height):
16299         * xfns.c (image_cache_refcount):
16300         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16301         on typical 64-bit hosts.
16303         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16304         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16305         Omit unnecessary casts to int.
16306         (parse_image_spec): Check that integers fall into 'int' range
16307         when the callers expect that.
16308         (image_ascent): Redo ascent calculation to avoid int overflow.
16309         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16310         (lookup_image): Remove unnecessary tests.
16311         (xbm_image_p): Locals are now of int, not EMACS_INT,
16312         since parse_image_check makes sure they fit into int.
16313         (png_load, gif_load, svg_load_image):
16314         Prefer int to unsigned where either will do.
16315         (tiff_handler): New function, combining the cores of the
16316         old tiff_error_handler and tiff_warning_handler.
16317         This function is rewritten to use vsnprintf and thereby avoid
16318         stack buffer overflows.  It uses only the features of vsnprintf
16319         that are common to both POSIX and native Microsoft.
16320         (tiff_error_handler, tiff_warning_handler): Use it.
16321         (tiff_load, gif_load, imagemagick_load_image):
16322         Don't assume :index value fits in 'int'.
16323         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16324         (imagemagick_load_image): Check that crop parameters fit into
16325         the integer types that MagickCropImage accepts.  Don't assume
16326         Vimagemagick_render_type has a nonnegative value.  Don't assume
16327         size_t fits in 'long'.
16328         (gs_load): Use printmax_t to print the widest integers possible.
16329         Check for integer overflow when computing image height and width.
16331 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
16333         * xdisp.c (redisplay_window): Don't force window start if point
16334         will be invisible in the resulting window.  (Bug#9324)
16336 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
16338         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16339         the display spec is of the form `(space ...)'.
16340         (handle_display_spec): Return the value returned by
16341         handle_single_display_spec, not just 1 or zero.
16342         (handle_single_display_spec): If the display spec is of the form
16343         `(space ...)', and specifies display in the text area, return 2
16344         rather than 1.
16345         (try_cursor_movement): Check for the need to scroll more
16346         accurately, and prefer exact match for point under bidi.
16347         Don't advance `row' beyond the last row of the window.
16349         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16350         into disp_prop; all users changed.
16352         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16353         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16354         for the text covered by the display property.
16356 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
16358         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16359         Change return value to nil.
16360         (Frecord_buffer): Delete unused function.
16362 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
16364         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16365         buffers, return left-to-right.
16366         (set_cursor_from_row): Consider candidate row a win if its glyph
16367         represents a newline and point is on that newline.  Fixes cursor
16368         positioning on the newline at EOL of R2L text within L2R
16369         paragraph, and vice versa.
16370         (try_cursor_movement): Check continued rows, in addition to
16371         continuation rows.  Fixes unwarranted scroll when point enters a
16372         continued line of R2L text within an L2R paragraph, or vice versa.
16373         (cursor_row_p): Consider the case of point being equal to
16374         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
16375         from the end of a short line to the beginning of a continued line
16376         of R2L text within L2R paragraph.
16377         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16378         composed characters.
16380         * bidi.c (bidi_check_type): Use xassert.
16381         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16382         members.
16384 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
16386         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16387         a character.
16389 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
16391         * nsfont.m (ns_otf_to_script): Fix typo.
16393 2011-08-22  Kenichi Handa  <handa@m17n.org>
16395         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16396         extra slot even if the purpose is char-code-property-table.
16398 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
16400         * xdisp.c (redisplay_window): When computing centering_position,
16401         account for the height of the header line.  (Bug#8874)
16403         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16404         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
16405         candidate is selected by the mouse, and that candidate has a
16406         composed character under the mouse.
16408         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
16409         coordinates reported by pos-visible-in-window-p for a composed
16410         character in column zero.
16412 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
16414         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16416 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
16418         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16419         consider it a hit if to_charpos is anywhere in the range of the
16420         composed buffer positions.
16422 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
16424         * image.c (gif_load): Don't assume that each subimage has the same
16425         dimensions as the base image.  Handle disposal method that is
16426         "undefined" by the gif spec (Bug#9335).
16428 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
16430         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
16431         (Fcondition_case): Document `debug' symbol in error handler.
16433 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
16435         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16436         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16437         from an Org mode buffer to a Speedbar frame.
16439         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16440         a composition, take its buffer position from IT->cmp_it.charpos.
16441         Fixes cursor positioning at the beginning of a line that begins
16442         with a composed character.
16444 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
16446         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16447         character bidirectional type, use STRONG_L instead.  Fixes crashes
16448         in a buffer produced by `describe-categories'.
16450         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16451         members before the level stack, so they would be saved and
16452         restored when copying iterator state.  Fixes incorrect reordering
16453         around TABs covered by display properties.
16455 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
16457         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
16459 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
16461         * eval.c (internal_condition_case, internal_condition_case_1)
16462         (internal_condition_case_2, internal_condition_case_n):
16463         Remove unnecessary aborts (Bug#9081).
16465 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
16467         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16468         has no `load' handler, try opening the file locally.  (Bug#9311)
16470 2011-08-16  Ken Brown  <kbrown@cornell.edu>
16472         * gmalloc.c: Expand comment.
16474 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
16476         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16477         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
16479 2011-08-16  Ken Brown  <kbrown@cornell.edu>
16481         Fix memory allocation problems in Cygwin build (Bug#9273).
16483         * unexcw.c ( __malloc_initialized): Declare external variable.
16484         (fixup_executable): Force the dumped emacs to reinitialize malloc.
16486         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16487         New variables.
16488         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16489         dumped emacs.
16490         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16491         in the static heap.
16492         [CYGWIN] (special_realloc): New function.
16493         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16494         requests to realloc storage in the static heap.
16496 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
16498         * bidi.c (bidi_initialize): Remove unused local.
16500 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
16502         * bidimirror.h:
16503         * biditype.h: Remove file.
16504         * makefile.w32-in ($(BLD)/bidi.$(O)):
16505         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
16507         * dispextern.h: Fix a typo in the comment to bidi_type_t.
16509         * chartab.c: Improve commentary for the uniprop_table API.
16511         * bidi.c (bidi_paragraph_init): Support zero value of
16512         bidi_ignore_explicit_marks_for_paragraph_level.
16513         (bidi_initialize): Use uniprop_table instead of including
16514         biditype.h and bidimirror.h.
16516         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16517         coordinates of the iterator when restoring from ppos_it.
16518         (Bug#9296)
16520 2011-08-14  Kenichi Handa  <handa@m17n.org>
16522         * process.c (create_process): Call setup_process_coding_systems
16523         after the pid of the process is set to -1 (Bug#8162).
16525 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
16527         * xdisp.c (move_it_in_display_line_to): Don't invoke
16528         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16529         ppos_it.  Fixes vertical cursor motion when line beginning is
16530         covered by an image.  (Bug#9296)
16532 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
16534         * nsterm.h (ns_run_ascript): Declare.
16535         (NSAPP_DATA2_RUNASSCRIPT): Define.
16537         * nsfns.m (as_script, as_result, as_status): New static variables.
16538         (ns_run_ascript): New function.
16539         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
16540         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16541         the event loop.  Get status from as_status (Bug#7276).
16543         * nsterm.m (sendEvent): If event is NSApplicationDefined and
16544         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16545         the event loop (Bug#7276).
16547 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
16549         * gnutls.c (QCgnutls_bootprop_priority)
16550         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16551         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16552         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16553         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16554         (QCgnutls_bootprop_verify_hostname_error)
16555         (QCgnutls_bootprop_callbacks_verify): Rename from
16556         Qgnutls_bootprop_..., all uses changed.
16558         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16559         uses changed.
16561 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
16563         * xfaces.c (Qframe_set_background_mode): Now static.
16564         * dispextern.h (Qframe_set_background_mode): Remove decl.
16566         * process.c (Fnetwork_interface_info): Declare local only if needed.
16568 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
16570         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16571         (Fnetwork_interface_list): Allocate in increments of bytes instead
16572         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
16573         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
16574         sockaddr.
16575         (struct ifflag_def): notrailers is smart on OSX.
16576         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16577         Get hardware address with getifaddrs if available.
16579 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
16581         * xdisp.c (iterate_out_of_display_property): xassert that
16582         IT->position is set to within IT->object's boundaries.  Break from
16583         the loop as soon as EOB is reached; avoids infloops in redisplay
16584         when IT->position is set up wrongly due to some bug.
16585         Set IT->current to match the bidi iterator unconditionally.
16586         (push_display_prop): Allow GET_FROM_STRING as IT->method on
16587         entry.  Force push_it to save on the stack the current
16588         buffer/string position, to be restored by pop_it.  Fix flags in
16589         the iterator structure wrt the object coming from a display
16590         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16591         properties.  (Bug#9284)
16593 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
16595         * fontset.c (fontset_get_font_group): Add proper type checks.
16596         (Bug#9172)
16598 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
16600         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16601         and LC_VERSION_MIN_MACOSX.
16602         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16603         (dump_it) [LC_FUNCTION_STARTS]: Use it.
16605 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
16607         * xdisp.c (forward_to_next_line_start): Allow to use the
16608         no-display-properties-and-no-overlays under bidi display.
16609         Set disp_pos in the bidi iterator to avoid searches for display
16610         properties and overlays.
16612 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
16614         * editfns.c (Fset_time_zone_rule): Document relationship with the
16615         setenv function.
16617         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16618         the font entity extracted from the cache (Bug#8109).
16620 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
16622         * composite.c (autocmp_chars): Don't reset point.  That is done by
16623         restore_point_unwind (Bug#5984).
16625 2011-08-07  Juri Linkov  <juri@jurta.org>
16627         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16628         to show the arg `TIME' instead of `TIMEVAL'.
16630 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
16632         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16633         display property strides EOL and includes a newline, as in
16634         longlines-mode.  (Bug#9254)
16635         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16636         word-wrap under bidirectional display.  (Bug#9224)
16638         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16639         is non-zero, even if the data buffer is NULL.  Fixes a crash in
16640         vertical-motion with longlines-mode.  (Bug#9254)
16642 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
16644         * bidi.c <bidi_cache_total_alloc>: Now static.
16645         (bidi_initialize): Initialize bidi_cache_total_alloc.
16647         * xdisp.c (display_line): Release buffer allocated for shelved bidi
16648         cache.  (Bug#9221)
16650         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16651         amount allocated this far in `bidi_cache_total_alloc'.
16652         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16653         non-zero, only free the data buffer without restoring the cache
16654         contents.  All callers changed.
16656         * dispextern.h (bidi_unshelve_cache): Update prototype.
16658         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16659         (move_it_in_display_line, move_it_to)
16660         (move_it_vertically_backward, move_it_by_lines): Replace the call
16661         to xfree to an equivalent call to bidi_unshelve_cache.
16662         (move_it_in_display_line_to): Fix logic of returning
16663         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
16665 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
16667         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16668         came from a string character with a `cursor' property.  (Bug#9229)
16670 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
16672         * Makefile.in (LIB_PTHREAD): New variable.
16673         (LIBES): Add LIB_PTHREAD (Bug#9216).
16675         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16676         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16678 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
16680         * regex.c (re_iswctype): Remove some redundant boolean conversions.
16682 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
16684         * xterm.c (x_find_topmost_parent): New function.
16685         (x_set_frame_alpha): Find topmost parent window with
16686         x_find_topmost_parent and set the property there also (bug#9181).
16687         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16689 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
16691         * callproc.c (Fcall_process): Avoid vfork clobbering
16692         the local vars buffer, coding_systems, current_dir.
16694 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
16696         * keymap.c (Fmake_composed_keymap): Move to subr.el.
16698 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
16700         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16701         so that it is not optimized away.
16703         * xdisp.c (compute_display_string_pos): Remove unused local.
16705 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
16707         Fix slow cursor motion and scrolling in large buffers with
16708         selective display, like Org Mode buffers.  (Bug#9218)
16710         * dispextern.h (struct bidi_it): New member disp_prop_p.
16712         * xdisp.c: Remove one-slot cache of display string positions.
16713         (compute_display_string_pos): Accept an additional argument
16714         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
16715         for a display string or property.  If found, set DISP_PROP_P
16716         non-zero.
16718         * bidi.c (bidi_fetch_char): Accept an additional argument
16719         DISP_PROP_P, and pass it to compute_display_string_pos.
16720         Only handle text covered by a display string if DISP_PROP_P is returned
16721         non-zero.  All callers of bidi_fetch_char changed.
16723 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
16725         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16727 2010-12-03  Don March  <don@ohspite.net>
16729         * keymap.c (Fdefine_key): Fix non-prefix key error message when
16730         last character M-[char] is translated to ESC [char] (bug#7541).
16732 2011-08-02  Kenichi Handa  <handa@m17n.org>
16734         * lisp.h (uniprop_table): Extern it.
16736         * chartab.c (uniprop_table): Make it non-static.
16738 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
16740         * xdisp.c (forward_to_next_line_start): Accept additional argument
16741         BIDI_IT_PREV, and store into it the state of the bidi iterator had
16742         on the newline.
16743         (reseat_at_next_visible_line_start): Use the bidi iterator state
16744         returned by forward_to_next_line_start to restore the state of
16745         it->bidi_it after backing up to previous newline.  (Bug#9212)
16747 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
16749         * regex.c (re_comp): Protoize.
16750         (re_exec): Fix return type.
16751         (regexec): Fix type of `ret'.  (Bug#9203)
16753 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
16755         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16756         This is needed if max-image-size is a floating-point number.
16758 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
16760         * print.c (print_object): Print empty symbol as ##.
16762         * lread.c (read1): Read ## as empty symbol.
16764 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
16766         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16767         setting frame foreground color (Bug#9175).
16768         (x_set_background_color): Likewise.
16770         * nsmenu.m (-setText): Size tooltip dimensions precisely to
16771         contents (Bug#9176).
16772         (EmacsTooltip -init): Remove bezels and add shadows to
16773         tooltip windows.
16775         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16776         or scroll bar (Bug#8470).
16778         * nsfont.m (nsfont_open): Remove assignment to voffset and
16779         unnecessary vars hshink, expand, hd, full_height, min_height.
16780         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16782         * nsterm.h (nsfont_info): Remove voffset field.
16784 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
16786         Implement strike-through and overline on NextStep (Bug#8863).
16788         * nsfont.m (nsfont_open): Use underline position provided by font,
16789         instead of hard-coded value of 2.
16790         (nsfont_draw): Call ns_draw_text_decoration instead.
16792         * nsterm.h: Add declaration for ns_draw_text_decoration.
16794         * nsterm.m (ns_draw_text_decoration): New function for drawing
16795         underline, overline, and strike-through.
16796         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16797         ns_draw_text_decoration.  Change treatment of cursor drawing to
16798         accommodate underlining, etc.
16800 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
16802         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16803         default.
16805 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
16807         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16808         Without this fix, if a signal arrives just after memory fills up,
16809         'malloc' might be invoked reentrantly.
16811         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16812         In other words, assume that every image size is allowed, on non-X
16813         hosts.  This assumption is probably wrong, but it lets Emacs compile.
16815 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
16817         * regex.c (re_iswctype): Convert return values to boolean.
16819 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
16821         * xdisp.c (compute_display_string_pos): Don't use cached display
16822         string position if the buffer had its restriction changed.
16823         (Bug#9184)
16825 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
16827         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16829 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
16831         Integer signedness and overflow and related fixes.  (Bug#9079)
16833         * bidi.c: Integer size and overflow fixes.
16834         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16835         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16836         (bidi_cache_find_level_change, bidi_cache_ensure_space)
16837         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16838         (bidi_find_other_level_edge):
16839         Use ptrdiff_t instead of EMACS_INT where either will do.
16840         This works better on 32-bit hosts configured --with-wide-int.
16841         (bidi_cache_ensure_space): Check for size-calculation overflow.
16842         Use % rather than repeated addition, for better worst-case speed.
16843         Don't set bidi_cache_size until after xrealloc returns, because it
16844         might not return.
16845         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
16846         (bidi_cache_ensure_space): Also check that the bidi cache size
16847         does not exceed that of the largest Lisp string or buffer.  See Eli
16848         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
16850         * alloc.c (__malloc_size_t): Remove.
16851         All uses replaced by size_t.  See Andreas Schwab's note
16852         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16854         * image.c: Improve checking for integer overflow.
16855         (check_image_size): Assume that f is nonnull, since
16856         it is always nonnull in practice.  This is one less thing to
16857         worry about when checking for integer overflow later.
16858         (x_check_image_size): New function, which checks for integer
16859         overflow issues inside X.
16860         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
16861         This removes the need for a memory_full check.
16862         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
16863         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
16864         (xbm_read_bitmap_data): Change locals back to 'int', since
16865         their values must fit in 'int'.
16866         (xpm_load_image, png_load, tiff_load):
16867         Invoke x_create_x_image_and_pixmap earlier,
16868         to avoid much needless work if the image is too large.
16869         (tiff_load): Treat overly large images as if
16870         x_create_x_image_and_pixmap failed, not as malloc failures.
16871         (gs_load): Use x_check_image_size.
16873         * gtkutil.c: Omit integer casts.
16874         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
16875         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
16877         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
16879         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
16880         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
16881         would wrongly return t on a 64-bit host.
16883         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
16884         The plain *_OVERFLOW macros run afoul of GCC bug 49705
16885         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
16886         and therefore cause GCC to emit a bogus diagnostic in some cases.
16888         * image.c: Integer signedness and overflow and related fixes.
16889         This is not an exhaustive set of fixes, but it's time to
16890         record what I've got.
16891         (lookup_pixel_color, check_image_size): Remove redundant decls.
16892         (check_image_size): Don't assume that arbitrary EMACS_INT values
16893         fit in 'int', or that arbitrary 'double' values fit in 'int'.
16894         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
16895         (tiff_load, imagemagick_load_image):
16896         Check for overflow in size calculations.
16897         (x_create_x_image_and_pixmap): Remove unnecessary test for
16898         xmalloc returning NULL; that can't happen.
16899         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
16900         (xpm_color_bucket): Use better integer hashing function.
16901         (xpm_cache_color): Don't possibly over-allocate memory.
16902         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
16903         (gif_memory_source):
16904         Use ptrdiff_t, not int or size_t, to record sizes.
16905         (png_load): Don't assume values greater than 2**31 fit in 'int'.
16906         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
16907         either works, as we prefer signed integers.
16908         (tiff_read_from_memory, tiff_write_from_memory):
16909         Return tsize_t, not size_t, since that's what the TIFF API wants.
16910         (tiff_read_from_memory): Don't fail simply because the read would
16911         go past EOF; instead, return a short read.
16912         (tiff_load): Omit no-longer-needed casts.
16913         (Fimagemagick_types): Don't assume size fits into 'int'.
16915         Improve hashing quality when configured --with-wide-int.
16916         * fns.c (hash_string): New function, taken from sxhash_string.
16917         Do not discard information about ASCII character case; this
16918         discarding is no longer needed.
16919         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
16920         * lisp.h: Declare it.
16921         * lread.c (hash_string): Remove, since we now use fns.c's version.
16922         The fns.c version returns a wider integer if --with-wide-int is
16923         specified, so this should help the quality of the hashing a bit.
16925         * emacs.c: Integer overflow minor fix.
16926         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
16927         Define only if GNU_LINUX.
16928         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
16930         * dispnew.c: Integer signedness and overflow fixes.
16931         Remove unnecessary forward decls, that were a maintenance hassle.
16932         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
16933         All uses changed.
16934         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
16935         (scrolling_window): Use ptrdiff_t, not int, for byte count.
16936         (prepare_desired_row, line_draw_cost):
16937         Use int, not unsigned, where either works.
16938         (save_current_matrix, restore_current_matrix):
16939         Use ptrdiff_t, not size_t, where either works.
16940         (init_display): Check for overflow more accurately, and without
16941         relying on undefined behavior.
16943         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
16944         Remove, replacing with the new symbols in lisp.h.  All uses changed.
16945         * fileio.c (make_temp_name):
16946         * filelock.c (lock_file_1, lock_file):
16947         * xdisp.c (message_dolog):
16948         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
16949         Use pMd etc. instead.
16950         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
16951         replacing the pWIDE etc. symbols removed from editfns.c.
16953         * keyboard.h (num_input_events): Now uintmax_t.
16954         This is (very slightly) less likely to mess up due to wraparound.
16955         All uses changed.
16957         * buffer.c: Integer signedness fixes.
16958         (alloc_buffer_text, enlarge_buffer_text):
16959         Use ptrdiff_t rather than size_t when either will do, as we prefer
16960         signed integers.
16962         * alloc.c: Integer signedness and overflow fixes.
16963         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
16964         (__malloc_size_t): Default to size_t, not to int.
16965         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
16966         (Fgarbage_collect, mark_object_loop_halt, mark_object):
16967         Prefer ptrdiff_t to size_t when either would do, as we prefer
16968         signed integers.
16969         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
16970         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
16971         Now const.  Initialize with values that are in range even if char
16972         is signed.
16973         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
16974         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
16975         These functions do the right thing with sizes > 2**32.
16976         (check_depth): Now ptrdiff_t, not int.
16977         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
16978         Adjust to new way of storing sizes.  Check for size overflow bugs
16979         in rest of code.
16980         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
16981         slightly wrong anyway, as it missed one instance of
16982         XMALLOC_OVERRUN_CHECK_OVERHEAD.
16983         (refill_memory_reserve): Omit needless cast to size_t.
16984         (mark_object_loop_halt): Mark as externally visible.
16986         * xselect.c: Integer signedness and overflow fixes.
16987         (Fx_register_dnd_atom, x_handle_dnd_message):
16988         Use ptrdiff_t, not size_t, since we prefer signed.
16989         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
16990         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
16991         x_dnd_atoms_size and x_dnd_atoms_length.
16993         * doprnt.c: Prefer signed to unsigned when either works.
16994         * eval.c (verror):
16995         * doprnt.c (doprnt):
16996         * lisp.h (doprnt):
16997         * xdisp.c (vmessage):
16998         Use ptrdiff_t, not size_t, when using or implementing doprnt,
16999         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17000         prefer signed arithmetic to avoid comparison confusion.
17001         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17002         but is a bit tricky.
17004         Assume freestanding C89 headers, string.h, stdlib.h.
17005         * data.c, doprnt.c, floatfns.c, print.c:
17006         Include float.h unconditionally.
17007         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17008         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
17009         * regex.c: Likewise for stddef.h, string.h.
17010         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
17011         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17012         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17013         (STDC_HEADERS): Remove obsolete defines.
17014         * sysdep.c: Include limits.h unconditionally.
17016         Assume support for memcmp, memcpy, memmove, memset.
17017         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17018         * regex.c (memcmp, memcpy):
17019         Remove; we assume C89 now.
17021         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17022         (__malloc_safe_bcopy): Remove; no longer needed.
17024         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
17025         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
17026         well either way, and we prefer signed to unsigned.
17028 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17030         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17031         closes the connection while we're reading (bug#9182).
17033 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
17035         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17036         are specified (Bug#9168).
17038 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
17040         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17041         Found by GCC static checking and --with-wide-int on a 32-bit host.
17043 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
17045         * xdisp.c (compute_display_string_pos): Fix logic of caching
17046         previous display string position.  Initialize cached_prev_pos to
17047         -1.  Fixes slow-down at the beginning of a buffer.
17049 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
17051         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17052         for attrs[LFACE_FONTSET_INDEX].
17054 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
17056         * xml.c (parse_region): Remove unused local
17057         that was recently introduced.
17059 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
17061         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17062         revision 84777 on 2008-02-22.
17064         * xdisp.c (move_it_in_display_line_to): Record the best matching
17065         position for TO_CHARPOS while scanning the line, and restore it on
17066         exit if none of the characters scanned was an exact match.
17067         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
17068         when exact match is impossible due to invisible text, and the
17069         lines are truncated.
17071 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
17073         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17074         for OSX >= 10.7.
17076 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
17078         Fix a significant slow-down of cursor motion with C-n, C-p,
17079         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17080         auto-repeat under bidi redisplay in fontified buffers.
17081         * xdisp.c (compute_stop_pos_backwards): New function.
17082         (next_element_from_buffer): Call compute_stop_pos_backwards to
17083         find a suitable prev_stop when we find ourselves before
17084         base_level_stop.
17085         (reseat): Don't look for prev_stop, as that could mean a very long
17086         run.
17087         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17088         <cached_disp_overlay_modiff>: Cache for last found display string
17089         position.
17090         (compute_display_string_pos): Return the cached position if asked
17091         about the same buffer in the same area of character positions, and
17092         the buffer wasn't changed since the time the display string
17093         position was cached.
17095 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
17097         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17098         is an integer, which is important for empty lines.  (Bug#9149)
17100 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
17102         * frame.c (Fmodify_frame_parameters): In tty case, update the
17103         default face if necessary (Bug#4238).
17105 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
17107         * editfns.c (Fstring_to_char): No need to explain what a character
17108         is in the docstring (Bug#6576).
17110 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17112         * xml.c (parse_region): Make sure we always return a tree.
17114 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
17116         * xml.c (parse_region): If a document contains only comments,
17117         return that, too.
17119 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17121         * xml.c (make_dom): Return comments, too.
17123 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
17125         Port to OpenBSD.
17126         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17127         and the surrounding thread.
17128         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17129         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
17130         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17131         timer goes off.
17132         * s/openbsd.h (BROKEN_SIGIO): Define.
17133         * unexelf.c (unexec) [__OpenBSD__]:
17134         Don't update the .mdebug section of the Alpha COFF symbol table.
17136 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17138         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17139         (bug#8460).
17141 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
17143         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17144         This fixes some race conditions on the permissions of any newly
17145         created file.
17147         * alloc.c (valid_pointer_p): Use pipe, not open.
17148         This fixes some permissions issues when debugging.
17150         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
17151         If fchown fails to set both uid and gid, try to set just gid,
17152         as that is sometimes allowed.  Adjust the file's mode to eliminate
17153         setuid or setgid bits that are inappropriate if fchown fails.
17155 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
17157         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17158         to compare Lisp_Objects.
17159         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17160         global_gnutls_log_level, don't mistake it for a Lisp_Object.
17161         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17163 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
17165         * lread.c (read_integer): Unread even EOF character.
17166         (read1): Likewise.  Properly record start position of symbol.
17168         * lread.c (read1): Read `#:' as empty uninterned symbol if no
17169         symbol character follows.
17171 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
17173         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
17174         This works around a problem with the previous change to Fcopy_file.
17175         Recent glibc declares fchown with __attribute__((warn_unused_result)),
17176         and without this change, GCC might complain about discarding
17177         fchown's return value.
17179 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
17181         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17183 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
17185         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
17187 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17189         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17190         it's used from the C level.
17192         * process.c: Use the same condition for POLL_FOR_INPUT in both
17193         keyboard.c and process.c (bug#1858).
17195 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
17197         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17198         (Fgnutls_boot): Use it.
17200 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
17202         * doc.c (Fsubstitute_command_keys): Revert last change.
17204 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17206         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17207         quotes the next character, and doesn't affect other longer
17208         sequences (bug#8935).
17210         * lread.c (syms_of_lread): Clarify that is isn't only
17211         `eval-buffer' and `eval-defun' that's affected by
17212         `lexical-binding' (bug#8460).
17214 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
17216         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
17217         bidi redisplay when a line includes both an image and is truncated.
17219 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
17221         Fix minor problems found by static checking.
17222         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17223         (elsz): Now a signed constant, not a size_t var.  We prefer signed
17224         types to unsigned, to avoid integer comparison confusion.  Without
17225         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17226         "cannot optimize loop, the loop counter may overflow", a symptom
17227         of the confusion.
17228         * indent.c (Fvertical_motion): Mark locals as initialized.
17229         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17231 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17233         * search.c (Fre_search_backward): Mention `case-fold-search' in
17234         all the re_search_* functions (bug#8138).
17236         * keyboard.c (Fopen_dribble_file): Document when the file is
17237         closed (bug#8056).
17239 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
17241         * bidi.c (bidi_dump_cached_states): Fix format of displaying
17242         bidi_cache_idx.
17244         Support bidi reordering of display and overlay strings.
17245         * xdisp.c (compute_display_string_pos)
17246         (compute_display_string_end): Accept additional argument STRING.
17247         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17248         (reseat_to_string): Initialize bidi_it->string.s and
17249         bidi_it->string.schars.
17250         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
17251         NULL (avoids a crash in bidi_paragraph_init).
17252         Initialize itb.string.lstring.
17253         (init_iterator): Call bidi_init_it only of a valid
17254         buffer position was specified.  Initialize paragraph_embedding to
17255         L2R.
17256         (reseat_to_string): Initialize the bidi iterator.
17257         (display_string): If we need to ignore text properties of
17258         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
17259         original value of -1 will not work with bidi.)
17260         (compute_display_string_pos): First arg is now struct
17261         `text_pos *'; all callers changed.  Support display properties on
17262         Lisp strings.
17263         (compute_display_string_end): Support display properties on Lisp
17264         strings.
17265         (init_iterator, reseat_1, reseat_to_string): Initialize the
17266         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17267         when iterating on a string not from display properties).
17268         (compute_display_string_pos, compute_display_string_end):
17269         Fix calculation of the object to scan.  Fixes an error when using
17270         arrow keys.
17271         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
17272         base_level_stop; instead, set base_level_stop to BEGV.
17273         Fixes crashes in vertical-motion.
17274         (next_element_from_buffer): Improve commentary for when
17275         the iterator is before prev_stop.
17276         (init_iterator): Initialize bidi_p from the default value of
17277         bidi-display-reordering, not from buffer-local value.  Use the
17278         buffer-local value only if initializing for buffer iteration.
17279         (handle_invisible_prop): Support invisible properties on strings
17280         that are being bidi-reordered.
17281         (set_iterator_to_next): Support bidi reordering of C strings and
17282         Lisp strings.
17283         (next_element_from_string): Support bidi reordering of Lisp
17284         strings.
17285         (handle_stop_backwards): Support Lisp strings as well.
17286         (display_string): Support display of R2L glyph rows.
17287         Use IT_STRING_CHARPOS when displaying from a Lisp string.
17288         (init_iterator): Don't initialize it->bidi_p for strings
17289         here.
17290         (reseat_to_string): Initialize it->bidi_p for strings here.
17291         (next_element_from_string, next_element_from_c_string)
17292         (next_element_from_buffer): Add xassert's for correspondence
17293         between IT's object being iterated and it->bidi_it.string
17294         structure.
17295         (face_before_or_after_it_pos): Support bidi iteration.
17296         (next_element_from_c_string): Handle the case of the first string
17297         character that is not the first one in the visual order.
17298         (get_visually_first_element): New function, refactored from common
17299         parts of next_element_from_buffer, next_element_from_string, and
17300         next_element_from_c_string.
17301         (tool_bar_lines_needed, redisplay_tool_bar)
17302         (display_menu_bar): Force left-to-right direction.  Add a FIXME
17303         comment for making that be controlled by a user option.
17304         (push_it, pop_it): Save and restore the state of the
17305         bidi iterator.  Save and restore the bidi_p flag.
17306         (pop_it): Iterate out of display property for string iteration as
17307         well.
17308         (iterate_out_of_display_property): Support iteration over strings.
17309         (handle_single_display_spec): Set up it->bidi_it for iteration
17310         over a display string, and call bidi_init_it.
17311         (handle_single_display_spec, next_overlay_string)
17312         (get_overlay_strings_1, push_display_prop): Set up the bidi
17313         iterator for displaying display or overlay strings.
17314         (forward_to_next_line_start): Don't use the shortcut if
17315         bidi-iterating.
17316         (back_to_previous_visible_line_start): If handle_display_prop
17317         pushed the iterator stack, restore the internal state of the bidi
17318         iterator by calling bidi_pop_it same number of times.
17319         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17320         and we are bidi-iterating, don't decrement the iterator position;
17321         instead, set the first_elt flag in the bidi iterator, to produce
17322         the same effect.
17323         (reseat_1): Remove redundant setting of string_from_display_prop_p.
17324         (push_display_prop): xassert that we are iterating a buffer.
17325         (push_it, pop_it): Save and restore paragraph_embedding member.
17326         (handle_single_display_spec, next_overlay_string)
17327         (get_overlay_strings_1, reseat_1, reseat_to_string)
17328         (push_display_prop): Set up the `unibyte' member of bidi_it.string
17329         correctly.  Don't assume unibyte strings are not bidi-reordered.
17330         (compute_display_string_pos)
17331         (compute_display_string_end): Fix handling the case of C string.
17332         (push_it, pop_it): Save and restore from_disp_prop_p.
17333         (handle_single_display_spec, push_display_prop): Set the
17334         from_disp_prop_p flag.
17335         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17336         (pop_it): Call iterate_out_of_display_property only if we are
17337         popping after iteration over a string that came from a display
17338         property.  Fix a typo in popping stretch info.  Add an assertion
17339         for verifying that the iterator position is in sync with the bidi
17340         iterator.
17341         (handle_single_display_spec, get_overlay_strings_1)
17342         (push_display_prop): Fix initialization of paragraph direction for
17343         string when that of the parent object is not yet determined.
17344         (reseat_1): Call bidi_init_it to resync the bidi
17345         iterator with IT's position.  (Bug#7616)
17346         (find_row_edges): If ROW->start.pos gives position
17347         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
17348         (handle_stop, back_to_previous_visible_line_start, reseat_1):
17349         Reset the from_disp_prop_p flag.
17350         (SAVE_IT, RESTORE_IT): New macros.
17351         (pos_visible_p, face_before_or_after_it_pos)
17352         (back_to_previous_visible_line_start)
17353         (move_it_in_display_line_to, move_it_in_display_line)
17354         (move_it_to, move_it_vertically_backward, move_it_by_lines)
17355         (try_scrolling, redisplay_window, display_line): Use them when
17356         saving a temporary copy of the iterator and restoring it back.
17357         (back_to_previous_visible_line_start, reseat_1)
17358         (init_iterator): Empty the bidi cache "stack".
17359         (move_it_in_display_line_to): If iterator ended up at
17360         EOL, but we never saw any buffer positions smaller than
17361         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
17362         motion in bidi-reordered lines.
17363         (move_it_in_display_line_to): Record prev_method and prev_pos
17364         immediately before the call to set_iterator_to_next.  Fixes cursor
17365         motion in bidi-reordered lines with stretch glyphs and strings
17366         displayed in margins.  (Bug#8133) (Bug#8867)
17367         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17368         TO_CHARPOS.
17369         (pos_visible_p): Support positions in bidi-reordered lines.
17370         Save and restore bidi cache.
17372         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17373         (bidi_paragraph_info): Delete unused struct.
17374         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17375         (bidi_cache_start): New variable.
17376         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17377         to zero.
17378         (bidi_cache_fetch_state, bidi_cache_search)
17379         (bidi_cache_find_level_change, bidi_cache_iterator_state)
17380         (bidi_cache_find, bidi_peek_at_next_level)
17381         (bidi_level_of_next_char, bidi_find_other_level_edge)
17382         (bidi_move_to_visually_next): Compare cache index with
17383         bidi_cache_start rather than with zero.
17384         (bidi_fetch_char): Accept new argument STRING; all callers
17385         changed.  Support iteration over a string.  Support strings with
17386         display properties.  Support unibyte strings.  Fix the type of
17387         `len' according to what STRING_CHAR_AND_LENGTH expects.
17388         (bidi_paragraph_init, bidi_resolve_explicit_1)
17389         (bidi_resolve_explicit, bidi_resolve_weak)
17390         (bidi_level_of_next_char, bidi_move_to_visually_next):
17391         Support iteration over a string.
17392         (bidi_set_sor_type, bidi_resolve_explicit_1)
17393         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17394         can now be zero (for strings); special values 0 and -1 were
17395         changed to -1 and -2, respectively.
17396         (bidi_char_at_pos): New function.
17397         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17398         Call it instead of FETCH_MULTIBYTE_CHAR.
17399         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17400         initialized to valid values.
17401         (bidi_init_it): Don't initialize charpos and bytepos with invalid
17402         values.
17403         (bidi_level_of_next_char): Allow the sentinel "position" to pass
17404         the test for valid cached positions.  Fix the logic for looking up
17405         the sentinel state in the cache.  GCPRO the Lisp string we are
17406         iterating.
17407         (bidi_push_it, bidi_pop_it): New functions.
17408         (bidi_initialize): Initialize the bidi cache start stack pointer.
17409         (bidi_cache_ensure_space): New function, refactored from part of
17410         bidi_cache_iterator_state.  Don't assume the required size is just
17411         one BIDI_CACHE_CHUNK away.
17412         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17413         (bidi_count_bytes, bidi_char_at_pos): New functions.
17414         (bidi_cache_search): Don't assume bidi_cache_last_idx is
17415         always valid if bidi_cache_idx is valid.
17416         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17417         is valid if it's going to be used.
17418         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17419         (bidi_cache_fetch_state, bidi_cache_search)
17420         (bidi_cache_find_level_change, bidi_cache_ensure_space)
17421         (bidi_cache_iterator_state, bidi_cache_find)
17422         (bidi_find_other_level_edge, bidi_cache_start_stack):
17423         All variables related to cache indices are now EMACS_INT.
17425         * dispextern.h (struct bidi_string_data): New structure.
17426         (struct bidi_it): New member `string'.  Make flag members be 1-bit
17427         fields, and put them last in the struct.
17428         (compute_display_string_pos, compute_display_string_end):
17429         Update prototypes.
17430         (bidi_push_it, bidi_pop_it): Add prototypes.
17431         (struct iterator_stack_entry): New members bidi_p,
17432         paragraph_embedding, and from_disp_prop_p.
17433         (struct it): Member bidi_p is now a bit field 1 bit wide.
17434         (bidi_shelve_cache, bidi_unshelve_cache):
17435         Declare prototypes.
17437         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17438         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17439         and vector-like objects.
17441         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17442         cache around display iteration.
17444         * window.c (Fwindow_end, window_scroll_pixel_based)
17445         (displayed_window_lines, Frecenter): Save and restore the bidi
17446         cache around display iteration.
17448 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17450         * editfns.c (Fdelete_region): Clarify the use of the named
17451         parameters (bug#6788).
17453 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
17455         * indent.c (Fvertical_motion): Set and restore w->pointm when
17456         saving and restoring the window's buffer (Bug#9006).
17458 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17460         * editfns.c (Fstring_to_char): Clarify just what is returned
17461         (bug#6576).  Text by Eli Zaretskii.
17463 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
17465         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17467 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
17469         * buffer.c (mmap_find): Fix a typo.
17471 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
17473         Fix execution of x selection hooks.
17474         * xselect.c (Qx_lost_selection_functions)
17475         (Qx_sent_selection_functions): New vars.
17476         (syms_of_xselect): DEFSYM them.
17477         (x_handle_selection_request): Pass Qx_sent_selection_functions
17478         rather than Vx_sent_selection_functions to Frun_hook_with_args.
17479         (x_handle_selection_clear,x_clear_frame_selections):
17480         Pass Qx_lost_selection_functions rather than
17481         Vx_lost_selection_functions to Frun_hook_with_args.
17483 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
17485         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
17486         The old code sometimes used this field without initializing it.
17488         * alloc.c (gc_sweep): Don't read past end of array.
17489         In theory, the old code could also have corrupted Emacs internals,
17490         though it'd be very unlikely.
17492 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
17494         * character.c (Fcharacterp): Don't advertise optional ignored
17495         argument.  (Bug#4026)
17497 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17499         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17500         key" (bug#4257).
17502         * window.c (Fset_window_start): Doc fix (bug#4199).
17503         (Fset_window_hscroll): Ditto.
17505 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
17507         Fix minor new problems caught by GCC 4.6.1.
17508         * term.c (init_tty): Remove unused local.
17509         * xsettings.c (store_monospaced_changed): Define this function only
17510         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
17511         not used otherwise.
17513 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
17515         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17517 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17519         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17520         are the mini-buffer and the echo area (bug#3320).
17522         * term.c (init_tty): Remove support for supdup, c10 and perq
17523         terminals, which are no longer supported (bug#1482).
17525 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
17527         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17529 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
17531         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17532         for non-popups (Bug#3642).
17534 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
17536         * alloc.c (reset_malloc_hooks): Protoize.
17537         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
17538         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17539         * cm.c (losecursor): Likewise.
17540         * data.c (fmod): Likewise.
17541         * dispnew.c (swap_glyphs_in_rows): Likewise.
17542         * emacs.c (memory_warning_signal): Likewise.
17543         * floatfns.c (float_error): Likewise.
17544         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17545         (otf_open, font_otf_capability, generate_otf_features)
17546         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17547         Likewise.
17548         * image.c (pbm_read_file): Likewise.
17549         * indent.c (string_display_width): Likewise.
17550         * intervals.c (check_for_interval, search_for_interval)
17551         (inc_interval_count, count_intervals, root_interval)
17552         (adjust_intervals_for_insertion, make_new_interval): Likewise.
17553         * lread.c (defalias): Likewise.
17554         * ralloc.c (r_alloc_check): Likewise.
17555         * regex.c (set_image_of_range_1, set_image_of_range)
17556         (regex_grow_registers): Likewise.
17557         * sysdep.c (strerror): Likewise.
17558         * termcap.c (valid_filename_p, tprint, main): Likewise.
17559         * tparam.c (main): Likewise.
17560         * unexhp9k800.c (run_time_remap, save_data_space)
17561         (update_file_ptrs, read_header, write_header, calculate_checksum)
17562         (copy_file, copy_rest, display_header): Likewise.
17563         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17564         Likewise.
17565         * xdisp.c (check_it): Likewise.
17566         * xfaces.c (register_color, unregister_color, unregister_colors):
17567         Likewise.
17568         * xfns.c (print_fontset_result): Likewise.
17569         * xrdb.c (member, fatal, main): Likewise.
17571 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
17573         Fix minor problems found by static checking (Bug#9031).
17574         * chartab.c (char_table_set_range, map_sub_char_table):
17575         Remove unused locals.
17576         (uniprop_table): Now static.
17577         * composite.c (_work_char): Remove unused static var.
17579 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
17581         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17583 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
17585         * gtkutil.c (qttip_cb): Remove code without function.
17587 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
17589         * w32.c (pthread_sigmask): New stub.
17591 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
17593         Use pthread_sigmask, not sigprocmask (Bug#9010).
17594         sigprocmask is portable only for single-threaded applications, and
17595         Emacs can be multi-threaded when it uses GTK.
17596         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17597         (LIBES): Use it.
17598         * callproc.c (Fcall_process):
17599         * process.c (create_process):
17600         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17601         Use pthread_sigmask, not sigprocmask.
17603 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
17605         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17606         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17607         wrong (Bug#8591).
17609 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
17611         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17612         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17613         (xg_hide_tooltip): Fix comment.
17615         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17616         in registerServicesMenuSendTypes.
17617         (validRequestorForSendType): Don't check ns_return_types.
17619         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17620         ns_return_type.
17622 2011-07-08  Jason Rumney  <jasonr@gnu.org>
17624         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17625         SH_SHOW for hidden windows (Bug#5482).
17627         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17628         frame struct members of non-existent frames (Bug#6284).
17630 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
17632         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17633         variable firstTime not needed on OSX >= 10.6.
17634         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17635         >= 10.5.  Use setKnobProportion, setDoubleValue.
17637         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17638         (MAC_OS_X_VERSION_10_5): Define if not defined.
17639         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17640         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17641         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17643         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
17644         cString and lossyCString on OSX >= 10.4.
17646         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
17647         sizeToFit on OSX >= 10.2.
17649         * nsimage.m (allocInitFromFile): Don't use deprecated method
17650         bestRepresentationForDevice on OSX >= 10.6.
17652         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17653         to avoid warning.
17655         * emacs.c: Declare unexec_init_emacs_zone.
17657         * nsgui.h: Fix compiler warning about gnulib redefining verify.
17659         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17661         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17662         on svcsMenu (Bug#8842).
17664         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17665         ns_return_types.
17666         (Fns_list_services): Just return Qnil on 10.6, code not working there.
17668         * nsterm.m (QUTF8_STRING): Declare.
17669         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17670         (validRequestorForSendType): Return type is (id).
17671         Change indexOfObjectIdenticalTo to indexOfObject.
17672         Check if we have local selection before returning self (Bug#8842).
17673         (writeSelectionToPasteboard): Put local selection into paste board
17674         if we have a local selection (Bug#8842).
17675         (syms_of_nsterm): DEFSYM QUTF8_STRING.
17677         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17678         (ns_get_local_selection): Declare.
17680 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17682         * keymap.c (describe_map_tree): Don't insert a double newline at
17683         the end of the buffer (bug#1169) and return whether we inserted
17684         something.
17686         * callint.c (Fcall_interactively): Change "reading args" to
17687         "providing args" to try to clarify what it does (bug#1010).
17689 2011-07-07  Kenichi Handa  <handa@m17n.org>
17691         * composite.c (composition_compute_stop_pos): Ignore a static
17692         composition starting before CHARPOS (Bug#8915).
17694         * xdisp.c (handle_composition_prop): Likewise.
17696 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
17698         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17699         (Bug#9015)
17701 2011-07-07  Kenichi Handa  <handa@m17n.org>
17703         * character.h (unicode_category_t): New enum type.
17705         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17706         (Qchar_code_property_table): New variable.
17707         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17708         (UNIPROP_COMPRESSED_FORM_P): New macros.
17709         (char_table_ascii): Uncompress the compressed values.
17710         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
17711         Uncompress the compressed values.
17712         (sub_char_table_ref_and_range): Likewise.
17713         (char_table_ref_and_range): Uncompress the compressed values.
17714         (sub_char_table_set): New arg is_uniprop.  Callers changed.
17715         Uncompress the compressed values.
17716         (sub_char_table_set_range): Args changed.  Callers changed.
17717         (char_table_set_range): Adjuted for the above change.
17718         (map_sub_char_table): Delete args default_val and parent.  Add arg
17719         top.  Give decoded values to a Lisp function.
17720         (map_char_table): Adjust for the above change.  Give decoded
17721         values to a Lisp function.  Gcpro more variables.
17722         (uniprop_table_uncompress)
17723         (uniprop_decode_value_run_length): New functions.
17724         (uniprop_decoder, uniprop_decoder_count): New variables.
17725         (uniprop_get_decoder, uniprop_encode_value_character)
17726         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17727         New functions.
17728         (uniprop_encoder, uniprop_encoder_count): New variables.
17729         (uniprop_get_encoder, uniprop_table)
17730         (Funicode_property_table_internal, Fget_unicode_property_internal)
17731         (Fput_unicode_property_internal): New functions.
17732         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17733         Sunicode_property_table_internal, Sget_unicode_property_internal,
17734         and Sput_unicode_property_internal.  Defvar_lisp
17735         char-code-property-alist.
17737         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
17738         Vunicode_category_table.
17740         * font.c (font_range): Adjust for the change of
17741         Vunicode_category_table.
17743 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
17745         * m/iris4d.h: Remove file, move contents ...
17746         * s/irix6-5.h: ... here.
17748 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
17750         Remove unportable assumption about struct layout (Bug#8884).
17751         * alloc.c (mark_buffer):
17752         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17753         (clone_per_buffer_values): Don't assume that
17754         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17755         This isn't true in general, and it's particularly not true
17756         if Emacs is configured with --with-wide-int.
17757         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17758         New macros, used in the buffer.c change.
17760 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
17762         * xsettings.c: Use both GConf and GSettings if both are available.
17763         (store_config_changed_event): Add comment.
17764         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17765         (store_tool_bar_style_changed): New functions.
17766         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
17767         (struct xsettings): Move font inside HAVE_XFT.
17768         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
17769         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
17770         Move inside HAVE_XFT.
17771         (something_changed_gsettingsCB): Rename from something_changedCB.
17772         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17773         also.
17774         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
17775         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
17776         (something_changed_gconfCB): Rename from something_changedCB.
17777         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17778         (parse_settings): Move check for font inside HAVE_XFT.
17779         (read_settings, apply_xft_settings): Add comment.
17780         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
17781         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
17782         call store_font_name_changed.
17783         (xft_settings_event): Add comment.
17784         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
17785         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
17786         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
17787         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
17788         (xsettings_initialize): Call init_gsettings last.
17789         (xsettings_get_system_font, xsettings_get_system_normal_font):
17790         Add comment.
17792 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
17794         Random fixes.  E.g., (random) never returned negative values.
17795         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17796         subseconds part to the entropy, as that's a bit more random.
17797         Prefer signed to unsigned, since the signedness doesn't matter and
17798         in general we prefer signed.  When given a limit, use a
17799         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17800         latter isn't right if USE_2_TAGS_FOR_INTS.
17801         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17802         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
17804 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
17806         * textprop.c (text_property_stickiness):
17807         Obey Vtext_property_default_nonsticky.
17808         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17809         * w32fns.c (syms_of_w32fns):
17810         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17812 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
17814         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17815         This is more efficient than Ffile_directory_p and avoids a minor race.
17817 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17819         * buffer.c (Foverlay_put): Say what the return value is
17820         (bug#7835).
17822         * fileio.c (barf_or_query_if_file_exists): Check first if the file
17823         is a directory before asking whether to use the file name
17824         (bug#7564).
17825         (barf_or_query_if_file_exists): Make the "File is a directory"
17826         error be more correct.
17828         * fns.c (Frequire): Remove the mention of the .gz files, since
17829         that's installation-specific, but keep the mention of
17830         `get-load-suffixes'.
17832 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
17834         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17835         Report string overflow if the output is too long.
17837 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
17839         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17840         (syms_of_gnutls): Remove duplicate DEFSYM for
17841         Qgnutls_bootprop_verify_hostname_error, an error for
17842         Qgnutls_bootprop_verify_error (which is no longer used).
17844         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17845         unused since revno:102982 (2011-01-26).  All callers changed.
17846         Also (re)move comments that are misplaced or no longer relevant.
17848 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17850         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17852 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
17854         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17855         and background color parameters if they have been changed.
17857 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17859         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
17861 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
17863         * xsettings.c (SYSTEM_FONT): Define only when used.
17864         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
17866         * keymap.c (access_keymap_1): Now static.
17868 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
17870         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
17871         leave any prefix arg for the up event (Bug#1586).
17873 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
17875         * lread.c (syms_of_lread): Mention single symbols defined by
17876         `defvar' or `defconst' (bug#7154).
17878         * fns.c (Frequire): Mention .el.gz files (bug#7314).
17879         (Frequire): Mention get-load-suffixes.
17881 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
17883         * window.h (window): Remove clone_number slot.
17884         * window.c (Fwindow_clone_number, Fset_window_clone_number):
17885         Remove.
17886         (make_parent_window, make_window, saved_window)
17887         (Fset_window_configuration, save_window_save): Don't deal with
17888         clone numbers.
17889         * buffer.c (Qclone_number): Remove declaration.
17890         (sort_overlays, overlay_strings): Don't deal with clone numbers.
17892 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
17894         Add multiple inheritance to keymaps.
17895         * keymap.c (Fmake_composed_keymap): New function.
17896         (Fset_keymap_parent): Simplify.
17897         (fix_submap_inheritance): Remove.
17898         (access_keymap_1): New function extracted from access_keymap to handle
17899         embedded parents and handle lists of maps.
17900         (access_keymap): Use it.
17901         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
17902         (Fcopy_keymap): Handle embedded parents.
17903         (Fcommand_remapping, define_as_prefix): Simplify.
17904         (Fkey_binding): Simplify.
17905         (syms_of_keymap): Move minibuffer-local-completion-map,
17906         minibuffer-local-filename-completion-map,
17907         minibuffer-local-must-match-map, and
17908         minibuffer-local-filename-must-match-map to Elisp.
17909         (syms_of_keymap): Defsubr make-composed-keymap.
17910         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
17911         (parse_menu_item): Trivial simplification.
17913 2011-07-01  Glenn Morris  <rgm@gnu.org>
17915         * Makefile.in (SETTINGS_LIBS): Fix typo.
17917 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
17919         * coding.c (Fencode_coding_string): Record the last coding system
17920         used, as the function doc string says (bug#8738).
17922 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
17924         * xsettings.c (store_monospaced_changed): Take new font as arg and
17925         check for change against current_mono_font.
17926         (EMACS_TYPE_SETTINGS): Remove this and related defines.
17927         (emacs_settings_constructor, emacs_settings_get_property)
17928         (emacs_settings_set_property, emacs_settings_class_init)
17929         (emacs_settings_init, gsettings_obj): Remove.
17930         (something_changedCB): New function for HAVE_GSETTINGS.
17931         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
17932         with value as argument.
17933         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
17934         g_settings_new (Bug#8967).  Do not create gsettings_obj.
17935         Remove calls to g_settings_bind.  Connect something_changedCB to
17936         "changed".
17938         * xgselect.c: Add defined (HAVE_GSETTINGS).
17939         (xgselect_initialize): Ditto.
17941         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
17942         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
17943         xg_select.
17945 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
17947         * eval.c (struct backtrace): Simplify and port the data structure.
17948         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
17949         signed bit field, as this assumption is not portable and it makes
17950         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
17951         "char debug_on_exit : 1" as this is not portable either; instead,
17952         use the portable "unsigned int debug_on_exit : 1".  Remove unused
17953         member evalargs.  Remove obsolete comments about cc bombing out.
17955 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
17957         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
17958         Let HAVE_GSETTINGS override HAVE_GCONF.
17959         (store_monospaced_changed): New function.
17960         (EMACS_SETTINGS): A new type derived from GObject to handle
17961         GSettings notifications.
17962         (emacs_settings_constructor, emacs_settings_get_property)
17963         (emacs_settings_set_property, emacs_settings_class_init):
17964         New functions.
17965         (gsettings_client, gsettings_obj): New variables.
17966         (GSETTINGS_SCHEMA): New define.
17967         (something_changedCB): Call store_monospaced_changed.
17968         (init_gsettings): New function.
17969         (xsettings_initialize): Call init_gsettings.
17970         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
17971         to NULL.
17973         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
17974         GCONF_CFLAGS/LIBS.
17976 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
17978         * window.c (resize_root_window, grow_mini_window)
17979         (shrink_mini_window): Rename Qresize_root_window to
17980         Qwindow_resize_root_window and Qresize_root_window_vertically to
17981         Qwindow_resize_root_window_vertically.
17983 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
17985         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
17987 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
17989         * makefile.w32-in: Redesign dependencies so they reflect more
17990         clearly which files are directly included by each source file,
17991         and not through other includes.
17993 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
17995         * buffer.c (Qclone_number): Declare static and DEFSYM it.
17996         (sort_overlays, overlay_strings): When an overlay's clone number
17997         matches the window's clone number process the overlay even if
17998         the overlay's window property doesn't match the current window.
18000         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18001         (Fwindow_hchild): Rename to Fwindow_left_child.
18002         (Fwindow_next): Rename to Fwindow_next_sibling.
18003         (Fwindow_prev): Rename to Fwindow_prev_sibling.
18004         (resize_window_check): Rename to window_resize_check.
18005         (resize_window_apply): Rename to window_resize_apply.
18006         (Fresize_window_apply): Rename to Fwindow_resize_apply.
18007         (Fdelete_other_windows_internal, resize_frame_windows)
18008         (Fsplit_window_internal, Fdelete_window_internal)
18009         (grow_mini_window, shrink_mini_window)
18010         (Fresize_mini_window_internal): Fix callers accordingly.
18012 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
18014         * emacsgtkfixed.h: State that this is only used with Gtk+3.
18015         (emacs_fixed_set_min_size): Remove.
18016         (emacs_fixed_new): Take frame as argument.
18018         * emacsgtkfixed.c: State that this is only used with Gtk+3.
18019         (_EmacsFixedPrivate): Remove minwidth/height.
18020         Add struct frame *f.
18021         (emacs_fixed_init): Initialize priv->f.
18022         (get_parent_class, emacs_fixed_set_min_size): Remove.
18023         (emacs_fixed_new): Set priv->f to argument.
18024         (emacs_fixed_get_preferred_width)
18025         (emacs_fixed_get_preferred_height): Use min_width/height from
18026         frames size_hint to set minimum and natural (Bug#8919).
18027         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18028         and use min_width/height from frames size_hint to set
18029         min_width/height (Bug#8919).
18031         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
18032         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18033         Fix indentation.
18035 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
18037         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18038         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18039         called at ZV.
18041 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
18043         * process.c (wait_reading_process_output): Bypass select if
18044         waiting for a cell while ignoring keyboard input, and input is
18045         pending.  Suggested by Jan Djärv (Bug#8869).
18047 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
18049         Use gnulib's dup2 module instead of rolling our own.
18050         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18052 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
18054         * dispnew.c (scrolling_window): Before scrolling, turn off a
18055         mouse-highlight in the window being scrolled.
18057 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
18059         Move DEFSYM to lisp.h and use everywhere.
18061         * character.h (DEFSYM): Move declaration...
18062         * lisp.h (DEFSYM): ...here.
18064         * gnutls.c:
18065         * minibuf.c:
18066         * w32menu.c:
18067         * w32proc.c:
18068         * w32select.c: Don't include character.h.
18070         * alloc.c (syms_of_alloc):
18071         * buffer.c (syms_of_buffer):
18072         * bytecode.c (syms_of_bytecode):
18073         * callint.c (syms_of_callint):
18074         * casefiddle.c (syms_of_casefiddle):
18075         * casetab.c (init_casetab_once):
18076         * category.c (init_category_once, syms_of_category):
18077         * ccl.c (syms_of_ccl):
18078         * cmds.c (syms_of_cmds):
18079         * composite.c (syms_of_composite):
18080         * dbusbind.c (syms_of_dbusbind):
18081         * dired.c (syms_of_dired):
18082         * dispnew.c (syms_of_display):
18083         * doc.c (syms_of_doc):
18084         * editfns.c (syms_of_editfns):
18085         * emacs.c (syms_of_emacs):
18086         * eval.c (syms_of_eval):
18087         * fileio.c (syms_of_fileio):
18088         * fns.c (syms_of_fns):
18089         * frame.c (syms_of_frame):
18090         * fringe.c (syms_of_fringe):
18091         * insdel.c (syms_of_insdel):
18092         * keymap.c (syms_of_keymap):
18093         * lread.c (init_obarray, syms_of_lread):
18094         * macros.c (syms_of_macros):
18095         * msdos.c (syms_of_msdos):
18096         * print.c (syms_of_print):
18097         * process.c (syms_of_process):
18098         * search.c (syms_of_search):
18099         * sound.c (syms_of_sound):
18100         * syntax.c (init_syntax_once, syms_of_syntax):
18101         * terminal.c (syms_of_terminal):
18102         * textprop.c (syms_of_textprop):
18103         * undo.c (syms_of_undo):
18104         * w32.c (globals_of_w32):
18105         * window.c (syms_of_window):
18106         * xdisp.c (syms_of_xdisp):
18107         * xfaces.c (syms_of_xfaces):
18108         * xfns.c (syms_of_xfns):
18109         * xmenu.c (syms_of_xmenu):
18110         * xsettings.c (syms_of_xsettings):
18111         * xterm.c (syms_of_xterm): Use DEFSYM.
18113 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
18115         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
18117 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
18119         Integer and buffer overflow fixes (Bug#8873).
18121         * print.c (printchar, strout): Check for string overflow.
18122         (PRINTPREPARE, printchar, strout):
18123         Don't set size unless allocation succeeds.
18125         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18126         for sizes.  Check for string overflow more accurately.
18127         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18129         * macros.c: Integer and buffer overflow fixes.
18130         * keyboard.h (struct keyboard.kbd_macro_bufsize):
18131         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18132         Use ptrdiff_t, not int, for sizes.
18133         Don't increment bufsize until after realloc succeeds.
18134         Check for size-calculation overflow.
18135         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18137         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18139         * lread.c: Integer overflow fixes.
18140         (read_integer): Radix is now EMACS_INT, not int,
18141         to improve quality of diagnostics for out-of-range radices.
18142         Calculate buffer size correctly for out-of-range radices.
18143         (read1): Check for integer overflow in radices, and in
18144         read-circle numbers.
18145         (read_escape): Avoid int overflow.
18146         (Fload, openp, read_buffer_size, read1)
18147         (substitute_object_recurse, read_vector, read_list, map_obarray):
18148         Use ptrdiff_t, not int, for sizes.
18149         (read1): Use EMACS_INT, not int, for sizes.
18150         Check for size overflow.
18152         * image.c (cache_image): Check for size arithmetic overflow.
18154         * lread.c: Integer overflow issues.
18155         (saved_doc_string_size, saved_doc_string_length)
18156         (prev_saved_doc_string_size, prev_saved_doc_string_length):
18157         Now ptrdiff_t, not int.
18158         (read1): Don't assume doc string length fits in int.  Check for
18159         out-of-range doc string lengths.
18160         (read_list): Don't assume file position fits in int.
18161         (read_escape): Check for hex character overflow.
18163 2011-06-22  Leo Liu  <sdl.web@gmail.com>
18165         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18166         Move to minibuffer.el.
18168 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
18170         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
18171         The following patches are for when GLYPH_DEBUG && !XASSERT.
18172         * dispextern.h (trace_redisplay_p, dump_glyph_string):
18173         * dispnew.c (flush_stdout):
18174         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18175         Mark as externally visible.
18176         * dispnew.c (check_window_matrix_pointers): Now static.
18177         * dispnew.c (window_to_frame_vpos):
18178         * xfns.c (unwind_create_frame):
18179         * xterm.c (x_check_font): Remove unused local.
18180         * scroll.c (CHECK_BOUNDS):
18181         * xfaces.c (cache_fache): Rename local to avoid shadowing.
18182         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18183         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18184         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18185         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18186         Now static.
18187         (debug_method_add): Use va_list and vsprintf rather than relying
18188         on undefined behavior with wrong number of arguments.
18189         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18190         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18191         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18192         since we're not interested in debugging glyphs with old libraries.
18193         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18194         GCC 4.6.0's static checking.
18196 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
18198         Integer overflow and signedness fixes (Bug#8873).
18199         A few related buffer overrun fixes, too.
18201         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18203         * dispextern.h (struct face.stipple):
18204         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18205         (x_bitmap_mask, x_allocate_bitmap_record)
18206         (x_create_bitmap_from_data, x_create_bitmap_from_file)
18207         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18208         (x_create_bitmap_from_xpm_data):
18209         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18210         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18211         (.bitmaps_last):
18212         * xfaces.c (load_pixmap):
18213         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18214         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18215         (.bitmaps_last, struct x_output.icon_bitmap):
18216         Use ptrdiff_t, not int, for bitmap indexes.
18217         (x_allocate_bitmap_record): Check for size overflow.
18218         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18220         Use ptrdiff_t, not int, for overlay counts.
18221         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18222         * editfns.c (overlays_around, get_pos_property):
18223         * textprop.c (get_char_property_and_overlay):
18224         * xdisp.c (next_overlay_change, note_mouse_highlight):
18225         * xfaces.c (face_at_buffer_position):
18226         * buffer.c (OVERLAY_COUNT_MAX): New macro.
18227         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18228         (Fnext_overlay_change, Fprevious_overlay_change)
18229         (mouse_face_overlay_overlaps, Foverlays_in):
18230         Use ptrdiff_t, not int, for sizes.
18231         (overlays_at, overlays_in): Check for size-calculation overflow.
18233         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18235         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18236         (x_session_initialize): Do not assume string length fits in int.
18238         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18239         This is unlikely, but can occur if DPI is outlandish.
18241         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
18242         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18244         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18245         * xrdb.c (magic_file_p, search_magic_path):
18246         Omit last arg SUFFIX; it was always 0.  All callers changed.
18247         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
18249         * xfont.c (xfont_match): Avoid need for strlen.
18251         * xfns.c: Don't assume strlen fits in int.
18252         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18254         * xdisp.c (message_log_check_duplicate): Return intmax_t,
18255         not unsigned long, as we prefer signed integers.  All callers changed.
18256         Detect integer overflow in repeat count.
18257         (message_dolog): Don't assume print length fits in 39 bytes.
18258         (display_mode_element): Don't assume strlen fits in int.
18260         * termcap.c: Don't assume sizes fit in int and never overflow.
18261         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18262         (gobble_line): Check for size-calculation overflow.
18264         * minibuf.c (Fread_buffer):
18265         * lread.c (intern, intern_c_string):
18266         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18267         Don't assume string length fits in int.
18269         * keyboard.c (parse_tool_bar_item):
18270         * gtkutil.c (style_changed_cb): Avoid need for strlen.
18272         * font.c: Don't assume string length fits in int.
18273         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18274         Use ptrdiff_t, not int.
18275         (font_intern_prop): Don't assume string length fits in int.
18276         Don't assume integer property fits in fixnum.
18277         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
18279         * filelock.c: Fix some buffer overrun and integer overflow issues.
18280         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
18281         Reformulate so as not to need the command string.
18282         Invoke gzip -cd rather than gunzip, as it's more portable.
18283         (lock_info_type, lock_file_1, lock_file):
18284         Don't assume pid_t and time_t fit in unsigned long.
18285         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18286         (current_lock_owner): Prefer signed type for sizes.
18287         Use memcpy, not strncpy, where memcpy is what is really wanted.
18288         Don't assume (via atoi) that time_t and pid_t fit in int.
18289         Check for time_t and/or pid_t out of range, e.g., via a network share.
18290         Don't alloca where an auto var works fine.
18292         * fileio.c: Fix some integer overflow issues.
18293         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18294         Don't assume string length fits in int.
18295         (directory_file_name): Don't assume string length fits in long.
18296         (make_temp_name): Don't assume pid fits in int, or that its print
18297         length is less than 20.
18299         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18301         * coding.c (make_subsidiaries): Don't assume string length fits in int.
18303         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18305         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18306         We prefer signed integers, even for size calculations.
18308         * emacs.c: Don't assume string length fits in 'int'.
18309         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18310         (main): Don't invoke strlen when not needed.
18312         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18313         (XD_DEBUG_MESSAGE): Don't waste a byte.
18315         * callproc.c (getenv_internal_1, getenv_internal)
18316         (Fgetenv_internal):
18317         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18319         * lread.c (invalid_syntax): Omit length argument.
18320         All uses changed.  This doesn't fix a bug, but it simplifies the
18321         code away from its former Hollerith-constant appearance, and it's
18322         one less 'int' to worry about when looking at integer-overflow issues.
18323         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
18325         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18326         This didn't break anything, but it didn't help either.
18327         It's confusing to put a bogus integer in a place where the actual
18328         value does not matter.
18329         (LIST_END_P): Remove unused macro and its bogus comment.
18330         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
18332         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18333         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18334         implementation.
18335         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18336         We prefer signed types, and the value cannot exceed the EMACS_INT
18337         range anyway (because otherwise the length would not be representable).
18338         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18339         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18340         This avoids a GCC warning when WIDE_EMACS_INT.
18342         * indent.c (sane_tab_width): New function.
18343         (current_column, scan_for_column, Findent_to, position_indentation)
18344         (compute_motion): Use it.  This is just for clarity.
18345         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
18347         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
18349         * lisp.h (lint_assume): New macro.
18350         * composite.c (composition_gstring_put_cache):
18351         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18353         * editfns.c, insdel.c:
18354         Omit unnecessary forward decls, to simplify future changes.
18356         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18358         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18360         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
18361         Use much-faster test for byte-length change.
18362         Don't assume string byte-length fits in 'int'.
18363         Check that character arg fits in 'int'.
18364         (mapcar1): Declare byte as byte, for clarity.
18366         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18368         * fns.c (concat): Catch string overflow earlier.
18369         Do not rely on integer wraparound.
18371         * dispextern.h (struct it.overlay_strings_charpos)
18372         (struct it.selective): Now EMACS_INT, not int.
18373         * xdisp.c (forward_to_next_line_start)
18374         (back_to_previous_visible_line_start)
18375         (reseat_at_next_visible_line_start, next_element_from_buffer):
18376         Don't arbitrarily truncate the value of 'selective' to int.
18378         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18380         * composite.c: Don't truncate sizes to 'int'.
18381         (composition_gstring_p, composition_reseat_it)
18382         (composition_adjust_point): Use EMACS_INT, not int.
18383         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18384         not EMACS_UINT, for indexes.
18386         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18388         * buffer.c: Include <verify.h>.
18389         (struct sortvec.priority, struct sortstr.priority):
18390         Now EMACS_INT, not int.
18391         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
18392         (struct sortstr.size, record_overlay_string)
18393         (struct sortstrlist.size, struct sortlist.used):
18394         Don't truncate size to int.
18395         (record_overlay_string): Check for size-calculation overflow.
18396         (init_buffer_once): Check at compile-time, not run-time.
18398 2011-06-22  Jim Meyering  <meyering@redhat.com>
18400         Don't leak an XBM-image-sized buffer
18401         * image.c (xbm_load): Free the image buffer after using it.
18403 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
18405         Port to Sun C.
18406         * composite.c (find_automatic_composition): Omit needless 'return 0;'
18407         that Sun C diagnosed.
18408         * fns.c (secure_hash): Fix pointer signedness issue.
18409         * intervals.c (static_offset_intervals): New function.
18410         (offset_intervals): Use it.
18412 2011-06-21  Leo Liu  <sdl.web@gmail.com>
18414         * deps.mk (fns.o):
18415         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18416         sha512.h.
18418         * fns.c (secure_hash): Rename from crypto_hash_function and change
18419         the first arg to accept symbols.
18420         (Fsecure_hash): New primitive.
18421         (syms_of_fns): New symbols.
18423 2011-06-20  Deniz Dogan  <deniz@dogan.se>
18425         * process.c (Fset_process_buffer): Clarify return value in
18426         docstring.
18428 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
18430         * dispnew.c (add_window_display_history): Use BVAR.
18432         * xdisp.c (debug_method_add): Use BVAR.
18433         (check_window_end, dump_glyph_matrix, dump_glyph)
18434         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18436         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18437         Likewise.
18439         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18440         check till after the cache is created in init_frame_faces.
18442 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
18444         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18446 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
18448         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18449         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18450         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18452         Improve buffer-overflow checking (Bug#8873).
18453         * fileio.c (Finsert_file_contents):
18454         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18455         Remove the old (too-loose) buffer overflow checks.
18456         They weren't needed, since make_gap checks for buffer overflow.
18457         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18458         The old code merely checked for Emacs fixnum overflow, and relied
18459         on undefined (wraparound) behavior.  The new code avoids undefined
18460         behavior, and also checks for ptrdiff_t and/or size_t overflow.
18462         * editfns.c (Finsert_char): Don't dump core with very negative counts.
18463         Tune.  Don't use wider integers than needed.  Don't use alloca.
18464         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
18466         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18468         * insdel.c, lisp.h (buffer_overflow): New function.
18469         (insert_from_buffer_1, replace_range, replace_range_2):
18470         * insdel.c (make_gap_larger):
18471         * editfns.c (Finsert_char):
18472         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18474         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18476 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
18478         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
18480         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18481         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18483         * fileio.c: Don't assume EMACS_INT fits in off_t.
18484         (emacs_lseek): New static function.
18485         (Finsert_file_contents, Fwrite_region): Use it.
18486         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18488         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18490         * fns.c: Don't overflow int when computing a list length.
18491         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18492         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18493         truncation on 64-bit hosts.  Check for QUIT every
18494         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18495         faster and is responsive enough.
18496         (Flength): Report an error instead of overflowing an integer.
18497         (Fsafe_length): Return a float if the value is not representable
18498         as a fixnum.  This shouldn't happen except in contrived situations.
18499         (Fnthcdr, Fsort): Don't assume list length fits in int.
18500         (Fcopy_sequence): Don't assume vector length fits in int.
18502         * alloc.c: Check that resized vectors' lengths fit in fixnums.
18503         (header_size, word_size): New constants.
18504         (allocate_vectorlike): Don't check size overflow here.
18505         (allocate_vector): Check it here instead, since this is the only
18506         caller of allocate_vectorlike that could cause overflow.
18507         Check that the new vector's length is representable as a fixnum.
18509         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18510         The previous code was bogus.  For example, next_almost_prime (32)
18511         returned 39, which is undesirable as it is a multiple of 3; and
18512         next_almost_prime (24) returned 25, which is a multiple of 5 so
18513         why was the code bothering to check for multiples of 7?
18515         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18517         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18519         Variadic C functions now count arguments with ptrdiff_t.
18520         This partly undoes my 2011-03-30 change, which replaced int with size_t.
18521         Back then I didn't know that the Emacs coding style prefers signed int.
18522         Also, in the meantime I found a few more instances where arguments
18523         were being counted with int, which may truncate counts on 64-bit
18524         machines, or EMACS_INT, which may be unnecessarily wide.
18525         * lisp.h (struct Lisp_Subr.function.aMANY)
18526         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18527         Arg counts are now ptrdiff_t, not size_t.
18528         All variadic functions and their callers changed accordingly.
18529         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
18530         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18531         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
18532         * callint.c (Fcall_interactively): Check arg count for overflow,
18533         to avoid potential buffer overrun.  Use signed char, not 'int',
18534         for 'varies' array, so that we needn't bother to check its size
18535         calculation for overflow.
18536         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18537         * eval.c (apply_lambda):
18538         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18539         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
18540         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18542         * callint.c (Fcall_interactively): Don't use index var as event count.
18544         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18545         * mem-limits.h (SIZE): Remove; no longer used.
18547         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
18549         Remove unnecessary casts.
18550         * xterm.c (x_term_init):
18551         * xfns.c (x_set_border_pixel):
18552         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18553         These aren't needed now that we assume ANSI C.
18555         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18556         It's more likely to cause problems (due to unsigned overflow)
18557         than to cure them.
18559         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18561         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18563         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18565         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18567         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18569         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18571         GLYPH_CODE_FACE returns EMACS_INT, not int.
18572         * dispextern.h (merge_faces):
18573         * xfaces.c (merge_faces):
18574         * xdisp.c (get_next_display_element, next_element_from_display_vector):
18575         Don't assume EMACS_INT fits in int.
18577         * character.h (CHAR_VALID_P): Remove unused parameter.
18578         * fontset.c, lisp.h, xdisp.c: All uses changed.
18580         * editfns.c (Ftranslate_region_internal): Omit redundant test.
18582         * fns.c (concat): Minor tuning based on overflow analysis.
18583         This doesn't fix any bugs.  Use int to hold character, instead
18584         of constantly refetching from Emacs object.  Use XFASTINT, not
18585         XINT, for value known to be a character.  Don't bother comparing
18586         a single byte to 0400, as it's always less.
18588         * floatfns.c (Fexpt):
18589         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18591         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18592         for characters.
18594         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18596         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18597         Without this fix, on a 64-bit host (aset S 0 4294967386) would
18598         incorrectly succeed when S was a string, because 4294967386 was
18599         truncated before it was used.
18601         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18602         Otherwise, an out-of-range integer could cause undefined behavior
18603         on a 64-bit host.
18605         * composite.c: Use int, not EMACS_INT, for characters.
18606         (fill_gstring_body, composition_compute_stop_pos): Use int, not
18607         EMACS_INT, for values that are known to be in character range.
18608         This doesn't fix any bugs but is the usual style inside Emacs and
18609         may generate better code on 32-bit machines.
18611         Make sure a 64-bit char is never passed to ENCODE_CHAR.
18612         This is for reasons similar to the recent CHAR_STRING fix.
18613         * charset.c (Fencode_char): Check that character arg is actually
18614         a character.  Pass an int to ENCODE_CHAR.
18615         * charset.h (ENCODE_CHAR): Verify that the character argument is no
18616         wider than 'int', as a compile-time check to prevent future regressions
18617         in this area.
18619         * character.c (char_string): Remove unnecessary casts.
18621         Make sure a 64-bit char is never passed to CHAR_STRING.
18622         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18623         by silently ignoring the top 32 bits, allowing some values
18624         that were far too large to be valid characters.
18625         * character.h: Include <verify.h>.
18626         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18627         arguments are no wider than unsigned, as a compile-time check
18628         to prevent future regressions in this area.
18629         * data.c (Faset):
18630         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
18631         (Fsubst_char_in_region):
18632         * fns.c (concat):
18633         * xdisp.c (decode_mode_spec_coding):
18634         Adjust to CHAR_STRING's new requirement.
18635         * editfns.c (Finsert_char, Fsubst_char_in_region):
18636         * fns.c (concat): Check that character args are actually
18637         characters.  Without this test, these functions did the wrong
18638         thing with wildly out-of-range values on 64-bit hosts.
18640         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18641         These casts should not be needed on 32-bit hosts, either.
18642         * keyboard.c (read_char):
18643         * lread.c (Fload): Remove casts to unsigned.
18645         * lisp.h (UNSIGNED_CMP): New macro.
18646         This fixes comparison bugs on 64-bit hosts.
18647         (ASCII_CHAR_P): Use it.
18648         * casefiddle.c (casify_object):
18649         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
18650         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18651         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18652         * dispextern.h (FACE_FROM_ID):
18653         * keyboard.c (read_char): Use UNSIGNED_CMP.
18655         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18656         not to EMACS_INT, to avoid GCC warning.
18658         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18660         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18661         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18662         isn't needed on 32-bit machines.
18664         * buffer.c (Fgenerate_new_buffer_name):
18665         Use EMACS_INT for count, not int.
18666         (advance_to_char_boundary): Return EMACS_INT, not int.
18668         * data.c (Qcompiled_function): Now static.
18670         * window.c (window_body_lines): Now static.
18672         * image.c (gif_load): Rename local to avoid shadowing.
18674         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18675         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18676         * alloc.c (make_save_value): Integer argument is now of type
18677         ptrdiff_t, not int.
18678         (mark_object): Use ptrdiff_t, not int.
18679         * lisp.h (pD): New macro.
18680         * print.c (print_object): Use it.
18682         * alloc.c: Use EMACS_INT, not int, to count objects.
18683         (total_conses, total_markers, total_symbols, total_vector_size)
18684         (total_free_conses, total_free_markers, total_free_symbols)
18685         (total_free_floats, total_floats, total_free_intervals)
18686         (total_intervals, total_strings, total_free_strings):
18687         Now EMACS_INT, not int.  All uses changed.
18688         (Fgarbage_collect): Compute overall total using a double, so that
18689         integer overflow is less likely to be a problem.  Check for overflow
18690         when converting back to an integer.
18691         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18692         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18693         These were 'int' variables that could overflow on 64-bit hosts;
18694         they were never used, so remove them instead of repairing them.
18695         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
18696         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18697         Previously, this ceilinged at INT_MAX, but that doesn't work on
18698         64-bit machines.
18699         (allocate_pseudovector): Don't use EMACS_INT when int would do.
18701         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
18702         (allocate_vectorlike): Check for ptrdiff_t overflow.
18703         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18704         when a (possibly-narrower) signed value would do just as well.
18705         We prefer using signed arithmetic, to avoid comparison confusion.
18707         * alloc.c: Catch some string size overflows that we were missing.
18708         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18709         for convenience in STRING_BYTES_MAX.
18710         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18711         The definition here is exact; the one in lisp.h was approximate.
18712         (allocate_string_data): Check for string overflow.  This catches
18713         some instances we weren't catching before.  Also, it catches
18714         size_t overflow on (unusual) hosts where SIZE_MAX <= min
18715         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18716         and ptrdiff_t and EMACS_INT are both 64 bits.
18718         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18719         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
18720         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
18722         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18724         * alloc.c (Fmake_string): Check for out-of-range init.
18726 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
18728         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18730 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
18732         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18733         xg_get_default_scrollbar_width.
18735         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18736         (int_gtk_range_get_value): Move to the scroll bar part of the file.
18737         (style_changed_cb): Call update_theme_scrollbar_width and call
18738         x_set_scroll_bar_default_width and xg_frame_set_char_size for
18739         all frames (Bug#8505).
18740         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18741         Call gtk_window_set_resizable if HAVE_GTK3.
18742         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18743         and height if HAVE_GTK3 (Bug#8505).
18744         (scroll_bar_width_for_theme): New variable.
18745         (update_theme_scrollbar_width): New function.
18746         (xg_get_default_scrollbar_width): Move code to
18747         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18748         (xg_initialize): Call update_theme_scrollbar_width.
18750         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18752         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18754 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
18756         * frame.c (make_frame): Call other_buffer_safely instead of
18757         other_buffer.
18759         * window.c (temp_output_buffer_show): Call display_buffer with
18760         second argument Vtemp_buffer_show_specifiers and reset latter
18761         immediately after the call.
18762         (Vtemp_buffer_show_specifiers): New variable.
18763         (auto_window_vscroll_p, next_screen_context_lines)
18764         (Vscroll_preserve_screen_position): Remove leading asterisks from
18765         doc-strings.
18767 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
18769         Fix minor problems found by GCC 4.6.0 static checking.
18770         * buffer.c (Qclone_number): Remove for now, as it's unused.
18771         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18772         (record_buffer): Remove unused local.
18773         * frame.c (other_visible_frames, frame_buffer_list): Now static.
18774         (set_frame_buffer_list): Remove; unused.
18775         * frame.h (other_visible_frames): Remove decl.
18776         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18777         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18778         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18779         if HAVE_GPM.
18780         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18781         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18782         Define only if HAVE_GPM.
18783         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18784         (update_hints_inhibit): Remove; never set.  All uses removed.
18785         * widgetprv.h (emacsFrameClassRec): Remove decl.
18786         * window.c (delete_deletable_window): Now returns void, since it
18787         wasn't returning anything.
18788         (compare_window_configurations): Remove unused locals.
18789         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18790         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
18791         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18792         the same widths as pointers.  This follows up on the 2011-05-06 patch.
18793         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18794         * xterm.h: Likewise.
18795         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18797 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
18799         * makefile.w32-in: Update dependencies.
18800         (LISP_H): Add lib/intprops.h.
18802 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
18804         * image.c (gif_load): Add animation frame delay to the metadata.
18805         (syms_of_image): Use DEFSYM.  New symbol `delay'.
18807 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
18809         * window.c (delete_deletable_window): Re-add.
18810         (Fset_window_configuration): Rewrite to handle dead buffers and
18811         consequently deletable windows.
18812         (window_tree, Fwindow_tree): Remove.  Supply functionality in
18813         window.el.
18814         (compare_window_configurations): Simplify code.
18816 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
18818         * image.c (imagemagick_load_image): Fix type mismatch.
18819         (Fimagemagick_types): Likewise.
18821         * window.h (replace_buffer_in_windows): Declare.
18823 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
18825         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18826         Qclone_number.  Remove external declaration of Qdelete_window.
18827         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
18828         code.
18829         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18830         Run Qbuffer_list_update_hook if allowed.
18831         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
18832         buffer list implementation.
18833         (other_buffer_safely): New function.
18834         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18835         calls to replace_buffer_in_windows and
18836         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
18837         if allowed.
18838         (record_buffer): Inhibit quitting and rewrite using quittable
18839         functions.  Run Qbuffer_list_update_hook if allowed.
18840         (Frecord_buffer, Funrecord_buffer): New functions.
18841         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18842         Move switch-to-buffer to window.el.
18843         (bury-buffer): Move to window.el.
18844         (Vbuffer_list_update_hook): New variable.
18846         * lisp.h (other_buffer_safely): Add prototype in buffer.c
18847         section.
18849         * window.h (resize_frame_windows): Move up in code.
18850         (Fwindow_frame): Remove EXFUN.
18851         (replace_buffer_in_all_windows): Remove prototype.
18852         (replace_buffer_in_windows_safely): Add prototype.
18854         * window.c: Declare Qdelete_window static again.  Move down
18855         declaration of select_count.
18856         (Fnext_window, Fprevious_window): Rewrite doc-strings.
18857         (Fother_window): Move to window.el.
18858         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18859         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
18860         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
18861         window.el.
18862         (replace_buffer_in_windows): Implement by calling
18863         Qreplace_buffer_in_windows.
18864         (replace_buffer_in_all_windows): Remove with some functionality
18865         moved into replace_buffer_in_windows_safely.
18866         (replace_buffer_in_windows_safely): New function.
18867         (select_window_norecord, select_frame_norecord): Move in front
18868         of run_window_configuration_change_hook.  Remove now obsolete
18869         declarations.
18870         (Fset_window_buffer): Rewrite doc-string.
18871         Call Qrecord_window_buffer.
18872         (keys_of_window): Move binding for other-window to window.el.
18874 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
18876         * dispextern.h (struct image): Replace data member, whose int_val
18877         and ptr_val fields were not used by anything, with a single
18878         lisp_val object.
18880         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
18881         (gif_clear_image, gif_load, imagemagick_load_image)
18882         (gs_clear_image, gs_load): Callers changed.
18884 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
18886         * buffer.h: Include <time.h>, for time_t.
18887         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
18889         Fix minor problems found by static checking.
18891         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
18893         Make identifiers static if they are not used in other modules.
18894         * data.c (Qcompiled_function, Qframe, Qvector):
18895         * image.c (QimageMagick, Qsvg):
18896         * minibuf.c (Qmetadata):
18897         * window.c (resize_window_check, resize_root_window): Now static.
18898         * window.h (resize_window_check, resize_root_window): Remove decls.
18900         * window.c (window_deletion_count, delete_deletable_window):
18901         Remove; unused.
18902         (window_body_lines): Now static.
18903         (Fdelete_other_windows_internal): Mark vars as initialized.
18904         Make sure 'resize_failed' is initialized.
18905         (run_window_configuration_change_hook): Rename local to avoid shadowing.
18906         (resize_window_apply): Remove unused local.
18907         * window.h (delete_deletable_window): Remove decl.
18909         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
18910         (imagemagick_load_image): Fix pointer signedness problem by changing
18911         last arg from unsigned char * to char *.  All uses changed.
18912         Also, fix a local for similar reasons.
18913         Remove unused locals.  Remove locals to avoid shadowing.
18914         (fn_rsvg_handle_free): Remove; unused.
18915         (svg_load, svg_load_image): Fix pointer signedness problem.
18916         (imagemagick_load_image): Don't use garbage pointer image_wand.
18918         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
18920 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
18922         * image.c (gif_load): Fix omitted cast error introduced by
18923         2011-06-06 change.
18925 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
18927         * window.h (resize_proportionally, orig_total_lines)
18928         (orig_top_line): Remove from window structure.
18929         (set_window_height, set_window_width, change_window_heights)
18930         (Fdelete_window): Remove prototypes.
18931         (resize_frame_windows): Remove duplicate declaration.
18933 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
18935         * window.h (resize_frame_windows, resize_window_check)
18936         (delete_deletable_window, resize_root_window)
18937         (resize_frame_windows): Declare prototypes.
18939         * window.c (resize_window_apply): Make definition be "static" to
18940         match the prototype.
18942 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
18944         * window.c: Remove declarations of Qwindow_size_fixed,
18945         window_min_size_1, window_min_size_2, window_min_size,
18946         size_window, window_fixed_size_p, enlarge_window, delete_window.
18947         Remove static from declaration of Qdelete_window, it's
18948         temporarily needed by Fbury_buffer.
18949         (replace_window): Don't assign orig_top_line and
18950         orig_total_lines.
18951         (Fdelete_window, delete_window): Remove.  Window deletion is
18952         handled by window.el.
18953         (window_loop): Remove DELETE_OTHER_WINDOWS case.
18954         Replace Fdelete_window calls with calls to Qdelete_window.
18955         (Fdelete_other_windows): Remove.  Deleting other windows is
18956         handled by window.el.
18957         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
18958         handled in window.el.
18959         (window_min_size_2, window_min_size_1, window_min_size): Remove.
18960         Window minimum sizes are handled in window.el.
18961         (shrink_windows, size_window, set_window_height)
18962         (set_window_width, change_window_heights, window_height)
18963         (window_width, CURBEG, CURSIZE, enlarge_window)
18964         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
18965         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
18966         handled in window.el.
18967         (make_dummy_parent): Rename to make_parent_window and give it a
18968         second argument horflag.
18969         (make_window): Don't set resize_proportionally any more.
18970         (Fsplit_window): Remove.  Windows are split in window.el.
18971         (save_restore_action, save_restore_orig_size)
18972         (shrink_window_lowest_first, save_restore_orig_size): Remove.
18973         Resize mini windows in window.el.
18974         (grow_mini_window, shrink_mini_window): Implement by calling
18975         Qresize_root_window_vertically, resize_window_check and
18976         resize_window_apply.
18977         (saved_window, Fset_window_configuration, save_window_save):
18978         Do not handle orig_top_line, orig_total_lines, and
18979         resize_proportionally.
18980         (window_min_height, window_min_width): Move to window.el.
18981         (keys_of_window): Move bindings for delete-other-windows,
18982         split-window, delete-window and enlarge-window to window.el.
18984         * buffer.c: Temporarily extern Qdelete_window.
18985         (Fbury_buffer): Temporarily call Qdelete_window instead of
18986         Fdelete_window (Fbury_buffer will move to window.el soon).
18988         * frame.c (set_menu_bar_lines_1): Remove code handling
18989         orig_top_line and orig_total_lines.
18991         * dispnew.c (adjust_frame_glyphs_initially): Don't use
18992         set_window_height but set heights directly.
18993         (change_frame_size_1): Use resize_frame_windows.
18995         * xdisp.c (init_xdisp): Don't use set_window_height but set
18996         heights directly.
18998         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
18999         Use resize_frame_windows instead of change_window_heights and run
19000         run_window_configuration_change_hook.
19002         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19003         instead of change_window_heights and run
19004         run_window_configuration_change_hook.
19006 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
19008         * window.c (replace_window): Rename second argument REPLACEMENT to
19009         NEW.  New third argument SETFLAG.  Rewrite.
19010         (delete_window, make_dummy_parent): Call replace_window with
19011         third argument 1.
19012         (window_list_1): Move down in code.
19013         (run_window_configuration_change_hook): Move set_buffer part
19014         before select_frame_norecord part in order to unwind correctly.
19015         Rename count1 to count.
19016         (recombine_windows, delete_deletable_window, resize_root_window)
19017         (Fdelete_other_windows_internal)
19018         (Frun_window_configuration_change_hook, make_parent_window)
19019         (resize_window_check, resize_window_apply, Fresize_window_apply)
19020         (resize_frame_windows, Fsplit_window_internal)
19021         (Fdelete_window_internal, Fresize_mini_window_internal):
19022         New functions.
19023         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19025 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
19027         * window.h (window): Add some new members to window structure -
19028         normal_lines, normal_cols, new_total, new_normal, clone_number,
19029         splits, nest, prev_buffers, next_buffers.
19030         (WINDOW_TOTAL_SIZE): Move here from window.c.
19031         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
19033         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19034         Remove.
19035         (make_dummy_parent): Set new members of windows structure.
19036         (make_window): Move down in code.  Handle new members of window
19037         structure.
19038         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19039         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19040         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19041         (Fset_window_prev_buffers, Fwindow_next_buffers)
19042         (Fset_window_next_buffers, Fset_window_clone_number):
19043         New functions.
19044         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19045         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19046         Doc-string fixes.
19047         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19048         Argument WINDOW can be now internal window too.
19049         (Fwindow_use_time): Move up in code.
19050         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19051         Rewrite doc-string.
19052         (Fset_window_configuration, saved_window)
19053         (Fcurrent_window_configuration, save_window_save): Handle new
19054         members of window structure.
19055         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19056         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19057         (syms_of_window): New Lisp objects Qrecord_window_buffer,
19058         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19059         Qget_mru_window, Qresize_root_window,
19060         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19061         Qauto_buffer_name; staticpro them.
19063 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
19065         * window.c (Fwindow_total_size, Fwindow_left_column)
19066         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19067         (Fwindow_list_1): New functions.
19068         (window_box_text_cols): Replace with window_body_cols.
19069         (Fwindow_width, Fscroll_left, Fscroll_right):
19070         Use window_body_cols instead of window_box_text_cols.
19071         (delete_window, Fset_window_configuration):
19072         Call delete_all_subwindows with window as argument.
19073         (delete_all_subwindows): Take a window as argument and not a
19074         structure.  Rewrite.
19075         (window_loop): Remove handling of GET_LRU_WINDOW and
19076         GET_LARGEST_WINDOW.
19077         (Fget_lru_window, Fget_largest_window): Move to window.el.
19079         * window.h: Extern window_body_cols instead of
19080         window_box_text_cols.  delete_all_subwindows now takes a
19081         Lisp_Object as argument.
19083         * indent.c (compute_motion, Fcompute_motion):
19084         Use window_body_cols instead of window_box_text_cols.
19086         * frame.c (delete_frame): Call delete_all_subwindows with root
19087         window as argument.
19089 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
19091         * fns.c (Fputhash): Document return value.
19093 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
19095         * image.c (gif_load): Implement gif89a spec "no disposal" method.
19097 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
19099         Cons<->int and similar integer overflow fixes (Bug#8794).
19101         Check for overflow when converting integer to cons and back.
19102         * charset.c (Fdefine_charset_internal, Fdecode_char):
19103         Use cons_to_unsigned to catch overflow.
19104         (Fencode_char): Use INTEGER_TO_CONS.
19105         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19106         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19107         * data.c (long_to_cons, cons_to_long): Remove.
19108         (cons_to_unsigned, cons_to_signed): New functions.
19109         These signal an error for invalid or out-of-range values.
19110         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19111         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19112         * font.c (Ffont_variation_glyphs):
19113         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19114         * lisp.h: Include <intprops.h>.
19115         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19116         (cons_to_signed, cons_to_unsigned): New decls.
19117         (long_to_cons, cons_to_long): Remove decls.
19118         * undo.c (record_first_change): Use INTEGER_TO_CONS.
19119         (Fprimitive_undo): Use CONS_TO_INTEGER.
19120         * xfns.c (Fx_window_property): Likewise.
19121         * xselect.c: Include <limits.h>.
19122         (x_own_selection, selection_data_to_lisp_data):
19123         Use INTEGER_TO_CONS.
19124         (x_handle_selection_request, x_handle_selection_clear)
19125         (x_get_foreign_selection, Fx_disown_selection_internal)
19126         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19127         (lisp_data_to_selection_data): Use cons_to_unsigned.
19128         (x_fill_property_data): Use cons_to_signed.
19129         Report values out of range.
19131         Check for buffer and string overflow more precisely.
19132         * buffer.h (BUF_BYTES_MAX): New macro.
19133         * lisp.h (STRING_BYTES_MAX): New macro.
19134         * alloc.c (Fmake_string):
19135         * character.c (string_escape_byte8):
19136         * coding.c (coding_alloc_by_realloc):
19137         * doprnt.c (doprnt):
19138         * editfns.c (Fformat):
19139         * eval.c (verror):
19140         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19141         since they may not be the same number.
19142         * editfns.c (Finsert_char):
19143         * fileio.c (Finsert_file_contents):
19144         Likewise for BUF_BYTES_MAX.
19146         * image.c: Use ptrdiff_t, not int, for sizes.
19147         (slurp_file): Switch from int to ptrdiff_t.
19148         All uses changed.
19149         (slurp_file): Check that file size fits in both size_t (for
19150         malloc) and ptrdiff_t (for sanity and safety).
19152         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19153         if b->modtime has its maximal value.
19155         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19157         Don't assume time_t can fit into int.
19158         * buffer.h (struct buffer.modtime): Now time_t, not int.
19159         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19160         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19162         Minor fixes for signed vs unsigned integers.
19163         * character.h (MAYBE_UNIFY_CHAR):
19164         * charset.c (maybe_unify_char):
19165         * keyboard.c (read_char, reorder_modifiers):
19166         XINT -> XFASTINT, since the integer must be nonnegative.
19167         * ftfont.c (ftfont_spec_pattern):
19168         * keymap.c (access_keymap, silly_event_symbol_error):
19169         XUINT -> XFASTINT, since the integer must be nonnegative.
19170         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19171         since it makes no difference and we prefer signed.
19172         * keyboard.c (record_char): Use XUINT when all the neighbors do.
19173         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19174         nonnegative.
19176 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
19178         * window.h (Fwindow_frame): Declare.
19180 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
19182         * alloc.c: Simplify handling of large-request failures (Bug#8800).
19183         (SPARE_MEMORY): Always define.
19184         (LARGE_REQUEST): Remove.
19185         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19187 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
19189         * lisp.h: Move EXFUNS for Fframe_root_window,
19190         Fframe_first_window and Fset_frame_selected_window to window.h.
19192         * window.h: Move EXFUNS for Fframe_root_window,
19193         Fframe_first_window and Fset_frame_selected_window here from
19194         lisp.h.
19196         * frame.c (Fwindow_frame, Fframe_first_window)
19197         (Fframe_root_window, Fframe_selected_window)
19198         (Fset_frame_selected_window): Move to window.c.
19199         (Factive_minibuffer_window): Move to minibuf.c.
19200         (Fother_visible_frames_p): New function.
19202         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19204         * window.c (decode_window, decode_any_window): Move up in code.
19205         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19206         (inhibit_frame_unsplittable): Remove unused variable.
19207         (Fwindow_buffer): Move up and rewrite doc-string.
19208         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19209         (Fwindow_prev): New functions.
19210         (Fwindow_frame): Move here from frame.c.  Accept any window as
19211         argument.
19212         (Fframe_root_window, Fframe_first_window)
19213         (Fframe_selected_window): Move here from frame.c.  Accept frame
19214         or arbitrary window as argument.  Update doc-strings.
19215         (Fminibuffer_window): Move up in code.
19216         (Fwindow_minibuffer_p): Move up in code and simplify.
19217         (Fset_frame_selected_window): Move here from frame.c.
19218         Marginal rewrite.
19219         (Fselected_window, select_window, Fselect_window): Move up in
19220         code.  Minor doc-string fixes.
19222 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
19224         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19225         Do not assume that spare memory exists; that assumption is valid
19226         only if SYSTEM_MALLOC.
19227         (LARGE_REQUEST): New macro, so that the issue of large requests
19228         is separated from the issue of spare memory.
19230 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
19232         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19233         format.  (Bug#8806)
19235         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19237         * xfns.c (x_set_scroll_bar_default_width): Move declarations
19238         before statements.
19240 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
19242         * gtkutil.c (xg_get_default_scrollbar_width): New function.
19244         * gtkutil.h: Declare xg_get_default_scrollbar_width.
19246         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19247         min width by calling x_set_scroll_bar_default_width (Bug#8505).
19249 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
19251         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19253 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
19255         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19256         (x_clipboard_manager_save): Add return value.
19257         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19258         New error handlers.
19259         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19260         Obey Vx_select_enable_clipboard_manager.  Catch errors in
19261         x_clipboard_manager_save (Bug#8779).
19262         (Vx_select_enable_clipboard_manager): New variable.
19263         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
19265 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
19267         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19269 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
19271         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19272         in the current matrix if keep_current_p is non-zero.
19274 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
19276         * bidi.c (bidi_level_of_next_char): Fix last change.
19278 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
19280         Support bidi reordering of text covered by display properties.
19282         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19283         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19284         (bidi_cache_search, bidi_cache_iterator_state)
19285         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
19286         (bidi_level_of_next_char, bidi_move_to_visually_next):
19287         Support character positions inside a run of characters covered by a
19288         display string.
19289         (bidi_paragraph_init, bidi_resolve_explicit_1)
19290         (bidi_level_of_next_char): Call bidi_fetch_char and
19291         bidi_fetch_char_advance instead of FETCH_CHAR and
19292         FETCH_CHAR_ADVANCE.
19293         (bidi_init_it): Initialize new members.
19294         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19295         definitions.
19296         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19297         instead of using explicit *_CHAR codes.
19298         (bidi_resolve_explicit, bidi_resolve_weak):
19299         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
19300         bidirectional text is supported only in multibyte buffers.
19301         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19302         it to initialize the frame_window_p member of struct bidi_it.
19303         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19304         (bidi_resolve_explicit, bidi_resolve_weak)
19305         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19306         bidi_it->nchars is non-positive.
19307         (bidi_level_of_next_char): Don't try to lookup the cache for the
19308         next/previous character if nothing is cached there yet, or if we
19309         were just reseat()'ed to a new position.
19311         * xdisp.c (set_cursor_from_row): Set start and stop points
19312         according to the row's direction when priming the loop that looks
19313         for the glyph on which to display cursor.
19314         (single_display_spec_intangible_p): Function deleted.
19315         (display_prop_intangible_p): Reimplement to call
19316         handle_display_spec instead of single_display_spec_intangible_p.
19317         Accept 3 additional arguments needed by handle_display_spec.
19318         This fixes incorrect cursor motion across display property with complex
19319         values: lists, `(when COND...)' forms, etc.
19320         (single_display_spec_string_p): Support property values that are
19321         lists with the argument STRING its top-level element.
19322         (display_prop_string_p): Fix the condition for processing a
19323         property that is a list to be consistent with handle_display_spec.
19324         (handle_display_spec): New function, refactored from the
19325         last portion of handle_display_prop.
19326         (compute_display_string_pos): Accept additional argument
19327         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
19328         value of a `display' property is a "replacing spec".
19329         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19330         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
19331         the display property, but just return a value indicating whether
19332         the display property will replace the characters it covers.
19333         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19334         frame_window_p members of struct bidi_it.
19335         (compute_display_string_pos, compute_display_string_end):
19336         New functions.
19337         (push_it): Accept second argument POSITION, where pop_it should
19338         jump to continue iteration.
19339         (reseat_1): Initialize bidi_it.disp_pos.
19341         * keyboard.c (adjust_point_for_property): Adjust the call to
19342         display_prop_intangible_p to its new signature.
19344         * dispextern.h (struct bidi_it): New member frame_window_p.
19345         (bidi_init_it): Update prototypes.
19346         (display_prop_intangible_p): Update prototype.
19347         (compute_display_string_pos, compute_display_string_end):
19348         Declare prototypes.
19349         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
19350         EMACS_INT.
19352 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
19354         Malloc failure behavior now depends on size of allocation.
19355         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19356         * lisp.h: Change signatures accordingly.
19357         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19358         All callers changed.  (Bug#8762)
19360         * gnutls.c: Use Emacs's memory allocators.
19361         Without this change, the gnutls library would invoke malloc etc.
19362         directly, which causes problems on non-SYNC_INPUT hosts, and which
19363         runs afoul of improving memory_full behavior.  (Bug#8761)
19364         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19365         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19366         xfree instead of the default malloc, realloc, free.
19367         (Fgnutls_boot): No need to check for memory allocation failure,
19368         since xmalloc does that for us.
19370         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
19371         * category.c (hash_get_category_set):
19372         * ccl.c (ccl_driver):
19373         * charset.c (Fdefine_charset_internal):
19374         * charset.h (struct charset.hash_index):
19375         * composite.c (get_composition_id, gstring_lookup_cache)
19376         (composition_gstring_put_cache):
19377         * composite.h (struct composition.hash_index):
19378         * dispextern.h (struct image.hash):
19379         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19380         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19381         (hashfn_equal, hashfn_user_defined, make_hash_table)
19382         (maybe_resize_hash_table, hash_lookup, hash_put)
19383         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19384         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19385         (Fsxhash, Fgethash, Fputhash, Fmaphash):
19386         * image.c (make_image, search_image_cache, lookup_image)
19387         (xpm_put_color_table_h):
19388         * lisp.h (struct Lisp_Hash_Table):
19389         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
19390         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
19391         for hashes and hash indexes, instead of 'unsigned' and 'int'.
19392         * alloc.c (allocate_vectorlike):
19393         Check for overflow in vector size calculations.
19394         * ccl.c (ccl_driver):
19395         Check for overflow when converting EMACS_INT to int.
19396         * fns.c, image.c: Remove unnecessary static decls that would otherwise
19397         need to be updated by these changes.
19398         * fns.c (make_hash_table, maybe_resize_hash_table):
19399         Check for integer overflow with large hash tables.
19400         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19401         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19402         (SXHASH_REDUCE): New macro.
19403         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19404         Use it instead of discarding useful hash info with large hash values.
19405         (sxhash_float): New function.
19406         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
19407         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
19408         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19409         Rewrite to use FIXNUM_BITS, as this simplifies things.
19410         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19411         Adjust signatures to match updated version of code.
19412         (consing_since_gc): Now EMACS_INT, since a single hash table can
19413         use more than INT_MAX bytes.
19415 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
19417         Make it possible to build with GCC-4.6+ -O2 -flto.
19419         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19421 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
19423         * minibuf.c (get_minibuffer, read_minibuf_unwind):
19424         Call minibuffer-inactive-mode.
19426 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
19428         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19429         Update dependencies.
19431 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
19433         * data.c (init_data): Remove code for UTS, this system is not
19434         supported anymore.
19436 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
19438         Don't force ./temacs to start in terminal mode.
19440         * frame.c (make_initial_frame): Initialize faces in all cases, not
19441         only when CANNOT_DUMP is defined.
19442         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19444 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
19446         * dispnew.c (add_window_display_history): Use const for the string
19447         pointer.  Remove declaration, not needed.
19449 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
19451         Use 'inline', not 'INLINE'.
19452         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
19453         * alloc.c, fontset.c (INLINE): Remove.
19454         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19455         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19456         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19457         * gmalloc.c (register_heapinfo): Use inline unconditionally.
19458         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19460 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
19462         Make it possible to run ./temacs.
19464         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19465         syms_of_callproc does the same thing.  Remove test for
19466         "initialized", do it in the caller.
19467         * emacs.c (main): Avoid calling set_initial_environment when dumping.
19469 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
19471         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19472         (read_minibuf): Use get_minibuffer.
19473         (syms_of_minibuf): Use DEFSYM.
19474         (Qmetadata): New var.
19475         * data.c (Qbuffer): Don't make it static.
19476         (syms_of_data): Use DEFSYM.
19478 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
19480         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
19481         (CCL_CODE_MIN): New macro.
19483 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
19485         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19487         * eval.c (Qdebug): Now static.
19488         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
19489         2011-04-26 change (bzr 104015) that inadvertently undid part of
19490         the 2011-04-14 change (bzr 103913).
19492 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
19494         * image.c: Various fixes to ImageMagick code comments.
19495         (Fimagemagick_types): Doc fix.
19497 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
19499         Minor fixes prompted by GCC 4.6.0 warnings.
19501         * xselect.c (converted_selections, conversion_fail_tag): Now static.
19503         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19504         (x_clipboard_manager_save_all): Move extern decl to ...
19505         * xterm.h: ... here, so that it can be checked for consistency.
19507 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
19509         * xselect.c (x_clipboard_manager_save_frame)
19510         (x_clipboard_manager_save_all): New functions.
19511         (Fx_clipboard_manager_save): Lisp function deleted.
19513         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19514         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19516         * xterm.h: Update prototype.
19518 2011-05-28  William Xu  <william.xwl@gmail.com>
19520         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19521         exiting (Bug#8239).
19523 2011-05-28  Jim Meyering  <meyering@redhat.com>
19525         Avoid a sign-extension bug in crypto_hash_function.
19526         * fns.c (to_uchar): Define.
19527         (crypto_hash_function): Use it to convert some newly-signed
19528         variables to unsigned, to avoid sign-extension bugs.  For example,
19529         without this change, (md5 "truc") would evaluate to
19530         45723a2aff78ff4fff7fff1114760e62 rather than the expected
19531         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
19532         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
19534 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
19536         Integer overflow fixes.
19538         * dbusbind.c: Serial number integer overflow fixes.
19539         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
19540         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19541         to hold a serial number that is too large for a fixnum.
19542         (Fdbus_method_return_internal, Fdbus_method_error_internal):
19543         Check for serial numbers out of range.  Decode any serial number
19544         that was so large that it became a float.  (Bug#8722)
19546         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19547         (Fdbus_call_method, Fdbus_call_method_asynchronously):
19548         Use XFASTINT rather than XUINT when numbers are nonnegative.
19549         (xd_append_arg, Fdbus_method_return_internal):
19550         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
19551         arguments, check that Lisp number is nonnegative, rather than
19552         silently wrapping negative numbers around.  (Bug#8722)
19553         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
19554         (Bug#8722)
19556         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19558         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19560         ccl: Add integer overflow checks.
19561         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19562         (IN_INT_RANGE): New macros.
19563         (ccl_driver): Use them to check for integer overflow when
19564         decoding a CCL program.  Many of the new checks are whether XINT (x)
19565         fits in int; it doesn't always, on 64-bit hosts.  The new version
19566         doesn't catch all possible integer overflows, but it's an
19567         improvement.  (Bug#8719)
19569         * alloc.c (make_event_array): Use XINT, not XUINT.
19570         There's no need for unsigned here.
19572         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19573         This follows up to the 2011-05-06 change that substituted uintptr_t
19574         for EMACS_INT.  This case wasn't caught back then.
19576         Rework Fformat to avoid integer overflow issues.
19577         * editfns.c: Include <float.h> unconditionally, as it's everywhere
19578         now (part of C89).  Include <verify.h>.
19579         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19580         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19581         (Fformat): Avoid the prepass trying to compute sizes; it was only
19582         approximate and thus did not catch overflow reliably.  Instead, walk
19583         through the format just once, formatting and computing sizes as we go,
19584         checking for integer overflow at every step, and allocating a larger
19585         buffer as needed.  Keep track separately whether the format is
19586         multibyte.  Keep only the most-recently calculated precision, rather
19587         than them all.  Record whether each argument has been converted to
19588         string.  Use EMACS_INT, not int, for byte and char and arg counts.
19589         Support field widths and precisions larger than INT_MAX.  Avoid
19590         sprintf's undefined behavior with conversion specifications such as %#d
19591         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
19592         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
19593         formatting out-of-range floating point numbers with int
19594         formats.  (Bug#8668)
19596         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19598         * data.c: Avoid integer truncation in expressions involving floats.
19599         * data.c: Include <intprops.h>.
19600         (arith_driver): When there's an integer overflow in an expression
19601         involving floating point, convert the integers to floating point
19602         so that the resulting value does not suffer from catastrophic
19603         integer truncation.  For example, on a 64-bit host (* 4
19604         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19605         Do not rely on undefined behavior after integer overflow.
19607         merge count_size_as_multibyte, parse_str_to_multibyte
19608         * character.c, character.h (count_size_as_multibyte):
19609         Rename from parse_str_to_multibyte; all uses changed.
19610         Check for integer overflow.
19611         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19612         since it's now a duplicate of the other.  This is more of
19613         a character than a buffer op, so better that it's in character.c.
19614         * fns.c, print.c: Adjust to above changes.
19616 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
19618         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19620 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
19622         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19623         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19624         (x_clipboard_manager_save): Now static.
19625         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19627         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19628         (crypto_hash_function): Now static.
19629         Fix pointer signedness problems.  Avoid unnecessary initializations.
19631 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
19633         * termhooks.h (Vselection_alist): Make it terminal-local.
19635         * terminal.c (create_terminal): Initialize it.
19637         * xselect.c: Support for clipboard managers.
19638         (Vselection_alist): Move to termhooks.h as terminal-local var.
19639         (LOCAL_SELECTION): New macro.
19640         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19641         (symbol_to_x_atom): Remove gratuitous arg.
19642         (x_handle_selection_request, lisp_data_to_selection_data)
19643         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
19644         (x_own_selection, x_get_local_selection, x_convert_selection):
19645         New arg, specifying work frame.  Use terminal-local Vselection_alist.
19646         (some_frame_on_display): Delete unused function.
19647         (Fx_own_selection_internal, Fx_get_selection_internal)
19648         (Fx_disown_selection_internal, Fx_selection_owner_p)
19649         (Fx_selection_exists_p): New optional frame arg.
19650         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19651         (x_handle_selection_clear): Don't treat other terminals with the
19652         same keyboard specially.  Use the terminal-local Vselection_alist.
19653         (x_clear_frame_selections): Use Frun_hook_with_args.
19655         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19657         * xterm.h: Add support for those atoms.
19659 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
19661         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19662         (converted_selections, conversion_fail_tag): New global variables.
19663         (x_selection_request_lisp_error): Free the above.
19664         (x_get_local_selection): Remove unnecessary code.
19665         (x_reply_selection_request): Args changed; handle arbitrary array
19666         of converted selections stored in converted_selections.
19667         Separate the XChangeProperty and SelectionNotify steps.
19668         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19669         (x_convert_selection): New function.
19670         (x_handle_selection_event): Simplify.
19671         (x_get_foreign_selection): Don't ignore incoming requests while
19672         waiting for an answer; this will fail when we implement
19673         SAVE_TARGETS, and seems unnecessary anyway.
19674         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19675         (Vx_sent_selection_functions): Doc fix.
19677 2011-05-26  Leo Liu  <sdl.web@gmail.com>
19679         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
19681 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
19683         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19685         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19686         for fringe update if it has periodic bitmap.
19687         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
19688         and fringe_bitmap_periodic_p.
19690         * fringe.c (get_fringe_bitmap_data): New function.
19691         (draw_fringe_bitmap_1, update_window_fringes): Use it.
19692         (update_window_fringes): Record periodicity of fringe bitmap in glyph
19693         row.  Mark glyph row for fringe update if periodicity changed.
19695         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19696         for fringe update unless it has periodic bitmap.
19698 2011-05-25  Kenichi Handa  <handa@m17n.org>
19700         * xdisp.c (get_next_display_element): Set correct it->face_id for
19701         a static composition.
19703 2011-05-24  Leo Liu  <sdl.web@gmail.com>
19705         * deps.mk (fns.o):
19706         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19708         * fns.c (crypto_hash_function, Fsha1): New function.
19709         (Fmd5): Use crypto_hash_function.
19710         (syms_of_fns): Add Ssha1.
19712 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
19714         * gnutls.c: Remove unused macros.
19715         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19716         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19717         Remove macros that are defined and never used.
19718         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19720 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
19722         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19723         (Fx_get_selection_internal): Minor cleanup.
19724         (Fx_own_selection_internal): Rename arguments for consistency with
19725         select.el.
19727 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
19729         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19731 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
19733         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19735 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
19737         * dispnew.c (scrolling_window): Don't exclude the case that the
19738         last enabled row in the desired matrix touches the bottom boundary.
19740 2011-05-21  Glenn Morris  <rgm@gnu.org>
19742         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
19743         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19744         and add some more files.
19746 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
19748         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19749         report_file_error introduced by the change from 2011-05-07.
19751 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
19753         * systime.h (Time): Define only if emacs is defined.
19754         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19755         where the include path doesn't have X11/X.h by default.  See
19756         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19758 2011-05-20  Kenichi Handa  <handa@m17n.org>
19760         * composite.c (find_automatic_composition): Fix previous change.
19762 2011-05-20  Glenn Morris  <rgm@gnu.org>
19764         * lisp.mk: New file, split from Makefile.in.
19765         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19766         (shortlisp): Remove.
19767         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19769 2011-05-19  Glenn Morris  <rgm@gnu.org>
19771         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19772         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19773         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19774         (lisp): Set the order to that of loadup.el.
19775         (shortlisp): Make it a copy of $lisp.
19776         (SOME_MACHINE_LISP): Remove.
19777         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19778         Use just $shortlisp, not $SOME_MACHINE_LISP too.
19780 2011-05-18  Kenichi Handa  <handa@m17n.org>
19782         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19783         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19784         (find_automatic_composition): Mostly rewrite for efficiency.
19786 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
19788         * makefile.w32-in: Update dependencies.
19790 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
19792         * menu.c: Include limits.h (fixes the MS-Windows build broken by
19793         revision 104625).
19795 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
19797         Fix some integer overflow issues, such as string length overflow.
19799         * insdel.c (count_size_as_multibyte): Check for string overflow.
19801         * character.c (lisp_string_width): Check for string overflow.
19802         Use EMACS_INT, not int, for string indexes and lengths; in
19803         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
19804         the resulting string length overflows an EMACS_INT; instead,
19805         report a string overflow if no precision given.  When checking for
19806         precision exhaustion, use a check that cannot possibly have
19807         integer overflow.  (Bug#8675)
19808         * character.h (lisp_string_width): Adjust to new signature.
19810         * alloc.c (string_overflow): New function.
19811         (Fmake_string): Use it.  This doesn't change behavior, but saves
19812         a few bytes and will simplify future changes.
19813         * character.c (string_escape_byte8): Likewise.
19814         * lisp.h (string_overflow): New decl.
19816         Fixups, following up to the user-interface timestamp change.
19817         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19818         for UI timestamps, instead of unsigned long.
19819         * msdos.c (mouse_get_pos): Likewise.
19820         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
19821         * w32gui.h (Time): Define by including "systime.h" rather than by
19822         declaring it ourselves.  (Bug#8664)
19824         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19825         * image.c (clear_image_cache): Likewise.
19827         * term.c (term_mouse_position): Don't assume time_t wraparound.
19829         Be more systematic about user-interface timestamps.
19830         Before, the code sometimes used 'Time', sometimes 'unsigned long',
19831         and sometimes 'EMACS_UINT', to represent these timestamps.
19832         This change causes it to use 'Time' uniformly, as that's what X uses.
19833         This makes the code easier to follow, and makes it easier to catch
19834         integer overflow bugs such as Bug#8664.
19835         * frame.c (Fmouse_position, Fmouse_pixel_position):
19836         Use Time, not unsigned long, for user-interface timestamps.
19837         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19838         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19839         * keyboard.h (last_event_timestamp): Likewise.
19840         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19841         * menu.h (xmenu_show): Likewise.
19842         * term.c (term_mouse_position): Likewise.
19843         * termhooks.h (struct input_event.timestamp): Likewise.
19844         (struct terminal.mouse_position_hook): Likewise.
19845         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19846         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19847         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
19848         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19849         what it was before.
19850         * menu.h, termhooks.h: Include "systime.h", for Time.
19852         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19853         Don't assume that the difference between two unsigned long values
19854         can fit into an integer.  At this point, we know button_down_time
19855         <= event->timestamp, so the difference must be nonnegative, so
19856         there's no need to cast the result if double-click-time is
19857         nonnegative, as it should be; check that it's nonnegative, just in
19858         case.  This bug is triggered when events are more than 2**31 ms
19859         apart (about 25 days).  (Bug#8664)
19861         * xselect.c (last_event_timestamp): Remove duplicate decl.
19862         (x_own_selection): Remove needless cast to unsigned long.
19864         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
19865         that always fit in int.  Use a sentinel instead of a counter, to
19866         avoid a temp and to allay GCC's concerns about possible int overflow.
19867         * frame.h (struct frame): Use int for menu_bar_items_used
19868         instead of EMACS_INT, since it always fits in int.
19870         * menu.c (grow_menu_items): Check for int overflow.
19872         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
19874         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
19875         Before, the code was not consistent.  These values cannot exceed
19876         2**31 - 1 so there's no need to make them unsigned.
19877         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
19878         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
19879         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
19880         as modifiers.
19881         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
19883         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
19884         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
19885         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
19886         presumably because the widths might not match.
19888         * window.c (size_window): Avoid needless test at loop start.
19890 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
19892         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
19894 2011-05-12  Drew Adams  <drew.adams@oracle.com>
19896         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
19898 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
19900         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
19901         `width' to `bar_area_x' and `bar_area_width', respectively.
19902         (x_scroll_run): Take account of fringe background extension.
19904         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
19905         Rename local vars `left' and `width' to `bar_area_x' and
19906         `bar_area_width', respectively.
19907         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
19908         background extension.
19910 2011-05-10  Jim Meyering  <meyering@redhat.com>
19912         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
19914 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
19916         * image.c (Finit_image_library): Return t for built-in image types,
19917         like pbm and xbm.  (Bug#8640)
19919 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
19921         * w32menu.c (set_frame_menubar): Fix submenu allocation.
19923 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
19925         * w32console.c (Fset_screen_color): Doc fix.
19926         (Fget_screen_color): New function.
19927         (syms_of_ntterm): Defsubr it.
19929         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
19930         unlink the temporary file if Fcall_process didn't create it in the
19931         first place.
19932         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
19933         child process will be redirected to a file specified with `:file'.
19934         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
19935         cue to call_process_cleanup not to close that handle.
19937 2011-05-07  Ben Key  <bkey76@gmail.com>
19939         * makefile.w32-in: The bootstrap-temacs rule now makes use of
19940         one of two shell specific rules, either bootstrap-temacs-CMD or
19941         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
19942         to the previous implementation of the bootstrap-temacs rule.
19943         The bootstrap-temacs-CMD rule is similar to the previous
19944         implementation of the bootstrap-temacs rule except that it
19945         makes use of the ESC_CFLAGS variable instead of the CFLAGS
19946         variable.
19948         These changes, along with some changes to nt/configure.bat,
19949         nt/gmake.defs, and nt/nmake.defs, are required to extend my
19950         earlier fix to add support for --cflags and --ldflags options
19951         that include quotes so that it works whether make uses cmd or
19952         sh as the shell.
19954 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
19956         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
19957         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
19958         is a constant.
19959         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
19960         a string.  Handle both cases.
19961         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
19962         (Fdbus_register_method): Use Qinvalid_function.
19964 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
19966         * makefile.w32-in: Update dependencies.
19967         (LISP_H): Add inttypes.h and stdin.h.
19968         (PROCESS_H): Add unistd.h.
19970 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
19972         * lread.c: Include limits.h (fixes the MS-Windows build broken by
19973         revision 104134).
19975 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
19977         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
19979         * term.c (vfatal): Remove stray call to va_end.
19980         It's not needed and the C Standard doesn't allow it here anyway.
19982         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
19983         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
19985         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
19986         bytes.
19988         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
19990         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
19992         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
19994         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
19996         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
19998         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
19999         * charset.c (Fdefine_charset_internal): Don't initialize
20000         charset.code_space[15].  The value was garbage, on hosts with
20001         32-bit int (Bug#8600).
20003         * lread.c (read_integer): Be more consistent with string-to-number.
20004         Use string_to_number to do the actual conversion; this avoids
20005         rounding errors and fixes some other screwups.  Without this fix,
20006         for example, #x1fffffffffffffff was misread as -2305843009213693952.
20007         (digit_to_number): Move earlier, for benefit of read_integer.
20008         Return -1 if the digit is out of range for the base, -2 if it is
20009         not a digit in any supported base.  (Bug#8602)
20011         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20013         * dispnew.c (scrolling_window): Return 1 if we scrolled,
20014         to match comment at start of function.  This also removes a
20015         GCC warning about overflow in a 32+64-bit port.
20017         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20019         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20020         Reported by Stefan Monnier in
20021         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
20022         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20023         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
20025         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
20026         (EMACS_UINTPTR): Likewise, with uintptr_t.
20028         * lisp.h: Prefer 64-bit EMACS_INT if available.
20029         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20030         on 32-bit hosts that have 64-bit int, so that they can access
20031         large files.
20032         However, temporarily disable this change unless the temporary
20033         symbol WIDE_EMACS_INT is defined.
20035         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20037         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20038         This removes an assumption that EMACS_INT and long are the same
20039         width as pointers.  The assumption is true for Emacs porting targets
20040         now, but we want to make other targets possible.
20041         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20042         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20043         In the rest of the code, change types of integers that hold casted
20044         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20045         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20046         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20047         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20048         No need to cast type when ORing.
20049         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20050         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20051         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20052         assume EMACS_INT is the same width as char *.
20053         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20054         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20055         Remove no-longer-needed casts.
20056         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20057         (xg_tool_bar_help_callback, xg_make_tool_item):
20058         Use EMACS_INTPTR to hold an integer
20059         that will be cast to void *; this can avoid a GCC warning
20060         if EMACS_INT is not the same width as void *.
20061         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20062         * xdisp.c (display_echo_area_1, resize_mini_window_1):
20063         (current_message_1, set_message_1):
20064         Use a local to convert to proper width without a cast.
20065         * xmenu.c (dialog_selection_callback): Likewise.
20067         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20068         Also, don't assume VALBITS / RAND_BITS is less than 5,
20069         and don't rely on undefined behavior when shifting a 1 left into
20070         the sign bit.
20071         * lisp.h (get_random): Change signature to match.
20073         * lread.c (hash_string): Use size_t, not int, for hash computation.
20074         Normally we prefer signed values; but hashing is special, because
20075         it's better to use unsigned division on hash table sizes so that
20076         the remainder is nonnegative.  Also, size_t is the natural width
20077         for hashing into memory.  The previous code used 'int', which doesn't
20078         retain enough info to hash well into very large tables.
20079         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20081         * dbusbind.c: Don't possibly lose pointer info when converting.
20082         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20083         Use XPNTR rather than XHASH, so that the high-order bits of
20084         the pointer aren't lost when converting through void *.
20086         * eval.c (Fautoload): Don't double-shift a pointer.
20088         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20090 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
20092         * gnutls.c (DEF_GNUTLS_FN):
20093         * image.c (DEF_IMGLIB_FN): Make function pointers static.
20095 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
20097         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20098         marker.  (Bug#8610)
20100 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
20102         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20103         New version that can reserve upto 2GB of heap space.
20105 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
20107         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20109 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
20111         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20112         `gnutls_certificate_set_x509_key_file'.
20114 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
20116         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20117         Update dependencies.
20119 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
20121         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20122         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20123         Remove unused parameter `fildes'.
20124         * process.c (read_process_output, send_process): Don't pass it.
20126 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
20128         Fix previous change: the library cache is defined in w32.c.
20129         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20130         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20132 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
20134         Implement dynamic loading of GnuTLS on Windows.
20136         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20137         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20138         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20139         Declare.
20141         * gnutls.c (Qgnutls_dll): Define.
20142         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20143         (gnutls_*): Declare function pointers.
20144         (init_gnutls_functions): New function to initialize function pointers.
20145         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20146         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20147         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20148         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20149         (emacs_gnutls_write, emacs_gnutls_read)
20150         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20151         (Fgnutls_available_p): New function.
20152         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
20153         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20154         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20156         * image.c: Include w32.h.
20157         (Vimage_type_cache): Delete.
20158         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20159         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20160         (w32_delayed_load): Move to w32.c.
20162         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20164         * w32.c (QCloaded_from, Vlibrary_cache): Define.
20165         (w32_delayed_load): Move from image.c.  When loading a library, record
20166         its filename in the :loaded-from property of the library id.
20167         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20168         Initialize and staticpro them.
20169         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20171         * process.c: Include lisp.h before w32.h, not after.
20172         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20173         instead of gnutls_record_check_pending.
20175         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20177 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
20179         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20180         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
20181         as passed in.
20183 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
20185         * xterm.c (x_set_frame_alpha): Do not set property on anything
20186         else than FRAME_X_OUTER_WINDOW (Bug#8608).
20188 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
20190         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
20192 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
20194         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20195         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20196         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20197         (gnutls_global_initialized, Qgnutls_bootprop_priority)
20198         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20199         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20200         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20201         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20202         (Qgnutls_bootprop_callbacks_verify): Make static.
20204 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
20206         * callproc.c: Indentation fixup.
20208         * sysdep.c (wait_for_termination_1): Make static.
20209         (wait_for_termination, interruptible_wait_for_termination):
20210         Move after wait_for_termination_1.
20212 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
20214         * sysdep.c (interruptible_wait_for_termination): New function
20215         which is like wait_for_termination, but allows keyboard
20216         interruptions.
20218         * callproc.c (Fcall_process): Add (:file "file") as an option for
20219         the STDOUT buffer.
20220         (Fcall_process_region): Ditto.
20222 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
20224         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20225         rather than `XVECTOR (FOO)->size'.
20227         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20228         inttypes.h, as a gnulib replacement is used if it not available in
20229         system headers.
20231 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
20233         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20234         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20235         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
20237         * coding.c (coding_alloc_by_realloc): Error out if destination
20238         will grow beyond MOST_POSITIVE_FIXNUM.
20239         (decode_coding_emacs_mule): Abort if there isn't enough place in
20240         charbuf for the composition carryover bytes.  Reserve an extra
20241         space for up to 2 characters produced in a loop.
20242         (decode_coding_iso_2022): Abort if there isn't enough place in
20243         charbuf for the composition carryover bytes.
20245 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
20247         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20248         aborting when %lld or %lll format is passed.
20249         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20250         %llo or %llx format is passed.  (Bug#8545)
20252         * window.c (window_scroll_line_based): Use a marker instead of
20253         simple variables to record original value of point.  (Bug#7952)
20255         * doprnt.c (doprnt): Fix the case where a multibyte sequence
20256         produced by %s or %c overflows available buffer space.  (Bug#8545)
20258 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
20260         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
20261         (SIZE_MAX): Move defn after all includes, as they might #define it.
20263 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
20265         * w32.c (init_environment): Warn about defaulting HOME to C:\.
20267 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
20269         * keyboard.c (Qdelayed_warnings_hook): Define.
20270         (command_loop_1): Run `delayed-warnings-hook'
20271         if Vdelayed_warnings_list is non-nil.
20272         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20273         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20275 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
20277         * doprnt.c (doprnt): Don't return value smaller than the buffer
20278         size if the message was truncated.  (Bug#8545).
20280 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
20282         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20283         (Fx_window_property): #if-0 the whole functions, not just the bodies.
20285 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
20287         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20289 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
20291         * makefile.w32-in: Update dependencies.
20293 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
20295         Improve `doprnt' and its usage.  (Bug#8545)
20296         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20297         `format_end'.  Remove support for %l as a conversion specifier.
20298         Don't use xrealloc.  Improve diagnostics when the %l size modifier
20299         is used.  Update the commentary.
20301         * eval.c (verror): Simplify calculation of size_t.
20303         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20304         messages.
20306 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
20308         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20309         change.
20311 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
20313         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20314         This makes this file independent of the recent pseudovector change.
20316 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
20318         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20320         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
20321         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
20322         Remove unused local.
20323         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
20325         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
20326         GCC 4.6.0 optimizes based on type-based alias analysis.
20327         For example, if b is of type struct buffer * and v of type struct
20328         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20329         != &v->size, and therefore "v->size = 1; b->size = 2; return
20330         v->size;" must therefore return 1.  This assumption is incorrect
20331         for Emacs, since it type-puns struct Lisp_Vector * with many other
20332         types.  To fix this problem, this patch adds a new type struct
20333         vectorlike_header that documents the constraints on layout of vectors
20334         and pseudovectors, and helps optimizing compilers not get fooled
20335         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
20336         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
20337         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20338         the size member.
20339         (XSETPVECTYPE): Rewrite in terms of new macro.
20340         (XSETPVECTYPESIZE): New macro, specifying both type and size.
20341         This is a bit clearer, and further avoids the possibility of
20342         undesirable aliasing.
20343         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
20344         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
20345         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20346         since Lisp_Subr is a special case (no "next" field).
20347         (ASIZE): Now uses header.size rather than size.
20348         All previous uses of XVECTOR (foo)->size replaced to use this macro,
20349         to avoid the hassle of writing XVECTOR (foo)->header.size.
20350         (struct vectorlike_header): New type.
20351         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20352         object, to help avoid aliasing.
20353         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20354         (SUBRP): Likewise, since Lisp_Subr is a special case.
20355         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20356         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20357         (struct Lisp_Hash_Table): Combine first two members into a single
20358         struct vectorlike_header member.  All uses of "size" and "next" members
20359         changed to be "header.size" and "header.next".
20360         * buffer.h (struct buffer): Likewise.
20361         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20362         * frame.h (struct frame): Likewise.
20363         * process.h (struct Lisp_Process): Likewise.
20364         * termhooks.h (struct terminal): Likewise.
20365         * window.c (struct save_window_data, struct saved_window): Likewise.
20366         * window.h (struct window): Likewise.
20367         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20368         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20369         * buffer.c (init_buffer_once): Likewise.
20370         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20371         special case.
20372         * process.c (Fformat_network_address): Use local var for size,
20373         for brevity.
20375         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20377         Make the Lisp reader and string-to-float more consistent (Bug#8525)
20378         * data.c (atof): Remove decl; no longer used or needed.
20379         (digit_to_number): Move to lread.c.
20380         (Fstring_to_number): Use new string_to_number function, to be
20381         consistent with how the Lisp reader treats infinities and NaNs.
20382         Do not assume that floating-point numbers represent EMACS_INT
20383         without losing information; this is not true on most 64-bit hosts.
20384         Avoid double-rounding errors, by insisting on integers when
20385         parsing non-base-10 numbers, as the documentation specifies.
20386         * lisp.h (string_to_number): New decl, replacing ...
20387         (isfloat_string): Remove.
20388         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
20389         (read1): Do not accept +. and -. as integers; this
20390         appears to have been a coding error.  Similarly, do not accept
20391         strings like +-1e0 as floating point numbers.  Do not report
20392         overflow for integer overflows unless the base is not 10 which
20393         means we have no simple and reliable way to continue.
20394         Break out the floating-point parsing into a new
20395         function string_to_number, so that Fstring_to_number parses
20396         floating point numbers consistently with the Lisp reader.
20397         (digit_to_number): Move here from data.c.  Make it static inline.
20398         (E_CHAR, EXP_INT): Remove, replacing with ...
20399         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20400         (string_to_number): New function, replacing isfloat_string.
20401         This function checks for valid syntax and produces the resulting
20402         Lisp float number too.  Rework it so that string-to-number
20403         no longer mishandles examples like "1.0e+".  Use strtoumax,
20404         so that overflow for non-base-10 numbers is reported only when
20405         there's no portable and simple way to convert to floating point.
20407         * textprop.c (set_text_properties_1): Rewrite for clarity,
20408         and to avoid GCC warning about integer overflow.
20410         * intervals.h (struct interval): Use EMACS_INT for members
20411         where EMACS_UINT might cause problems.  See
20412         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20413         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20414         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20415         All uses changed.
20416         (offset_intervals): Tell GCC not to worry about length overflow
20417         when negating a negative length.
20419         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20420         (overrun_check_free): Likewise.
20422         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20423         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20424         word size.
20426         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20427         (gnutls_make_error): Rename local to avoid shadowing.
20428         (gnutls_emacs_global_deinit): ifdef out; not used.
20429         (Fgnutls_boot): Use const for pointer to readonly storage.
20430         Comment out unused local.  Fix pointer signedness problems.
20432         * lread.c (openp): Don't stuff size_t into an 'int'.
20433         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20434         about possible signed overflow.
20436         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20437         (GDK_KEY_g): Don't define if already defined.
20438         (xg_prepare_tooltip): Avoid pointer signedness problem.
20439         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20441         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20442         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
20444         * xfns.c (Fx_window_property): Simplify a bit,
20445         to make a bit faster and to avoid GCC 4.6.0 warning.
20446         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20448         * fns.c (internal_equal): Don't assume size_t fits in int.
20450         * alloc.c (compact_small_strings): Tighten assertion a little.
20452         Replace pEd with more-general pI, and fix some printf arg casts.
20453         * lisp.h (pI): New macro, generalizing old pEd macro to other
20454         conversion specifiers.  For example, use "...%"pI"d..." rather
20455         than "...%"pEd"...".
20456         (pEd): Remove.  All uses replaced with similar uses of pI.
20457         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
20458         * alloc.c (check_pure_size): Don't overflow by converting size to int.
20459         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20460         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20461         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20462         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20463         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20464         64-bit hosts.
20465         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20466         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20467         * print.c (safe_debug_print, print_object): Likewise.
20468         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20469         to int.
20470         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
20471         avoiding the 0 flag, which is not portable.
20472         * process.c (Fmake_network_process): Use pI to avoid cast.
20473         * region-cache.c (pp_cache): Likewise.
20474         * xdisp.c (decode_mode_spec): Likewise.
20475         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20476         behavior on 64-bit hosts with printf arg.
20477         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
20478         (x_stop_queuing_selection_requests): Likewise.
20479         (x_get_window_property): Don't truncate byte count to an 'int'
20480         when tracing.
20482         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20483         here, since it parses constructs like leading '-' and spaces,
20484         which are not wanted; and it overflows with large numbers.
20485         Instead, simply match F[0-9]+, which is what is wanted anyway.
20487         * alloc.c: Remove unportable assumptions about struct layout.
20488         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20489         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20490         (allocate_vectorlike, make_pure_vector): Use the new macros,
20491         plus offsetof, to remove unportable assumptions about struct layout.
20492         These assumptions hold on all porting targets that I know of, but
20493         they are not guaranteed, they're easy to remove, and removing them
20494         makes further changes easier.
20496         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20497         This doesn't fix a bug but makes the code clearer.
20498         (string_overrun_cookie): Now const.  Use initializers that
20499         don't formally overflow signed char, to avoid warnings.
20500         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20501         can cause Emacs to crash when string overrun checking is enabled.
20502         (allocate_buffer): Don't assume sizeof (struct buffer) is a
20503         multiple of sizeof (EMACS_INT); it need not be, if
20504         alignof(EMACS_INT) < sizeof (EMACS_INT).
20505         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
20507 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
20509         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
20511 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
20513         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
20514         supposed to be handshaking.  (Bug#8556)
20515         Reported by Paul Eggert <eggert@cs.ucla.edu>.
20517 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
20519         * lisp.h (Qdebug): List symbol.
20520         * eval.c (Qdebug): Restore global linkage.
20521         * keyboard.c (debug-on-event): New variable.
20522         (handle_user_signal): Break into debugger when debug-on-event
20523         matches the current signal symbol.
20525 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
20527         * alloc.c (check_sblock, check_string_bytes)
20528         (check_string_free_list): Convert to standard C.
20530 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
20532         * w32.c (emacs_gnutls_push): Fix typo.
20534 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
20536         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20537         "cast to pointer from integer of different size".
20539         Improve doprnt and its use in verror.  (Bug#8545)
20540         * doprnt.c (doprnt): Document the set of format control sequences
20541         supported by the function.  Use SAFE_ALLOCA instead of always
20542         using `alloca'.
20544         * eval.c (verror): Don't limit the buffer size at size_max-1, that
20545         is one byte too soon.  Don't use xrealloc; instead xfree and
20546         xmalloc anew.
20548 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
20550         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20551         callbacks stage.
20553         * gnutls.c: Renamed global_initialized to
20554         gnutls_global_initialized.  Added internals for the
20555         :verify-hostname-error, :verify-error, and :verify-flags
20556         parameters of `gnutls-boot' and documented those parameters in the
20557         docstring.  Start callback support.
20558         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
20559         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
20560         on error.  Return error code.
20561         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20562         (emacs_gnutls_read): Likewise.
20563         (Fgnutls_boot): Return handshake error code.
20564         (emacs_gnutls_handle_error): New function.
20565         (wsaerror_to_errno): Likewise.
20567         * w32.h (emacs_gnutls_pull): Add prototype.
20568         (emacs_gnutls_push): Likewise.
20570         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20571         (emacs_gnutls_push): Likewise.
20573 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
20575         * process.c (wait_reading_process_output): Check if GnuTLS
20576         buffered some data internally if no FDs are set for TLS
20577         connections.
20579         * makefile.w32-in (OBJ2): Add gnutls.$(O).
20580         (LIBS): Link to USER_LIBS.
20581         ($(BLD)/gnutls.$(0)): New target.
20583 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
20585         * xdisp.c (handle_single_display_spec): Rename the
20586         display_replaced_before_p argument into display_replaced_p, to
20587         make it consistent with the commentary.  Fix typos in the
20588         commentary.
20590         * textprop.c (syms_of_textprop): Remove dead code.
20591         (copy_text_properties): Delete obsolete commentary about an
20592         interface that was deleted long ago.  Fix typos in the description
20593         of arguments.
20595         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20596         to changes in oldXMenu/XMenu.h from 2011-04-16.
20597         <menu_help_message, prev_menu_help_message>: Constify.
20598         (IT_menu_make_room): menu->help_text is now `const char **';
20599         adjust.
20601         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20602         to changes in oldXMenu/XMenu.h from 2011-04-16.
20603         (struct XMenu): Declare `help_text' `const char **'.
20605         * xfaces.c <Qunspecified>: Make extern again.
20607         * syntax.c: Include sys/types.h before including regex.h, as
20608         required by POSIX.
20610         * doc.c (get_doc_string): Improve the format passed to `error'.
20612         * doprnt.c (doprnt): Improve commentary.
20614         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20616         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20617         them with etags.
20619         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20620         changes in globals.h immediately force recompilation.
20621         (TAGS): Depend on $(CURDIR)/m/intel386.h and
20622         $(CURDIR)/s/ms-w32.h.
20623         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
20625         * character.c (Fchar_direction): Function deleted.
20626         (syms_of_character): Don't defsubr it.
20627         <char-direction-table>: Deleted.
20629 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
20631         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
20632         * doprnt.c: Include limits.h.
20633         (SIZE_MAX): New macro.
20634         (doprnt): Return a size_t value.  2nd arg is now size_t.
20635         Many local variables are now size_t instead of int or unsigned.
20636         Improve overflow protection.  Support `l' modifier for integer
20637         conversions.  Support %l conversion.  Don't assume an EMACS_INT
20638         argument for integer conversions and for %c.
20640         * lisp.h (doprnt): Restore prototype.
20642         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20643         $(SRC)/character.h.
20645         * Makefile.in (base_obj): Add back doprnt.o.
20647         * deps.mk (doprnt.o): Add back prerequisites.
20648         (callint.o): Depend on character.h.
20650         * eval.c (internal_lisp_condition_case): Include the handler
20651         representation in the error message.
20652         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
20653         when breaking from the loop.
20655         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20657         * callint.c (Fcall_interactively): When displaying error message
20658         about invalid control letter, pass the character's codepoint, not
20659         a pointer to its multibyte form.  Improve display of the character
20660         in octal and display also its hex code.
20662         * character.c (char_string): Use %x to display the (unsigned)
20663         codepoint of an invalid character, to avoid displaying a bogus
20664         negative value.
20666         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20667         `error', not SYMBOL_NAME itself.
20669         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20670         character arguments to `error'.
20672         * charset.c (check_iso_charset_parameter): Fix incorrect argument
20673         to `error' in error message about FINAL_CHAR argument.  Make sure
20674         FINAL_CHAR is a character, and use %c when it is passed as
20675         argument to `error'.
20677 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
20679         * s/ms-w32.h (localtime): Redirect to sys_localtime.
20681         * w32.c: Include <time.h>.
20682         (sys_localtime): New function.
20684 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
20686         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20688         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
20690 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
20692         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20693         zombies (Bug#8467).
20695 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
20697         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20698         gl_state.e_property when gl_state.object is Qt.
20700         * insdel.c (make_gap_larger): Remove limitation of buffer size
20701         to <= INT_MAX.
20703 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
20705         * xdisp.c (lookup_glyphless_char_display)
20706         (produce_glyphless_glyph): Handle cons cell entry in
20707         glyphless-char-display.
20708         (Vglyphless_char_display): Document it.
20710         * term.c (produce_glyphless_glyph): Handle cons cell entry in
20711         glyphless-char-display.
20713 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
20715         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20717         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20719         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20720         definition for no-X builds.
20722 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
20724         Static checks with GCC 4.6.0 and non-default toolkits.
20726         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20728         * process.c (keyboard_bit_set): Define only if SIGIO.
20729         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20730         (send_process): Repair possible setjmp clobbering.
20732         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20734         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20736         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20738         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20739         Define only if needed.
20741         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20742         by pacifying GCC about it.  Maybe it's time to retire it?
20743         * xfaces.c (USG, __TIMEVAL__): Likewise.
20745         * dispextern.h (struct redisplay_interface): Rename param
20746         to avoid shadowing.
20747         * termhooks.h (struct terminal): Likewise.
20748         * xterm.c (xembed_send_message): Likewise.
20750         * insdel.c (make_gap_smaller): Define only if
20751         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20753         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20754         it.
20756         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20757         so that we aren't warned about unused symbols.
20759         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20761         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
20763         * xfns.c (x_real_positions): Mark locals as initialized.
20765         * xmenu.c (xmenu_show): Don't use uninitialized vars.
20767         * xterm.c: Fix problems found by static analysis with other toolkits.
20768         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
20769         (x_dispatch_event): Declare static if USE_GTK, and
20770         define if USE_GTK || USE_X_TOOLKIT.
20771         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
20772         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
20773         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20774         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
20776         * xmenu.c (menu_help_callback): Pointer type fixes.
20777         Use const pointers when pointing at readonly data.  Avoid pointer
20778         signedness clashes.
20779         (FALSE): Remove unused macro.
20780         (update_frame_menubar): Remove unused decl.
20782         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20784         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20785         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20786         (single_menu_item): Rename local to avoid shadowing.
20788         * keyboard.c (make_lispy_event): Remove unused local var.
20790         * frame.c, frame.h (x_get_resource_string): Bring this back, but
20791         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20793         * bitmaps: Change bitmaps from unsigned char back to the X11
20794         compatible char.  Avoid the old compiler warnings about
20795         out-of-range initializers by using, for example, '\xab' rather
20796         than 0xab.
20798         * xgselect.c (xgselect_initialize): Check vs interface
20799         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20801         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20803         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20804         to read-only memory.
20806         * fns.c (vector): Remove; this old hack is no longer needed.
20808         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
20809         Remove unused var.
20810         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
20812         * xrdb.c (x_load_resources): Omit unused local.
20814         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
20815         (x_window): Rename locals to avoid shadowing.
20816         (USG): Use the kludged USG macro, to pacify gcc.
20818         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
20819         (x_term_init): Remove local to avoid shadowing.
20821         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
20823         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20824         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20826 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
20828         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20830         Fix regex.c, syntax.c and friends for buffers > 2GB.
20831         * syntax.h (struct gl_state_s): Declare character position members
20832         EMACS_INT.
20834         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20836         * textprop.c (verify_interval_modification, interval_of):
20837         Declare arguments EMACS_INT.
20839         * intervals.c (adjust_intervals_for_insertion): Declare arguments
20840         EMACS_INT.
20842         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20844         * indent.c (Fvertical_motion): Local variable it_start is now
20845         EMACS_INT.
20847         * regex.c (re_match, re_match_2, re_match_2_internal)
20848         (bcmp_translate, regcomp, regexec, print_double_string)
20849         (group_in_compile_stack, re_search, re_search_2, regex_compile)
20850         (re_compile_pattern, re_exec): Declare arguments and local
20851         variables `size_t' and `ssize_t' and return values `regoff_t', as
20852         appropriate.
20853         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20854         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20855         <compile_stack_type>: `size' and `avail' are now `size_t'.
20857         * regex.h <regoff_t>: Use ssize_t, not int.
20858         (re_search, re_search_2, re_match, re_match_2): Arguments that
20859         specify buffer/string position and length are now ssize_t and
20860         size_t.  Return type is regoff_t.
20862 2011-04-16  Ben Key  <bkey76@gmail.com>
20864         * nsfont.m: Fixed bugs in ns_get_family and
20865         ns_descriptor_to_entity that were caused by using free to
20866         deallocate memory blocks that were allocated by xmalloc (via
20867         xstrdup).  This caused Emacs to crash when compiled with
20868         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
20869         --enable-checking=xmallocoverrun).  xfree is now used to
20870         deallocate these memory blocks.
20872 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
20874         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
20876         emacs_write: Accept and return EMACS_INT for sizes.
20877         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
20878         et seq.
20879         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
20880         Accept and return EMACS_INT.
20881         (emacs_gnutls_write): Return the number of bytes written on
20882         partial writes.
20883         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
20884         (emacs_read, emacs_write): Remove check for negative size, as the
20885         Emacs source code has been audited now.
20886         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
20887         (emacs_read, emacs_write): Use it.
20888         * process.c (send_process): Adjust to the new signatures of
20889         emacs_write and emacs_gnutls_write.  Do not attempt to store
20890         a byte offset into an 'int'; it might overflow.
20891         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
20893         * sound.c: Don't assume sizes fit in 'int'.
20894         (struct sound_device.period_size, alsa_period_size):
20895         Return EMACS_INT, not int.
20896         (struct sound_device.write, vox_write, alsa_write):
20897         Accept EMACS_INT, not int.
20898         (wav_play, au_play): Use EMACS_INT to store sizes and to
20899         record read return values.
20901 2011-04-15  Ben Key  <bkey76@gmail.com>
20903         * keyboard.c (Qundefined): Don't declare static since it is used
20904         in nsfns.m.
20905         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
20906         static since they are used in nsfont.m.
20908 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
20910         * process.c (Qprocessp): Don't declare static.
20911         * lisp.h (Qprocessp): Declare again.
20913 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
20915         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
20917 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
20919         Improve C-level modularity by making more things 'static'.
20921         Don't publish debugger-only interfaces to other modules.
20922         * lisp.h (safe_debug_print, debug_output_compilation_hack):
20923         (verify_bytepos, count_markers): Move decls to the only modules
20924         that need them.
20925         * region-cache.h (pp_cache): Likewise.
20926         * window.h (check_all_windows): Likewise.
20927         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
20929         * sysdep.c (croak): Now static, if
20930         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
20931         * syssignal.h (croak): Declare only if not static.
20933         * alloc.c (refill_memory_reserve): Now static if
20934         !defined REL_ALLOC || defined SYSTEM_MALLOC.
20935         * lisp.h (refill_memory_reserve): Declare only if not static.
20937         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
20938         Define only if USE_LUCID.
20940         * xrdb.c (x_customization_string, x_rm_string): Now static.
20942         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
20943         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
20945         * xdisp.c (draw_row_with_mouse_face): Now static.
20946         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
20948         * window.h (check_all_windows): Mark externally visible.
20950         * window.c (window_deletion_count): Now static.
20952         * undo.c: Make symbols static if they're not exported.
20953         (last_undo_buffer, last_boundary_position, pending_boundary):
20954         Now static.
20956         * textprop.c (interval_insert_behind_hooks): Now static.
20957         (interval_insert_in_front_hooks): Likewise.
20959         * term.c: Make symbols static if they're not exported.
20960         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
20961         (max_frame_lines, tty_set_terminal_modes):
20962         (tty_reset_terminal_modes, tty_turn_off_highlight):
20963         (get_tty_terminal): Now static.
20964         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
20965         * termhooks.h (term_mouse_moveto): Do not declare if
20966         HAVE_WINDOW_SYSTEM.
20967         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
20968         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
20970         * sysdep.c: Make symbols static if they're not exported.
20971         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
20972         Now static.
20973         (sigprocmask_set, full_mask): Remove; unused.
20974         (wait_debugging): Mark as visible.
20975         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
20976         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
20978         * syntax.c (syntax_temp): Define only if !__GNUC__.
20980         * sound.c (current_sound_device, current_sound): Now static.
20982         * search.c (searchbufs, searchbuf_head): Now static.
20984         * scroll.c (scroll_cost): Remove; unused.
20985         * dispextern.h (scroll_cost): Remove decl.
20987         * region-cache.h (pp_cache): Mark as externally visible.
20989         * process.c: Make symbols static if they're not exported.
20990         (process_tick, update_tick, create_process, chan_process):
20991         (Vprocess_alist, proc_buffered_char, datagram_access):
20992         (fd_callback_data, send_process_frame, process_sent_to): Now static.
20993         (deactivate_process): Mark defn as static, as well as decl.
20994         * lisp.h (create_process): Remove decl.
20995         * process.h (chan_process, Vprocess_alist): Remove decls.
20997         * print.c: Make symbols static if they're not exported.
20998         (print_depth, new_backquote_output, being_printed, print_buffer):
20999         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21000         (print_interval, print_number_index, initial_stderr_stream):
21001         Now static.
21002         * lisp.h (Fprinc): Remove decl.
21003         (debug_output_compilation_hack): Mark as externally visible.
21005         * sysdep.c (croak): Move decl from here to syssignal.h.
21006         * syssignal.h (croak): Put it here, so the API can be checked when
21007         'croak' is called from dissociate_if_controlling_tty.
21009         * minibuf.c: Make symbols static if they're not exported.
21010         (minibuf_save_list, choose_minibuf_frame): Now static.
21011         * lisp.h (choose_minibuf_frame): Remove decl.
21013         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21015         * lread.c: Make symbols static if they're not exported.
21016         (read_objects, initial_obarray, oblookup_last_bucket_number):
21017         Now static.
21018         (make_symbol): Remove; unused.
21019         * lisp.h (initial_obarray, make_symbol): Remove decls.
21021         * keyboard.c: Make symbols static if they're not exported.
21022         (single_kboard, recent_keys_index, total_keys, recent_keys):
21023         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21024         (this_single_command_key_start, echoing, last_auto_save):
21025         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21026         (command_loop, echo_now, keyboard_init_hook, help_char_p):
21027         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21028         (Vlispy_mouse_stem, double_click_count):
21029         Now static.
21030         (force_auto_save_soon): Define only if SIGDANGER.
21031         (ignore_mouse_drag_p): Now static if
21032         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21033         (print_help): Remove; unused.
21034         (stop_character, last_timer_event): Mark as externally visible.
21035         * keyboard.h (ignore_mouse_drag_p): Declare only if
21036         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21037         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21038         * lisp.h (echoing): Remove decl.
21039         (force_auto_save_soon): Declare only if SIGDANGER.
21040         * xdisp.c (redisplay_window): Simplify code, to make it more
21041         obvious that ignore_mouse_drag_p is not accessed if !defined
21042         USE_GTK && !defined HAVE_NS.
21044         * intervals.c: Make symbols static if they're not exported.
21045         (merge_properties_sticky, merge_interval_right, delete_interval):
21046         Now static.
21047         * intervals.h (merge_interval_right, delete_interval): Remove decls.
21049         * insdel.c: Make symbols static if they're not exported.
21050         However, leave prepare_to_modify_buffer alone.  It's never
21051         called from outside this function, but that appears to be a bug.
21052         (combine_after_change_list, combine_after_change_buffer):
21053         (adjust_after_replace, signal_before_change): Now static.
21054         (adjust_after_replace_noundo): Remove; unused.
21055         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
21056         (signal_before_change): Remove decls.
21058         * indent.c (val_compute_motion, val_vmotion): Now static.
21060         * image.c: Make symbols static if they're not exported.
21061         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21062         if USE_GTK.
21063         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21064         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21066         * fringe.c (standard_bitmaps): Now static.
21067         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21069         * frame.c: Make symbols static if they're not exported.
21070         (x_report_frame_params, make_terminal_frame): Now static.
21071         (get_frame_param): Now static, unless HAVE_NS.
21072         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21073         (x_get_resource_string): Remove; not used.
21074         * frame.h (make_terminal_frame, x_report_frame_params):
21075         (x_get_resource_string); Remove decls.
21076         (x_fullscreen_adjust): Declare only if WINDOWSNT.
21077         * lisp.h (get_frame_param): Declare only if HAVE_NS.
21079         * font.c, fontset.c: Make symbols static if they're not exported.
21080         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21081         (FACE_SUITABLE_FOR_CHAR_P): Use it.
21082         * font.c (font_close_object): Now static.
21083         * font.h (font_close_object): Remove.
21084         * fontset.c (FONTSET_OBJLIST): Remove.
21085         (free_realized_fontset) #if-0 the body, which does nothing.
21086         (face_suitable_for_char_p): #if-0, as it's never called.
21087         * fontset.h (face_suitable_for_char_p): Remove decl.
21088         * xfaces.c (face_at_string_position):
21089         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
21090         since 0 is always ASCII.
21092         * fns.c (weak_hash_tables): Now static.
21094         * fileio.c: Make symbols static if they're not exported.
21095         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21096         (Vwrite_region_annotation_buffers): Now static.
21098         * eval.c: Make symbols static if they're not exported.
21099         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21100         * lisp.h (backtrace_list): Remove decl.
21102         * emacs.c: Make symbols static if they're not exported.
21103         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21104         (fatal_error_code, fatal_error_signal_hook, standard_args):
21105         Now static.
21106         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21107         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21108         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21109         * lisp.h (fatal_error_signal_hook): Remove decl.
21110         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21112         * editfns.c: Move a (normally-unused) function to its only use.
21113         * editfns.c, lisp.h (get_operating_system_release): Remove.
21114         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21115         worth the hassle of breaking this out.
21117         * xterm.c: Make symbols static if they're not exported.
21118         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21119         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21120         (x_destroy_window, x_delete_display):
21121         Now static.
21122         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21123         (x_mouse_leave): Remove; unused.
21124         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21125         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21126         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21127         Remove decls.
21128         (x_mouse_leave): Declare only if WINDOWSNT.
21129         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21130         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21131         USE_X_TOOLKIT.
21133         * ftxfont.c: Make symbols static if they're not exported.
21134         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21135         HAVE_FREETYPE.
21136         * font.h (ftxfont_driver): Likewise.
21138         * xfns.c: Make symbols static if they're not exported.
21139         (x_last_font_name, x_display_info_for_name):
21140         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21141         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21142         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21143         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21144         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21145         (last_show_tip_args): Now static.
21146         (xic_defaut_fontset, xic_create_fontsetname): Define only if
21147         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21148         (x_screen_planes): Remove; unused.
21149         * dispextern.h (x_screen_planes): Remove decl.
21151         * dispnew.c: Make symbols static if they're not exported.
21152         * dispextern.h (redraw_garbaged_frames, scrolling):
21153         (increment_row_positions): Remove.
21154         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21155         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21156         Now static.
21157         (redraw_garbaged_frames): Remove; unused.
21159         * xfaces.c: Make symbols static if they're not exported.
21160         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21161         Remove decls.
21162         * xterm.h (defined_color): Remove decls.
21163         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21164         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21165         (menu_face_changed_default, defined_color, free_realized_face):
21166         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21167         (ascii_face_of_lisp_face): Remove; unused.
21169         * xdisp.c: Make symbols static if they're not exported.
21170         * dispextern.h (scratch_glyph_row, window_box_edges):
21171         (glyph_to_pixel_coords, set_cursor_from_row):
21172         (get_next_display_element, set_iterator_to_next):
21173         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21174         (show_mouse_face): Remove decls
21175         * frame.h (message_buf_print): Likewise.
21176         * lisp.h (pop_message, set_message, check_point_in_composition):
21177         Likewise.
21178         * xterm.h (set_vertical_scroll_bar): Likewise.
21179         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21180         (message_buf_print, scratch_glyph_row, displayed_buffer):
21181         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21182         (get_next_display_element, show_mouse_face, window_box_edges):
21183         (frame_to_window_pixel_xy, check_point_in_composition):
21184         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21185         (glyph_to_pixel_coords): Remove; unused.
21187         * dired.c (file_name_completion): Now static.
21189         * dbusbind.c (xd_in_read_queued_messages): Now static.
21191         * lisp.h (circular_list_error, FOREACH): Remove; unused.
21192         * data.c (circular_list_error): Remove.
21194         * commands.h (last_point_position, last_point_position_buffer):
21195         (last_point_position_window): Remove decls.
21196         * keyboard.c: Make these variables static.
21198         * coding.h (coding, code_convert_region, encode_coding_gap):
21199         Remove decls.
21200         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21201         (iso_code_class, detect_coding, code_convert_region): Now static.
21202         (encode_coding_gap): Remove; unused.
21204         * chartab.c (chartab_chars, chartab_bits): Now static.
21206         * charset.h (charset_iso_8859_1): Remove decl.
21207         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21208         Now static.
21210         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21211         * ccl.c (Vccl_program_table): Now static.
21212         (check_ccl_update): Remove; unused.
21214         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21215         * category.h: ... from here.
21216         * category.c (check_category_table, set_category_set): Now static.
21218         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21219         * lisp.h: Remove these decls.
21221         * buffer.c (buffer_count): Remove unused var.
21223         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21224         so that it's not optimized away.
21225         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21226         * dispextern.h (bidi_dump_cached_states): Remove, since it's
21227         exported only to the debugger.
21229         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
21230         * atimer.h (run_all_atimers): Remove; not exported.
21232         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21233         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21234         was inaccessible from Lisp.
21235         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21236         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21238         alloc.c: Import and export fewer symbols, and remove unused items.
21239         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21240         is defined.
21241         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21242         it's not optimized away by whole-program optimization.
21243         (message_enable_multibyte, free_misc): Remove.
21244         (catchlist, handlerlist, mark_backtrace):
21245         Declare only if BYTE_MARK_STACK.
21246         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21247         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21248         (message_enable_multibyte): Remove decl.
21249         (free_misc, interval_free_list, float_block, float_block_index):
21250         (n_float_blocks, float_free_list, cons_block, cons_block_index):
21251         (cons_free_list, last_marked_index):
21252         Now static.
21253         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21254         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21255         (mark_backtrace): Define only if BYTE_MARK_STACK.
21256         * xdisp.c (message_enable_multibyte): Now static.
21258         Declare Lisp_Object Q* variables to be 'static' if not exported.
21259         This makes it easier for human readers (and static analyzers)
21260         to see whether these variables are used from other modules.
21261         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21262         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21263         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21264         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21265         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21266         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21267         * xmenu.c, xselect.c:
21268         Declare Q* vars static if they are not used in other modules.
21269         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21270         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21271         Remove decls of unexported vars.
21272         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21274         * lisp.h (DEFINE_FUNC): Make sname 'static'.
21276         Make Emacs functions such as Fatom 'static' by default.
21277         This makes it easier for human readers (and static analyzers)
21278         to see whether these functions can be called from other modules.
21279         DEFUN now defines a static function.  To make the function external
21280         so that it can be used in other C modules, use the new macro DEFUE.
21281         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21282         (Finit_image_library):
21283         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21284         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21285         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21286         Remove decls, since these functions are now static.
21287         (Funintern, Fget_internal_run_time): New decls, since these functions
21288         were already external.
21290         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21291         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21292         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21293         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21294         * keyboard.c, keymap.c, lread.c:
21295         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21296         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21297         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21298         Mark functions with DEFUE instead of DEFUN,
21299         if they are used in other modules.
21300         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21301         decls for now-static functions.
21302         * buffer.h (Fdelete_overlay): Remove decl.
21303         * callproc.c (Fgetenv_internal): Mark as internal.
21304         * composite.c (Fremove_list_of_text_properties): Remove decl.
21305         (Fcomposition_get_gstring): New forward static decl.
21306         * composite.h (Fcomposite_get_gstring): Remove decl.
21307         * dired.c (Ffile_attributes): New forward static decl.
21308         * doc.c (Fdocumntation_property): New forward static decl.
21309         * eval.c (Ffetch_bytecode): New forward static decl.
21310         (Funintern): Remove extern decl; now in .h file where it belongs.
21311         * fileio.c (Fmake_symbolic_link): New forward static decl.
21312         * image.c (Finit_image_library): New forward static decl.
21313         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21314         * intervals.h (Fprevious_property_change):
21315         (Fremove_list_of_text_properties): Remove decls.
21316         * keyboard.c (Fthis_command_keys): Remove decl.
21317         (Fcommand_execute): New forward static decl.
21318         * keymap.c (Flookup_key): New forward static decl.
21319         (Fcopy_keymap): Now static.
21320         * keymap.h (Flookup_key): Remove decl.
21321         * process.c (Fget_process): New forward static decl.
21322         (Fprocess_datagram_address): Mark as internal.
21323         * syntax.c (Fsyntax_table_p): New forward static decl.
21324         (skip_chars): Remove duplicate decl.
21325         * textprop.c (Fprevious_property_change): New forward static decl.
21326         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21327         Now internal.
21328         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21329         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21331         * editfns.c (Fformat): Remove unreachable code.
21333 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
21335         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21336         change.  (Bug#8496)
21338 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
21340         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21341         when at ZV.  (Bug#8487)
21343 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
21345         * charset.c (Fclear_charset_maps): Use xfree instead of free.
21346         (Bug#8437)
21347         * keyboard.c (parse_tool_bar_item): Likewise.
21348         * sound.c (sound_cleanup, alsa_close): Likewise.
21349         * termcap.c (tgetent): Likewise.
21350         * xfns.c (x_default_font_parameter): Likewise.
21351         * xsettings.c (read_and_apply_settings): Likewise.
21353         * alloc.c (overrun_check_malloc, overrun_check_realloc)
21354         (overrun_check_free): Protoize.
21356 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
21358         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21359         since callers should never pass a negative size.
21360         Change the signature to match that of plain 'read' and 'write'; see
21361         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21362         * lisp.h: Update prototypes of emacs_write and emacs_read.
21364 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
21366         * xdisp.c (redisplay_window): Don't try to determine the character
21367         position of the scroll margin if the window start point w->startp
21368         is outside the buffer's accessible region.  (Bug#8468)
21370 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
21372         Fix write-region and its subroutines for buffers > 2GB.
21373         * fileio.c (a_write, e_write): Modify declaration of arguments and
21374         local variables to support buffers larger than 2GB.
21375         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21377         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21378         argument, local variables, and return value.
21380         * lisp.h: Update prototypes of emacs_write and emacs_read.
21382         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21384 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
21386         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21388         Fix more problems found by GCC 4.6.0's static checks.
21390         * xdisp.c (vmessage): Use a better test for character truncation.
21392         * charset.c (load_charset_map): <, not <=, for optimization,
21393         and to avoid potential problems with integer overflow.
21394         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
21395         * casetab.c (set_identity, shuffle): Likewise.
21396         * editfns.c (Fformat): Likewise.
21397         * syntax.c (skip_chars): Likewise.
21399         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21400         This also lets GCC 4.6.0 generate slightly better loop code.
21402         * callint.c (Fcall_interactively): <, not <=, for optimization.
21403         (Fcall_interactively): Count the number of arguments produced,
21404         not the number of arguments given.  This is simpler and lets GCC
21405         4.6.0 generate slightly better code.
21407         * ftfont.c: Distingish more carefully between FcChar8 and char.
21408         The previous code passed unsigned char * to a functions like
21409         strlen and xstrcasecmp that expect char *, which does not
21410         conform to the C standard.
21411         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21412         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21413         char * when the C standard requires it.
21415         * keyboard.c (read_char): Remove unused var.
21417         * eval.c: Port to Windows vsnprintf (Bug#8435).
21418         Include <limits.h>.
21419         (SIZE_MAX): Define if the headers do not.
21420         (verror): Do not give up if vsnprintf returns a negative count.
21421         Instead, grow the buffer.  This ports to Windows vsnprintf, which
21422         does not conform to C99.  Problem reported by Eli Zaretskii.
21423         Also, simplify the allocation scheme, by avoiding the need for
21424         calling realloc, and removing the ALLOCATED variable.
21426         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21428         Remove invocations of doprnt, as Emacs now uses vsnprintf.
21429         But keep the doprint source code for now, as we might revamp it
21430         and use it again (Bug#8435).
21431         * lisp.h (doprnt): Remove.
21432         * Makefile.in (base_obj): Remove doprnt.o.
21433         * deps.mk (doprnt.o): Remove.
21435         error: Print 32- and 64-bit integers portably (Bug#8435).
21436         Without this change, on typical 64-bit hosts error ("...%d...", N)
21437         was used to print both 32- and 64-bit integers N, which relied on
21438         undefined behavior.
21439         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
21440         * lisp.h (error, verror): Mark as printf-like functions.
21441         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21442         Report overflow in size calculations when allocating printf buffer.
21443         Do not truncate output string at its first null byte.
21444         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21445         Truncate the output at a character boundary, since vsnprintf does not
21446         do that.
21447         * charset.c (check_iso_charset_parameter): Convert internal
21448         character to string before calling 'error', since %c now has the
21449         printf meaning.
21450         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21451         overflow when computing char to be passed to 'error'.  Do not
21452         pass Lisp_Object to 'error'; pass the integer instead.
21453         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21454         formatted with plain %d.
21456         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21458         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21460         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21462         * xterm.c (x_catch_errors): Remove duplicate declaration.
21464         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21466         * xdisp.c, lisp.h (message_nolog): Remove; unused.
21468 2011-04-10  Jim Meyering  <meyering@redhat.com>
21470         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21471         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21472         return ssize_t not "int", and use size_t as the buffer length.
21473         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21474         * gnutls.h: Update declarations.
21475         * process.c (read_process_output): Use ssize_t, to match.
21476         (send_process): Likewise.
21478 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
21480         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21482 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
21484         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21485         Use unsigned char, to match FcChar8 type definition.
21487         * xterm.c (handle_one_xevent):
21488         * xmenu.c (create_and_show_popup_menu):
21489         * xselect.c (x_decline_selection_request)
21490         (x_reply_selection_request): Avoid type-punned deref of X events.
21492 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
21494         Fix some uses of `int' instead of EMACS_INT.
21495         * search.c (string_match_1, fast_string_match)
21496         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21497         (scan_buffer, find_next_newline_no_quit)
21498         (find_before_next_newline, search_command, Freplace_match)
21499         (Fmatch_data): Make some `int' variables be EMACS_INT.
21501         * xdisp.c (display_count_lines): 3rd argument and return value now
21502         EMACS_INT.  All callers changed.
21503         (pint2hrstr): Last argument is now EMACS_INT.
21505         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21506         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21507         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21508         (decode_coding_utf_16, decode_coding_emacs_mule)
21509         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21510         (decode_coding_ccl, decode_coding_charset)
21511         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21512         (decode_coding_iso_2022, decode_coding_emacs_mule)
21513         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21514         <char_offset, last_offset>: Declare EMACS_INT.
21515         (encode_coding_utf_8, encode_coding_utf_16)
21516         (encode_coding_emacs_mule, encode_invocation_designation)
21517         (encode_designation_at_bol, encode_coding_iso_2022)
21518         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21519         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21520         Declare EMACS_INT.
21521         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21522         (encode_invocation_designation): Last argument P_NCHARS is now
21523         EMACS_INT.
21524         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21525         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21527         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21528         All users changed.
21530         * ccl.c (Fccl_execute_on_string): Declare some variables
21531         EMACS_INT.
21533 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
21535         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21537 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
21539         * process.c (Fformat_network_address): Doc fix.
21541 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
21543         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
21545 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
21547         * keyboard.c (read_char): Call Lisp function help-form-show,
21548         instead of using internal_with_output_to_temp_buffer.
21549         (Qhelp_form_show): New var.
21550         (syms_of_keyboard): Use DEFSYM macro.
21552         * print.c (internal_with_output_to_temp_buffer): Function deleted.
21554         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21556 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
21558         * process.c (Flist_processes): Remove to Lisp.
21559         (list_processes_1): Delete.
21561 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
21563         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21565         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21567 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
21569         Fix more problems found by GCC 4.6.0's static checks.
21571         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21573         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21575         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
21577         * xdisp.c (vmessage): Mark as a printf-like function.
21579         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21581         * sound.c (sound_warning): Don't crash if arg contains a printf format.
21583         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21584         printf-like functions.
21585         (tiff_load): Add casts to remove these marks before passing them
21586         to system-supplied API.
21588         * eval.c (Fsignal): Remove excess argument to 'fatal'.
21590         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21591         This avoids several warnings with gcc -Wstrict-overflow.
21592         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21593         directly, rather than having caller test rule sign.  This avoids
21594         some unnecessary tests.
21595         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21596         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
21597         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
21599         * xfont.c (xfont_text_extents): Remove var that was set but not used.
21600         (xfont_open): Avoid unnecessary tests.
21602         * composite.c (composition_gstring_put_cache): Use unsigned integer.
21604         * composite.h, composite.c (composition_gstring_put_cache):
21605         Use EMACS_INT, not int, for length.
21607         * composite.h (COMPOSITION_DECODE_REFS): New macro,
21608         breaking out part of COMPOSITION_DECODE_RULE.
21609         (COMPOSITION_DECODE_RULE): Use it.
21610         * composite.c (get_composition_id): Remove unused local vars,
21611         by using the new macro.
21613         * textprop.c (set_text_properties_1): Change while to do-while,
21614         since the condition is always true at first.
21616         * intervals.c (graft_intervals_into_buffer): Mark var as used.
21617         (interval_deletion_adjustment): Return unsigned value.
21618         All uses changed.
21620         * process.c (list_processes_1, create_pty, read_process_output):
21621         (exec_sentinel): Remove vars that were set but not used.
21622         (create_pty): Remove unnecessary "volatile"s.
21623         (Fnetwork_interface_info): Avoid possibility of int overflow.
21624         (read_process_output): Do adaptive read buffering even if carryover.
21625         (read_process_output): Simplify nbytes computation if buffered.
21627         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21629         * syntax.c (scan_words): Remove var that was set but not used.
21630         (update_syntax_table): Use unsigned instead of int.
21632         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
21633         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
21634         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
21636         * print.c (print_error_message): Avoid int overflow.
21638         * font.c (font_list_entities): Redo for clarity,
21639         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21641         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
21642         (font_score): Avoid potential overflow in diff calculation.
21644         * fns.c (substring_both): Remove var that is set but not used.
21645         (sxhash): Redo loop for clarity and to avoid wraparound warning.
21647         * eval.c (funcall_lambda): Rename local to avoid shadowing.
21649         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21650         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21651         can always succeed if overflow has undefined behavior.
21653         * search.c (boyer_moore, wordify): Remove vars set but not used.
21654         (wordify): Omit three unnecessary tests.
21656         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21657         All callers changed.  This avoids the need for an unused var.
21659         * casefiddle.c (casify_region): Remove var that is set but not used.
21661         * dired.c (file_name_completion): Remove var that is set but not used.
21663         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21665         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
21666         (Finsert_file_contents): Remove unnecessary code checking fd.
21668         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21669         Check for integer overflow on size calculations.
21671         * buffer.c (Fprevious_overlay_change): Remove var that is set
21672         but not used.
21674         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21675         Remove vars that are set but not used.
21676         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
21677         (timer_check_2): Mark vars as initialized.
21679         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21681         * image.c (lookup_image): Remove var that is set but not used.
21682         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
21684         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21685         that are set but not used.
21687         * xfns.c (make_invisible_cursor): Don't return garbage
21688         if XCreateBitmapFromData fails (Bug#8410).
21690         * xselect.c (x_get_local_selection, x_handle_property_notify):
21691         Remove vars that are set but not used.
21693         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
21694         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
21696         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21697         Remove var that is set but not used.
21698         (scroll_bar_windows_size): Now size_t, not int.
21699         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21700         Check for overflow.
21702         * xfaces.c (realize_named_face): Remove vars that are set but not used.
21703         (map_tty_color) [!defined MSDOS]: Likewise.
21705         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21707         * coding.c: Remove vars that are set but not used.
21708         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21709         All callers changed.
21710         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21711         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21712         (decode_coding_charset): Remove vars that are set but not used.
21714         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21715         that is set but not used.
21717         * print.c (print_object): Remove var that is set but not used.
21719         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
21720         The gnulib version avoids calling malloc in the usual case,
21721         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21722         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21723         * filelock.c (current_lock_owner): Likewise.
21724         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21725         * sysdep.c: Include allocator.h, careadlinkat.h.
21726         (emacs_no_realloc_allocator): New static constant.
21727         (emacs_readlink): New function.
21728         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21729         ../lib/careadlinkat.h.
21731 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
21733         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21734         first non-nil return value).
21736 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
21738         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21739         if not defined (Bug#8403).
21741 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
21743         * xdisp.c (display_count_lines): Remove parameter `start',
21744         unused since revno:20537 (1998-01-01).  All callers changed.
21745         (get_char_face_and_encoding): Remove parameter `multibyte_p',
21746         unused since revno:87605 (2008-05-14).  All callers changed.
21747         (fill_stretch_glyph_string): Remove parameters `row' and `area',
21748         unused at least since Kim's GUI unification at revno:50135 (2003-03-16)
21749         and thereabouts.  All callers changed.
21750         (get_per_char_metric): Remove parameter `f', unused since
21751         revno:87605 (2008-05-14).  All callers changed.
21753 2011-04-02  Jim Meyering  <meyering@redhat.com>
21755         do not dereference NULL upon failed strdup
21756         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21757         (ns_get_family): Likewise.
21759 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
21761         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21763 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
21765         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21766         later (Bug#8403).
21768 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
21770         Add lexical binding.
21772         * window.c (Ftemp_output_buffer_show): New fun.
21773         (Fsave_window_excursion):
21774         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21776         * lread.c (lisp_file_lexically_bound_p): New function.
21777         (Fload): Bind Qlexical_binding.
21778         (readevalloop): Remove `evalfun' arg.
21779         Bind Qinternal_interpreter_environment.
21780         (Feval_buffer): Bind Qlexical_binding.
21781         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21782         Mark as dynamic.
21783         (syms_of_lread): Declare `lexical-binding'.
21785         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21787         * keyboard.c (eval_dyn): New fun.
21788         (menu_item_eval_property): Use it.
21790         * image.c (parse_image_spec): Use Ffunctionp.
21792         * fns.c (concat, mapcar1): Accept byte-code-functions.
21794         * eval.c (Fsetq): Handle lexical vars.
21795         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21796         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21797         (FletX, Flet): Obey lexical binding.
21798         (Fcommandp): Handle closures.
21799         (Feval): New `lexical' arg.
21800         (eval_sub): New function extracted from Feval.  Use it almost
21801         everywhere where Feval was used.  Look up vars in lexical env.
21802         Handle closures.
21803         (Ffunctionp): Move from subr.el.
21804         (Ffuncall): Handle closures.
21805         (apply_lambda): Remove `eval_flags'.
21806         (funcall_lambda): Handle closures and new byte-code-functions.
21807         (Fspecial_variable_p): New function.
21808         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21809         but without exporting it to Lisp.
21811         * doc.c (Fdocumentation, store_function_docstring):
21812         * data.c (Finteractive_form): Handle closures.
21814         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21815         interactive spec.
21817         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21818         New byte-codes.
21819         (exec_byte_code): New function extracted from Fbyte_code to handle new
21820         calling convention for byte-code-functions.  Add new byte-codes.
21822         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
21824         * alloc.c (Fmake_symbol): Init new `declared_special' field.
21826 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
21828         * xdisp.c (redisplay_internal): Fix prototype.
21830 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
21832         * xdisp.c (SCROLL_LIMIT): New macro.
21833         (try_scrolling): Use it when setting scroll_limit.
21834         Limit scrolling to 100 screen lines.
21835         (redisplay_window): Even when falling back on "recentering",
21836         position point in the window according to scroll-conservatively,
21837         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
21839         (try_scrolling): When point is above the window, allow searching
21840         as far as scroll_max, or one screenful, to compute vertical
21841         distance from PT to the scroll margin position.  This prevents
21842         try_scrolling from unnecessarily failing when
21843         scroll-conservatively is set to a value slightly larger than the
21844         window height.  Clean up the case of PT below the margin at bottom
21845         of window: scroll_max can no longer be INT_MAX.  When aggressive
21846         scrolling is in use, don't let point enter the opposite scroll
21847         margin as result of the scroll.
21848         (syms_of_xdisp) <scroll-conservatively>: Document the
21849         threshold of 100 lines for never-recentering scrolling.
21851 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
21853         * dispextern.h (move_it_by_lines):
21854         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21855         since revno:34925 (2000-12-29).  All callers changed.
21856         (message_log_check_duplicate): Remove parameters `prev_bol' and
21857         `this_bol', unused since revno:20537 (1998-01-01).  All callers changed.
21858         (redisplay_internal): Remove parameter `preserve_echo_area',
21859         unused since revno:25013 (1999-07-21).  All callers changed.
21861         * indent.c (Fvertical_motion):
21862         * window.c (window_scroll_pixel_based, Frecenter):
21863         Don't pass `need_y_p' to `move_it_by_lines'.
21865 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
21867         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
21868         steal a few bits to be more compact.
21869         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
21870         Remove unneeded casts.
21872         * bytecode.c (Fbyte_code): CAR and CDR can GC.
21874 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
21876         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
21877         binding" message (bug#7967).
21879 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
21881         Fix more problems found by GCC 4.6.0's static checks.
21883         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
21884         Remove unused local var.
21886         * editfns.c (Fmessage_box): Remove unused local var.
21888         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
21889         (note_mode_line_or_margin_highlight, note_mouse_highlight):
21890         Omit unused local vars.
21891         * window.c (shrink_windows): Omit unused local var.
21892         * menu.c (digest_single_submenu): Omit unused local var.
21893         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
21894         Omit unused local var.
21896         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
21897         Don't assume string length fits in int.
21898         (keyremap_step, read_key_sequence): Use size_t for sizes.
21899         (read_key_sequence): Don't check last_real_key_start redundantly.
21901         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
21902         instead of alloca (Bug#8344).
21904         * eval.c (Fbacktrace): Don't assume nargs fits in int.
21905         (Fbacktrace_frame): Don't assume nframes fits in int.
21907         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
21909         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
21910         concerns.
21912         * term.c (produce_glyphless_glyph): Remove unnecessary test.
21914         * cm.c (calccost): Turn while-do into do-while, for clarity.
21916         * keyboard.c (syms_of_keyboard): Use the same style as later
21917         in this function when indexing through an array.  This also
21918         works around GCC bug 48267.
21920         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
21922         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
21924         * chartab.c (sub_char_table_ref_and_range): Redo for slight
21925         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
21927         * keyboard.c, keyboard.h (num_input_events): Now size_t.
21928         This avoids undefined behavior on integer overflow, and is a bit
21929         more convenient anyway since it is compared to a size_t variable.
21931         Variadic C functions now count arguments with size_t, not int.
21932         This avoids an unnecessary limitation on 64-bit machines, which
21933         caused (substring ...) to crash on large vectors (Bug#8344).
21934         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
21935         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
21936         All variadic functions and their callers changed accordingly.
21937         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
21938         * data.c (arith_driver, float_arith_driver): Likewise.
21939         * editfns.c (general_insert_function): Likewise.
21940         * eval.c (struct backtrace.nargs, interactive_p)
21941         (internal_condition_case_n, run_hook_with_args, apply_lambda)
21942         (funcall_lambda, mark_backtrace): Likewise.
21943         * fns.c (concat): Likewise.
21944         * frame.c (x_set_frame_parameters): Likewise.
21945         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
21946         0 if not found, not -1.  All callers changed.
21948         * alloc.c (garbage_collect): Don't assume stack size fits in int.
21949         (stack_copy_size): Now size_t, not int.
21950         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
21952 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
21954         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
21955         unused since revno:43563.1.17 (2002-03-01) and revno:84043 (2008-02-1).
21956         All callers changed.
21958         * lisp.h (multibyte_char_to_unibyte):
21959         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
21960         unused since revno:43563.1.16 (2002-03-01) and revno:84043 (2008-02-1).
21961         * character.h (CHAR_TO_BYTE8):
21962         * cmds.c (internal_self_insert):
21963         * editfns.c (general_insert_function):
21964         * keymap.c (push_key_description):
21965         * search.c (Freplace_match):
21966         * xdisp.c (message_dolog, set_message_1): All callers changed.
21968 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
21970         * keyboard.c (safe_run_hook_funcall): New function.
21971         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
21972         don't set the hook to nil, but remove the offending function instead.
21973         (Qcommand_hook_internal): Remove, unused.
21974         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
21975         Vcommand_hook_internal.
21977         * eval.c (enum run_hooks_condition): Remove.
21978         (funcall_nil, funcall_not): New functions.
21979         (run_hook_with_args): Call each function through a `funcall' argument.
21980         Remove `cond' argument, now redundant.
21981         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
21982         (Frun_hook_with_args_until_failure): Adjust accordingly.
21983         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
21985 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
21987         * dispextern.h (string_buffer_position): Remove declaration.
21989         * print.c (strout): Remove parameter `multibyte', unused since
21990         revno:25356 (1999-08-21).  All callers changed.
21992         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
21993         never used since function introduction in revno:20870 (1998-02-08).
21994         All callers changed.
21996         * w32.c (_wsa_errlist): Use braces for struct initializers.
21998         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
21999         never used since function introduction in revno:36704 (2001-03-09).
22000         All callers changed.
22001         (string_buffer_position): Likewise.  Also, make static (it's never
22002         used outside xdisp.c).
22003         (cursor_row_p): Remove parameter `w', unused since
22004         revno:32591 (2000-10-17).  All callers changed.
22005         (decode_mode_spec): Remove parameter `precision', introduced during
22006         Gerd Moellmann's rewrite at revno:25013 (1999-07-21), but never used.
22007         All callers changed.
22009 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
22011         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22013 2011-03-27  Anders Lindgren  <andlind@gmail.com>
22015         * nsterm.m (ns_menu_bar_is_hidden): New variable.
22016         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22017         (ns_update_auto_hide_menu_bar): New functions.
22018         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22019         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22020         ns_constrain_all_frames.
22021         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22022         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22024 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
22026         * nsmenu.m (runDialogAt): Remove argument to timer_check.
22028 2011-03-27  Glenn Morris  <rgm@gnu.org>
22030         * syssignal.h: Replace RETSIGTYPE with void.
22031         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22032         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22033         Replace SIGTYPE with void everywhere.
22034         * s/usg5-4-common.h (SIGTYPE): Remove definition.
22035         * s/template.h (SIGTYPE): Remove commented out definition.
22037 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
22039         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22040         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
22042 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
22044         * w32.c (read_unc_volume): Use parameter `henum', instead of
22045         global variable `wget_enum_handle'.
22047         * keymap.c (describe_vector): Remove parameters `indices' and
22048         `char_table_depth', unused since revno:43563.1.32 (2002-03-01).
22049         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22051         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22053         * keyboard.c (timer_check): Remove parameter `do_it_now',
22054         unused since revno:14998 (1996-04-12).
22055         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22056         unused since revno:86854 (2008-04-19).
22058         * keyboard.c (read_char):
22059         * w32menu.c (w32_menu_display_help):
22060         * xmenu.c (show_help_event, menu_help_callback):
22061         Adjust calls to `show_help_echo'.
22063         * gtkutil.c (xg_maybe_add_timer):
22064         * keyboard.c (readable_events):
22065         * process.c (wait_reading_process_output):
22066         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22068         * insdel.c (adjust_markers_gap_motion):
22069         Remove; no-op since revno:20569 (1998-01-02).
22070         (gap_left, gap_right): Don't call it.
22072 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
22074         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22075         incurred during fontification.
22077 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
22079         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22080         (DEFVAR_PER_BUFFER): Don't pass it.
22082         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22083         (scrolling_window): Don't pass it.
22085 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
22087         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22089         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22090         and `suffix'.
22091         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22092         of variables specific to SELinux and computation of `encoded_absname'.
22094         * image.c (XPutPixel): Remove unused variable `height'.
22096         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22098         * unexw32.c (get_section_info): Remove unused variable `section'.
22100         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22101         (system_process_attributes): Remove unused variable `sess'.
22102         (sys_read): Remove unused variable `err'.
22104         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22105         (w32_wnd_proc): Remove unused variable `isdead'.
22106         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22107         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22108         (x_create_tip_frame): Remove unused variable `tem'.
22110         * w32inevt.c (w32_console_read_socket):
22111         Remove unused variable `no_events'.
22113         * w32term.c (x_draw_composite_glyph_string_foreground):
22114         Remove unused variable `width'.
22116 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
22118         * w32term.c (x_set_glyph_string_clipping):
22119         Don't pass uninitialized region to CombineRgn.
22121 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
22123         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22124         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22125         (Fx_close_connection): Remove unused variable `i'.
22127         * w32font.c (w32font_draw): Return number of glyphs.
22128         (w32font_open_internal): Remove unused variable `i'.
22129         (w32font_driver): Add missing initializer.
22131         * w32menu.c (utf8to16): Remove unused variable `utf16'.
22132         (fill_in_menu): Remove unused variable `items_added'.
22134         * w32term.c (last_mouse_press_frame): Remove static global variable.
22135         (w32_clip_to_row): Remove unused variable `f'.
22136         (x_delete_terminal): Remove unused variable `i'.
22138         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22139         (NOTHING): Remove unused static global variable.
22140         (uniscribe_check_otf): Remove unused variable `table'.
22141         (uniscribe_font_driver): Add missing initializers.
22143 2011-03-23  Julien Danjou  <julien@danjou.info>
22145         * term.c (Fsuspend_tty, Fresume_tty):
22146         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22147         * window.c (temp_output_buffer_show):
22148         * insdel.c (signal_before_change):
22149         * frame.c (Fhandle_switch_frame):
22150         * fileio.c (Fdo_auto_save):
22151         * emacs.c (Fkill_emacs):
22152         * editfns.c (save_excursion_restore):
22153         * cmds.c (internal_self_insert):
22154         * callint.c (Fcall_interactively):
22155         * buffer.c (Fkill_all_local_variables):
22156         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22157         Use Frun_hooks.
22158         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
22159         unconditionally since it does the check itself.
22161 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
22163         Fix more problems found by GCC 4.5.2's static checks.
22165         * coding.c (encode_coding_raw_text): Avoid unnecessary test
22166         the first time through the loop, since we know p0 < p1 then.
22167         This also avoids a gcc -Wstrict-overflow warning.
22169         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22170         leading to a memory leak, possible in functions like
22171         load_charset_map_from_file that can allocate an unbounded number
22172         of objects (Bug#8318).
22174         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22175         that could (at least in theory) be that large.
22177         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22178         This is less likely to overflow, and avoids undefined behavior if
22179         overflow does occur.  All callers changed.  Use strtoul to scan
22180         for the unsigned long integer.
22181         (pint2hrstr): Simplify and tune code slightly.
22182         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
22184         * scroll.c (do_scrolling): Work around GCC bug 48228.
22185         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22187         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22188         This also avoids a warning with gcc -Wstrict-overflow.
22189         (validate_x_resource_name): Simplify count usage.
22190         This also avoids a warning with gcc -Wstrict-overflow.
22192         * fileio.c (Fcopy_file): Report error if fchown or fchmod
22193         fail (Bug#8306).
22195         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
22197         * process.c (Fmake_network_process): Use socklen_t, not int,
22198         where POSIX says socklen_t is required in portable programs.
22199         This fixes a porting bug on hosts like 64-bit HP-UX, where
22200         socklen_t is wider than int (Bug#8277).
22201         (Fmake_network_process, server_accept_connection):
22202         (wait_reading_process_output, read_process_output):
22203         Likewise.
22205         * process.c: Rename or move locals to avoid shadowing.
22206         (list_processes_1, Fmake_network_process):
22207         (read_process_output_error_handler, exec_sentinel_error_handler):
22208         Rename or move locals.
22209         (Fmake_network_process): Define label "retry_connect" only if needed.
22210         (Fnetwork_interface_info): Fix pointer signedness.
22211         (process_send_signal): Add cast to avoid pointer signedness problem.
22212         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
22213         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
22215         Make tparam.h and terminfo.c consistent.
22216         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22217         Include tparam.h instead, since it declares them.
22218         * cm.h (PC): Remove extern decl; tparam.h now does this.
22219         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22220         * terminfo.c: Include tparam.h, to check interfaces.
22221         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
22222         (tparam): Adjust signature to match interface in tparam.h;
22223         this removes some undefined behavior.  Check that outstring and len
22224         are zero, which they always are with Emacs.
22225         * tparam.h (PC, BC, UP): New extern decls.
22227         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
22228         (xftfont_open): Rename locals to avoid shadowing.
22230         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
22231         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22232         (OTF_TAG_SYM): Omit macro if not needed.
22233         (ftfont_list): Remove unused local.
22234         (get_adstyle_property, ftfont_pattern_entity):
22235         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22236         Rename locals to avoid shadowing.
22238         * xfont.c (xfont_list_family): Mark var as initialized.
22240         * xml.c (make_dom): Now static.
22242         * composite.c (composition_compute_stop_pos): Rename local to
22243         avoid shadowing.
22244         (composition_reseat_it): Remove unused locals.
22245         (find_automatic_composition, composition_adjust_point): Likewise.
22246         (composition_update_it): Mark var as initialized.
22247         (find_automatic_composition): Mark vars as initialized,
22248         with a FIXME (Bug#8290).
22250         character.h: Rename locals to avoid shadowing.
22251         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22252         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22253         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22254         (BUF_DEC_POS): Be more systematic about renaming local temporaries
22255         to avoid shadowing.
22257         * textprop.c (property_change_between_p): Remove; unused.
22259         * intervals.c (interval_start_pos): Now static.
22261         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22263         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22264         Rename locals to avoid shadowing.
22266         * sound.c (wav_play, au_play, Fplay_sound_internal):
22267         Fix pointer signedness.
22268         (alsa_choose_format): Remove unused local var.
22269         (wav_play): Initialize a variable to 0, to prevent undefined
22270         behavior (Bug#8278).
22272         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22274         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22276         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22277         clobbering (Bug#8298).
22278         * sysdep.c (sys_subshell): Likewise.
22279         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
22281         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22282         This should get cleaned up, so that child_setup has the
22283         same signature on all platforms.
22285         * callproc.c (call_process_cleanup): Now static.
22286         (relocate_fd): Rename locals to avoid shadowing.
22288 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
22290         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
22291         not to be necessary, and produces flickering.
22293 2011-03-20  Glenn Morris  <rgm@gnu.org>
22295         * config.in: Remove file.
22297 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
22299         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22300         are now in src/globals.h.
22301         (syms_of_minibuf): Remove spurious & from previous change.
22303 2011-03-20  Leo Liu  <sdl.web@gmail.com>
22305         * minibuf.c (completing-read-function): New variable.
22306         (completing-read-default): Rename from completing-read.
22307         (completing-read): Call completing-read-function.
22309 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
22311         * xfaces.c (Fx_load_color_file):
22312         Read color file from absolute filename (bug#8250).
22314 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
22316         * makefile.w32-in: Update dependencies.
22318 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
22320         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22322 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
22324         Fix more problems found by GCC 4.5.2's static checks.
22326         * process.c (make_serial_process_unwind, send_process_trap):
22327         (sigchld_handler): Now static.
22329         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22330         That way, the code declares only the vars that it needs.
22331         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22332         * s/cygwin.h (PTY_ITERATION): Likewise.
22333         * s/darwin.h (PTY_ITERATION): Likewise.
22334         * s/gnu-linux.h (PTY_ITERATION): Likewise.
22336         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22337         * process.c (allocate_pty): Don't declare stb unless it's needed.
22339         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
22340         (CONSTANTLIM): Remove; unused.
22341         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22342         Define only if needed.
22344         * unexelf.c (unexec): Name an expression,
22345         to avoid gcc -Wbad-function-cast warning.
22346         Use a different way to cause a compilation error if anyone uses
22347         n rather than nn, a way that does not involve shadowing.
22348         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
22350         * deps.mk (unexalpha.o): Remove; unused.
22352         New file unexec.h, the (simple) interface for unexec (Bug#8267).
22353         * unexec.h: New file.
22354         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22355         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22356         Depend on unexec.h.
22357         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22358         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22359         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
22360         Change as necessary to match prototype in unexec.h.
22362         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22363         shadowing.
22364         (back_comment, skip_chars): Mark vars as initialized.
22366         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22367         Rename locals to avoid shadowing.
22369         * lread.c (read1): Rewrite so as not to use empty "else".
22370         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
22372         * print.c (Fredirect_debugging_output): Fix pointer signedess.
22374         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22375         warning when compiling print.c.
22377         * font.c (font_unparse_fcname): Abort in an "impossible" situation
22378         instead of using an uninitialized var.
22379         (font_sort_entities): Mark var as initialized.
22381         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22383         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22384         pointers to constants.
22385         (font_parse_fcname): Remove unused vars.
22386         (font_delete_unmatched): Now static.
22387         (font_get_spec): Remove; unused.
22388         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22389         (font_update_drivers, Ffont_get_glyphs, font_add_log):
22390         Rename or move locals to avoid shadowing.
22392         * fns.c (require_nesting_list, require_unwind): Now static.
22393         (Ffillarray): Rename locals to avoid shadowing.
22395         * floatfns.c (domain_error2): Define only if needed.
22396         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
22398         * alloc.c (mark_backtrace): Move decl from here ...
22399         * lisp.h: ... to here, so that it can be checked.
22401         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
22402         (Fdefvar): Rewrite so as not to use empty "else".
22403         (lisp_indirect_variable): Name an expression,
22404         to avoid gcc -Wbad-function-cast warning.
22405         (Fdefvar): Rename locals to avoid shadowing.
22407         * callint.c (quotify_arg, quotify_args): Now static.
22408         (Fcall_interactively): Rename locals to avoid shadowing.
22409         Use const pointer when appropriate.
22411         * lisp.h (get_system_name, get_operating_system_release):
22412         Move decls here, to check interfaces.
22413         * process.c (get_operating_system_release): Move decl to lisp.h.
22414         * xrdb.c (get_system_name): Likewise.
22415         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22416         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22417         some of which prompt warnings from gcc -Wbad-function-cast.
22418         (Fformat_time_string, Fencode_time, Finsert_char):
22419         (Ftranslate_region_internal, Fformat):
22420         Rename or remove local vars to avoid shadowing.
22421         (Ftranslate_region_internal): Mark var as initialized.
22423         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22424         avoid shadowing.
22426         * lisp.h (eassert): Check that the argument compiles, even if
22427         ENABLE_CHECKING is not defined.
22429         * data.c (Findirect_variable): Name an expression, to avoid
22430         gcc -Wbad-function-cast warning.
22431         (default_value, arithcompare, arith_driver, arith_error): Now static.
22432         (store_symval_forwarding): Rename local to avoid shadowing.
22433         (Fmake_variable_buffer_local, Fmake_local_variable):
22434         Mark variables as initialized.
22435         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
22437         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
22438         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22439         Rename locals to avoid shadowing.
22440         (mark_stack): Move local variables into the #ifdef region where
22441         they're used.
22442         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22443         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22444         needed otherwise.
22445         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22446         (GC_STRING_CHARS): Remove; not used.
22447         (Fmemory_limit): Cast sbrk's returned value to char *.
22449         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22450         avoids undefined behavior in theory.
22452         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22454         Use functions, not macros, for up- and down-casing (Bug#8254).
22455         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22456         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
22457         to use the following functions instead of these macros.
22458         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
22459         EMACS_INT, since callers assume the returned value fits in int.
22460         (upcase1): Likewise, for UPCASE_TABLE.
22461         (uppercasep, lowercasep, upcase): New static inline functions.
22462         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
22463         the race-condition problem in the old DOWNCASE.
22465         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22466         Rename locals to avoid shadowing.
22467         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
22468         (regex_compile, re_search_2, re_match_2_internal):
22469         Remove unused local vars.
22470         (FREE_VAR): Rewrite so as not to use empty "else",
22471         which gcc can warn about.
22472         (regex_compile, re_match_2_internal): Mark locals as initialized.
22473         (RETALLOC_IF): Define only if needed.
22474         (WORDCHAR_P): Likewise.  This one is never needed, but is used
22475         only in a comment talking about a compiler bug, so put inside
22476         the #if 0 of that comment.
22477         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22478         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22479         Remove; unused.
22481         * search.c (boyer_moore): Rename locals to avoid shadowing.
22482         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22483         (PREV_CHAR_BOUNDARY): Likewise.
22485         * search.c (simple_search): Remove unused var.
22487         * dired.c (compile_pattern): Move decl from here ...
22488         * lisp.h: ... to here, so that it can be checked.
22489         (struct re_registers): New forward decl.
22491         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22493         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22494         All uses changed.
22495         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22496         Rename locals to avoid shadowing.
22497         (Fvertical_motion): Mark locals as initialized.
22499         * casefiddle.c (casify_object, casify_region): Now static.
22500         (casify_region): Mark local as initialized.
22502         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22504         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22505         New macros, so that the caller can use some names other than
22506         gcpro1, gcpro2, etc.
22507         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22508         of the new macros.
22509         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22510         argument, for consistency with GCPRO2_VAR, etc: it is now the
22511         prefix of the variable, not the variable itself.  All uses
22512         changed.
22513         * dired.c (directory_files_internal, file_name_completion):
22514         Rename locals to avoid shadowing.
22516         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22517         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22518         dired.c's scmp function, had undefined behavior.
22519         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22520         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22521         * buffer.h: ... to here, because these macros use current_buffer,
22522         and the new implementation with inline functions needs to have
22523         current_buffer in scope now, rather than later when the macros
22524         are used.
22525         (downcase, upcase1): New static inline functions.
22526         (DOWNCASE, UPCASE1): Reimplement using these functions.
22527         This avoids undefined behavior in expressions like
22528         DOWNCASE (x) == DOWNCASE (y), which previously suffered
22529         from race conditions in accessing the global variables
22530         case_temp1 and case_temp2.
22531         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22532         * lisp.h (case_temp1, case_temp2): Remove their decls.
22533         * character.h (ASCII_CHAR_P): Move from here ...
22534         * lisp.h: ... to here, so that the inline functions mentioned
22535         above can use them.
22537         * dired.c (directory_files_internal_unwind): Now static.
22539         * fileio.c (file_name_as_directory, directory_file_name):
22540         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22541         Now static.
22542         (file_name_as_directory): Use const pointers when appropriate.
22543         (Fexpand_file_name): Likewise.  In particular, newdir might
22544         point at constant storage, so make it a const pointer.
22545         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
22546         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22547         signedness issues.
22548         (Fset_file_times, Finsert_file_contents, auto_save_error):
22549         Rename locals to avoid shadowing.
22551         * minibuf.c (choose_minibuf_frame_1): Now static.
22552         (Ftry_completion, Fall_completions): Rename or remove locals
22553         to avoid shadowing.
22555         * marker.c (bytepos_to_charpos): Remove; unused.
22557         * lisp.h (verify_bytepos, count_markers): New decls,
22558         so that gcc does not warn that these functions aren't declared.
22560         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22561         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
22562         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
22563         (copy_text): Remove unused local var.
22565         * filelock.c (within_one_second): Now static.
22566         (lock_file_1): Rename local to avoid shadowing.
22568         * buffer.c (fix_overlays_before): Mark locals as initialized.
22569         (fix_start_end_in_overlays): Likewise.  This function should be
22570         simplified by using pointers-to-pointers, but that's a different
22571         matter.
22572         (switch_to_buffer_1): Now static.
22573         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22574         (report_overlay_modification): Rename locals to avoid shadowing.
22576         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
22577         Fix pointer signedness issue.
22578         (sys_subshell): Mark local as volatile if checking for lint,
22579         to suppress a gcc -Wclobbered warning that does not seem to be right.
22580         (MAXPATHLEN): Define only if needed.
22582         * process.c (serial_open, serial_configure): Move decls from here ...
22583         * systty.h: ... to here, so that they can be checked.
22585         * fns.c (get_random, seed_random): Move extern decls from here ...
22586         * lisp.h: ... to here, so that they can be checked.
22588         * sysdep.c (reset_io): Now static.
22589         (wait_for_termination_signal): Remove; unused.
22591         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22592         (copy_keymap_item, append_key, push_text_char_description):
22593         Now static.
22594         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
22595         (DENSE_TABLE_SIZE): Remove; unused.
22596         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22597         (describe_map_tree):
22598         Rename locals to avoid shadowing.
22600         * keyboard.c: Declare functions static if they are not used elsewhere.
22601         (echo_char, echo_dash, cmd_error, top_level_2):
22602         (poll_for_input, handle_async_input): Now static.
22603         (read_char, kbd_buffer_get_event, make_lispy_position):
22604         (make_lispy_event, make_lispy_movement, apply_modifiers):
22605         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22606         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22607         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
22608         (read_key_sequence, read_char): Mark locals as initialized.
22609         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
22611         * keyboard.h (make_ctrl_char): New decl.
22612         (mark_kboards): Move decl here ...
22613         * alloc.c (mark_kboards): ... from here.
22615         * lisp.h (force_auto_save_soon): New decl.
22617         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
22618         (DEFINE_DUMMY_FUNCTION): New macro.
22619         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22620         Use it.
22621         (main): Add casts to avoid warnings
22622         if GCC considers string literals to be constants.
22624         * lisp.h (fatal_error_signal): Add decl, since it's exported.
22626         * dbusbind.c: Pointer signedness fixes.
22627         (xd_signature, xd_append_arg, xd_initialize):
22628         (Fdbus_call_method, Fdbus_call_method_asynchronously):
22629         (Fdbus_method_return_internal, Fdbus_method_error_internal):
22630         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22631         (Fdbus_register_signal): Use SSDATA when the context wants char *.
22633         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22634         if GCC considers string literals to be constants.
22635         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
22637 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
22639         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22640         (print_preprocess, print_object): New macro to fix last change.
22642         * print.c (print_preprocess): Don't forget font objects.
22644 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
22646         * emacs.c (USAGE3): Doc fixes.
22648 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
22650         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22651         structure.
22653 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
22655         * lisp.h (VWindow_system, Qfile_name_history):
22656         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22657         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22658         (w32_system_caret_x, w32_system_caret_y): Declare extern.
22660         * w32select.c: Don't #include "keyboard.h".
22661         (run_protected): Add extern declaration for waiting_for_input.
22663         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22664         * w32console.c (detect_input_pending, read_input_pending)
22665         (encode_terminal_code):
22666         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22667         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22668         (w32_system_caret_y, Qfile_name_history):
22669         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22670         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22671         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22672         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22673         * w32proc.c (Qlocal, report_file_error):
22674         * w32term.c (Vwindow_system, updating_frame):
22675         * w32uniscribe.c (initialized, uniscribe_font_driver):
22676         Remove unneeded extern declarations.
22678 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
22680         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
22682 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
22684         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22685         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22686         These macros can no longer be used for assignment.
22688         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22689         Assign struct members directly, instead of using BUF_BEGV etc.
22690         (record_buffer_markers, fetch_buffer_markers): New functions for
22691         recording and fetching special buffer markers.
22692         (set_buffer_internal_1, set_buffer_temp): Use them.
22694         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22696         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22698         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22699         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22701         * xdisp.c (hscroll_window_tree):
22702         (reconsider_clip_changes): Use PT instead of BUF_PT.
22704 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
22706         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22707         $(EMACS_ROOT)/lib/intprops.h.
22709 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
22711         Fix more problems found by GCC 4.5.2's static checks.
22713         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22714         to unsigned char * to avoid compiler diagnostic.
22715         (xg_free_frame_widgets): Make it clear that a local variable is
22716         needed only if USE_GTK_TOOLTIP.
22717         (gdk_window_get_screen): Make it clear that this macro is needed
22718         only if USE_GTK_TOOLTIP.
22719         (int_gtk_range_get_value): New function, which avoids a diagnostic
22720         from gcc -Wbad-function-cast.
22721         (xg_set_toolkit_scroll_bar_thumb): Use it.
22722         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22723         diagnostic from gcc -Wbad-function-cast.
22724         (get_utf8_string, xg_get_file_with_chooser):
22725         Rename locals to avoid shadowing.
22726         (create_dialog): Move locals to avoid shadowing.
22728         * xgselect.c (xg_select): Remove unused var.
22730         * image.c (four_corners_best): Mark locals as initialized.
22731         (gif_load): Initialize transparent_p to zero (Bug#8238).
22732         Mark another local as initialized.
22733         (my_png_error, my_error_exit): Mark with NO_RETURN.
22735         * image.c (clear_image_cache): Now static.
22736         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
22737         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
22738         (x_edge_detection): Remove unnecessary cast that
22739         gcc -Wbad-function-cast diagnoses.
22740         (gif_load): Fix pointer signedness.
22741         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22742         (jpeg_load, gif_load): Rename locals to avoid shadowing.
22744 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
22746         Improve quality of tests for time stamp overflow.
22747         For example, without this patch (encode-time 0 0 0 1 1
22748         1152921504606846976) returns the obviously-bogus value (-948597
22749         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
22750         reports time overflow.  See
22751         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
22752         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22753         * editfns.c: Include limits.h and intprops.h.
22754         (TIME_T_MIN, TIME_T_MAX): New macros.
22755         (time_overflow): Move earlier, to before first use.
22756         (hi_time, lo_time): New functions, for an accurate test for
22757         out-of-range times.
22758         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22759         (Fget_internal_run_time): Don't assume time_t fits in int.
22760         (make_time): Use list2 instead of Fcons twice.
22761         (Fdecode_time): More accurate test for out-of-range times.
22762         (check_tm_member): New function.
22763         (Fencode_time): Use it, to test for out-of-range times.
22764         (lisp_time_argument): Don't rely on undefined left-shift and
22765         right-shift behavior when checking for time stamp overflow.
22767         * editfns.c (time_overflow): New function, refactoring common code.
22768         (Fformat_time_string, Fdecode_time, Fencode_time):
22769         (Fcurrent_time_string): Use it.
22771         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22772         * dired.c (make_time): Move to ...
22773         * editfns.c (make_time): ... here.
22774         * systime.h: Note the move.
22776 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
22778         * fringe.c (update_window_fringes): Remove unused variables.
22780         * unexmacosx.c (copy_data_segment): Also copy __got section.
22781         (Bug#8223)
22783 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
22785         * termcap.c [MSDOS]: Include "msdos.h".
22786         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22787         Constify `char *' arguments and their references according to
22788         prototypes in tparam.h.
22790         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
22792         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22793         Adapt all references accordingly.
22795         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22797 2011-03-11  Tom Tromey  <tromey@redhat.com>
22799         * buffer.c (syms_of_buffer): Remove obsolete comment.
22801 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
22803         * termhooks.h (encode_terminal_code): Declare prototype.
22805         * msdos.c (encode_terminal_code): Don't declare prototype.
22807         * term.c (encode_terminal_code): Now external again, used by
22808         w32console.c and msdos.c.
22810         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22811         Depend on $(SRC)/tparam.h, see revno 103623.
22813 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
22815         Fix some minor problems found by GCC 4.5.2's static checks.
22817         * fringe.c (update_window_fringes): Mark locals as initialized
22818         (Bug#8227).
22819         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
22821         * alloc.c (mark_fringe_data): Move decl from here ...
22822         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22823         to check its interface.
22824         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22826         * fontset.c (free_realized_fontset): Now static.
22827         (Fset_fontset_font): Rename local to avoid shadowing.
22828         (fontset_font): Mark local as initialized.
22829         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
22831         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22833         * xselect.c (x_disown_buffer_selections): Remove; not used.
22834         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
22835         (x_own_selection, Fx_disown_selection_internal): Rename locals
22836         to avoid shadowing.
22837         (x_handle_dnd_message): Remove local to avoid shadowing.
22839         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22840         so that the caller can use some name other than gcpro1.
22841         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
22842         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22843         (Fx_backspace_delete_keys_p):
22844         Use them to avoid shadowing, and rename vars to avoid shadowing.
22845         (x_decode_color, x_set_name, x_window): Now static.
22846         (Fx_create_frame): Add braces to silence GCC warning.
22847         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
22848         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22849         Remove unused locals.
22850         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22851         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22852         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22853         macros.
22855         * xterm.h (x_mouse_leave): New decl.
22857         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22858         Remove unused functions.
22859         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
22860         (x_calc_absolute_position): Now static.
22861         (XTread_socket): Don't define label "out" unless it's used.
22862         Don't declare local "event" unless it's used.
22863         (x_iconify_frame, x_free_frame_resources): Don't declare locals
22864         unless they are used.
22865         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
22866         (x_fatal_error_signal): Remove; not used.
22867         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
22868         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
22869         (x_error_catcher, x_connection_closed, x_error_handler):
22870         (x_error_quitter, xembed_send_message, x_iconify_frame):
22871         (my_log_handler): Rename locals to avoid shadowing.
22872         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
22873         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
22875         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
22876         Rename or move locals to avoid shadowing.
22877         (tty_defined_color, merge_face_heights): Now static.
22878         (free_realized_faces_for_fontset): Remove; not used.
22879         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
22880         does not deduce is never used uninitialized.
22881         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
22882         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
22884         * terminal.c (store_terminal_param): Now static.
22886         * xmenu.c (menu_highlight_callback): Now static.
22887         (set_frame_menubar): Remove unused local.
22888         (xmenu_show): Rename parameter to avoid shadowing.
22889         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
22890         since they might point to immutable storage.
22891         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
22892         since it's unused otherwise.
22894         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
22895         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
22896         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
22897         avoids a gcc -Wuninitialized diagnostic.
22898         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
22899         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
22900         does not deduce are never used uninitialized.
22902         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
22904         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
22905         * window.c (window_loop, size_window):
22906         (run_window_configuration_change_hook, enlarge_window): Likewise.
22908         * window.c (display_buffer): Now static.
22909         (size_window): Mark variables that gcc -Wuninitialized
22910         does not deduce are never used uninitialized.
22911         * window.h (check_all_windows): New decl, to forestall
22912         gcc -Wmissing-prototypes diagnostic.
22913         * dispextern.h (bidi_dump_cached_states): Likewise.
22915         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
22916         shadowing.
22917         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
22918         Include <limits.h>.
22919         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
22920         and to avoid gcc -Wuninitialized warning.
22921         (load_charset_map): Mark variables that gcc -Wuninitialized
22922         does not deduce are never used uninitialized.
22923         (load_charset): Abort instead of using uninitialized var (Bug#8229).
22925         * coding.c (coding_set_source, coding_set_destination):
22926         Use "else { /* comment */ }" rather than "else /* comment */;"
22927         for clarity, and to avoid gcc -Wempty-body warning.
22928         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
22929         a block, when the outer 'i' will do.
22930         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
22931         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
22932         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
22933         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
22934         (Fdecode_sjis_char, Fdefine_coding_system_internal):
22935         Rename locals to avoid shadowing.
22936         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
22937         * coding.c (emacs_mule_char, encode_invocation_designation):
22938         Now static, since they're not used elsewhere.
22939         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
22940         (decode_coding_object, encode_coding_object, detect_coding_system):
22941         (decode_coding_emacs_mule): Mark variables that gcc
22942         -Wuninitialized does not deduce are never used uninitialized.
22943         (detect_coding_iso_2022): Initialize a local variable that might
22944         be used uninitialized.  Leave a FIXME because it's not clear that
22945         this initialization is needed.  (Bug#8211)
22946         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
22947         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
22948         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
22949         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
22950         Remove unused macros.
22952         * category.c (hash_get_category_set): Remove unused local var.
22953         (copy_category_table): Now static, since it's not used elsewhere.
22954         * character.c (string_count_byte8): Likewise.
22956         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
22957         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
22959         * chartab.c (copy_sub_char_table): Now static, since it's not used
22960         elsewhere.
22961         (sub_char_table_ref_and_range, char_table_ref_and_range):
22962         Rename locals to avoid shadowing.
22963         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
22965         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
22966         (BIDI_BOB): Remove unused macro.
22968         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
22969         deduce are never used uninitialized.
22970         * term.c (encode_terminal_code): Likewise.
22972         * term.c (encode_terminal_code): Now static.  Remove unused local.
22974         * tparam.h: New file.
22975         * term.c, tparam.h: Include it.
22976         * deps.mk (term.o, tparam.o): Depend on tparam.h.
22977         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
22978         Move these decls to tparam.h, and make them agree with what
22979         is actually in tparam.c.  The previous trick of using incompatible
22980         decls in different modules does not conform to the C standard.
22981         All callers of tparam changed to use tparam's actual API.
22982         * tparam.c (tparam1, tparam, tgoto):
22983         Use const pointers where appropriate.
22985         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
22986         * cm.h (struct cm): Likewise.
22987         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
22988         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
22989         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
22990         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
22991         (turn_on_face, init_tty): Likewise.
22992         * termchar.h (struct tty_display_info): Likewise.
22994         * term.c (term_mouse_position): Rename local to avoid shadowing.
22996         * alloc.c (mark_ttys): Move decl from here ...
22997         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
22999 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
23001         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23003 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
23005         * search.c (compile_pattern_1): Remove argument regp, unused since
23006         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23007         (compile_pattern): Don't pass it.
23009 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
23011         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23012         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23013         for ! HAVE_GTK3.
23014         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23016         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23018         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
23019         gdk_window_get_screen, gdk_window_get_geometry,
23020         gdk_x11_window_lookup_for_display and GDK_KEY_g.
23021         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23022         (xg_get_pixbuf_from_pixmap): New function.
23023         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23024         to Pixmap, take frame as parameter, remove GdkColormap parameter.
23025         Call xg_get_pixbuf_from_pixmap instead of
23026         gdk_pixbuf_get_from_drawable.
23027         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23028         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23029         (xg_check_special_colors): Use GtkStyleContext and its functions
23030         for HAVE_GTK3.
23031         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23032         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23033         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
23034         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23035         Call gtk_widget_get_preferred_size.
23036         (xg_frame_resized): gdk_window_get_geometry only takes 5
23037         parameters.
23038         (xg_win_to_widget, xg_event_is_for_menubar):
23039         Call gdk_x11_window_lookup_for_display.
23040         (xg_set_widget_bg): New function.
23041         (delete_cb): New function.
23042         (xg_create_frame_widgets): Connect delete-event to delete_cb.
23043         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
23044         (xg_set_background_color): Call xg_set_widget_bg.
23045         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23046         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23047         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23048         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23049         if ! HAVE_GTK3.
23050         (update_frame_tool_bar): Call gtk_widget_hide.
23051         (xg_initialize): Use GDK_KEY_g.
23053         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23054         if ! HAVE_GTK3
23055         (x_session_initialize): Call gdk_x11_set_sm_client_id.
23057         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23058         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23059         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23061 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
23063         * w32xfns.c (select_palette): Check success of RealizePalette against
23064         GDI_ERROR, not zero.
23066 See ChangeLog.11 for earlier changes.
23068 ;; Local Variables:
23069 ;; coding: utf-8
23070 ;; End:
23072   Copyright (C) 2011-2013 Free Software Foundation, Inc.
23074   This file is part of GNU Emacs.
23076   GNU Emacs is free software: you can redistribute it and/or modify
23077   it under the terms of the GNU General Public License as published by
23078   the Free Software Foundation, either version 3 of the License, or
23079   (at your option) any later version.
23081   GNU Emacs is distributed in the hope that it will be useful,
23082   but WITHOUT ANY WARRANTY; without even the implied warranty of
23083   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23084   GNU General Public License for more details.
23086   You should have received a copy of the GNU General Public License
23087   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.