aboutsummaryrefslogtreecommitdiffstats
path: root/src/ChangeLog
diff options
context:
space:
mode:
authorKenichi Handa2013-06-18 23:49:59 +0900
committerKenichi Handa2013-06-18 23:49:59 +0900
commitde86fd6193edf3e78c9b8074f9cf475b3cc560f9 (patch)
treed58ae133163d5269d73c3ce247b663ff2cd5e8d9 /src/ChangeLog
parent3c542890fe6fb88ecdca7e38c9f85e7360980110 (diff)
parent7946c240f94fb9802e89ab90d0e4c239e337f266 (diff)
downloademacs-de86fd6193edf3e78c9b8074f9cf475b3cc560f9.tar.gz
emacs-de86fd6193edf3e78c9b8074f9cf475b3cc560f9.zip
merge emacs
Diffstat (limited to 'src/ChangeLog')
-rw-r--r--src/ChangeLog22969
1 files changed, 45 insertions, 22924 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9ce8dce3604..1ecd7f159a2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -2,6 +2,50 @@
2 2
3 * font.c (Ffont_spec): Signal an error for an invalid font name. 3 * font.c (Ffont_spec): Signal an error for an invalid font name.
4 4
52013-06-18 Paul Eggert <eggert@cs.ucla.edu>
6
7 Porting fixes for merged specpdl and backtrace stacks (Bug#14643).
8 In particular this ports to 32-bit sparc Sun cc.
9 * eval.c (init_eval_once, grow_specpdl): Allocate a specbinding
10 array with a dummy element at specpdl[-1], so that its address can
11 be taken portably.
12 (unbind_to): Do not copy the binding; not needed, now that we
13 copy old_value in the one place where the copy is needed.
14 * fileio.c (Fwrite_region): Use ptrdiff_t, not int, for specpdl count.
15 * lisp.h (BITS_PER_PTRDIFF_T): Remove; no longer needed.
16 (union specbinding): Rename from struct specbinding. Redo layout
17 to avoid the need for 'ptrdiff_t nargs : BITS_PER_PTRDIFF_T - 1;',
18 which is not portable. With Sun C 5.12 32-bit sparc, the
19 declaration causes nargs to be an unsigned bitfield, a behavior
20 that the C standard allows; but Emacs wants nargs to be signed.
21 The overall type is now a union of structures rather than a
22 structure of union of structures, and the 'kind' member is now a
23 bitfield, so that the overall type doesn't grow. All uses changed.
24 * process.c (Fmake_serial_process): Remove unnecessary initialization.
25
262013-06-17 Paul Eggert <eggert@cs.ucla.edu>
27
28 * frame.c (x_report_frame_params): Cast parent_desc to uintptr_t.
29 Needed if HAVE_NTGUI. Reported by Juanma Barranquero.
30
31 * nsfont.m (ns_registry_to_script): Parenthesize while expression.
32
332013-06-17 Eli Zaretskii <eliz@gnu.org>
34
35 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
36 unless we know that the window w's frame is a frame object.
37 Another attempt at solving bug#14062 and bug#14630.
38
392013-06-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
40
41 * textprop.c (property_set_type): New enum.
42 (add_properties): Allow appending/prepending text properties.
43 (add_text_properties_1): Factored out of Fadd_text_properties.
44 (Fadd_text_properties): Moved all the code into
45 add_text_properties_1.
46 (Fadd_face_text_property): New function that calls
47 add_text_properties_1.
48
52013-06-17 Paul Eggert <eggert@cs.ucla.edu> 492013-06-17 Paul Eggert <eggert@cs.ucla.edu>
6 50
7 Move functions from lisp.h to individual modules when possible. 51 Move functions from lisp.h to individual modules when possible.
@@ -1820,22930 +1864,7 @@
1820 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin 1864 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1821 and FreeBSD now. 1865 and FreeBSD now.
1822 1866
18232013-03-11 Paul Eggert <eggert@cs.ucla.edu> 1867See ChangeLog.12 for earlier changes.
1824
1825 * insdel.c (adjust_after_replace): Use bool for boolean.
1826
18272013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1828
1829 * keyboard.c: Move keyboard decoding to read_key_sequence.
1830 (decode_keyboard_code): Remove.
1831 (tty_read_avail_input): Don't try to decode input.
1832 (read_decoded_char): New function.
1833 (read_key_sequence): Use it.
1834
18352013-03-10 Daniel Colascione <dancol@dancol.org>
1836
1837 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1838 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1839 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1840 w32fns.c.
1841
1842 * w32term.c (construct_drag_n_drop): Use the above macros to make
1843 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1844
1845 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1846 properly display non-ASCII frame titles in cygw32 builds.
1847
1848 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1849 call ShellExecute in cygw32 builds.
1850
1851 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1852 common file dialog code.
1853
1854 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1855 can just use du like other systems.
1856
1857 * coding.c (from_unicode_buffer): Declare.
1858 * coding.c (from_unicode_buffer): Implement.
1859
18602013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1861
1862 * lread.c: Minor cleanup.
1863 (FROM_FILE_P): New macro.
1864 (skip_dyn_bytes, unreadchar, read1): Use it.
1865 (read_list): Consolidate duplicated code.
1866
1867 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1868
18692013-03-10 Eli Zaretskii <eliz@gnu.org>
1870
1871 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1872 (redisplay_internal, set_cursor_from_row, try_window)
1873 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1874 (display_line, notice_overwritten_cursor)
1875 (mouse_face_from_buffer_pos, note_mouse_highlight):
1876 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1877 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1878 (mouse_face_from_string_pos, fast_find_string_pos):
1879 Use MATRIX_ROW_VPOS.
1880
1881 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1882
1883 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1884
1885 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1886 MATRIX_MODE_LINE_ROW.
1887
1888 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1889
18902013-03-10 handa <handa@gnu.org>
1891
1892 * lisp.h (adjust_after_replace): Extern it.
1893
1894 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1895 case of detection for coding_category_utf_8_auto.
1896 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1897 Skip decoding if all bytes are ASCII.
1898
1899 * insdel.c (adjust_after_replace): Make it public. New arg
1900 text_at_gap_tail.
1901 (adjust_after_insert): Call adjust_after_replace with the new arg
1902 value 0.
1903
19042013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1905
1906 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1907 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1908 from Elisp via unread-command-events.
1909
1910 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1911 functions to mean "no change".
1912
19132013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1914
1915 region-cache.c, scroll.c, search.c: Use bool for booleans.
1916 * lisp.h (compile_pattern):
1917 * scroll.c (do_scrolling, do_direct_scrolling):
1918 * search.c (struct regexp_cache, compile_pattern_1)
1919 (compile_pattern, string_match_1, search_command)
1920 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1921 (search_regs_saved, Fregexp_quote):
1922 Use bool for boolean.
1923 * region-cache.c (region_cache_forward, region_cache_backward):
1924 Fix comments to match code: these functions return int, not boolean.
1925
19262013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1927
1928 * search.c (find_newline): Accept start and end byte positions
1929 as arguments and allow -1 if not known.
1930 (find_newline_no_quit): Likewise for start position.
1931 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1932 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1933 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1934 * editfns.c (Fconstrain_to_field): Break long line.
1935 Adjust call to find_newline.
1936 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1937 Use DEC_BOTH to start next search from the previous buffer
1938 position, where appropriate.
1939 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1940 (get_visually_first_element, move_it_vertically_backward): Likewise.
1941 Obtain byte position from the display iterator, where appropriate.
1942
19432013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1944
1945 print.c, process.c: Use bool for booleans.
1946 * lisp.h (wait_reading_process_output):
1947 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1948 (strout, debug_output_compilation_hack, float_to_string, print)
1949 (print_object):
1950 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1951 (decode_status, status_message, create_process, create_pty)
1952 (Fmake_network_process, Fnetwork_interface_info)
1953 (wait_reading_process_output, read_process_output)
1954 (write_queue_push, write_queue_pop, process_send_signal)
1955 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1956 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1957 Use bool for booleans.
1958 * process.c (Fnetwork_interface_list): Remove unused local.
1959 (connect_counter): Now EMACS_INT, not int.
1960
19612013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1962
1963 * bidi.c (bidi_fetch_char): Swap first and second arguments
1964 to match other functions accepting character and byte positions.
1965 Adjust comment.
1966 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1967 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1968 when you need just to move to the previous buffer position.
1969 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1970
19712013-03-07 Eli Zaretskii <eliz@gnu.org>
1972
1973 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1974
19752013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1976
1977 Avoid character to byte conversions in motion subroutines.
1978 * indent.h (compute_motion, vmotion): Add byte position argument.
1979 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1980 Add eassert.
1981 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1982 Use list5 for return value.
1983 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1984 Adjust comments, style and calls to compute_motion.
1985 (Fvertical_motion): Adjust call to vmotion.
1986 * window.c (Fdelete_other_windows_internal): Record window start
1987 byte position and adjust call to vmotion.
1988 (window_scroll_line_based): Likewise with call to compute_motion.
1989 Use SET_PT_BOTH.
1990 (Frecenter): Adjust calls to vmotion.
1991
19922013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1993
1994 * lisp.h (list2i, list3i): New functions.
1995 (list4i): Move from window.c and make LISP_INLINE.
1996 * editfns.c (make_lisp_time):
1997 * fns.c (Flocale_info):
1998 * keyboard.c (parse_modifiers):
1999 * xterm.c (x_ewmh_activate_frame): Use list2i.
2000 * instel.c (signal_after_change):
2001 * nsfns.m (Fx_server_version, Fxw_color_values):
2002 * w32fns.c (Fxw_color_values, Fx_server_version):
2003 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
2004 * fileio.c (Fvisited_file_modtime):
2005 * nsfns.m (Fns_display_usable_bounds):
2006 * w32.c (ltime): Use list4i.
2007
20082013-03-06 Eli Zaretskii <eliz@gnu.org>
2009
2010 * search.c (find_newline_no_quit): Rename from find_next_newline.
2011 Add commentary.
2012
2013 * lisp.h (find_newline_no_quit): Rename prototype.
2014
2015 * xdisp.c (back_to_previous_line_start)
2016 (forward_to_next_line_start, get_visually_first_element)
2017 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
2018 * indent.c (vmotion): Callers of find_newline_no_quit changed.
2019 * bidi.c (bidi_find_paragraph_start): Callers of
2020 find_newline_no_quit changed.
2021
2022 * msdos.c: Change encoding to cp850. (Bug#13879)
2023 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
2024
20252013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
2026
2027 Coding system support cleanup and minor refactoring.
2028 * coding.h (enum coding_result_code): Remove
2029 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
2030 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
2031 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
2032 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
2033 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
2034 (decode_coding_region, encode_coding_region, decode_coding_string):
2035 Remove unused compatibility macros.
2036 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
2037 (record_conversion_result): Adjust user.
2038 (syms_of_coding): Likewise.
2039 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
2040 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
2041 (decode_coding_object): Simplify since xrealloc never returns NULL.
2042 Add eassert.
2043
20442013-03-06 Paul Eggert <eggert@cs.ucla.edu>
2045
2046 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
2047 * sysdep.c (list_system_processes)
2048 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
2049 Make it a stub in this case; otherwise the build might fail,
2050 and this code hasn't been tested on such hosts anyway.
2051 Problem reported by Nelson H. F. Beebe in
2052 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
2053 and analyzed by Jérémie Courrèges-Anglas in
2054 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
2055
20562013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
2057
2058 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
2059 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
2060 (get_visually_first_element, move_it_vertically_backward): Ajust users.
2061 * bidi.c (bidi_find_paragraph_start): Likewise.
2062 * indent.c (vmotion): Likewise.
2063
20642013-03-05 Paul Eggert <eggert@cs.ucla.edu>
2065
2066 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
2067 * filelock.c: Include <c-ctype.h>.
2068 (MAX_LFINFO): New top-level constant.
2069 (lock_info_type): Remove members pid, boot_time. Add members at,
2070 dot, colon. Change user member to be the entire buffer, not a
2071 pointer. This allows us to handle the case where a foreign
2072 pid or boot time exceeds the local range. All uses changed.
2073 (LINKS_MIGHT_NOT_WORK): New constant.
2074 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
2075 (defined_WINDOWSNT): Remove.
2076 (MAKE_LOCK_NAME, file_in_lock_file_name):
2077 Always use .#FILE (not .#-FILE) for the file lock,
2078 even if it is a regular file.
2079 (rename_lock_file): New function.
2080 (create_lock_file): Use it.
2081 (create_lock_file, read_lock_data):
2082 Prefer a symbolic link for the lock file, falling back on a
2083 regular file if symlinks don't work. Do not try to create
2084 symlinks on MS-Windows, due to security hassles. Stick with
2085 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
2086 link, rename, unlink, mkstemp) when creating locks, as a GNUish
2087 host may be using a Windowsish file system, and cannot use
2088 MS-Windows-only system calls. Fall back on mktemp if mkstemp
2089 doesn't work. Don't fail merely because of a symlink-contents
2090 length limit in the current file system; fall back on regular
2091 files. Increase the symlink contents length limit to 8 KiB, this
2092 should be big enough for any real use and doesn't crunch the
2093 stack.
2094 (create_lock_file, lock_file_1, read_lock_data):
2095 Simplify allocation of lock file buffers now that they fit in 8 KiB.
2096 (lock_file_1): Return error number, not bool. All callers changed.
2097 (ELOOP): New macro, if not already defined.
2098 (read_lock_data): Return size of lock file contents, not Lisp object.
2099 All callers changed. Handle a race condition if some other process
2100 replaces a regular-file lock with a symlink lock or vice versa,
2101 while we're trying to read the lock.
2102 (current_lock_owner): Parse contents more carefully, to help avoid
2103 confusing a regular-file lock with some other application's use
2104 of the file. Check for lock file contents being too long, or
2105 not parsing correctly.
2106 (current_lock_owner, lock_file):
2107 Allow foreign pid and boot times that exceed the local range.
2108 (current_lock_owner, lock_if_free, lock_file):
2109 Simplify allocation of lock file contents.
2110 * w32.c (sys_rename_replace): New function, containing most of
2111 the contents of the old sys_rename.
2112 (sys_rename): Use it.
2113 (fchmod): New dummy function.
2114 * w32.h (sys_rename_replace, fchmod): New decls.
2115
21162013-03-05 Eli Zaretskii <eliz@gnu.org>
2117
2118 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
2119 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
2120 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
2121 <dmantipov@yandex.ru>.
2122
21232013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
2124
2125 * composite.c (get_composition_id, fill_gstring_header):
2126 Use make_uninit_vector where appropriate.
2127 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
2128 * xselect.c (clean_local_selection_data): Likewise.
2129
21302013-03-04 Paul Eggert <eggert@cs.ucla.edu>
2131
2132 Fix misuse of ImageMagick that caused core dump (Bug#13846).
2133 * image.c (imagemagick_load_image): Calculate height and width
2134 after flattening the image, not before.
2135
21362013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
2137
2138 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
2139 * ftfont.c (ftfont_shape_by_flt): Likewise.
2140 * w32uniscribe.c (uniscribe_shape): Likewise.
2141
21422013-03-02 Paul Eggert <eggert@cs.ucla.edu>
2143
2144 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
2145 The old approach, which fell back on DIR/.#FILE.0 through
2146 DIR/.#FILE.9, had race conditions that could not be easily fixed.
2147 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
2148 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
2149 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
2150 because the locking mechanism was never reliable in that case).
2151 This patch fixes this and other bugs discovered by a code
2152 inspection that was prompted by
2153 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
2154 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
2155 to avoid interoperability problems between the MS-Windows and
2156 non-MS-Windows implementations. MS-Windows and non-MS-Windows
2157 instances of Emacs now ignore each others' locks.
2158 * filelock.c (defined_WINDOWSNT): New constant.
2159 (MAKE_LOCK_NAME, fill_in_lock_file_name):
2160 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
2161 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
2162 regular files on MS-Windows hosts.
2163 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
2164 Use SAFE_ALLOCA to avoid problems with long file names.
2165 (MAX_LFINFO): Now a local constant, not a global macro.
2166 (IS_LOCK_FILE): Remove.
2167 (lock_file_1): Don't inspect errno if symlink call succeeds;
2168 that's not portable.
2169 (lock_file): Document that this function can return if lock
2170 creation fails.
2171 (lock_file): Don't access freed storage.
2172
21732013-03-02 Andreas Schwab <schwab@linux-m68k.org>
2174
2175 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
2176
21772013-03-02 Paul Eggert <eggert@cs.ucla.edu>
2178
2179 * textprop.c: Use bool for booleans.
2180 (validate_interval_range, Fadd_text_properties)
2181 (Fremove_text_properties): Prefer bool to int when either works.
2182
21832013-03-02 Eli Zaretskii <eliz@gnu.org>
2184
2185 * textprop.c (Fadd_text_properties, Fremove_text_properties):
2186 If the interval tree changes as a side effect of calling
2187 modify_region, re-do processing starting from the call to
2188 validate_interval_range. (Bug#13743)
2189
21902013-02-28 Eli Zaretskii <eliz@gnu.org>
2191
2192 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
2193 (Bug#13546).
2194
21952013-02-27 Eli Zaretskii <eliz@gnu.org>
2196
2197 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
2198 _SH_DENYRW flag, instead of emacs_open, to deny any other process
2199 access to the lock file until it is written and closed.
2200 (Bug#13807)
2201
22022013-02-27 Paul Eggert <eggert@cs.ucla.edu>
2203
2204 * callint.c (Qcall_interactively):
2205 * macros.c (Qexecute_kbd_macro):
2206 Now static.
2207
22082013-02-26 Bastien Guerry <bzg@gnu.org>
2209
2210 * window.c (Frecenter): Tiny docstring enhancement.
2211
22122013-02-26 Paul Eggert <eggert@cs.ucla.edu>
2213
2214 Minor textprop integer cleanup.
2215 * intervals.h, textprop.c (add_text_properties_from_list):
2216 Return void, not int, since nobody uses the return value.
2217 * textprop.c (validate_plist, add_properties, remove_properties)
2218 (Fadd_text_properties):
2219 Don't assume list length fits in int.
2220 (interval_has_all_properties, interval_has_some_properties)
2221 (interval_has_some_properties_list, add_properties, remove_properties)
2222 (Fadd_text_properties, Fremove_text_properties)
2223 (Fremove_list_of_text_properties, text_property_stickiness):
2224 Use bool for booleans.
2225 (Fadd_text_properties, Fremove_text_properties):
2226 (Fremove_list_of_text_properties):
2227 Reindent do-while as per GNU style.
2228
22292013-02-25 Eli Zaretskii <eliz@gnu.org>
2230
2231 Implement CLASH_DETECTION for MS-Windows.
2232
2233 * filelock.c [WINDOWSNT]: Include w32.h.
2234 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
2235 function of that name. Up-case the macro arguments.
2236 (IS_LOCK_FILE): New macro.
2237 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
2238 (create_lock_file): New function, with body extracted from
2239 lock_file_1.
2240 [WINDOWSNT]: Implement lock files by writing a regular file with
2241 the lock information as its contents.
2242 (read_lock_data): New function, on Posix platforms just calls
2243 emacs_readlinkat.
2244 [WINDOWSNT]: Read the lock info from the file.
2245 (current_lock_owner): Call read_lock_data instead of calling
2246 emacs_readlinkat directly.
2247 (lock_file) [WINDOWSNT]: Run the file name through
2248 dostounix_filename.
2249
2250 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
2251 just check if the process by that PID exists.
2252
2253 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
2254 also present, as doing so will fail to error out if the file
2255 already exists.
2256
2257 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
2258
2259 * textprop.c (Fadd_text_properties, Fremove_text_properties)
2260 (Fremove_list_of_text_properties): Skip all of the intervals in
2261 the region between START and END that already have resp. don't
2262 have the requested properties, not just the first one.
2263 Add assertions that the loop afterwards always modifies the
2264 properties. (Bug#13743)
2265
22662013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
2267
2268 * callint.c (Fcall_interactively): Use the right lexical environment
2269 for `interactive' specs (bug#13811).
2270 * eval.c (Feval): Accept a lexical environment.
2271
22722013-02-25 Paul Eggert <eggert@cs.ucla.edu>
2273
2274 Simplify data_start configuration (Bug#13783).
2275 This is a followon simplification to the fix for Bug#13650.
2276 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
2277 (START_FILES): Remove. All uses removed.
2278 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
2279 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
2280 (buildobj.h): Use it.
2281 ($(ALLOBJS)): Depend on globals.h.
2282 (temacs$(EXEEXT)): Use $(ALLOBJS).
2283 * autodeps.mk (ALLOBJS): Move to Makefile.in.
2284 * deps.mk (vm-limit.o):
2285 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
2286 Do not depend on mem-limits.h.
2287 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
2288 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
2289 [__GNUC__ && !ORDINARY_LINK]: Remove.
2290 * mem-limits.h, pre-crt0.c: Remove.
2291 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
2292 * unexcoff.c (etext): New decl.
2293 (make_hdr): Use DATA_START instead of start_of_data.
2294 * vm-limit.c: Move most of mem-limits.h's contents here.
2295 (data_start): New decl. It's OK if this is approximate,
2296 so simplify-away some unnecessary exactness.
2297 (POINTER): Remove; all uses removed.
2298 (data_space_start): Now char *, to avoid casts.
2299 (exceeds_lisp_ptr): New function, replacing the old
2300 EXCEEDS_LISP_PTR macro. All uses changed.
2301 (check_memory_limits): Simplify and remove casts.
2302 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
2303 (memory_warnings): Use data_start instead of start_of_data.
2304
23052013-02-24 Andreas Schwab <schwab@linux-m68k.org>
2306
2307 * xdisp.c (set_message): Only check for debug-on-message if STRING
2308 is a string. (Bug#13797)
2309
23102013-02-24 Paul Eggert <eggert@cs.ucla.edu>
2311
2312 Fix regression introduced by July 10 filelock.c patch.
2313 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
2314 2012-07-10 patch to this file. Reported by Eli Zaretskii in
2315 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
2316 and diagnosed by Andreas Schwab in
2317 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
2318
23192013-02-22 Paul Eggert <eggert@cs.ucla.edu>
2320
2321 Assume C89 or better.
2322 * ralloc.c (SIZE, POINTER, NIL):
2323 * vm-limit.c (POINTER):
2324 Remove, replacing all uses with C89 equivalents. These old
2325 symbols were present only for porting to pre-C89 platforms.
2326
23272013-02-22 Claudio Bley <claudio.bley@gmail.com>
2328
2329 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
2330 This avoids warning messages reported as part of Bug#13546.
2331
23322013-02-21 Ken Brown <kbrown@cornell.edu>
2333
2334 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
2335
23362013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2337
2338 * sheap.c (report_sheap_usage): Prefer message1_nolog.
2339
2340 * keyboard.c (Qcommand_execute): New var.
2341 (command_loop_1, read_char): Use it.
2342 (Fcommand_execute): Remove, replace by an Elisp implementation.
2343 (syms_of_keyboard): Adjust accordingly.
2344
23452013-02-19 Daniel Colascione <dancol@dancol.org>
2346
2347 * sheap.c (report_sheap_usage): Use message, not message1, so
2348 that we don't try to create a buffer while we're in the middle
2349 of dumping Emacs. Explain why.
2350
23512013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
2352
2353 * search.c (find_newline): Return byte position in bytepos.
2354 Adjust comment.
2355 (find_next_newline_no_quit, find_before_next_newline):
2356 Add bytepos argument.
2357 * lisp.h (find_newline, find_next_newline_no_quit)
2358 (find_before_next_newline): Adjust prototypes.
2359 * bidi.c (bidi_find_paragraph_start):
2360 * editfns.c (Fconstrain_to_field, Fline_end_position):
2361 * indent.c (compute_motion, vmotion):
2362 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2363 (get_visually_first_element, move_it_vertically_backward):
2364 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2365
23662013-02-19 Eli Zaretskii <eliz@gnu.org>
2367
2368 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2369 resources were not orderly released.
2370
23712013-02-17 Eli Zaretskii <eliz@gnu.org>
2372
2373 * xdisp.c (x_draw_vertical_border): For a window that is neither
2374 the leftmost nor the rightmost, redraw both the left and the right
2375 vertical borders. (Bug#13723)
2376
23772013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2378
2379 * xml.c (init_libxml2_functions):
2380 * sound.c (sound_warning):
2381 * sheap.c (report_sheap_usage):
2382 * process.c (wait_reading_process_output):
2383 * msdos.c (XMenuActivate):
2384 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2385 * keyboard.c (top_level_1):
2386 * editfns.c (Fmessage, Fmessage_box):
2387 * callint.c (Fcall_interactively):
2388 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2389
23902013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2391
2392 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
2393 * frame.c (syms_of_frame): ... to here.
2394
23952013-02-16 Eli Zaretskii <eliz@gnu.org>
2396
2397 * w32.c (sys_chown): Remove unused function.
2398
2399 * w32term.c <input_signal_count>: Declare 'volatile'
2400 unconditionally. (Bug#9066)
2401
2402 * w32.c (set_errno): Reset h_errno and don't set it to any other
2403 value. Set errno instead.
2404 (check_errno): Reset h_errno.
2405 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2406 (sys_gethostname, sys_getservbyname, sys_getpeername)
2407 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2408 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2409 h_errno.
2410 (sys_gethostbyname): Set h_errno only errors detected.
2411
24122013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2413
2414 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2415
24162013-02-15 Eli Zaretskii <eliz@gnu.org>
2417
2418 * keyboard.c (read_char): Fix calculation of auto-save time out
2419 when auto-save-timeout is less than 4. (Bug#13720)
2420
2421 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
2422 time. Improve diagnostics in DebPrint. (Bug#13546)
2423
2424 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2425 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2426 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2427 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2428 make sure errno is set to an appropriate value. (Bug#13546)
2429 (socket_to_fd): Add assertion against indexing fd_info[] with a
2430 value that is out of bounds.
2431 (sys_accept): If fd is negative, do not set up the child_process
2432 structure for reading.
2433
24342013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2435
2436 * composite.c (fill_gstring_header): Remove useless prototype.
2437 Break long line.
2438 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2439 * print.c (PRINTDECLARE, print_object):
2440 * search.c (compile_pattern, fast_looking_at, search_buffer):
2441 (simple_search, boyer_moore, Freplace_match):
2442 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2443 (get_overlay_arrow_glyph_row, display_mode_element):
2444 (decode_mode_spec_coding, message3):
2445 * xfaces.c (face_at_string_position): Use bool for booleans.
2446 Adjust comments.
2447
24482013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2449
2450 Fix AIX port (Bug#13650).
2451 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2452 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2453 was #undeffed earlier, so it cannot be used as a macro here.
2454 Use the constant and not the macro.
2455
24562013-02-15 Eli Zaretskii <eliz@gnu.org>
2457
2458 * w32proc.c (new_child): If no vacant slots are found in
2459 child_procs[], make another pass looking for slots whose process
2460 has exited or died. (Bug#13546)
2461
2462 * w32.c (sys_pipe): When failing due to file descriptors above
2463 MAXDESC, set errno to EMFILE.
2464 (_sys_read_ahead): Update cp->status when failing to read serial
2465 communications input, so that the status doesn't stay at
2466 STATUS_READ_IN_PROGRESS. (Bug#13546)
2467
24682013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2469
2470 * gtkutil.c (tb_size_cb): New function.
2471 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2472
24732013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2474
2475 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2476 an event.
2477
24782013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2479
2480 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2481
24822013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2483
2484 * font.c (font_range): Add pos_byte argument. Adjust comment
2485 and break long line.
2486 * font.h (font_range): Adjust prototype.
2487 * composite.c (autocmp_chars): Pass byte position to font_range.
2488 Break long line. Remove useless prototype and format comment.
2489
24902013-02-13 Glenn Morris <rgm@gnu.org>
2491
2492 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2493
24942013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2495
2496 Improve AIX port some more (Bug#13650).
2497 With this, it should be as good as it was in 23.3, though it's
2498 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2499 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2500 * unexaix.c (start_of_text): Remove.
2501 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2502 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2503 (orig_load_scnptr, orig_data_scnptr):
2504 Now off_t, not long, since they are file offsets.
2505 (make_hdr): Use _data, not start_of_data ().
2506 This is the key part of the fix.
2507 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2508 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2509
2510 * pre-crt0.c (data_start): Initialize to 1.
2511 This ports to compilers that optimize the external declaration
2512 'int x = 0;' as if it were 'int x;' to shrink the executable.
2513
2514 Improve AIX port (Bug#13650).
2515 This doesn't fix the bug, but it makes progress: Emacs builds now.
2516 * unexaix.c: Include inttypes.h, stdarg.h.
2517 (report_error, report_error_1): Mark as _Noreturn.
2518 (report_error): Don't report the wrong errno.
2519 (report_error_1): Now varargs. All callers changed.
2520 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2521 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2522 (write_ptr): Use %p to print address rather than %lx and a cast
2523 to unsigned long. Grow buffer a bit, to be safer.
2524
25252013-02-13 Eli Zaretskii <eliz@gnu.org>
2526
2527 * bidi.c (bidi_resolve_neutral): After finding the next
2528 non-neutral character, accept NEUTRAL_ON type as well, because
2529 directional control characters, such as LRE and RLE, have their
2530 type converted to that by bidi_resolve_weak. This avoids aborts
2531 when LRE/RLE follows a run of neutrals.
2532 (bidi_move_to_visually_next): Assert that return value of
2533 bidi_peek_at_next_level is non-negative. Negative values will
2534 cause an infloop.
2535
25362013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2537
2538 Minor getenv-related fixes.
2539 * callproc.c (Fcall_process_region) [!DOS_NT]:
2540 Avoid unnecessary duplicate call to getenv.
2541 * callproc.c (init_callproc):
2542 * dispnew.c (init_display):
2543 * sysdep.c (sys_subshell):
2544 Omit unnecessary cast of getenv or egetenv.
2545
25462013-02-13 Juanma Barranquero <lekktu@gmail.com>
2547
2548 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2549 Update dependencies.
2550
25512013-02-12 Eli Zaretskii <eliz@gnu.org>
2552
2553 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2554 marker's position.
2555 (display_line): Set w->region_showing to the value of
2556 it->region_beg_charpos, not to -1. This fixes redisplay
2557 optimization when cursor is moved up after M->. (Bug#13623)
2558 (Bug#13626)
2559 (try_scrolling): Scroll text up more if point is too close to ZV
2560 and inside the scroll margin. This makes sure point is moved
2561 outside the scroll margin in these cases.
2562
2563 * window.h (struct window): region_showing can no longer be
2564 negative.
2565
25662013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2567
2568 Tune by using memchr and memrchr.
2569 * doc.c (Fsnarf_documentation):
2570 * fileio.c (Fsubstitute_in_file_name):
2571 * search.c (find_newline, scan_newline):
2572 * xdisp.c (pos_visible_p, display_count_lines):
2573 Use memchr and memrchr rather than scanning byte-by-byte.
2574 * search.c (find_newline): Rename from scan_buffer.
2575 Omit first arg TARGET, as it's always '\n'. All callers changed.
2576
2577 Clean up read_key_sequence a tiny bit more.
2578 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2579 (read_key_sequence): Remove unused locals.
2580
25812013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2582
2583 Clean up read_key_sequence a bit; reread active keymaps after first event.
2584 * keyboard.c (read_char, read_char_x_menu_prompt)
2585 (read_char_minibuf_menu_prompt):
2586 Replace nmaps+maps with a single `map' arg.
2587 (follow_key): Operate on a single map.
2588 (active_maps): New function.
2589 (test_undefined): Also return true for nil bindings.
2590 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2591 a single (composed) keymap. Remember `first_event' to choose the right
2592 set of active keymaps. Recompute the set of keymaps after receiving
2593 the first event. Remove GOBBLE_FIRST_EVENT.
2594 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2595 * keyboard.h (read_char): Update declaration.
2596 * lread.c (read_filtered_event): Adjust call to read_char.
2597
25982013-02-11 Eli Zaretskii <eliz@gnu.org>
2599
2600 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2601 Don't use the limitation on backwards movement when lines are truncated
2602 in the window. (Bug#13675)
2603
26042013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2605
2606 * marker.c (set_marker_internal): If desired position is passed
2607 as a marker, avoid call to buf_charpos_to_bytepos.
2608 * window.c (Fset_window_point): Omit redundant type checking.
2609 (Fset_window_start): Likewise. Format comment.
2610 (window_scroll_pixel_based): Use set_marker_restricted_both
2611 with character and byte positions obtained from an iterator.
2612 (Fset_window_configuration): Use set_marker_restricted_both.
2613 * xdisp.c (message_dolog): Likewise.
2614
26152013-02-10 Eli Zaretskii <eliz@gnu.org>
2616
2617 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2618 When text lines are longer than window's screen lines, don't move back
2619 too far. This speeds up some redisplay operations. (Bug#13675)
2620
26212013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2622
2623 * syntax.c (scan_sexps_forward): Fix byte position calculation
2624 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2625
26262013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2627
2628 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2629 that was not needed.
2630
26312013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2632
2633 Minor hashing refactoring.
2634 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2635 (sxhash_float): Return EMACS_UINT, for consistency with the other
2636 hash functions.
2637 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2638 non-static inline function and therefore can't use static vars.
2639 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2640 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2641 with the other hash functions.
2642
26432013-02-09 Eli Zaretskii <eliz@gnu.org>
2644
2645 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2646 XXXXXX part of the temporary file pattern is not downcased even
2647 when w32-downcase-file-names is non-nil. (Bug#13661)
2648
2649 * xdisp.c (decode_mode_spec): Remove handling of %t.
2650
2651 * msdos.c (careadlinkatcwd): Remove.
2652
26532013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2654
2655 * lread.c (skip_dyn_bytes): New function (bug#12598).
2656 (read1): Use it. Use getc instead of READCHAR to read bytes.
2657 (load_each_byte): Remove. Update users.
2658
26592013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2660
2661 * search.c (scan_buffer): Calculate end byte position just once.
2662 (scan_newline): Do not recalculate start_byte.
2663 (search_command): Use eassert.
2664 * syntax.c (struct lisp_parse_state): New member location_byte.
2665 (scan_sexps_forward): Record from_byte and avoid redundant
2666 character to byte position calculation ...
2667 (Fparse_partial_sexp): ... here. Break too long line.
2668
26692013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2670
2671 * lisp.h (make_uninit_vector): New function.
2672 * alloc.c (Fvector, Fmake_byte_code):
2673 * ccl.c (Fregister_ccl_program):
2674 * charset.c (Fdefine_charset_internal, define_charset_internal):
2675 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2676 * composite.c (syms_of_composite):
2677 * font.c (Fquery_font, Ffont_info, syms_of_font):
2678 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2679 * ftfont.c (ftfont_shape_by_flt):
2680 * indent.c (recompute_width_table):
2681 * nsselect.m (clean_local_selection_data):
2682 * syntax.c (init_syntax_once):
2683 * w32unsubscribe.c (uniscribe_shape):
2684 * window.c (Fcurrent_window_configuration):
2685 * xfaces.c (Fx_family_fonts):
2686 * xselect.c (selection_data_to_lisp_data): Use it.
2687
26882013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2689
2690 * coding.c (Fdefine_coding_system_internal): Use AREF where
2691 argument is known to be a vector.
2692 * fns.c (Flocale_info): Likewise for ASET.
2693 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2694 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2695
26962013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2697
2698 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2699 height.
2700
2701 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2702 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2703 updateCollectionBehaviour.
2704
2705 * nsterm.m (NEW_STYLE_FS): Remove.
2706 (ns_last_use_native_fullscreen): New variable.
2707 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2708 (x_set_window_size): Do not take title bar and tool bar into account
2709 if isFullscreen returns YES.
2710 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2711 (check_native_fs): New function.
2712 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2713 (ns_term_init): Remove NEW_STYLE_FS.
2714 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2715 and tool bar if isFullscreen returns NO.
2716 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2717 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2718 with HAVE_NATIVE_FS.
2719 (window:willUseFullScreenPresentationOptions:): New method.
2720 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2721 Hide toolbar if not enabled (Bug#13444).
2722 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2723 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2724 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2725 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2726 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2727 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2728 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2729 (syms_of_nsterm): Add ns-use-native-fullscreen.
2730
27312013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2732
2733 * fileio.c (Qchoose_write_coding_system): Now static.
2734
27352013-02-04 Eli Zaretskii <eliz@gnu.org>
2736
2737 * xdisp.c (window_buffer_changed): region_showing can be negative,
2738 which still means region is being displayed.
2739 (redisplay_internal): Resurrect code that forced redisplay of the
2740 whole window when showing region and the mark has changed.
2741 Record the new mark position to allow redisplay optimizations.
2742 (display_line): If it->region_beg_charpos is non-zero, set the
2743 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2744
2745 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2746 not bitfield of 1 bit.
2747
27482013-02-03 Daniel Colascione <dancol@dancol.org>
2749
2750 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2751 daemon mode works on cygw32 when Emacs is installed and not just
2752 during development.
2753
27542013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2755
2756 Avoid file time stamp bug on MS-Windows (Bug#13149).
2757 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2758 as FAT32 doesn't update time stamps when truncating them.
2759 Also, check that a file time stamp is not a multiple of 100 ns;
2760 this should catch all instances of the problem on MS-Windows,
2761 as its native file system resolution is 100 ns or worse, and
2762 checking for a non-multiple of 100 ns should impose only a small
2763 overhead on systems with ns resolution.
2764
27652013-02-02 Eli Zaretskii <eliz@gnu.org>
2766
2767 Avoid encoding file names on MS-Windows when they need to be run
2768 through dostounix_filename.
2769 * w32.c (normalize_filename): Accept an additional argument
2770 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2771 downcase it even if w32-downcase-file-names is non-nil.
2772 (dostounix_filename): Accept an additional argument MULTIBYTE and
2773 pass it to normalize_filename.
2774 (emacs_root_dir): Adjust.
2775
2776 * msdos.h (dostounix_filename): Adjust prototype.
2777
2778 * w32.h (dostounix_filename): Adjust prototype.
2779
2780 * msdos.c (dostounix_filename): Accept an additional argument and
2781 ignore it.
2782 (init_environment): Adjust callers of dostounix_filename.
2783
2784 * fileio.c (Ffile_name_directory, file_name_as_directory)
2785 (directory_file_name, Fexpand_file_name)
2786 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2787 dostounix_filename.
2788 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2789 non-nil.
2790 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2791 variables, as egetenv is case-insensitive for DOS_NT.
2792
2793 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2794 with an encoded file name.
2795
2796 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2797 Adjust calls to dostounix_filename.
2798
2799 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2800
2801 * unexw32.c (unexec): Adjust call to dostounix_filename.
2802
2803 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2804
2805 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2806 dostounix_filename.
2807
2808 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2809 dostounix_filename.
2810
2811 * callproc.c (Fcall_process): Make sure program name in PATH and
2812 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2813 is passed to exec/spawnve, which fails unless the file-name
2814 encoding is UTF-8.
2815
2816 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2817 even if w32-quote-process-args is nil.
2818
28192013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2820
2821 Fix timestamp bug when write-region appends nothing (Bug#13149).
2822 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2823 the file's time stamp doesn't change if Emacs happens to write nothing
2824 to the file, and on a buggy file system this could cause Emacs to
2825 incorrectly infer that the file system doesn't have the bug.
2826 Avoid this problem by inhibiting the inference in this case.
2827
28282013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2829
2830 * window.h (struct window): Convert base_line_number, base_line_pos
2831 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2832 Convert region_showing member from Lisp_Object to bitfield.
2833 Remove sequence_number member. Adjust comments.
2834 * window.c (sequence_number): Remove.
2835 (make_window): Initialize column_number_displayed.
2836 * print.c (print_object): Follow the printed representation of
2837 frames and print window pointer to distinguish between windows.
2838 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2839 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2840 (wset_column_number_displayed, wset_region_showing): Remove.
2841 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2842 (try_scrolling, try_cursor_movement, redisplay_window)
2843 (try_window_reusing_current_matrix, try_window_id, display_line)
2844 (display_mode_lines, decode_mode_spec): Adjust users.
2845 * .gdbinit (pwinx): Do not print sequence_number.
2846
28472013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2848
2849 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2850 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2851 * dired.c: Include <fcntl.h>.
2852 (open_directory): New function, which uses open and fdopendir
2853 rather than opendir. DOS_NT platforms still use opendir, though.
2854 (directory_files_internal, file_name_completion): Use it.
2855 (file_attributes): New function, with most of the old Ffile_attributes.
2856 (directory_files_internal, Ffile_attributes): Use it.
2857 (file_attributes, file_name_completion_stat): First arg is now fd,
2858 not dir name. All uses changed. Use fstatat rather than lstat +
2859 stat.
2860 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2861 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2862 (emacs_readlinkat): New function, with much of the old
2863 Ffile_symlink_p, but with an fd argument for speed.
2864 It uses readlinkat rather than careadlinkatcwd, so that it
2865 need not assume the working directory.
2866 (Ffile_symlink_p): Use it.
2867 * filelock.c (current_lock_owner): Use emacs_readlinkat
2868 rather than emacs_readlink.
2869 * lisp.h (emacs_readlinkat): New decl.
2870 (READLINK_BUFSIZE, emacs_readlink): Remove.
2871 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2872 (emacs_norealloc_allocator, emacs_readlink): Remove.
2873 This stuff is moved to fileio.c.
2874 * w32.c (fstatat, readlinkat): New functions.
2875 (careadlinkat): Don't check that fd == AT_FDCWD.
2876 (careadlinkatcwd): Remove; no longer needed.
2877
28782013-01-31 Glenn Morris <rgm@gnu.org>
2879
2880 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2881 (Fwrite_region): Update for new choose_write_coding_system args.
2882 Move the last piece of choose_write_coding_system here. (Bug#13522)
2883 (syms_of_fileio): Add choose-write-coding-system.
2884
28852013-01-30 Eli Zaretskii <eliz@gnu.org>
2886
2887 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2888 (sys_close): Zero out the flags for the file descriptor before
2889 closing it. (Bug#13546)
2890
2891 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2892 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2893 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2894 DBCS. (Bug#13553)
2895
2896 * w32.c (w32_get_long_filename, init_environment, readlink):
2897 Support file names encoded in DBCS codepages.
2898 (readlink): Use the current file-name-coding-system, not the ANSI
2899 codepage, to decode and handle targets of symlinks.
2900
29012013-01-28 Eli Zaretskii <eliz@gnu.org>
2902
2903 * w32.c (opendir): Now accepts a 'const char *'.
2904
29052013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2906
2907 Remove obsolete redisplay code. See the discussion at
2908 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2909 * dispnew.c (preemption_period, preemption_next_check): Remove.
2910 (Vredisplay_preemption_period): Likewise.
2911 (update_frame, update_single_window, update_window, update_frame_1):
2912 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2913 used, following the 2012-06-22 change.
2914
29152013-01-25 Eli Zaretskii <eliz@gnu.org>
2916
2917 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2918
29192013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2920
2921 * font.c (num_fonts): Remove the leftover from old
2922 debugging code. Adjust comment style here and there.
2923 * insdel.c (insert_1): Remove.
2924 * lisp.h (insert_1): Remove prototype.
2925 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2926
29272013-01-25 Eli Zaretskii <eliz@gnu.org>
2928
2929 * w32.c (max_filename_mbslen): New function.
2930 (normalize_filename, readdir): Use it to detect locales where ANSI
2931 encoding of file names uses a double-byte character set (DBCS).
2932 If a DBCS encoding is used, advance by characters using
2933 CharNextExA, instead of incrementing a 'char *' pointer.
2934 Use _mbslwr instead of _strlwr. (Bug#13515)
2935
2936 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2937 request of memory reservation to 1.7GB. (Bug#13065)
2938
29392013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2940
2941 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2942 at check_extra_latin label. (Bug#13505)
2943
29442013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2945
2946 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2947 Avoid redundant calls to strlen.
2948
29492013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2950
2951 Drop async_visible and async_iconified fields of struct frame.
2952 This is possible because async input is gone; for details, see
2953 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2954 * frame.h (struct frame): Remove async_visible and async_iconified
2955 members, convert garbaged to unsigned bitfield. Adjust comments.
2956 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2957 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2958 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2959 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2960 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2961 * w32term.c: Ditto.
2962 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2963 properly. Likewise for obscured.
2964 * xterm.c: Ditto.
2965 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2966 properly.
2967 * nsterm.m: Ditto.
2968 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2969
29702013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2971
2972 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2973 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2974
29752013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2976
2977 * xdisp.c (message2, message2_nolog): Remove functions.
2978 (message3, message3_nolog): Extract nbytes and multibyteness directly
2979 from the string. Change all callers.
2980 (message3_nolog): Don't set message_enable_multibyte since set_message
2981 will reset it anyway.
2982 (message1, message1_nolog): Use message3.
2983 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2984 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2985 (set_message): Drop all but the second arg, which has to be a string.
2986 (set_message_1): Simplify now that we know that a1 is NULL and the
2987 second arg is a string.
2988 * frame.h (struct frame): Remove `message_buf' field.
2989 Use glyphs_initialized_p instead.
2990 (FRAME_MESSAGE_BUF): Remove macro.
2991 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2992 * lisp.h (message2, message2_nolog): Remove declarations.
2993 (message3, message3_nolog): Update declarations.
2994 * keyboard.c (read_char_minibuf_menu_text)
2995 (read_char_minibuf_menu_width): Remove vars.
2996 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2997 to correctly handle multibyte strings.
2998 * frame.c (delete_frame): Don't free message_buf any more.
2999 * editfns.c (message_text, message_length): Remove vars.
3000 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
3001 * fileio.c (auto_save_error): Use message3 instead of message2.
3002 * dispnew.c (adjust_frame_message_buffer): Remove function.
3003
30042013-01-23 Eli Zaretskii <eliz@gnu.org>
3005
3006 * w32term.c (w32fullscreen_hook): Account correctly for the screen
3007 real estate used for the tool bar and the menu bar.
3008
30092013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
3010
3011 * insdel.c (prepare_to_modify_buffer): Force redisplay if
3012 hidden buffer is prepared to modification (Bug#13164).
3013
30142013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
3015
3016 * window.h (struct window): Change window_end_valid member from
3017 Lisp_Object to a bitfield. Adjust comments.
3018 (wset_window_end_valid): Remove.
3019 * window.c (adjust_window_count): Clear window_end_valid.
3020 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
3021 (Fwindow_line_height, set_window_buffer, Frecenter)
3022 (Fsplit_window_internal, Fdelete_other_windows_internal)
3023 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
3024 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
3025 * xdisp.c (check_window_end, reconsider_clip_changes)
3026 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
3027 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
3028 (find_first_unchanged_at_end_row, try_window_id): Likewise.
3029
30302013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
3031
3032 * xdisp.c (mark_window_display_accurate): Simplify the loop
3033 assuming that the only one of vchild, hchild or buffer window
3034 slots is non-nil. Call mark_window_display_accurate_1 for
3035 the leaf windows only.
3036 (mark_window_display_accurate_1): Always assume leaf window.
3037 Adjust comment.
3038
30392013-01-22 Paul Eggert <eggert@cs.ucla.edu>
3040
3041 * emacs.c (Qkill_emacs_hook): Now static.
3042
3043 * fileio.c (Finsert_file_contents): Simplify.
3044 Remove unnecessary assignments and tests.
3045
30462013-01-21 Eli Zaretskii <eliz@gnu.org>
3047
3048 * w32.c (acl_set_file): Don't test for errors unless
3049 set_file_security returns FALSE. Avoids spurious errors when
3050 saving files.
3051
30522013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
3053
3054 * fileio.c (Finsert_file_contents): Revert code introduced at
3055 2013-01-18 in favor of the simpler and generally better fix.
3056 Save stack space by removing 'buffer' and reusing 'read_buf'
3057 where appropriate.
3058
30592013-01-19 Paul Eggert <eggert@cs.ucla.edu>
3060
3061 * lisp.h (eabs): Define unconditionally (Bug#13419).
3062 The old "#if !defined (eabs)" was an unnecessary revenant of back
3063 when this macro was called "abs". Document 'eabs' better.
3064
30652013-01-19 Glenn Morris <rgm@gnu.org>
3066
3067 * fns.c (Frandom): Doc fix.
3068
30692013-01-19 Eli Zaretskii <eliz@gnu.org>
3070
3071 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
3072 segfault when there are lots of overlays.
3073
3074 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
3075 when there are lots of overlays.
3076 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
3077 for the details and a way to reproduce.
3078
30792013-01-19 Paul Eggert <eggert@cs.ucla.edu>
3080
3081 * fileio.c: Use O_APPEND to append.
3082 This corresponds better to the natural interpretation of "append",
3083 and avoids the need to open the output file twice, or to invoke
3084 lseek when APPEND is neither nil nor a number.
3085 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
3086 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
3087 file possibly twice, and lseeking to its end; this avoids the
3088 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
3089 at the same time: the combination is never needed and apparently
3090 it doesn't work with DOS_NT.
3091
3092 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
3093 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
3094
3095 Allow floating-point file offsets.
3096 Problem reported by Vitalie Spinu in
3097 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
3098 * fileio.c (emacs_lseek): Remove.
3099 (file_offset): New function.
3100 (Finsert_file_contents, Fwrite_region): Use it.
3101
31022013-01-19 Chong Yidong <cyd@gnu.org>
3103
3104 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
3105 aborting on Fsignal (Bug#13289).
3106
31072013-01-19 Eli Zaretskii <eliz@gnu.org>
3108
3109 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
3110 set_file_security as failure due to insufficient privileges.
3111 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3112 (fstat): Return owner and group like 'stat' and 'lstat' do.
3113
31142013-01-19 Paul Eggert <eggert@cs.ucla.edu>
3115
3116 Work around bug in CIFS and vboxsf file systems (Bug#13149).
3117 The bug was observed on Ubuntu operating inside a virtual machine,
3118 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
3119 The workaround introduces a race condition on non-buggy hosts,
3120 but it's an unlikely race and anyway there's a nearly identical
3121 nearby race that can't be fixed.
3122 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
3123 New static vars.
3124 (Fwrite_region): Test for file system time stamp bug.
3125 (init_fileio): New function.
3126 * lisp.h (init_fileio): Declare it.
3127 * emacs.c (main): Call it.
3128
3129 * fileio.c (Finsert_file_contents): Simplify new diagnostic
3130 and make it more consistent with other stat-failure diagnostics.
3131
31322013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
3133
3134 Fix crash when inserting data from non-regular files.
3135 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
3136 for the error description produced by valgrind.
3137 * fileio.c (read_non_regular): Rename to read_contents.
3138 Free Lisp_Save_Value object used to pass parameters.
3139 (read_non_regular_quit): Rename to read_contents_quit.
3140 (Finsert_file_contents): Redesign internal file reading loop to adjust
3141 gap and end positions after each read and so help make_gap to work
3142 properly. Do not signal an I/O error too early and so do not leave
3143 not yet decoded characters in a buffer, which was the reason of
3144 redisplay crash. Use list2 to build return value. Adjust comments.
3145
31462013-01-17 Paul Eggert <eggert@cs.ucla.edu>
3147
3148 Close a race when statting and reading files (Bug#13149).
3149 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
3150 This avoids a race if the file is renamed between stat and open.
3151 This race is not the problem originally noted in Bug#13149;
3152 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
3153
31542013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
3155
3156 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
3157 objects, related functions and macros.
3158 (make_save_value): Adjust prototype.
3159 (make_save_pointer): New prototype.
3160 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
3161 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
3162 * alloc.c (format_save_value): Rename to make_save_value.
3163 (make_save_pointer): New function.
3164 (record_xmalloc): Use make_save_pointer.
3165 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
3166 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
3167 Change users of make_save_value to make_save_pointer.
3168 Likewise for format_save_value and make_save_value.
3169
31702013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
3171
3172 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
3173 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
3174 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
3175 debugging stubs.
3176
31772013-01-15 Paul Eggert <eggert@cs.ucla.edu>
3178
3179 * alloc.c (free_save_value): Now static.
3180
31812013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3182
3183 * keymap.c (map_keymap_internal): Use format_save_value.
3184 (map_keymap_char_table_item): Adjust accordingly.
3185 * fileio.c (non_regular_fd, non_regular_inserted)
3186 (non_regular_nbytes): Remove.
3187 (Finsert_file_contents): Convert trytry to ptrdiff_t.
3188 Use format_save_value to pass parameters to read_non_regular.
3189 (read_non_regular): Use XSAVE_ macros to extract parameters.
3190 Adjust comment.
3191 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
3192 format_save_value.
3193 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
3194
31952013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3196
3197 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
3198 extraction from any Lisp_Save_Value slot. Add type checking.
3199 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
3200 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
3201 * xselect.c: All users changed.
3202
32032013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3204
3205 Some convenient bits to deal with Lisp_Save_Values.
3206 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
3207 (allocate_misc): Remove prototype.
3208 (format_save_value): New prototype.
3209 * alloc.c (allocate_misc): Revert back to static.
3210 (format_save_value): New function to build Lisp_Save_Value
3211 object with the specified internal structure.
3212 (make_save_value): Reimplement using format_save_value.
3213 * editfns.c (save_excursion_save): Use format_save_value.
3214 (save_excursion_restore): Use XSAVE_OBJECT.
3215
32162013-01-14 Paul Eggert <eggert@cs.ucla.edu>
3217
3218 Avoid needless casts with XSAVE_POINTER.
3219 * alloc.c (mark_object) [GC_MARK_STACK]:
3220 * dired.c (directory_files_internal_unwind):
3221 * fileio.c (do_auto_save_unwind):
3222 * gtkutil.c (pop_down_dialog):
3223 * keymap.c (map_keymap_char_table_item):
3224 * lread.c (load_unwind):
3225 * nsmenu.m (pop_down_menu):
3226 * print.c (print_object) [GC_MARK_STACK]:
3227 * xfns.c (clean_up_file_dialog):
3228 * xmenu.c (cleanup_widget_value_tree):
3229 Omit casts between XSAVE_POINTER and a pointer type.
3230
32312013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3232
3233 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
3234 * eval.c (eval_sub): Protect `form' from being GCed before its
3235 car and cdr becomes protected with the backtrace entry.
3236
32372013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3238
3239 Make Lisp_Save_Value more versatile storage for up to four objects.
3240 * lisp.h (toplevel): Enumeration to describe types of saved objects.
3241 (struct Lisp_Save_Value): New layout. Adjust comments.
3242 (XSAVE_POINTER): New macro.
3243 (XSAVE_INTEGER): Likewise.
3244 (allocate_misc): Add prototype.
3245 (free_misc): Likewise.
3246 * alloc.c (allocate_misc): Now global.
3247 (free_misc): Likewise. Adjust comment.
3248 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
3249 (free_save_value): Likewise.
3250 (mark_object): Likewise.
3251 * editfns.c (save_excursion_save): Pack everything within
3252 Lisp_Save_Value and so avoid xmalloc.
3253 (save_excursion_restore): Adjust to match new layout. Use free_misc
3254 because we do not allocate extra memory any more. Add eassert.
3255 * print.c (print_object): New code to print Lisp_Save_Value. Do not
3256 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
3257 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
3258 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
3259 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
3260
32612013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3262
3263 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
3264 (nsfont_draw): Remove disabling of LCD smoothing.
3265 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
3266 Bug#11484 with LCD smoothing on.
3267
32682013-01-13 Paul Eggert <eggert@cs.ucla.edu>
3269
3270 Fix SIGDANGER handlers, for AIX (Bug#13408).
3271 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
3272 Move handlers here from emacs.c; they were out of place.
3273
32742013-01-11 Jan Djärv <jan.h.d@swipnet.se>
3275
3276 * xterm.c (syms_of_xterm): Adjust documentation for
3277 scroll-bar-adjust-thumb-portion.
3278
32792012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3280
3281 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
3282 determine whether scroll bar thumb size should be adjusted or not.
3283 Use variable for MOTIF.
3284
3285 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for GTK.
3286
32872013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3288
3289 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
3290 event is generated.
3291 (doCommandBySelector:): Set processingCompose to NO.
3292
3293 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
3294 Remove check for fkeys count > zero, block/unblock fixes the real bug.
3295 (nsfont_list_family): Add block/unblock_input calls.
3296 (nsfont_open): Move block_input earlier. Add unblock_input before early
3297 return.
3298 (nsfont_draw): Add block/unblock_input calls.
3299
33002013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
3301
3302 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
3303 for old_charpos and old_bytepos.
3304
33052013-01-12 Paul Eggert <eggert@cs.ucla.edu>
3306
3307 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
3308 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
3309 Clear tzvalbuf_in_environ if this workaround is in effect.
3310 Problem and fix reported by Kazuhiro Ito.
3311
33122013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
3313
3314 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
3315 Fix ambiguous doc string cross-reference(s).
3316
3317 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
3318 doc string cross-reference(s).
3319
3320 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
3321 string cross-reference(s).
3322
33232013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
3324
3325 Avoid unnecessary byte position calculation for the gap movement.
3326 Since all users of move_gap do CHAR_TO_BYTE for other purposes
3327 anyway, all of them should use move_gap_both instead.
3328 * lisp.h (move_gap): Remove prototype.
3329 * insdel.c (move_gap): Remove.
3330 (move_gap_both): Add eassert.
3331 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
3332 * xml.c (parse_region): Likewise.
3333
33342013-01-11 Paul Eggert <eggert@cs.ucla.edu>
3335
3336 emacsclient -t should not suspend Emacs server (Bug#13387)
3337 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
3338 New functions.
3339 * term.c (init_tty): Use them instead of rolling our own code.
3340 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
3341 switches from 'signal' to 'pthread_sigmask', which is safer in
3342 multithreaded applications.
3343 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
3344 which has already arranged for that.
3345 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
3346 This is the main part of the bug fix.
3347
33482013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
3349
3350 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
3351 x_last_font_name (Bug#13403).
3352
33532013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
3354
3355 Omit buffer_slot_type_mismatch and use generic predicates to enforce
3356 the type of per-buffer values where appropriate.
3357 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
3358 predicate, which is how it's really used now. Adjust comment.
3359 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
3360 * buffer.c (buffer_slot_type_mismatch): Remove.
3361 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3362 predicate. Adjust comment.
3363 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3364 fill-column, left-margin, tab-width, buffer-saved-size,
3365 left-margin-width, right-margin-width, left-fringe-width,
3366 right-fringe-width, scroll-bar-width and buffer-display-count.
3367 Use Qstringp for default-directory, buffer-file-name,
3368 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3369 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3370 line-spacing.
3371 * data.c (store_symval_forwarding): Adjust to call the predicate.
3372
33732013-01-09 Juanma Barranquero <lekktu@gmail.com>
3374
3375 * w32.c (get_name_and_id, acl_set_file):
3376 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3377
33782013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3379
3380 * lisp.h (make_gap_1): New prototype.
3381 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3382 gap size values.
3383 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3384 naming convention.
3385 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
3386 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
3387 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3388 (make_gap_1): New function to adjust the gap of any buffer.
3389 * coding.c (coding_alloc_by_making_gap): Use it.
3390 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3391 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3392
33932013-01-08 Juri Linkov <juri@jurta.org>
3394
3395 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3396 of (supports :underline (:style wave)). (Bug#13000)
3397
33982013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3399
3400 * undo.c (Fprimitive_undo): Move to simple.el.
3401 (syms_of_undo): Remove declarations for Sprimitive_undo.
3402
34032013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3404
3405 * keyboard.c (echo_add_key): Rename from echo_add_char.
3406
34072013-01-06 Chong Yidong <cyd@gnu.org>
3408
3409 * keyboard.c (echo_add_char): New function, factored out from
3410 echo_char. Don't add a space if the previous echo string was
3411 empty (Bug#13255).
3412 (echo_char): Use it.
3413 (read_key_sequence): When echoing mock input, ensure that the
3414 trailing dash is properly added.
3415
34162013-01-05 Eli Zaretskii <eliz@gnu.org>
3417
3418 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3419 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
3420 digits for buffer positions, before misalignment starts.
3421 Display "0" for integer "object" field.
3422 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3423 Display the newline glyph more unambiguously.
3424
34252013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3426
3427 * nsterm.m (ns_draw_underwave):
3428 * w32term.c (w32_draw_underwave):
3429 * xterm.c (x_draw_underwave): Make underwave look more triangular
3430 and also degrade gracefully for small fonts. (Bug#13000)
3431
3432 * nsterm.m (ns_draw_text_decoration):
3433 * w32term.c (x_draw_glyph_string):
3434 * xterm.c (x_draw_glyph_string): Don't use previous underline
3435 thickness and position if previous underline type is underwave.
3436
34372013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3438
3439 * fileio.c (Ffile_acl): Undocument return format.
3440
34412013-01-02 Glenn Morris <rgm@gnu.org>
3442
3443 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3444
34452013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3446
3447 Simplify via eabs.
3448 * dired.c (file_name_completion):
3449 * doc.c (get_doc_string):
3450 * floatfns.c (round2):
3451 * font.c (font_score, font_delete_unmatched):
3452 * fringe.c (compute_fringe_widths):
3453 * lread.c (read_list):
3454 * minibuf.c (Ftry_completion):
3455 * term.c (tty_ins_del_lines):
3456 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3457 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3458
34592012-12-31 Eli Zaretskii <eliz@gnu.org>
3460
3461 * w32.c (unsetenv): Set up the string passed to _putenv
3462 correctly.
3463 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
3464 for the bug this caused.
3465
34662012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3467
3468 * coding.c (Qmac): Now static.
3469
34702012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3471
3472 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3473 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3474 handlebox_widget. Set toolbar_in_hbox to false/true, set
3475 toolbar_is_packed to true.
3476 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3477 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3478 Show all on TOOLBAR_TOP_WIDGET.
3479 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3480 by TOOLBAR_TOP_WIDGET.
3481 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3482 Check toolbar_is_packed.
3483 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3484 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3485 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3486 false.
3487 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3488 (xg_update_menubar): Update title only if
3489 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3490 (xg_update_submenu): Skip tearoff only if
3491 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3492 (xg_initialize): Initialize xg_detached_menus only if
3493 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3494
3495 * xterm.h (struct x_output): Surround handlebox_widget with
3496 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3497 toolbar_in_hbox is bool.
3498
34992012-12-30 Andreas Schwab <schwab@linux-m68k.org>
3500
3501 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3502 (LIBS_GNUSTEP): Define.
3503 (LIBES): Add $(LIBS_GNUSTEP).
3504 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3505
35062012-12-30 Eli Zaretskii <eliz@gnu.org>
3507
3508 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3509 continuation glyph on a TTY with an indication of an empty line.
3510 (Bug#13277)
3511
35122012-12-29 Eli Zaretskii <eliz@gnu.org>
3513
3514 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3515 file's SELinux context or ACLs successfully set, nil otherwise.
3516 (Bug#13298)
3517 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
3518
3519 * w32proc.c (reader_thread): Avoid passing NULL handles to
3520 SetEvent and WaitForSingleObject.
3521
35222012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3523
3524 Port EXTERNALLY_VISIBLE to Clang 3.2.
3525 * conf_post.h (__has_attribute): New macro.
3526 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3527
35282012-12-27 Glenn Morris <rgm@gnu.org>
3529
3530 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3531 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3532
35332012-12-27 Eli Zaretskii <eliz@gnu.org>
3534
3535 * fileio.c (file_name_as_directory, directory_file_name):
3536 Accept an additional argument MULTIBYTE to indicate whether the input C
3537 came from a multibyte or a unibyte Lisp string; all callers
3538 adjusted. Don't assume the input string is always multibyte.
3539 (Bug#13262)
3540 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3541 don't ENCODE_FILE them, and return a unibyte string if the input
3542 was unibyte.
3543 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3544 don't assume the input strings will always be multibyte. If the
3545 input strings are multibyte, decode strings obtained from C
3546 library functions.
3547
35482012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3549
3550 * lisp.h (toplevel): Add two notices to the comment about
3551 defining a new Lisp data type.
3552 * print.c (print_object): If Lisp_Save_Value object's pointer
3553 is the address of a memory area containing Lisp_Objects, try
3554 to print them.
3555 * alloc.c (valid_lisp_object_p): Adjust comment.
3556
35572012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3558
3559 * keyboard.c (record_asynch_buffer_change): Initialize an event
3560 only if it's really needed.
3561 * frame.h (enum output_method): Remove output_mac member since
3562 it's a leftover from the deleted code.
3563 * frame.c (Fframep): Adjust user here ...
3564 * terminal.c (Fterminal_live_p): ... and here.
3565 * coding.c (Qmac): Now here because it's only used to denote
3566 end-of-line encoding type.
3567 (syms_of_coding): DEFSYM it.
3568 * frame.h (Qmac): Remove duplicated declaration.
3569
35702012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3571
3572 * window.c (select_window_1): Now static, since it's used only here.
3573
35742012-12-25 Eli Zaretskii <eliz@gnu.org>
3575
3576 * window.c (window_body_cols): Subtract display margins from the
3577 window body width on TTYs as well. See
3578 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3579 for the original report.
3580
35812012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3582
3583 * xdisp.c (redisplay_window): Remove inner local variable
3584 because the outer shadowed one has the same meaning.
3585 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3586 set but never used.
3587 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3588 (xg_create_tool_bar): Adjust users.
3589
35902012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3591
3592 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3593 * buffer.c (Fget_buffer_create): Use it to set compact field of
3594 struct buffer_text to avoid accessing an uninitialized value
3595 when compact_buffer is called for the first time.
3596 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3597 (Fset_buffer_modified_p): Use buffer_window_count to check
3598 whether the buffer is displayed in some window.
3599 * xdisp.c (message_dolog): Likewise.
3600
36012012-12-23 Eli Zaretskii <eliz@gnu.org>
3602
3603 * w32.c (acl_set_file): If setting the file security descriptor
3604 fails, and the new DACL is identical to the existing one, silently
3605 return success. This fixes problems for users backing up their
3606 own files without having the necessary privileges for setting
3607 security descriptors.
3608
3609 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3610 values.
3611 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3612 after WaitForSingleObject returns normally. This expedites reader
3613 thread shutdown when delete_child triggers it.
3614 (reap_subprocess): More accurate commentary for why we call
3615 delete_child only when cp->fd is negative.
3616
3617 * w32.c (sys_close): Do not call delete_child on a subprocess
3618 whose handle is not yet closed. Instead, set its file descriptor
3619 to a negative value, so that reap_subprocess will call
3620 delete_child on that subprocess when its SIGCHLD arrives.
3621 This avoids closing handles used for communications between sys_select
3622 and reader_thread, which doesn't give sys_select a chance to
3623 notice that the process exited and invoke the SIGCHLD handler for
3624 it.
3625
36262012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3627
3628 * nsfns.m (Fns_do_applescript): Run event loop until script has
3629 been executed (Bug#12969).
3630 (ns_run_ascript): Chech as_script for nil, set to nil after
3631 executing script.
3632
36332012-12-22 Martin Rudalics <rudalics@gmx.at>
3634
3635 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3636
36372012-12-22 Eli Zaretskii <eliz@gnu.org>
3638
3639 * w32term.c (w32fullscreen_hook): New function.
3640 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3641
36422012-12-21 Eli Zaretskii <eliz@gnu.org>
3643
3644 * fileio.c (Finsert_file_contents): Doc fix.
3645
3646 * w32proc.c (new_child, delete_child, find_child_pid): For a
3647 subprocess, consider its slot being in use as long as its process
3648 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3649 slot when a new process is started immediately after killing
3650 another one, without waiting enough time for the first process to
3651 be reaped and resources allocated for it be orderly freed.
3652 (Bug#13086)
3653 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3654
36552012-12-21 Chong Yidong <cyd@gnu.org>
3656
3657 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3658
3659 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3660
36612012-12-21 Eli Zaretskii <eliz@gnu.org>
3662
3663 * w32.c (get_name_and_id): Always pass NULL as the first argument
3664 of lookup_account_sid. Avoids crashes with UNC file names that
3665 refer to DFS domains, not to specific machine names. (Bug#12621)
3666 Remove now unused argument FNAME; all callers changed.
3667 (get_file_owner_and_group): Remove now unused argument FNAME; all
3668 callers changed.
3669
36702012-12-21 Chong Yidong <cyd@gnu.org>
3671
3672 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3673 error for invalid chars, don't check for a nil return value.
3674
36752012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3676
3677 Avoid calls to CHAR_TO_BYTE if byte position is known.
3678 * editfns.c (make_buffer_string_both): Use move_gap_both.
3679 (Fbuffer_string): Use make_buffer_string_both.
3680 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3681 Adjust comment.
3682 (buf_bytepos_to_charpos): Likewise.
3683 (charpos_to_bytepos): Remove.
3684 * fileio.c (Finsert_file_contents): Use move_gap_both.
3685 * search.c (Freplace_match): Likewise.
3686 * process.c (process_send_region): Likewise. Use convenient
3687 names for byte positions.
3688 * lisp.h (charpos_to_bytepos): Remove prototype.
3689 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3690 * insdel.c (move_gap): Likewise.
3691
36922012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3693
3694 * xdisp.c (redisplay_internal): Remove now-unused local.
3695
36962012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3697
3698 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3699 (redisplay_internal): Don't bother selecting the frame to get the
3700 proper value of frame-local variables (bug#13225).
3701
37022012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3703
3704 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3705 Rename 4th argument since it may be buffer or string. Adjust comment.
3706 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3707
37082012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3709
3710 * coding.c (Fdetect_coding_region): Do not check start and end with
3711 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3712 (code_convert_region): Likewise.
3713
37142012-12-18 Eli Zaretskii <eliz@gnu.org>
3715
3716 * w32.c (acl_get_file, acl_set_file): Run the file name through
3717 map_w32_filename, and resolve any symlinks in the file name, like
3718 Posix platforms do.
3719 (acl_set_file): Call revert_to_self, if any privileges were
3720 enabled.
3721
37222012-12-17 Juanma Barranquero <lekktu@gmail.com>
3723
3724 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3725 ($(BLD)/w32.$(O)): Update dependencies.
3726
37272012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3728
3729 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3730 propagate redisplay's scrolling (if any) to the right window.
3731 (redisplay_internal): Use ensure_selected_frame.
3732 (display_mode_lines): Complete last fix.
3733 * window.c (select_window_1): New func, extracted from select_window.
3734 (select_window): Use it.
3735 * window.h (select_window_1): Declare.
3736
37372012-12-17 Eli Zaretskii <eliz@gnu.org>
3738
3739 Emulate Posix ACL APIs on MS-Windows.
3740 * w32.c: Include sddl.h and sys/acl.h.
3741 (SDDL_REVISION_1): Define if not already defined.
3742 (g_b_init_get_security_descriptor_dacl)
3743 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3744 (g_b_init_is_valid_security_descriptor)
3745 (g_b_init_set_file_security): New static flags.
3746 (globals_of_w32): Initialize them to zero.
3747 (SetFileSecurity_Name): New string constant.
3748 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3749 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3750 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3751 (IsValidSecurityDescriptor_Proc): New typedefs.
3752 (get_file_security, get_security_descriptor_owner)
3753 (get_security_descriptor_group): Set errno to ENOTSUP.
3754 (set_file_security, get_security_descriptor_dacl)
3755 (is_valid_security_descriptor, convert_sd_to_sddl)
3756 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3757 (acl_free, acl_get_file, acl_set_file): New functions.
3758
3759 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3760
37612012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3762
3763 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3764 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3765 for some of that bug's symptoms can now cause Emacs to abort.
3766 Remove the workaround.
3767 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3768 The bug that caused SIGCHLD to get lost has been fixed, and the
3769 workaround for it can now cause Emacs to abort.
3770
37712012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3772
3773 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3774 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3775 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3776
37772012-12-16 Romain Francoise <romain@orebokech.com>
3778
3779 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3780 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3781 and copy ACL entries of file in addition to SELinux context if set.
3782 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3783
3784 * Makefile.in (LIBACL_LIBS): New macro.
3785 (LIBES): Use it.
3786
37872012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3788
3789 * fileio.c (internal_delete_file): Use bool for boolean.
3790
37912012-12-15 Eli Zaretskii <eliz@gnu.org>
3792
3793 Fix bug #13079 on MS-Windows with temp files not being deleted.
3794 * w32.h (_child_process): New members input_file and
3795 pending_deletion.
3796 (register_child): First argument is now pid_t.
3797 (record_infile, record_pending_deletion): New prototypes.
3798
3799 * w32proc.c (new_child): Initialize input_file and
3800 pending_deletion members of the child.
3801 (delete_child): Delete the child's temporary input file, if any,
3802 that is pending deletion.
3803 (register_child): First argument is now pid_t.
3804 (record_infile, record_pending_deletion): New functions.
3805 (reap_subprocess): Fix a typo in DebPrint string.
3806 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3807
3808 * fileio.c (internal_delete_file): Return an int again: non-zero
3809 if delete-file succeeds, zero otherwise.
3810
3811 * lisp.h (internal_delete_file): Adjust prototype.
3812
3813 * callproc.c (Fcall_process): Don't overwrite infile with result
3814 of DECODE_FILE.
3815 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3816 asynchronous subprocess, record the name of the input file name,
3817 if any.
3818 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3819 delete the file, record it as pending deletion when the subprocess
3820 exits.
3821
38222012-12-14 Eli Zaretskii <eliz@gnu.org>
3823
3824 * editfns.c [HAVE_PWD_H]: Include grp.h.
3825
3826 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3827
38282012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3829
3830 Fix permissions bugs with setgid directories etc. (Bug#13125)
3831 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3832 to mark it as a placeholder. The old value was often wrong.
3833 The only user of this attribute has been changed to use
3834 file-ownership-preserved-p instead, with its new group arg.
3835 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3836
38372012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3838
3839 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3840 Keep selected_window and selected_frame in sync.
3841
38422012-12-14 Eli Zaretskii <eliz@gnu.org>
3843
3844 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3845 try to get accurate owner and group information from NT file
3846 security APIs. This is to make most callers of 'stat' and
3847 'lstat', which don't need that information, much faster.
3848
3849 * dired.c (Ffile_attributes) [WINDOWSNT]:
3850 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3851 owner and group information from 'lstat'.
3852
38532012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3854
3855 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3856 as that confuses set-auto-coding, so insist on the head-read
3857 returning the full 1024 bytes. Let lseek compute the tail offset;
3858 less work for us. Do not ignore I/O errors when reading the tail.
3859
3860 * xdisp.c: Minor style fixes.
3861 (init_iterator): Hoist assignment out of if-expression.
3862 (markpos_of_region): Callers now test for sign, not for -1.
3863
38642012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3865
3866 Minor redisplay optimization when the region length is zero.
3867 * xdisp.c (markpos_of_region): New function.
3868 (init_iterator): Do not highlight the region of zero length.
3869 (redisplay_window): Check whether the region is of non-zero length.
3870 (try_cursor_movement): Allow if the region length is zero.
3871 (try_window_reusing_current_matrix, try_window_id): Likewise.
3872
38732012-12-13 Eli Zaretskii <eliz@gnu.org>
3874
3875 * search.c (search_buffer): Check the inverse translations of each
3876 character in pattern when the buffer being searched is unibyte.
3877 (Bug#13084)
3878
38792012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3880
3881 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3882 files, fixing a regression from 24.2.
3883 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3884
38852012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3886
3887 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3888 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3889 Remove unnecessary S_ISLNK test, as (contra the comments) this
3890 function can't copy symlinks. Improve quality of error message
3891 when attempting to copy files that are neither regular files nor
3892 directories.
3893
38942012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3895
3896 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3897 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3898 * window.c (Frecenter):
3899 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3900 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3901
39022012-12-12 Daniel Colascione <dancol@dancol.org>
3903
3904 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3905 the dumped Emacs is not a sparse file, greatly improving Cygwin
3906 "make bootstrap" performance.
3907
39082012-12-11 Michael Albinus <michael.albinus@gmx.de>
3909
3910 * inotify.c (inotify_callback): Generate an Emacs event for every
3911 incoming inotify event.
3912
39132012-12-11 Eli Zaretskii <eliz@gnu.org>
3914
3915 * xdisp.c (handle_face_prop): Fix logic of computing
3916 it->start_of_box_run_p.
3917 (append_space_for_newline): If the glyph row is R2L, reset the
3918 iterator's end_of_box_run_p flag before prepending the space glyph.
3919 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3920 iterator's start_of_box_run_p flag before prepending the stretch.
3921 (append_glyph, produce_image_glyph, append_composite_glyph)
3922 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3923 left_box_line_p and right_box_line_p flags of the glyph for R2L
3924 glyph rows. (Bug#13011)
3925
39262012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3927
3928 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3929 if changed buffer is not shown in a window.
3930 * insdel.c (prepare_to_modify_buffer): Likewise.
3931 * window.c (replace_buffer_in_windows_safely): Do nothing
3932 if buffer is not shown in a window.
3933 (Fforce_window_update): Likewise if string or buffer argument
3934 is passed.
3935
39362012-12-11 Eli Zaretskii <eliz@gnu.org>
3937
3938 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3939 encoded_file_name, which is what it is.
3940
39412012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3942
3943 Consistently use marker_position and marker_byte_position.
3944 * fringe.c (Ffringe_bitmaps_at_pos):
3945 * indent.c (Fvertical_motion):
3946 * insdel.c (prepare_to_modify_buffer):
3947 * keyboard.c (make_lispy_position):
3948 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3949 (window_scroll_pixel_based, displayed_window_lines)
3950 (Fset_window_configuration):
3951 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3952 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3953 Replace direct access to marker fields with calls
3954 to marker_position and/or marker_byte_position.
3955
39562012-12-11 Juanma Barranquero <lekktu@gmail.com>
3957
3958 * makefile.w32-in (SIG2STR_H): New macro.
3959 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3960 ($(BLD)/w32notify.$(O)): Update dependencies.
3961
39622012-12-10 Daniel Colascione <dancol@dancol.org>
3963
3964 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3965 Windows file notification functionality unless WINDOWSNT.
3966
3967 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3968 declarations.
3969
3970 * w32fns.c (cache_system_info): Initialize the global hinst
3971 variable here so various initialization calls DTRT.
3972
3973 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3974 (hinst): Remove unneeded extern declaration.
3975 (_start): Remove initialization of above variables; remove
3976 initialization of hinst, as cache_system_info now does that.
3977
3978 * emacs.c (main): Call cache_system_info early in startup; we
3979 previously weren't calling it in Cygwin builds.
3980
3981 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3982 Teach the autoconf build system how to compile a Windows resource file
3983 and link it to Emacs.
3984
39852012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3986
3987 Per-buffer window counters.
3988 * buffer.h (struct buffer): New member window_count.
3989 (buffer_window_count): New function.
3990 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3991 Initialize window_count.
3992 (Fkill_buffer): Verify window_count for the buffer being killed.
3993 (modify_overlay): Do not force redisplay if buffer is not shown
3994 in any window.
3995 (init_buffer_once): Initialize window_count for buffer_defaults
3996 and buffer_local_symbols.
3997 * window.h (buffer_shared): Remove declaration.
3998 (wset_buffer): Convert from inline ...
3999 * window.c (wset_buffer): ... to an ordinary function.
4000 (adjust_window_count): New function.
4001 (make_parent_window): Use it.
4002 * xdisp.c (buffer_shared): Remove.
4003 (redisplay_internal, redisplay_window): Adjust users.
4004 (buffer_shared_and_changed): Use per-buffer window counter.
4005
40062012-12-10 Eli Zaretskii <eliz@gnu.org>
4007
4008 Support for filesystem notifications on MS-Windows.
4009 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
4010 and this is a TTY frame, signal the caller that keyboard input is
4011 available.
4012
4013 * w32xfns.c (drain_message_queue): Now returns an int: an
4014 indication whether any WM_EMACS_FILENOTIFY messages were found in
4015 the queue.
4016
4017 * w32inevt.c (handle_file_notifications): New function.
4018 (w32_console_read_socket): Call it to process file notifications.
4019
4020 * w32console.c (initialize_w32_display): Record the main thread ID
4021 in dwMainThreadId.
4022
4023 * deps.mk (inotify.o): New dependency list.
4024
4025 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
4026
4027 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
4028 (WM_EMACS_END): Bump value by 1.
4029 (notification_buffer_in_use, file_notifications)
4030 (notifications_size, notifications_desc): Declare.
4031 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
4032 Add prototypes.
4033
4034 * w32term.c (lispy_file_action, queue_notifications): New functions.
4035 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
4036 <Qrenamed_to>: New symbols.
4037 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
4038
4039 * w32notify.c: New file, implements file event notifications for
4040 MS-Windows.
4041
4042 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
4043 by posting it to the w32_read_socket queue.
4044
4045 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
4046
4047 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
4048 (GLOBAL_SOURCES): Add w32notify.c
4049 ($(BLD)/w32notify.$(O)): New set of dependencies.
4050
4051 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
4052
4053 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
4054 Handle FILE_NOTIFY_EVENT.
4055 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
4056 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
4057 w32notify-handle-event by default.
4058
4059 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
4060 syms_of_w32notify.
4061
40622012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
4063
4064 Support for filesystem notifications on GNU/Linux via inotify.
4065 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
4066
4067 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
4068
4069 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
4070 (syms_of_keyboard): DEFSYM it.
4071 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
4072 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
4073 Qfile_inotify events.
4074 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
4075 special-event-map to inotify-handle-event.
4076
4077 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
4078
4079 * Makefile.in (base_obj): Add inotify.o.
4080
4081 * inotify.c: New file.
4082
40832012-12-10 Jan Djärv <jan.h.d@swipnet.se>
4084
4085 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
4086
40872012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
4088
4089 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
4090 DWORD_PTR, for compatibility with 64-bit builds.
4091
4092 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
4093 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
4094 (system_process_attributes): Use SIZE_T rather than DWORD, for
4095 compatibility with 64-bit builds.
4096
40972012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
4098
4099 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
4100
41012012-12-10 Eli Zaretskii <eliz@gnu.org>
4102
4103 * indent.c (Fvertical_motion): If a display string will be
4104 displayed on the left or the right margin, don't consider it as a
4105 factor in cursor positioning. (Bug#13108)
4106
41072012-12-10 Martin Rudalics <rudalics@gmx.at>
4108
4109 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
4110
41112012-12-10 Paul Eggert <eggert@cs.ucla.edu>
4112
4113 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
4114 for string length.
4115
41162012-12-08 Eli Zaretskii <eliz@gnu.org>
4117
4118 * w32.c (unsetenv): Return 0 if the input string is too long.
4119
41202012-12-08 Paul Eggert <eggert@cs.ucla.edu>
4121
4122 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
4123 * alloc.c (xputenv): New function.
4124 * dbusbind.c (Fdbus_init_bus):
4125 * emacs.c (main):
4126 * xterm.c (x_term_init):
4127 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
4128 * editfns.c (initial_tz): Move static var decl up.
4129 (tzvalbuf_in_environ): New static var.
4130 (init_editfns): Initialize these two static vars.
4131 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
4132 Save old TZ value on stack, if it's small.
4133 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
4134 instead, use xputenv+unsetenv to set and restore TZ.
4135 (environbuf): Remove static var. All uses removed.
4136 (Fset_time_zone_rule): Do not save TZ and environ;
4137 no longer needed here.
4138 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
4139 Move to inside set_time_zone_rule; they don't need file scope any more.
4140 (set_time_zone_rule): Maintain the TZ=value string separately.
4141 (syms_of_editfns): Don't initialize initial_tz;
4142 init_editfns now does it.
4143 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
4144 * lisp.h (xputenv): New decl.
4145
41462012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
4147
4148 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
4149
41502012-12-08 Eli Zaretskii <eliz@gnu.org>
4151
4152 * w32.c (unsetenv, sys_putenv): New functions.
4153
41542012-12-08 Chong Yidong <cyd@gnu.org>
4155
4156 * editfns.c (Finsert_char): Make the error message more
4157 informative (Bug#12992).
4158
41592012-12-08 Paul Eggert <eggert@cs.ucla.edu>
4160
4161 Simplify get_lim_data.
4162 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
4163 Remove USG and vlimit methods; no longer used these days.
4164 Add #error catchall just in case.
4165
4166 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
4167 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
4168 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
4169 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
4170 (deleted_pid_list, Fdelete_process, create_process)
4171 (record_child_status_change, handle_child_signal, deliver_child_signal)
4172 (init_process_emacs, syms_of_process):
4173 Assume SIGCHLD is defined.
4174 (parse_signal): Remove. All uses removed.
4175 (abbr_to_signal): New static function.
4176 (Fsignal_process): Use it to convert signal names to ints.
4177 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
4178 kill (getpgrp (), ...).
4179 (emacs_sigaction_init): Assume SIGCHLD is defined.
4180 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
4181 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
4182 * syssignal.h (EMACS_KILLPG): Remove.
4183 All uses replaced by 'kill' with a negative pid.
4184 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
4185 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
4186
41872012-12-07 Paul Eggert <eggert@cs.ucla.edu>
4188
4189 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
4190 This will cause a production Emacs to dump core instead of
4191 infinite-looping.
4192
41932012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4194
4195 * frame.c (make_frame): Do not set window's buffer to t.
4196 * window.c (Fsplit_window_internal): Likewise. Previously it was
4197 used to indicate that the window is being set up. Now we use
4198 set_window_buffer for all new windows, so the condition in ...
4199 (Fset_window_buffer): ... is always true and can be removed.
4200
42012012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4202
4203 Convenient macro to check whether the buffer is hidden.
4204 * buffer.h (BUFFER_HIDDEN_P): New macro.
4205 * frame.c (make_frame): Use it. Adjust comment.
4206 * buffer.c (candidate_buffer): New function.
4207 (Fother_buffer, other_buffer_safely): Use it.
4208
42092012-12-06 Eli Zaretskii <eliz@gnu.org>
4210
4211 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
4212 if the child process is still running. Instead, exit the wait
4213 loop and return zero. (Bug#13086)
4214
42152012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4216
4217 * frame.h (x_char_width, x_char_height): Remove prototypes.
4218 * w32term.h (x_char_width, x_char_height): Likewise.
4219 * xfns.c (x_char_width, x_char_height): Remove.
4220 * w32fns.c (x_char_width, x_char_height): Likewise.
4221 * nsfns.c (x_char_width, x_char_height): Likewise.
4222 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
4223 all window frames.
4224 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
4225 * keyboard.c (command_loop_1): Remove prototype.
4226 (command_loop_2, top_level_1): Add static to match prototype.
4227
42282012-12-06 Paul Eggert <eggert@cs.ucla.edu>
4229
4230 Fix a recently-introduced delete-process race condition.
4231 * callproc.c, process.h (record_kill_process):
4232 New function, containing part of the old call_process_kill.
4233 (call_process_kill): Use it.
4234 This does not change call_process_kill's behavior.
4235 * process.c (Fdelete_process): Use record_kill_process to fix a
4236 race condition that could cause Emacs to lose track of a child.
4237
42382012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4239
4240 Avoid code duplication between prev_frame and next_frame.
4241 * frame.c (candidate_frame): New function. Add comment.
4242 (prev_frame, next_frame): Use it. Adjust comment.
4243
42442012-12-06 Eli Zaretskii <eliz@gnu.org>
4245
4246 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
4247 fails, signal an error instead of continuing with an empty
4248 string. (Bug#13079)
4249 Encode expanded temp file pattern before passing it to mkstemp or
4250 mktemp.
4251
4252 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
4253 Encode the file name before passing it to dostounix_filename, in
4254 case it will downcase it (under w32-downcase-file-names).
4255 (Bug#12933)
4256
42572012-12-05 Paul Eggert <eggert@cs.ucla.edu>
4258
4259 Minor call-process cleanups.
4260 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
4261 at the same time as other platforms, to simplify analysis.
4262 No need for fd0_volatile since we have synch_process_fd.
4263 Avoid needless emacs_close; arg is always negative.
4264
42652012-12-04 Andreas Schwab <schwab@linux-m68k.org>
4266
4267 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
4268 processes.
4269
42702012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
4271
4272 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
4273 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
4274 and mouse_face_hidden members to a bitfields.
4275 * frame.h (struct frame): Remove set-but-not-used space_width member.
4276 (FRAME_SPACE_WIDTH): Remove.
4277 * nsterm.m, w32term.c, xterm.c: Adjust users.
4278 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
4279 member. Adjust users. Convert term_initted, delete_in_insert_mode,
4280 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
4281 members to a bitfields.
4282
42832012-12-03 Paul Eggert <eggert@cs.ucla.edu>
4284
4285 Don't let call-process be a zombie factory (Bug#12980).
4286 Fixing this bug required some cleanup of the signal-handling code.
4287 As a side effect, this change also fixes a longstanding rare race
4288 condition whereby Emacs could mistakenly kill unrelated processes,
4289 and it fixes a bug where a second C-g does not kill a recalcitrant
4290 synchronous process in GNU/Linux and similar platforms.
4291 The patch should also fix the last vestiges of Bug#9488,
4292 a bug which has mostly been fixed on the trunk by other changes.
4293 * callproc.c, process.h (synch_process_alive, synch_process_death)
4294 (synch_process_termsig, sync_process_retcode):
4295 Remove. All uses removed, to simplify analysis and so that
4296 less consing is done inside critical sections.
4297 * callproc.c (call_process_exited): Remove. All uses replaced
4298 with !synch_process_pid.
4299 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
4300 These take the role of what used to be in unwind-protect arg.
4301 All uses changed.
4302 (block_child_signal, unblock_child_signal):
4303 New functions, to avoid races that could kill innocent-victim processes.
4304 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
4305 (call_process_kill): Record killed processes as deleted, so that
4306 zombies do not clutter up the system. Do this inside a critical
4307 section, to avoid a race that would allow the clutter.
4308 (call_process_cleanup): Fix code so that the second C-g works again
4309 on common platforms such as GNU/Linux.
4310 (Fcall_process): Create the child process in a critical section,
4311 to fix a race condition. If creating an asynchronous process,
4312 record it as deleted so that zombies do not clutter up the system.
4313 Do unwind-protect for WINDOWSNT too, as that's simpler in the
4314 light of these changes. Omit unnecessary call to emacs_close
4315 before failure, as the unwind-protect code does that.
4316 * callproc.c (call_process_cleanup):
4317 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
4318 * process.c (record_deleted_pid): New function, containing
4319 code refactored out of Fdelete_process.
4320 (Fdelete_process): Use it.
4321 (process_status_retrieved): Remove. All callers changed to use
4322 child_status_change.
4323 (record_child_status_change): Remove, folding its contents into ...
4324 (handle_child_signal): ... this signal handler. Now, this
4325 function is purely a handler for SIGCHLD, and is not called after
4326 a synchronous waitpid returns; the synchronous code is moved to
4327 wait_for_termination. There is no need to worry about reaping
4328 more than one child now.
4329 * sysdep.c (get_child_status, child_status_changed): New functions.
4330 (wait_for_termination): Now takes int * status and bool
4331 interruptible arguments, too. Do not record child status change;
4332 that's now the caller's responsibility. All callers changed.
4333 Reimplement in terms of get_child_status.
4334 (wait_for_termination_1, interruptible_wait_for_termination):
4335 Remove. All callers changed to use wait_for_termination.
4336 * syswait.h: Include <stdbool.h>, for bool.
4337 (record_child_status_change, interruptible_wait_for_termination):
4338 Remove decls.
4339 (record_deleted_pid, child_status_changed): New decls.
4340 (wait_for_termination): Adjust to API changes noted above.
4341
4342 * bytecode.c, lisp.h (Qbytecode): Remove.
4343 No longer needed after 2012-11-20 interactive-p changes.
4344
43452012-12-03 Eli Zaretskii <eliz@gnu.org>
4346
4347 * xdisp.c (redisplay_window): If the cursor is visible, but inside
4348 the scroll margin, move point outside the margin. (Bug#13055)
4349
43502012-12-03 Jan Djärv <jan.h.d@swipnet.se>
4351
4352 * gtkutil.c (my_log_handler): New function.
4353 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
4354
43552012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4356
4357 * lisp.h (modify_region): Rename to...
4358 (modify_region_1): ...new prototype.
4359 * textprop.c (modify_region): Now static. Adjust users.
4360 * insdel.c (modify_region): Rename to...
4361 (modify_region_1): ...new function to work with current buffer.
4362 Adjust comment and users. Use true and false for booleans.
4363
43642012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4365
4366 * alloc.c (free_save_value): New function.
4367 (safe_alloca_unwind): Use it.
4368 * lisp.h (free_save_value): New prototype.
4369 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4370 Add comment.
4371 (save_excursion_restore): Adjust to match saved data structure.
4372 Use free_save_value to offload some work from GC. Drop obsolete
4373 #if 0 code.
4374
43752012-12-03 Chong Yidong <cyd@gnu.org>
4376
4377 * fileio.c (Vauto_save_list_file_name): Doc fix.
4378
43792012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
4380
4381 * w32fns.c: Remove prototype of atof.
4382 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
4383 builds.
4384 (file_dialog_callback): Make it UINT_PTR.
4385
4386 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4387 with 64-bit builds.
4388
4389 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4390 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4391 defined.
4392
43932012-12-03 Glenn Morris <rgm@gnu.org>
4394
4395 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
4396
43972012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4398
4399 Fix xpalloc confusion after memory is exhausted.
4400 * alloc.c (xpalloc): Comment fix.
4401 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4402 and signals an error, do not clear charset_table_size, as
4403 charset_table is still valid.
4404 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4405
4406 Use execve to avoid need to munge environ (Bug#13054).
4407 * callproc.c (Fcall_process):
4408 * process.c (create_process):
4409 Don't save and restore environ; no longer needed.
4410 * callproc.c (child_setup):
4411 Use execve, not execvp, to preserve environ.
4412
44132012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4414
4415 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4416
44172012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4418
4419 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4420 display for sliced images (Bug#10500).
4421
4422 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4423
44242012-11-30 Juanma Barranquero <lekktu@gmail.com>
4425
4426 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4427 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4428
44292012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4430
4431 * xdisp.c (window_outdated): Remove eassert since it hits
4432 some suspicious corner cases (see Bug#13007 and Bug#13012).
4433 (mode_line_update_needed): New function.
4434 (redisplay_internal, redisplay_window): Use it.
4435 (ensure_selected_frame): New function.
4436 (redisplay_internal, unwind_redisplay): Use it.
4437 (redisplay_internal): Move comment about buffer_shared...
4438 (buffer_shared_and_changed): ...near to its real use.
4439
44402012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4441
4442 * callproc.c (Fcall_process): Don't misreport vfork failure.
4443
44442012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4445
4446 * callproc.c (Fcall_process): Fix vfork portability problems.
4447 Do not assume that fd[0], count, filefd, and save_environ survive
4448 vfork. Fix bug whereby wrong errno value could be reported for
4449 pipe failure. Some minor cleanups, too, as follows. Move buf and
4450 bufsize to the context where they're needed. Change new_argv to
4451 be of type char **, as this is more convenient and avoids casts.
4452 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4453 Now local constants, not macros.
4454
44552012-11-18 Kenichi Handa <handa@gnu.org>
4456
4457 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4458 for the variable "f".
4459
44602012-11-13 Kenichi Handa <handa@gnu.org>
4461
4462 * font.c (font_unparse_xlfd): Exclude special characters from the
4463 generating XLFD name.
4464
44652012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4466
4467 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4468 * dired.c (stat_uname, stat_gname):
4469 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4470
4471 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4472 * dired.c (directory_files_internal, file_name_completion):
4473 Assume EAGAIN and EINTR are defined.
4474
4475 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4476 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4477 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4478 * lread.c (readbyte_from_file): Assume EINTR is defined.
4479 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4480 Assume EIO and EAGAIN are defined.
4481 * unexcoff.c (write_segment): Assume EFAULT is defined.
4482
44832012-11-27 Eli Zaretskii <eliz@gnu.org>
4484
4485 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4486 (Bug#11964)
4487
4488 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4489 highlighting on the frame was cleared. Prevents assertion
4490 violations when repeatedly clicking on the "Top" link of the
4491 "bread-crumbs" in Info buffers.
4492
44932012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4494
4495 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4496
44972012-11-24 Ken Brown <kbrown@cornell.edu>
4498
4499 * keyboard.c (HAVE_MOUSE):
4500 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4501 were always defined.
4502
45032012-11-24 Eli Zaretskii <eliz@gnu.org>
4504
4505 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4506 between bpos_covered and bpos_max. This fixes cursor display when
4507 several display strings follow each other.
4508
4509 * .gdbinit (pgx): If the glyph's object is a string, display the
4510 pointer to string data, rather than the value of the string object
4511 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4512
4513 * indent.c (Fvertical_motion): If the starting position is covered
4514 by a display string, return to one position before that, to avoid
4515 overshooting it inside move_it_to. (Bug#12930)
4516
45172012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4518
4519 * frame.h (struct frame): Remove display_preempted member
4520 since all users are dead long ago.
4521 * nsterm.h (struct x_output): Use the only dummy member.
4522 * w32menu.c (pending_menu_activation): Remove since not
4523 really used.
4524 (set_frame_menubar): Adjust user.
4525 * w32term.h (struct x_output): Drop outdated #if 0 code.
4526 (struct w32_output): Use bitfields for explicit_parent,
4527 asked_for_visible and menubar_active members.
4528 Drop unused pending_menu_activation member.
4529 * xterm.h (struct x_output): Drop outdated #if 0 code.
4530 Use bitfields for explicit_parent, asked_for_visible,
4531 has_been_visible and net_wm_state_hidden_seen members.
4532
45332012-11-23 Eli Zaretskii <eliz@gnu.org>
4534
4535 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4536 of a literal "/". (Bug#12955)
4537 (gl-stamp): Invoke fc.exe directly, not through cmd.
4538
45392012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4540
4541 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4542 * dired.c: Assume HAVE_DIRENT_H.
4543 (NAMLEN): Remove, replacing with ...
4544 (dirent_namelen): New function. All uses changed. Use the GNU macro
4545 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4546 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4547 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4548 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4549 $(NT_INC)/dirent.h.
4550 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4551 * ndir.h: Rename to ../nt/inc/dirent.h.
4552 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4553 Do not include <dirent.h>; no longer needed.
4554 * w32.c: Include <dirent.h> rather than "ndir.h".
4555
45562012-11-23 Chong Yidong <cyd@gnu.org>
4557
4558 * xftfont.c (xftfont_open): Remove duplicate assignment.
4559
45602012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4561
4562 * alloc.c (Fgarbage_collect): Unblock input after clearing
4563 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4564 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4565 * msdos.c (IT_frame_up_to_date): Use it here...
4566 * w32term.c (w32_frame_up_to_date): ...here...
4567 * xterm.c (XTframe_up_to_date): ...and here...
4568 * nsterm.m (ns_frame_up_to_date): ...but not here.
4569 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4570 Adjust users.
4571 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4572 Do not check whether GC is in progress.
4573
45742012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4575
4576 * xdisp.c (window_buffer_changed): New function.
4577 (update_menu_bar, update_tool_bar): Use it to
4578 simplify large 'if' statements.
4579 (redisplay_internal): Generalize commonly used
4580 'tail' and 'frame' local variables.
4581
45822012-11-22 Eli Zaretskii <eliz@gnu.org>
4583
4584 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4585 with Windows system header.
4586
45872012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4588
4589 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4590 * alloc.c: Assume unistd.h exists.
4591 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4592 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4593 (getwd) [USG]: Remove; no longer needed.
4594 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4595 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4596 * w32.h (getcwd): Remove decl.
4597
45982012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4599
4600 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4601 Make it set selected_window as well.
4602 (update_tool_bar): Use it.
4603
46042012-11-21 Ken Brown <kbrown@cornell.edu>
4605
4606 * emacs.c (main): Set the G_SLICE environment variable for all
4607 Cygwin builds, not just GTK builds. See
4608 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4609
46102012-11-21 Eli Zaretskii <eliz@gnu.org>
4611
4612 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4613 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4614 Define for the MSVC compiler.
4615
4616 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4617
4618 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4619 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4620 dostounix_filename. Prevents crashes down the road, because
4621 dostounix_filename assumes it gets a unibyte string.
4622 Reported by Michel de Ruiter <michel@sentient.nl>, see
4623 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4624
46252012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4626
4627 Conflate Qnil and Qunbound for `symbol-function'.
4628 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4629 * lread.c (init_obarray): Set `function' fields to Qnil.
4630 * eval.c (Fcommandp): Ignore Qunbound.
4631 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4632 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4633 Test NILP rather than Qunbound.
4634 (Ffmakunbound): Set to Qnil.
4635 (Fsymbol_function): Never signal an error.
4636 (Finteractive_form): Ignore Qunbound.
4637
46382012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4639
4640 * eval.c (interactive_p): Remove no-longer-used decl.
4641
46422012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4643
4644 * xdisp.c (buffer_shared): Adjust comment.
4645 (buffer_shared_and_changed): New function.
4646 (prepare_menu_bars, redisplay_internal): Use it to
4647 decide whether all windows or frames should be updated.
4648 (window_outdated): New function.
4649 (text_outside_line_unchanged_p, redisplay_window): Use it.
4650 (redisplay_internal): Likewise. Fix indentation.
4651
46522012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4653
4654 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4655 (syms_of_eval): Remove corresponding defsubr.
4656 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4657
46582012-11-19 Daniel Colascione <dancol@dancol.org>
4659
4660 * w32fns.c (Fx_file_dialog):
4661 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4662 cygwin_convert_file_name*.
4663
4664 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4665 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4666
46672012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4668
4669 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4670
46712012-11-18 Eli Zaretskii <eliz@gnu.org>
4672
4673 * w32select.c: Include w32common.h before w32term.h, so that
4674 windows.h gets included before w32term.h uses some of its
4675 features, see below.
4676
4677 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4678 New typedefs.
4679 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4680 New prototypes.
4681 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4682
46832012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4684
4685 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4686 (ns_select): Return at once if events are held (Bug#12834).
4687
46882012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4689
4690 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4691 Needed following 2012-10-20 change. (Bug#12902)
4692
46932012-11-18 Juanma Barranquero <lekktu@gmail.com>
4694
4695 * w32proc.c (waitpid): Remove unused label get_result.
4696
46972012-11-17 Juanma Barranquero <lekktu@gmail.com>
4698
4699 * makefile.w32-in (SYSWAIT_H): New macro.
4700 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4701 ($(BLD)/sysdep.$(O)): Update dependencies.
4702
47032012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4704
4705 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4706 * callproc.c (relocate_fd): Assume F_DUPFD.
4707 * emacs.c, term.c (O_RDWR): Remove.
4708 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4709 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4710 * nsterm.m: Assume <fcntl.h> exists.
4711 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4712 (create_pty, Fmake_network_process, server_accept_connection)
4713 (wait_reading_process_output, init_process_emacs):
4714 Assume O_NONBLOCK.
4715 (wait_reading_process_output): Put in a special case for WINDOWSNT
4716 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4717 It's not clear this is needed, but it's a more-conservative change.
4718 (create_process): Assume FD_CLOEXEC.
4719 (create_process, create_pty): Assume O_NOCTTY.
4720 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4721 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4722 Omit if not DOS_NT, since F_GETFL is not defined there.
4723 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4724 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4725 (O_NOCTTY): Remove.
4726 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4727 lack it, since gnulib guarantees this.
4728 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4729
47302012-11-17 Eli Zaretskii <eliz@gnu.org>
4731
4732 * w32.c (faccessat): Pretend that directories have the execute bit
4733 set. Emacs expects that, e.g., in files.el:cd-absolute.
4734
4735 * w32proc.c (create_child): Don't clip the PID of the child
4736 process to fit into an Emacs integer, as this is no longer a
4737 restriction.
4738 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4739 reaping only the process specified by PID argument, if that is
4740 positive. Use PID instead of dead_child to know which process to
4741 reap. Wait for the child to die only if WNOHANG is not in
4742 OPTIONS.
4743 (sys_select): Don't set dead_child.
4744
4745 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4746 as it is no longer needed.
4747
4748 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4749 no longer needed.
4750 (record_child_status_change): Remove the setting of
4751 record_at_most_one_child for the !WNOHANG case.
4752
47532012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4754
4755 Fix problems in ns port found by static checking.
4756 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4757 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4758 not to process group.
4759 (ns_select): Use emacs_write, not write, as that's more robust
4760 in the presence of signals.
4761 (fd_handler:): Check for read errors.
4762
47632012-11-16 Glenn Morris <rgm@gnu.org>
4764
4765 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4766
47672012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4768
4769 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4770
47712012-11-16 Eli Zaretskii <eliz@gnu.org>
4772
4773 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4774 use the same value of thread handle.
4775 (start_timer_thread): If the timer thread exited (due to error),
4776 clean up by closing the two handles it used. Duplicate the caller
4777 thread's handle here, so it gets duplicated only once, when
4778 launching the timer thread. Set priority of the timer thread, not
4779 the caller thread.
4780 (getitimer): Don't duplicate the caller thread's handle here.
4781 (Bug#12832)
4782
47832012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4784
4785 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4786 called (Bug#12834).
4787
47882012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4789
4790 Remove no-longer-used pty_max_bytes variable.
4791 * process.c (pty_max_bytes): Remove; unused.
4792 (send_process): Do not set it.
4793
47942012-11-15 Juanma Barranquero <lekktu@gmail.com>
4795
4796 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4797 Update dependencies.
4798
47992012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4800
4801 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4802 This follows up on the 2012-09-29 patch that removed indirection
4803 for the 'function' field. Reported by Sergey Vinokurov in
4804 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4805
48062012-11-14 Eli Zaretskii <eliz@gnu.org>
4807
4808 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4809 different name, as the MS runtime does not have such a function,
4810 and probably never will.) All callers changed. Ignore DIRFD
4811 value if PATH is an absolute file name, to match Posix spec
4812 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4813 symlinks.
4814
48152012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4816
4817 * xdisp.c (echo_area_display, redisplay_internal):
4818 Omit redundant check whether frame_garbaged is set.
4819
48202012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4821
4822 Use faccessat, not access, when checking file permissions (Bug#12632).
4823 This fixes a bug that has been present in Emacs since its creation.
4824 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4825 which must set some sort of record. (Torek's bug report was against
4826 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4827 same common flaw.) See Torek's Usenet posting
4828 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4829 Posted: Fri Apr 8 14:18:56 1983.
4830 * Makefile.in (LIB_EACCESS): New macro.
4831 (LIBES): Use it.
4832 * callproc.c (init_callproc):
4833 * charset.c (init_charset):
4834 * fileio.c (check_existing, check_executable, check_writable)
4835 (Ffile_readable_p):
4836 * lread.c (openp, load_path_check):
4837 * process.c (allocate_pty):
4838 * xrdb.c (file_p):
4839 Use effective UID when checking permissions, not real UID.
4840 * callproc.c (init_callproc):
4841 * charset.c (init_charset):
4842 * lread.c (load_path_check, init_lread):
4843 Test whether directories are accessible, not merely whether they exist.
4844 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4845 * fileio.c (check_existing, check_executable, check_writable)
4846 (Ffile_readable_p):
4847 Use symbolic names instead of integers for the flags, as they're
4848 portable now.
4849 (check_writable): New arg AMODE. All uses changed.
4850 Set errno on failure.
4851 (Ffile_readable_p): Use faccessat, not stat + open + close.
4852 (Ffile_writable_p): No need to call check_existing + check_writable.
4853 Just call check_writable and then look at errno. This saves a syscall.
4854 dir should never be nil; replace an unnecessary runtime check
4855 with an eassert. When checking the parent directory of a nonexistent
4856 file, check that the directory is searchable as well as writable, as
4857 we can't create files in unsearchable directories.
4858 (file_directory_p): New function, which uses 'stat' on most platforms
4859 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4860 (Ffile_directory_p, Fset_file_times): Use it.
4861 (file_accessible_directory_p): New function, which uses a single
4862 syscall for efficiency.
4863 (Ffile_accessible_directory_p): Use it.
4864 * xrdb.c (file_p): Use file_directory_p.
4865 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4866 * lread.c (openp): When opening a file, use fstat rather than
4867 stat, as that avoids a permissions race. When not opening a file,
4868 use file_directory_p rather than stat.
4869 (dir_warning): First arg is now a usage string, not a format.
4870 Use errno. All uses changed.
4871 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4872 that merely introduced a race.
4873 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4874 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4875 and similarly for the other O_* flags.
4876 * w32.c (sys_faccessat): Rename from sys_access and switch to
4877 faccessat's API. All uses changed.
4878 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4879 (magic_db): Rename from magic_file_p.
4880 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4881 char *, so that we don't have to test for file existence
4882 separately from opening the file for reading. This removes a race
4883 fixes a permission-checking problem, and simplifies the code.
4884 All uses changed.
4885 (file_p): Remove; no longer needed.
4886
48872012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4888
4889 Omit glyphs initialization at startup.
4890 * dispnew.c (glyphs_initialized_initially_p): Remove.
4891 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4892 (Fredraw_frame): Move actual code from here...
4893 (redraw_frame): ...to here. Add eassert. Adjust comment.
4894 (Fredraw_display): Use redraw_frame.
4895 * xdisp.c (clear_garbaged_frames): Likewise.
4896
48972012-11-13 Eli Zaretskii <eliz@gnu.org>
4898
4899 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4900 passed to pint2str and pint2hrstr to be at most the size of the
4901 frame's decode_mode_spec_buffer. This avoids crashes with very
4902 large values of FIELD_WIDTH argument to decode_mode_spec.
4903 (Bug#12867)
4904
49052012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4906
4907 Fix a race with verify-visited-file-modtime (Bug#12863).
4908 Since at least 1991 Emacs has ignored an mtime difference of no
4909 more than one second, but my guess is that this was to work around
4910 file system bugs that were fixed long ago. Since the race is
4911 causing problems now, let's remove that code.
4912 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4913 whose time stamp is off by no more than a second. Insist that the
4914 file time stamps match exactly.
4915
49162012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4917
4918 * frame.h (struct frame): Convert external_tool_bar member to
4919 1-bit unsigned bitfield.
4920 * termhooks.h (struct terminal): Remove mouse_moved member since
4921 all users are long dead. Adjust comment on mouse_position_hook.
4922
49232012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4924
4925 Simplify by using FOR_EACH_FRAME here and there.
4926 * frame.c (next_frame, prev_frame, other_visible_frames)
4927 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4928 * w32term.c (x_window_to_scroll_bar): Likewise.
4929 * window.c (window_list): Likewise.
4930 * xdisp.c (x_consider_frame_title): Likewise.
4931 * xfaces.c (Fdisplay_supports_face_attributes_p): Likewise.
4932 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4933 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4934 * xmenu.c (menubar_id_to_frame): Likewise.
4935 * xselect.c (frame_for_x_selection): Likewise.
4936 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4937 (x_window_to_menu_bar): Likewise.
4938 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4939
49402012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4941
4942 * data.c (Qdefalias_fset_function): Now static.
4943
4944 Another tweak to vectorlike_header change.
4945 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4946 Remove, and replace all uses with ...
4947 (next_in_free_list, set_next_in_free_list):
4948 New functions, which respect C's aliasing rules better.
4949
49502012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4951
4952 * window.c (list4i): Rename from 'quad'. All uses changed.
4953 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4954
49552012-11-11 Juanma Barranquero <lekktu@gmail.com>
4956
4957 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4958 warning about mixing declarations and code in ISO C90.
4959
49602012-11-10 Martin Rudalics <rudalics@gmx.at>
4961
4962 * window.c (Fsplit_window_internal): Set combination limit of
4963 new parent window to t iff Vwindow_combination_limit is t;
4964 fixing a regression introduced with the change from 2012-09-22.
4965 (Fset_window_combination_limit): Fix doc-string.
4966
49672012-11-10 Eli Zaretskii <eliz@gnu.org>
4968
4969 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4970 amount when the scroll margins are too large. When scrolling
4971 backwards in the buffer, give up if cannot reach point or the
4972 scroll margin within a reasonable number of screen lines.
4973 Fixes point position in window under scroll-up/down-aggressively when
4974 point is positioned many lines beyond the window top/bottom.
4975 (Bug#12811)
4976
4977 * ralloc.c (relinquish): If real_morecore fails to return memory
4978 to the system, don't crash; instead, leave the last heap
4979 unchanged and return. (Bug#12774)
4980
49812012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4982
4983 * lisp.h (AUTOLOADP): New macro.
4984 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4985 * data.c (Ffset): Remove special ad-advice-info handling.
4986 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4987 (Fsubr_arity): CSE.
4988 (Finteractive_form): Simplify.
4989 (Fquo): Don't insist on having at least 2 arguments.
4990 (Qdefalias_fset_function): New var.
4991
49922012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4993
4994 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4995
4996 * nsfont.m (Qcondensed, Qexpanded): New variables.
4997 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4998 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4999
50002012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
5001
5002 Fix recently introduced crash on MS-Windows (Bug#12839).
5003 * w32term.h (struct scroll_bar): Use convenient header.
5004 (SCROLL_BAR_VEC_SIZE): Remove.
5005 * w32term.c (x_scroll_bar_create): Use VECSIZE.
5006
50072012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
5008
5009 Tweak last vectorlike_header change.
5010 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
5011 vectorlike object on the free list. This is introduced to avoid
5012 some (but not all) pointer casting and aliasing problems, see
5013 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
5014 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
5015 objects.
5016 (xvectype, xvecsize): Use them to examine Lisp_Object values.
5017
50182012-11-09 Jan Djärv <jan.h.d@swipnet.se>
5019
5020 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
5021 been removed, so remove them here also.
5022
50232012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
5024
5025 * doc.c (Fdocumentation): Handle new property
5026 dynamic-docstring-function to replace the old ad-advice-info.
5027
50282012-11-09 Paul Eggert <eggert@cs.ucla.edu>
5029
5030 * fns.c (Qeql, hashtest_eq): Now static.
5031
50322012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
5033
5034 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
5035 * fns.c (hashfn_eq, hashfn_eql, sxhash):
5036 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
5037 * buffer.c (compare_overlays): Use XLI rather than XHASH.
5038
50392012-11-08 Paul Eggert <eggert@cs.ucla.edu>
5040
5041 Use same hash function for hashfn_profiler as for hash_string etc.
5042 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
5043 * lisp.h (sxhash_combine): New inline function, with the contents
5044 of the old SXHASH_COMBINE.
5045 * profiler.c (hashfn_profiler): Use it, instead of having a
5046 special hash function containing a comparison that always yields 1.
5047
50482012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
5049
5050 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
5051 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
5052 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
5053 Remove unused vars.
5054
50552012-11-08 Jan Djärv <jan.h.d@swipnet.se>
5056
5057 * image.c (xpm_make_color_table_h): Fix compiler error because
5058 make_hash_table changed.
5059
50602012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
5061
5062 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
5063
50642012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
5065
5066 Use ad-hoc comparison function for the profiler's hash-tables.
5067 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
5068 (make_log): Use them.
5069 (handle_profiler_signal): Don't inhibit quit any longer since we don't
5070 call Fequal any more.
5071 (Ffunction_equal): New function.
5072 (cmpfn_profiler, hashfn_profiler): New functions.
5073 (syms_of_profiler): Initialize them.
5074 * lisp.h (struct hash_table_test): New struct.
5075 (struct Lisp_Hash_Table): Use it.
5076 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
5077 * fns.c (make_hash_table): Take a struct to describe the test.
5078 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
5079 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
5080 (hash_lookup, hash_remove_from_table): Move assertion checking of
5081 hashfn result here. Check hash-equality before calling cmpfn.
5082 (Fmake_hash_table): Adjust call to make_hash_table.
5083 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
5084 (syms_of_fns): Initialize them.
5085 * emacs.c (main): Move syms_of_fns earlier.
5086 * xterm.c (syms_of_xterm):
5087 * category.c (hash_get_category_set): Adjust call to make_hash_table.
5088 * print.c (print_object): Adjust to new hash-table struct.
5089 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
5090
50912012-11-08 Eli Zaretskii <eliz@gnu.org>
5092
5093 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
5094 value of w32-scroll-lock-modifier is neither nil nor one of the
5095 known key modifiers. (Bug#12806)
5096
50972012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
5098
5099 Shrink struct vectorlike_header to the only size field.
5100 * lisp.h (enum pvec_type): Avoid explicit enum member values.
5101 Adjust comment.
5102 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
5103 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
5104 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
5105 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
5106 information from the vector header. Adjust comment.
5107 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
5108 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
5109 layout.
5110 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
5111 (struct vectorlike_header): Remove next member. Adjust comment.
5112 (struct Lisp_Subr): Add convenient header. Adjust comment.
5113 (allocate_pseudovector): Adjust prototype.
5114 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
5115 (sweep_string, lisp_malloc): Remove useless prototypes.
5116 (enum mem_type): Adjust comment.
5117 (NEXT_IN_FREE_LIST): New macro.
5118 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
5119 (Fmake_bool_vector): Likewise.
5120 (struct large_vector): New type to represent allocation unit for
5121 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
5122 (large_vectors): Change type to struct large_vector.
5123 (allocate_vector_from_block): Simplify.
5124 (PSEUDOVECTOR_NBYTES): Replace with...
5125 (vector_nbytes): ...new function. Adjust users.
5126 (sweep_vectors): Adjust processing of large vectors.
5127 (allocate_vectorlike): Likewise.
5128 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
5129 Add easserts. Adjust XSETPVECTYPESIZE usage.
5130 (allocate_buffer): Use BUFFER_PVEC_INIT.
5131 (live_vector_p): Adjust to match large vector.
5132 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
5133 * buffer.h (struct buffer): Add next member.
5134 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
5135 New macros.
5136 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
5137 * fns.c (internal_equal): Adjust to match enum pvec_type change.
5138 (copy_hash_table): Adjust to match vector header change.
5139 * lread.c (defsubr): Use XSETPVECTYPE.
5140 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
5141 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
5142 (xvecsize): New command.
5143
51442012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
5145
5146 * keyboard.c (event_to_kboard): Do not dereference
5147 frame_or_window field of SELECTION_REQUEST_EVENT
5148 and SELECTION_CLEAR_EVENT events (Bug#12814).
5149 * xterm.h (struct selection_input_event): Adjust comment.
5150
51512012-11-07 Eli Zaretskii <eliz@gnu.org>
5152
5153 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
5154 such as Scroll Lock, if the respective keys are treated as
5155 function keys, not as modifiers. This avoids destroying non-ASCII
5156 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
5157
51582012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
5159
5160 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
5161
51622012-11-06 Paul Eggert <eggert@cs.ucla.edu>
5163
5164 Restore some duplicate definitions (Bug#12814).
5165 This undoes part of the 2012-11-03 changes. Some people build
5166 with plain -g rather than with -g3, and they need the duplicate
5167 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
5168 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
5169 Define as macros, as well as as enums or as constants.
5170
51712012-11-06 Jan Djärv <jan.h.d@swipnet.se>
5172
5173 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
5174 to keypad keys (Bug#12816).
5175
51762012-11-06 Paul Eggert <eggert@cs.ucla.edu>
5177
5178 Minor adjustments of recently-changed frame functions.
5179 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
5180 known to be a frame (we're in the FRAMEP branch).
5181 * lisp.h (Qframep): Remove decl. frame.h declares this.
5182 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
5183 since they're meant for Lisp fixnum values.
5184
51852012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5186
5187 * window.c (Fwindow_combination_limit): Revert to the only
5188 required argument and adjust docstring as suggested in
5189 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
5190 by Martin Rudalics <rudalics@gmx.at>.
5191
51922012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5193
5194 Widely used frame validity and checking functions.
5195 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
5196 * frame.c (decode_live_frame, decode_any_frame): New functions.
5197 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
5198 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
5199 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
5200 (Fframe_pointer_visible_p): Use decode_any_frame.
5201 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
5202 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
5203 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
5204 (Fframe_focus): Likewise. Allow zero number of arguments.
5205 Adjust docstring.
5206 (frame_buffer_list, frame_buffer_predicate): Remove.
5207 * lisp.h (frame_buffer_predicate): Remove prototype.
5208 * buffer.c (Fother_buffer): Use decode_any_frame.
5209 * xdisp.c (Ftool_bar_lines_needed): Likewise.
5210 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
5211 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
5212 (Fclose_font, Ffont_info): Use decode_live_frame.
5213 * fontset.c (check_fontset_name): Likewise.
5214 * terminal.c (Fframe_terminal): Likewise.
5215 * w32fns.c (check_x_frame): Likewise.
5216 * window.c (Fminibuffer_window, Fwindow_at)
5217 (Fcurrent_window_configuration): Likewise.
5218 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
5219 Likewise. Allow zero number of arguments. Adjust docstring.
5220 * dispnew.c (Fredraw_frame): Likewise.
5221 * xfaces.c (frame_or_selected_frame): Remove.
5222 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
5223 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
5224 (Fframe_face_alist): Use decode_live_frame.
5225 * xfns.c (check_x_frame): Likewise.
5226
52272012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5228
5229 * window.c (quad): New function.
5230 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
5231 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
5232 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
5233 (Fwindow_line_height): Use it.
5234 (Fwindow_fringes): Use list3.
5235 (Fwindow_scroll_bars): Use list4.
5236 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
5237 (Fwindow_combination_limit): Allow zero number of arguments.
5238
52392012-11-05 Eli Zaretskii <eliz@gnu.org>
5240
5241 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
5242
5243 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
5244 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
5245 file descriptor 2 for standard error. (Bug#12805)
5246
52472012-11-05 Chong Yidong <cyd@gnu.org>
5248
5249 * process.c (wait_reading_process_output): Revert previous change.
5250
52512012-11-05 Paul Eggert <eggert@cs.ucla.edu>
5252
5253 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
5254 This removes code that has been obsolete since around 1990.
5255 * callproc.c (Fcall_process):
5256 * emacs.c (main):
5257 * process.c (create_process):
5258 * term.c (dissociate_if_controlling_tty):
5259 Assume setsid exists.
5260 * callproc.c (child_setup): Assume setpgid exists and behaves as
5261 per POSIX.1-1988 or later.
5262 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
5263 * emacs.c (shut_down_emacs):
5264 * sysdep.c (sys_suspend, init_foreground_group):
5265 Assume getpgrp behaves as per POSIX.1-1998 or later.
5266 * msdos.c (setpgrp): Remove.
5267 (tcgetpgrp, setpgid, setsid): New functions.
5268 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
5269 * term.c (no_controlling_tty): Remove; unused.
5270 * w32proc.c (setpgrp): Remove.
5271 (setsid, tcgetpgrp): New functions.
5272
5273 Simplify by assuming __fpending.
5274 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
5275 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
5276 Do not assume that __fpending's result fits in int.
5277
52782012-11-04 Paul Eggert <eggert@cs.ucla.edu>
5279
5280 Remove EMACS_OUTQSIZE+sleep hack.
5281 * dispnew.c (update_frame_1): Remove hack for terminals slower
5282 than 2400 bps, which throttled Emacs by having it sleep.
5283 This code hasn't worked since at least 2007, when the multi-tty stuff
5284 was added, and anyway those old terminals are long dead.
5285 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
5286 without the dispnew.c change, as dispnew.c doesn't include systty.h.
5287
5288 Fix data-loss with --version (Bug#9574).
5289 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
5290 as we can't assume that emacs_strerror is initialized, and strerror
5291 is good enough here.
5292 (main): Invoke atexit earlier, to catch earlier instances of
5293 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
5294
52952012-11-04 Michael Marchionna <tralfaz@pacbell.net>
5296
5297 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
5298 (keyDown): Remap keypad keys to X11 virtual key codes.
5299
53002012-11-03 Paul Eggert <eggert@cs.ucla.edu>
5301
5302 Fix data-loss with --batch (Bug#9574).
5303 * emacs.c: Include <close-stream.h>.
5304 (close_output_streams): New function.
5305 (main): Pass it to atexit, so that Emacs closes stdout and stderr
5306 and handles errors appropriately.
5307 (Fkill_emacs): Don't worry about flushing, as close_output_stream
5308 does that now.
5309
5310 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
5311 The symptom is a diagnostic "GLib-WARNING **: In call to
5312 g_spawn_sync(), exit status of a child process was requested but
5313 SIGCHLD action was set to SIG_IGN and ECHILD was received by
5314 waitpid(), so exit status can't be returned." The diagnostic
5315 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
5316 The real bug is a race condition between Emacs and glib: Emacs
5317 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
5318 so that glib can't find it. Work around the bug by invoking
5319 waitpid only on subprocesses that Emacs itself creates.
5320 * process.c (create_process, record_child_status_change):
5321 Don't use special value -1 in pid field, as the caller now must
5322 know the pid rather than having the callee infer it.
5323 The inference was sometimes incorrect anyway, due to another race.
5324 (create_process): Set new 'alive' member if child is created.
5325 (process_status_retrieved): New function.
5326 (record_child_status_change): Use it.
5327 Accept negative 1st argument, which means to wait for the
5328 processes that Emacs already knows about. Move special-case code
5329 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
5330 processes that have already been waited for, by testing and
5331 clearing new 'alive' member.
5332 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
5333 now does this internally.
5334 (handle_child_signal): Let record_child_status_change do all
5335 the work, since we do not want to reap all exited child processes,
5336 only the child processes that Emacs itself created.
5337 * process.h (Lisp_Process): New boolean member 'alive'.
5338
5339 Omit duplicate definitions no longer needed with gcc -g3.
5340 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
5341 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
5342 Define only as macros. There's no longer any need to also define
5343 these symbols as enums or as constants, since we now assume
5344 gcc -g3 when debugging.
5345
53462012-11-03 Eli Zaretskii <eliz@gnu.org>
5347
5348 * lisp.mk: Adjust comments to the fact that term/internal is now
5349 loaded from loadup.el.
5350
5351 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
5352 (msdos_fatal_signal): New function.
5353 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
5354 its argument list.
5355
5356 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
5357 for GCC versions before 4.
5358 (emacs_raise): Define to call msdos_fatal_signal.
5359
5360 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
5361 iterator when starting in the middle of a display or overlay
5362 string. (Bug#12745)
5363
53642012-11-03 Chong Yidong <cyd@gnu.org>
5365
5366 * process.c (wait_reading_process_output): Clean up the last
5367 change.
5368
53692012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5370
5371 * process.c (wait_reading_process_output): Avoid a race condition
5372 with SIGIO delivery (Bug#11536).
5373
53742012-11-03 Chong Yidong <cyd@gnu.org>
5375
5376 * buffer.c (cursor_type): Untabify docstring.
5377
53782012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5379
5380 * frame.h (struct frame): Drop can_have_scroll_bars member
5381 which is meaningless for a long time. Adjust comments.
5382 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5383 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5384
53852012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5386
5387 * window.c (decode_next_window_args): Update window arg after
5388 calling decode_live_window and so fix crash reported at
5389 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5390 by Juanma Barranquero <lekktu@gmail.com>.
5391 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5392 * font.c (Ffont_at): Likewise.
5393
53942012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5395
5396 * widget.c (resize_cb): New function.
5397 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5398 (EmacsFrameResize): Check if all is up to date before changing frame
5399 size.
5400
54012012-11-02 Eli Zaretskii <eliz@gnu.org>
5402
5403 Implement backtrace output for fatal errors on MS-Windows.
5404 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5405 (BACKTRACE_LIMIT_MAX): New macro.
5406 (w32_backtrace): New function.
5407 (emacs_abort): Use w32_backtrace when the user chooses not to
5408 attach a debugger. Update the text of the abort dialog.
5409
54102012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5411
5412 Window-related stuff cleanup here and there.
5413 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5414 Use decode_any_window.
5415 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5416 * xdisp.c (Fformat_mode_line): Likewise.
5417 * font.c (Ffont_at): Use decode_live_window.
5418 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5419 * window.c (decode_next_window_args): Likewise.
5420 (decode_any_window): Remove static.
5421 * window.h (decode_any_window): Add prototype.
5422 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5423 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5424 respectively.
5425
54262012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5427
5428 Remove pad from struct input_event.
5429 * termhooks.h (struct input_event): Remove padding field.
5430 Adjust comment.
5431 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5432 member is never cons for a long time. Adjust comment.
5433 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5434 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5435 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5436 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5437
54382012-11-01 Eli Zaretskii <eliz@gnu.org>
5439
5440 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5441
54422012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5443
5444 Fix crash when using Emacs as commit editor for git (Bug#12697).
5445 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5446 and it is configured in conf_post.h.
5447 (Fcall_process): Don't invoke both setsid and setpgid; the former
5448 is enough, if it exists.
5449 * callproc.c (Fcall_process, child_setup):
5450 * process.c (create_process): Use setpgid.
5451 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5452 for the real thing.
5453 * dispnew.c (init_display): Initialize the foreground group
5454 if we are running a tty display.
5455 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5456 * lisp.h (init_foreground_group): New decl.
5457 * sysdep.c (inherited_pgroup): New static var.
5458 (init_foreground_group, tcsetpgrp_without_stopping)
5459 (narrow_foreground_group, widen_foreground_group): New functions.
5460 (init_sys_modes): Narrow foreground group.
5461 (reset_sys_modes): Widen foreground group.
5462
54632012-10-31 Michael Albinus <michael.albinus@gmx.de>
5464
5465 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5466
54672012-10-31 Martin Rudalics <rudalics@gmx.at>
5468
5469 * minibuf.c (read_minibuf): Restore current buffer since
5470 choose_minibuf_frame calling Fset_frame_selected_window may
5471 change it (Bug#12766).
5472
54732012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5474
5475 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5476
54772012-10-30 Kenichi Handa <handa@gnu.org>
5478
5479 * font.c (Ffont_at): If WINDOW is specified and it is not
5480 displaying the current buffer, signal an error.
5481
54822012-10-29 Daniel Colascione <dancol@dancol.org>
5483
5484 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5485 In preparation for fixing bug#12739, move these functions from
5486 here...
5487
5488 * coding.h, coding.c: ... to here, and compile them only when
5489 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5490 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
5491
54922012-10-28 Eli Zaretskii <eliz@gnu.org>
5493
5494 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5495 (timer_loop, getitimer, setitimer): Use it instead of
5496 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5497 'clock'.
5498 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5499 literal 10000.
5500
55012012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5502
5503 * nsterm.m (NO_APPDEFINED_DATA): New define.
5504 (last_appdefined_event_data): New variable
5505 (last_appdefined_event): Remove.
5506 (ns_select): Initialize t from last_appdefined_event_data instead
5507 of [last_appdefined_event data1].
5508 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5509 remove last_appdefined_event (Bug#12698).
5510
55112012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5512
5513 * frame.c (x_set_font): Catch internal error.
5514
55152012-10-27 Eli Zaretskii <eliz@gnu.org>
5516
5517 Avoid overflow in w32 implementation of interval timers.
5518 When possible, for ITIMER_PROF count only times the main thread
5519 actually executes.
5520 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
5521 'volatile ULONGLONG' types. All the other data which was
5522 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
5523 (GetThreadTimes_Proc): New typedef.
5524 (w32_get_timer_time): New function, returns a suitable time value
5525 for the timer.
5526 (timer_loop): Enter critical section when accessing ULONGLONG
5527 values of the itimer_data struct, as these accesses are no longer
5528 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5529 Remove unused variable.
5530 (init_timers): Initialize s_pfn_Get_Thread_Times.
5531 (start_timer_thread): Don't assign itimer->caller_thread here.
5532 (getitimer): Assign itimer->caller_thread here.
5533 (setitimer): Always call getitimer to get the value of ticks_now.
5534 (sys_spawnve): Avoid compiler warning about format mismatch.
5535
55362012-10-26 Eli Zaretskii <eliz@gnu.org>
5537
5538 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5539 mouse movement events if the menu bar is active. This avoids
5540 producing a busy "hour-glass" cursor by Windows if the mouse
5541 pointer is positioned over a tooltip shown for some menu item.
5542
55432012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5544
5545 Don't assume process IDs fit in int.
5546 * emacs.c (shut_down_emacs) [!DOS_NT]:
5547 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5548 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5549 Use pid_t, not int, to store process IDs, as 'int'
5550 is not wide enough on a few platforms (e.g., AIX and IRIX).
5551
55522012-10-23 Kenichi Handa <handa@gnu.org>
5553
5554 The following change is to make face-font-rescale-alist work
5555 correctly for non-ASCII fonts.
5556
5557 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5558 (font_open_for_lface): Handle Vface_font_rescale_alist.
5559
55602012-10-23 Chong Yidong <cyd@gnu.org>
5561
5562 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5563
55642012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5565
5566 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5567 for screen font.
5568 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5569
5570 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5571 event (Bug#12681).
5572
55732012-10-21 Glenn Morris <rgm@gnu.org>
5574
5575 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5576
55772012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5578
5579 Port to OpenBSD 5.1.
5580 * frame.c (Fmouse_position, Fmouse_pixel_position):
5581 * xdisp.c (produce_stretch_glyph):
5582 Declare local vars only when they're needed.
5583 This is clearer and avoids a warning on OpenBSD about unused vars.
5584 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5585 This is safer, and avoids OpenBSD warnings about unused vars.
5586 * keyboard.c (record_menu_key): Remove unnecessary decl.
5587 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5588 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5589 as our definition clashes with OpenBSD's.
5590 * xfaces.c (load_face_colors, check_lface_attrs)
5591 (get_lface_attributes_no_remap, get_lface_attributes)
5592 (lface_fully_specified_p, x_supports_face_attributes_p)
5593 (tty_supports_face_attributes_p, face_fontset, realize_face)
5594 (realize_x_face, realize_tty_face):
5595 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5596 merely Lisp_Object *. This is more informative and avoids
5597 a warning on OpenBSD about accessing beyond an object's size.
5598
55992012-10-20 Chong Yidong <cyd@gnu.org>
5600
5601 * lread.c (Fload): Doc fix (Bug#12592).
5602
56032012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5604
5605 * font.c (Ffont_at): Fix previous change.
5606
56072012-10-19 Eli Zaretskii <eliz@gnu.org>
5608
5609 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5610 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5611 for the reasons.
5612
5613 * alloc.c (NSTATICS): Decrease to 0x800.
5614
56152012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5616
5617 * fns.c (Fnreverse): Include the problem element when signaling an
5618 error (bug#12677).
5619
56202012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5621
5622 * nsterm.m (ns_select): Check writefds before call to
5623 FD_ISSET (Bug#12668).
5624
56252012-10-18 Daniel Colascione <dancol@dancol.org>
5626
5627 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5628 (staticpro): If we run out of staticpro slots, die with an
5629 informative error instead of just calling emacs_abort.
5630
56312012-10-18 Martin Rudalics <rudalics@gmx.at>
5632
5633 Fix two flaws reported by Dmitry Antipov.
5634 * window.c (Ftemp_output_buffer_show): Remove.
5635 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5636 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5637
56382012-10-17 Eli Zaretskii <eliz@gnu.org>
5639
5640 * makefile.w32-in ($(BLD)/w32.$(O)):
5641 ($(BLD)/vm-limit.$(O)):
5642 ($(BLD)/term.$(O)):
5643 ($(BLD)/unexw32.$(O)):
5644 ($(BLD)/fileio.$(O)):
5645 ($(BLD)/dispnew.$(O)): Update dependencies.
5646
5647 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5648 Add prototypes.
5649
5650 * w32proc.c: Include ctype.h.
5651
5652 * w32.h (init_environment, check_windows_init_file)
5653 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5654 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5655 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5656 (sys_link): Add prototypes.
5657
5658 * w32.c: Include w32select.h.
5659 (sys_access, e_malloc, sys_select): Add prototypes.
5660 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5661
5662 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5663
5664 * unexw32.c: Include lisp.h and w32.h.
5665
5666 * term.c [WINDOWSNT]: Include w32term.h.
5667
5668 * process.c [WINDOWSNT]: Add prototype of sys_select.
5669
5670 * fileio.c [WINDOWSNT]: Include w32.h.
5671
5672 * dispnew.c [WINDOWSNT]: Include w32.h.
5673
5674 * cygw32.c (Fcygwin_convert_path_to_windows)
5675 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5676 Lisp_Object values. (Bug#12661)
5677
5678 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5679 to Lisp_Object. (Bug#12661)
5680
56812012-10-17 Kenichi Handa <handa@gnu.org>
5682
5683 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5684 invalidate.
5685
56862012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5687
5688 * buffer.c (Fkill_buffer): When unchaining the marker,
5689 reset its buffer pointer to NULL (Bug#12652).
5690
56912012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5692
5693 Do not verify indirection counters of killed buffers (Bug#12579).
5694 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5695 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5696
56972012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5698
5699 * alloc.c (Fmake_byte_code): Fix typo in comment.
5700 * print.c (print_interval): Define as static to match prototype.
5701 * indent.c (disptab_matches_widthtab, recompute_width_table):
5702 Convert to eassert.
5703
57042012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5705
5706 * editfns.c (get_system_name): Remove.
5707 * lisp.h (get_system_name): Remove prototype.
5708 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5709 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5710
57112012-10-15 Daniel Colascione <dancol@dancol.org>
5712
5713 * dbusbind.c: Add comment explaining reason for previous change.
5714
57152012-10-15 Martin Rudalics <rudalics@gmx.at>
5716
5717 * window.c (Fwindow_end): Rewrite check whether cached position
5718 can be used (Bug#12600).
5719 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5720 Set windows_or_buffers_changed.
5721
57222012-10-15 Daniel Colascione <dancol@dancol.org>
5723
5724 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5725 enabled by undefining the symbol "interface", which the platform
5726 headers define to something incompatible.
5727
57282012-10-14 Daniel Colascione <dancol@dancol.org>
5729
5730 * image.c (init_tiff_functions, init_imagemagick_functions)
5731 (init_svg_functions): Fix cygw32 build break by using these
5732 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5733
57342012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5735
5736 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5737
57382012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5739
5740 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5741
57422012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5743
5744 * coding.c (detect_coding): Set coding->id before calling
5745 this->detector.
5746
57472012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5748
5749 * fileio.c: Formatting fixes.
5750
57512012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5752
5753 Fix some stat-related races.
5754 * fileio.c (Fwrite_region): Avoid race condition if a file is
5755 removed or renamed by some other process immediately after Emacs
5756 writes it but before Emacs stats it. Do not assume that stat (or
5757 fstat) succeeds.
5758 * image.c (slurp_file): Resolve the file name with fopen + fstat
5759 rather than stat + fopen.
5760 (pbm_read_file) [0]: Remove unused code with stat race.
5761 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5762 Remove ineffective code with stat race.
5763
57642012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5765
5766 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5767
57682012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5769
5770 * nsterm.m (hold_event_q): New static variable.
5771 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5772 ! q_event_ptr.
5773 (hold_event): New function.
5774 (ns_read_socket): If hold_event_q have events, store them and
5775 return (Bug#12384).
5776 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5777 is zero (Bug#12384).
5778
57792012-10-12 Juanma Barranquero <lekktu@gmail.com>
5780
5781 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5782
57832012-10-12 Eli Zaretskii <eliz@gnu.org>
5784
5785 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5786
5787 * fileio.c (check_existing): New function.
5788 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5789 instead of calling 'stat', when what's needed is to check whether
5790 a file exists. This avoids expensive system calls on MS-Windows.
5791 (Bug#12587)
5792
5793 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5794
5795 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5796 determine whether a file exists and is not a directory.
5797
5798 * lisp.h (check_existing): Add prototype.
5799
58002012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5801
5802 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5803
58042012-10-12 Glenn Morris <rgm@gnu.org>
5805
5806 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5807
58082012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5809
5810 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5811
5812 * eval.c (Fautoload): Remember previous autoload status in load-history.
5813
58142012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5815
5816 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5817 * lread.c (load_each_byte, new_backquote_flag, readchar)
5818 (read_filtered_event, lisp_file_lexically_bound_p)
5819 (safe_to_load_version, Fload, complete_filename_p, openp)
5820 (build_load_history, readevalloop, read_escape, read1)
5821 (string_to_number, read_vector, read_list):
5822 * macros.c (Fstart_kbd_macro):
5823 * marker.c (CONSIDER):
5824 * menu.c (parse_single_submenu, digest_single_submenu)
5825 (find_and_return_menu_selection, Fx_popup_menu):
5826 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5827 (Ftry_completion):
5828 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5829 (ns_menu_show):
5830 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5831 (xmenu_show, xdialog_show):
5832 Use bool for booleans.
5833 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5834 as it's not a predicate. All uses changed. Omit unnecessary
5835 buffer termination.
5836
58372012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5838
5839 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5840 (save_excursion_restore): Do not restore mark if it was not saved.
5841
58422012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5843
5844 * marker.c (cached_modiff): EMACS_INT, not int.
5845
5846 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5847 instead of having a wrong decl.
5848 * nsmenu.m (waiting_for_input): Remove wrong decl.
5849
58502012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5851
5852 keyboard.c, keymap.c: Use bool for booleans.
5853 * dispnew.c (sit_for): Distinguish between 3-way display_option
5854 and boolean do_display.
5855 * keyboard.c (single_kboard, this_command_key_count_reset)
5856 (waiting_for_input, echoing, immediate_quit, input_pending)
5857 (interrupt_input, interrupts_deferred, pop_kboard)
5858 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5859 (command_loop_1, adjust_point_for_property)
5860 (safe_run_hooks_error, input_polling_used, read_char):
5861 (help_char_p, readable_events, kbd_buffer_events_waiting)
5862 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5863 (lucid_event_type_list_p, get_input_pending):
5864 (gobble_input, menu_separator_name_p, menu_bar_item)
5865 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5866 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5867 (keyremap_step, test_undefined, read_key_sequence)
5868 (detect_input_pending, detect_input_pending_ignore_squeezables)
5869 (detect_input_pending_run_timers, requeued_events_pending_p)
5870 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5871 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5872 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5873 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5874 (accessible_keymaps_1, Fkey_description, push_key_description):
5875 (shadow_lookup, struct where_is_internal_data)
5876 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5877 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5878 (describe_map, describe_vector):
5879 * menu.c (single_menu_item):
5880 * nsmenu.m (ns_update_menubar):
5881 * process.c (wait_reading_process_output):
5882 * search.c (scan_buffer, scan_newline):
5883 Use bool for boolean.
5884 * keyboard.c (timers_run, swallow_events)
5885 (detect_input_pending_run_timers):
5886 * process.c (wait_reading_process_output):
5887 Use unsigned for counter where wraparound-on-overflow is desired,
5888 since unsigned is guaranteed to have that behavior and signed is not.
5889 (read_char): Use ptrdiff_t for string length.
5890 (get_input_pending): Remove first argument, since it was always
5891 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5892 and behave as if it had that value. Return new value of
5893 input_pending. All callers changed.
5894 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5895 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5896 a string length.
5897 * keymap.c (push_key_description): Omit last arg, which was always 1.
5898 All callers changed.
5899
5900 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5901
59022012-10-10 Juanma Barranquero <lekktu@gmail.com>
5903
5904 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5905 ($(BLD)/term.$(O)): Update dependencies.
5906
59072012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5908
5909 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5910 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5911 initializer for PVEC_NORMAL_VECTOR.
5912
59132012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 Clean out old termopts cruft.
5916 * termopts.h (flow_control, meta_key): Remove unused decls.
5917 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5918 Don't include termopts.h.
5919
59202012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5921
5922 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5923
59242012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5925
5926 * commands.h (immediate_quit): Remove duplicate decl.
5927
59282012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5929
5930 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5931 caching.
5932 (nsfont_open): Remove setting of Vfonts_in_cache.
5933 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5934
59352012-10-09 Eli Zaretskii <eliz@gnu.org>
5936
5937 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5938 match what GetLastError returns. Explain why the function is
5939 needed.
5940
5941 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5942 'is_tooltip_frame', to avoid confusion with its global namesake.
5943
59442012-10-08 Daniel Colascione <dancol@dancol.org>
5945
5946 * xdisp.c (start_hourglass): Call w32_note_current_window when
5947 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5948 build that caused Emacs to display the hourglass cursor forever.
5949
5950 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5951 which is broken under remote desktop, calculate the number of
5952 colors available for a display based on the display's number of
5953 planes and number of bits per pixel per plane. (bug#10397).
5954
59552012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5956
5957 * nsfont.m (Vfonts_in_cache): New variable.
5958 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5959 are used. Add cached fonts to Vfonts_in_cache.
5960 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5961
59622012-10-08 Juanma Barranquero <lekktu@gmail.com>
5963
5964 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5965 in nt/config.nt.
5966 (FONT_H): Define after FRAME_H.
5967 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5968 Update dependencies.
5969
5970 * w32term.c: Remove leftover declaration of keyboard_codepage.
5971
59722012-10-08 Eli Zaretskii <eliz@gnu.org>
5973
5974 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5975 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5976 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5977 (GLOBAL_SOURCES): Add cygw32.c.
5978 ($(BLD)/unexw32.$(O)):
5979 ($(BLD)/w32.$(O)):
5980 ($(BLD)/w32console.$(O)):
5981 ($(BLD)/w32fns.$(O)):
5982 ($(BLD)/w32heap.$(O)):
5983 ($(BLD)/w32menu.$(O)):
5984 ($(BLD)/w32proc.$(O)): Add w32common.h.
5985
5986 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5987 'const char *'.
5988 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5989
59902012-10-08 Daniel Colascione <dancol@dancol.org>
5991
5992 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5993 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5994 accidental message numbering hole. Change other messages to
5995 match.
5996
5997 * w32select.h (HAVE_W32SELECT): Remove.
5998
5999 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
6000 w32common.h instead of w32heap.h.
6001
6002 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
6003 (get_allocation_unit, get_processor_type, get_w32_major_version)
6004 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
6005 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
6006 (OS_NT, os_subtype, cache_system_info): Move declarations to
6007 w32common.
6008
6009 * w32heap.c: Include w32common.h.
6010 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
6011 (w32_minor_version, w32_build_number, w32_subtype):
6012 Remove duplicate definitions.
6013
6014 * w32fns.c: Include w32common.h; include w32heap.h only in
6015 WINDOWSNT.
6016
6017 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
6018 Use `report_file_error' instead of `error' in order to better
6019 inform users of what went wrong. Increase NTGUI_UNICODE file
6020 dialog box file name length to 32k, the maximum allowed by the NT
6021 kernel.
6022
6023 * w32common.h: New file.
6024 (ROUND_UP, ROUND_DOWN, get_page_size)
6025 (get_allocation_unit, get_processor_type, get_w32_major_version)
6026 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
6027 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
6028 (OS_NT, os_subtype, cache_system_info): Move here.
6029
6030 * unexw32.c, unexcw.c: Include w32common.h.
6031
6032 * emacs.c (main): Use (defined (WINDOWSNT) || defined
6033 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
6034 to call syms_of_w32select.
6035
6036 * cygw32.h: Remove obsolete EXFUN declarations.
6037
6038 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
6039
6040 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
6041 of w32inevt.o from SOME_MACHINE_OBJECTS.
6042
60432012-10-08 Daniel Colascione <dancol@dancol.org>
6044
6045 * image.c: Permanent fix for JPEG compilation issue --- limit
6046 jpeglib `boolean' redefinition to Cygwin builds.
6047
60482012-10-08 Eli Zaretskii <eliz@gnu.org>
6049
6050 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
6051
6052 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
6053 Cygwin.
6054
60552012-10-08 Daniel Colascione <dancol@dancol.org>
6056
6057 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
6058 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
6059 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
6060 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
6061 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
6062 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
6063 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
6064 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
6065 now a supported configuration.
6066
6067 * Makefile.in: consolidate image variables into LIBIMAGE; add
6068 W32_OBJ and W32_LIBS. Compile new files.
6069
6070 * conf_post.h:
6071 (_DebPrint) declare tracing facility for W32 debugging. We need
6072 to unify tracing later.
6073
6074 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
6075 unconditional use of W32 Unicode functions. Cygwin runs only on
6076 100% Unicode operating systems.
6077
6078 * cygw32.c: New file. Define Cygwin-specific facilities.
6079 (Fcygwin_convert_path_to_windows)
6080 (Fcygwin_convert_path_from_windows): New user functions for
6081 accessing Cygwin path-munging routines.
6082
6083 * cygw32.h: New file.
6084 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
6085 UTF-16LE strings temporarily inside non-Lisp-visible string
6086 objects.
6087
6088 (w32_strerror): Just what it says on the tin.
6089
6090 * emacs.c: Make the NS fork-then-exec code for daemon-launching
6091 also run for Cygwin; both systems have the same problem with using
6092 GUI facilities in a forked child. Also call syms_of_cygw32,
6093 syms_of_w32select in correct places.
6094
6095 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
6096 needs fork-then-exec for daemon launching.
6097
6098 * font.h: Include frame.h.
6099
6100 * image.c: Use the image library cache machinery only when we're
6101 compiling for native WINDOWSNT; Cygwin can use shared libraries
6102 like any other Unixlike system.
6103
6104 * keyboard.c: Clarify a comment regarding the input loop.
6105
6106 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
6107 functions directly instead of trying to detect at runtime that our
6108 host operating system supports them. We make this change for two
6109 reasons: Cygwin lacks support for the multibyte character
6110 conversion functions used by the legacy menu code, and Cygwin
6111 never needs to rely on non-Unicode APIs.
6112
6113 * unexw32.c (hinst): Declare extern.
6114
6115 * w32.c: Change header order;
6116 (w32_strerror): Move to w32fns.c because we need it for
6117 non-WINDOWSNT builds.
6118
6119 * w32.h: Add #error macro to make sure we don't include w32.h for
6120 Cygwin builds. Remove w32select declarations.
6121
6122 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
6123 w32fns.c. w32console.c is WINDOWSNT-only.
6124
6125 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
6126 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
6127 POSIXy alternative.
6128 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
6129 (w32_major_version, w32_minor_version, w32_build_number)
6130 (os_subtype, sound_type): Define here
6131 (w32_defined_color): Make color parameter const for consistency
6132 with other _defined_color functions.
6133 (w32_createwindow): Unconditionally call w32_init_class instead of
6134 doing so only when hprevinst is non-NULL. Plumbing hprevinst
6135 through the code is complex and unnecessary because class
6136 registration is practically free.
6137 (w32_name_of_message): New EMACSDEBUG-only function.
6138 (Fset_message_beep): Move here
6139 (Fx_open_connection): Require that the display name for Windows be
6140 "w32" for consistency, emacsclient disambiguation, and maybe, one
6141 day, multi-window-system support.
6142 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
6143 Cygwin files for W32 GUI facilities, since these clearly don't
6144 expect Cygwin names.
6145 (_DebPrint): Define.
6146 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
6147 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
6148 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
6149 (w32_last_error): Remove.
6150
6151 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
6152
6153 * w32heap.c (syspage_mask): Declare here.
6154 (cache_system_info): Remove.
6155
6156 * w32inevt.c (faked_key): Define globally, not statically.
6157 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
6158 (w32_console_toggle_lock_key): Move to w32fns.c.
6159
6160 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
6161
6162 * w32proc.c (_DebPrint): Move to w32fns.c.
6163 * w32select.c: Include string.h, stdio.h for Cygwin.
6164 * w32select.h: New File.
6165
6166 * w32term.c: Include io.h for non-CYGWIN builds; needed for
6167 get_osfhandle.
6168 (w32_message_fd): New variable. Under Cygwin, holds the file
6169 descriptor the system used to tell us about pending thread
6170 messages.
6171
6172 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
6173 that prevented compilation under non-WINDOWSNT systems.
6174
6175 (w32_initialize): Open /dev/windows and assign it to
6176 w32_message_fd. Provide w32 feature.
6177
6178 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
6179 (WM_EMACS_INPUT_READY): add.
6180 (prepend_msg, w32_message_fd): Declare globally.
6181
6182 * w32xfns.c:
6183 (keyboard_handle): Use only when WINDOWSNT.
6184 (notify_msg_ready): New function. Posts a message to the main
6185 thread's message queue under CYGWIN, which wakes up the main
6186 thread from select(2) by making the /dev/windows file descriptor
6187 ready. Under WINDOWSNT, it sets an event the same way the old
6188 code did.
6189
6190 (post, prepend_msg): Actually call notify_msg_ready instead of
6191 setting the input event directly.
6192
61932012-10-07 Eli Zaretskii <eliz@gnu.org>
6194
6195 * ralloc.c (relinquish): If a heap is ready to be relinquished,
6196 but it still has blocs in it, don't return it to the system,
6197 instead of aborting. (Bug#12402)
6198
61992012-10-07 Jan Djärv <jan.h.d@swipnet.se>
6200
6201 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
6202
6203 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
6204 MAC_OS_X_VERSION_10_6.
6205 (syms_of_nsterm): Remove comment about Panther and above for
6206 ns-antialias-text.
6207 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
6208 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
6209 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
6210
6211 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
6212 MAC_OS_X_VERSION_10_4.
6213
6214 * nsmenu.m (fillWithWidgetValue:): Remove code for <
6215 MAC_OS_X_VERSION_10_2.
6216
6217 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
6218
6219 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
6220 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
6221
6222 * nsterm.m (ns_in_resize): Remove (Bug#12479).
6223 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
6224 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
6225 Remove ns_in_resize check.
6226 (ns_clear_frame_area): Remove resize handle code.
6227
6228 * nsfns.m (ns_in_resize): Remove.
6229 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
6230 Remove ns_in_resize check.
6231
62322012-10-07 Paul Eggert <eggert@cs.ucla.edu>
6233
6234 Improve sys_siglist detection.
6235 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
6236 defined as a macro, as is done in Solaris.
6237 (sys_siglist_entries): New macro.
6238 (save_strsignal): Use it.
6239 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
6240 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
6241
62422012-10-06 Jan Djärv <jan.h.d@swipnet.se>
6243
6244 * nsfns.m (Fx_create_frame): Call x_default_parameter with
6245 fullscreen/Fullscreen.
6246
6247 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
6248 tobar_height is new.
6249
6250 * nsterm.m (x_make_frame_visible): Check for fullscreen.
6251 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
6252 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
6253 (windowDidResize:): Check for correct window if old style fullscreen.
6254 Capitalize word in comment. Remove incorrect comment.
6255 (initFrameFromEmacs:): tbar_height renamed tibar_height.
6256 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
6257 error in drawing background.
6258 (toggleFullScreen:): Remove comment. Rearrange calls.
6259 Set toolbar values to zero, save old height in tobar_height.
6260 Restore tool bar height when leaving fullscreen.
6261 (canBecomeMainWindow): New function.
6262
62632012-10-06 Paul Eggert <eggert@cs.ucla.edu>
6264
6265 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
6266
62672012-10-05 Eli Zaretskii <eliz@gnu.org>
6268
6269 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
6270
6271 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
6272 that time stamps of directories could also be changed.
6273 Don't request the too broad GENERIC_WRITE, only the more restrictive
6274 FILE_WRITE_ATTRIBUTES access rights.
6275
6276 * fileio.c (Fset_file_times): Special-case ignoring errors for
6277 directories only on MSDOS, not on MS-Windows.
6278
62792012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
6280
6281 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
6282
62832012-10-04 Eli Zaretskii <eliz@gnu.org>
6284
6285 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
6286 see whether CreateFile failed.
6287
62882012-10-04 Paul Eggert <eggert@cs.ucla.edu>
6289
6290 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
6291 to avoid similar races.
6292 * keyboard.c (pending_signals): Now bool, not int.
6293
6294 Port timers to OpenBSD, plus check for timer failures.
6295 OpenBSD problem reported by Han Boetes.
6296 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
6297 and/or setitimer.
6298 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
6299 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
6300 like OpenBSD, which has timer_settime but does not declare it.
6301 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
6302 whether to use itimerspec-related primitives. All uses of
6303 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
6304
63052012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6306
6307 * profiler.c (handle_profiler_signal): Fix a malloc race
6308 that caused Emacs to hang on Fedora 17 when profiling Lisp.
6309
63102012-10-02 Jan Djärv <jan.h.d@swipnet.se>
6311
6312 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
6313
63142012-10-02 Eli Zaretskii <eliz@gnu.org>
6315
6316 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
6317 consistent with the change in return value of 'safe_strsignal'.
6318
63192012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6320
6321 Prefer plain 'static' to 'static inline' (Bug#12541).
6322 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
6323 (bidi_set_sor_type, bidi_push_embedding_level)
6324 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
6325 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
6326 (bidi_cache_search, bidi_cache_ensure_space)
6327 (bidi_cache_iterator_state, bidi_cache_find)
6328 (bidi_peek_at_next_level, bidi_set_paragraph_end)
6329 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6330 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
6331 Now 'static', not 'static inline'.
6332
6333 Count overruns when profiling; change units to ns.
6334 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
6335 Give extra weight to samples after overruns, to attempt to count
6336 the time more accurately.
6337 (setup_cpu_timer): Change sampling interval units from ms to ns, since
6338 the underlying primitives nominally do ns.
6339 (Fprofiler_cpu_start): Document the change. Mention that
6340 the sampling intervals are only approximate.
6341
63422012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6343
6344 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
6345
6346 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6347 case for the special 0 coding-system.
6348
6349 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
6350 (Fmake_overlay): Remove redundant tests.
6351 (fix_start_end_in_overlays): Remove redundant recentering.
6352
63532012-10-02 Juanma Barranquero <lekktu@gmail.com>
6354
6355 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
6356 Update dependencies.
6357
63582012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6359
6360 Fix a malloc race condition involving strsignal.
6361 A signal can arrive in the middle of a malloc, and Emacs's signal
6362 handler can invoke strsignal, which can invoke malloc, which is
6363 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6364 Fix it by altering the signal handler so that it does not invoke
6365 strsignal.
6366 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6367 * process.c (status_message): Use const pointer, in case strsignal
6368 is #defined to safe_strsignal.
6369 * sysdep.c (sys_siglist, init_signals): Always define and
6370 initialize a substitute sys_siglist if the system does not define
6371 one, even if HAVE_STRSIGNAL.
6372 (safe_strsignal): Rename from strsignal. Always define,
6373 using sys_siglist. Return a const pointer.
6374 * syssignal.h (safe_strsignal): New decl.
6375 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6376
63772012-10-01 Eli Zaretskii <eliz@gnu.org>
6378
6379 * w32proc.c (timer_loop): Fix code that waits for timer
6380 expiration, to avoid high CPU usage.
6381
63822012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6383
6384 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6385 (sweep_weak_table): Remove redundant prototypes.
6386
63872012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6388
6389 * emacs.c: Move the inclusion of TERM_HEADER after including
6390 windows.h on WINDOWSNT. This avoids compilation problems with
6391 MSVC.
6392
63932012-10-01 Eli Zaretskii <eliz@gnu.org>
6394
6395 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6396 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6397 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6398 as the previous version used 'void *'.
6399
6400 * ralloc.c (ROUNDUP): Fix last change.
6401 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6402 'size_t'.
6403
6404 * w32proc.c <disable_itimers>: New static flag.
6405 (init_timers): Initialize it to zero, after creating the critical
6406 sections used by the timer threads.
6407 (term_timers): Set to 1 before deleting the critical sections.
6408 (getitimer, setitimer): If disable_itimers is non-zero, return an
6409 error indication without doing anything. Reported by Fabrice
6410 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
6411 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6412 return results.
6413 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6414 support timers.
6415
6416 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6417 term_ntproc after all the other bookkeeping, to get timers working
6418 as long as possible.
6419
64202012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6421
6422 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6423 Suggested by Juri Linkov in
6424 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6425
6426 Prefer plain 'static' to 'static inline' (Bug#12541).
6427 With static functions, modern compilers inline pretty well by
6428 themselves; advice from programmers often hurts as much as it helps.
6429 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6430 this change shrinks the text size of the Emacs executable by 1.1%
6431 without affecting CPU significantly in my benchmark.
6432 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6433 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6434 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6435 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6436 (bset_auto_fill_function, bset_auto_save_file_format)
6437 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6438 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6439 (bset_cache_long_line_scans, bset_case_fold_search)
6440 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6441 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6442 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6443 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6444 (bset_header_line_format, bset_indicate_buffer_boundaries)
6445 (bset_indicate_empty_lines, bset_invisibility_spec)
6446 (bset_left_fringe_width, bset_major_mode, bset_mark)
6447 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6448 (bset_name, bset_overwrite_mode, bset_pt_marker)
6449 (bset_right_fringe_width, bset_save_length)
6450 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6451 (bset_scroll_up_aggressively, bset_selective_display)
6452 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6453 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6454 (set_buffer_overlays_after):
6455 * category.c (bset_category_table):
6456 * charset.c (read_hex):
6457 * coding.c (produce_composition, produce_charset)
6458 (handle_composition_annotation, handle_charset_annotation)
6459 (char_encodable_p):
6460 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6461 (assign_row, set_frame_matrix_frame, make_current)
6462 (add_row_entry):
6463 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6464 * fns.c (maybe_resize_hash_table):
6465 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6466 * gmalloc.c (register_heapinfo):
6467 * image.c (lookup_image_type):
6468 * intervals.c (set_interval_object, set_interval_left)
6469 (set_interval_right, copy_interval_parent, rotate_right)
6470 (rotate_left, balance_possible_root_interval):
6471 * keyboard.c (kset_echo_string, kset_kbd_queue)
6472 (kset_keyboard_translate_table, kset_last_prefix_arg)
6473 (kset_last_repeatable_command, kset_local_function_key_map)
6474 (kset_overriding_terminal_local_map, kset_real_last_command)
6475 (kset_system_key_syms, clear_event, set_prop):
6476 * lread.c (digit_to_number):
6477 * marker.c (attach_marker, live_buffer, set_marker_internal):
6478 * nsterm.m (ns_compute_glyph_string_overhangs):
6479 * process.c (pset_buffer, pset_command)
6480 (pset_decode_coding_system, pset_decoding_buf)
6481 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6482 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6483 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6484 * syntax.c (bset_syntax_table, dec_bytepos):
6485 * terminal.c (tset_param_alist):
6486 * textprop.c (interval_has_some_properties)
6487 (interval_has_some_properties_list):
6488 * window.c (wset_combination_limit, wset_dedicated)
6489 (wset_display_table, wset_hchild, wset_left_fringe_width)
6490 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6491 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6492 (wset_right_fringe_width, wset_right_margin_cols)
6493 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6494 (wset_vertical_scroll_bar_type, wset_window_parameters):
6495 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6496 (wset_column_number_displayed, wset_region_showing)
6497 (window_box_edges, run_window_scroll_functions)
6498 (append_glyph_string_lists, prepend_glyph_string_lists)
6499 (append_glyph_string, set_glyph_string_background_width)
6500 (append_glyph, append_composite_glyph)
6501 (take_vertical_position_into_account):
6502 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6503 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6504 (lface_hash, lface_same_font_attributes_p, lookup_face):
6505 * xml.c (libxml2_loaded_p):
6506 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6507 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6508 Now 'static', not 'static inline'.
6509
6510 * bidi.c: Tune.
6511 (bidi_copy_it): Do the whole copy with a single memcpy.
6512 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6513
6514 Revert the FOLLOW-SYMLINKS change for file-attributes.
6515 Doing it right would require several changes to Tramp, and there's
6516 not enough time to get that tested before the freeze today.
6517 * dired.c (directory_files_internal, Ffile_attributes):
6518 Undo last change.
6519
6520 * frame.c (x_report_frame_params): Port better to wider ints.
6521 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6522 or that pointers can be printed in 15 decimal digits.
6523 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6524
65252012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6526
6527 Support x64 build on MS-Windows.
6528 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6529 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6530 compatibility with x64.
6531 (x_get_focus_frame): Add prototype.
6532
6533 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6534 defining an XRectangle structure.
6535
6536 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6537 arithmetics for compatibility with x64.
6538
6539 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6540 compatibility with x64.
6541
6542 * w32heap.h: Adjust prototypes and declarations.
6543
6544 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6545 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6546 DWORD, long, and unsigned long, for compatibility with x64.
6547 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6548 (sbrk): Argument is now of type ptrdiff_t.
6549
6550 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6551 less than 0x0500.
6552 (w32_msg_pump): Use WPARAM type for 'result'.
6553
6554 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6555 architecture.
6556 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6557 compatibility with x64.
6558
6559 * vm-limit.c (lim_data): Now size_t.
6560 (check_memory_limits): Adjust prototypes of real_morecore and
6561 __morecore to receive argument of type ptrdiff_t. Use size_t for
6562 five_percent and data_size.
6563
6564 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6565 variables, for compatibility with x64.
6566 (rva_to_section, offset_to_section, relocate_offset)
6567 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6568 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6569 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6570 for compatibility with x64.
6571
6572 * sysdep.c (STDERR_FILENO): Define if not already defined.
6573
6574 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6575 (__morecore): Argument type is now ptrdiff_t.
6576 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6577 (relinquish): Use ptrdiff_t type for 'excess'.
6578 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6579
6580 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6581 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6582 instead of a literal number.
6583
6584 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6585 (min): Define only if not already defined.
6586
6587 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6588 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6589 hosts.
6590
6591 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6592 'bitmaps' is a pointer.
6593
6594 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6595
6596 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6597
65982012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6599
6600 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6601 * dired.c (directory_files_internal, Ffile_attributes):
6602 New arg follow_symlinks. All uses changed.
6603
66042012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6605
6606 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6607
66082012-09-30 Eli Zaretskii <eliz@gnu.org>
6609
6610 Support atimers and CPU profiler via profile.c on MS-Windows.
6611 * w32proc.c (sig_mask, crit_sig): New static variables.
6612 (sys_signal): Support SIGALRM and SIGPROF.
6613 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6614 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6615 sigfillset, and sigprocmask are no longer no-ops.
6616 (sigismember): New function.
6617 (struct itimer_data): New definition.
6618 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6619 (crit_prof): New static variables.
6620 (MAX_SINGLE_SLEEP): New definition.
6621 (timer_loop, stop_timer_thread, term_timers, init_timers)
6622 (start_timer_thread, getitimer, setitimer): New functions.
6623 (alarm): No longer a no-op, calls setitimer.
6624
6625 * w32.c (term_ntproc): Call term_timers.
6626 (init_ntproc): Make sure all signals are unblocked at startup, to
6627 erase any traces of dumping. Call init_timers.
6628
6629 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6630 Windows-specific code to display the hourglass mouse pointer is no
6631 longer used.
6632 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6633 to hourglass timer expiration.
6634 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6635 Remove, no longer used.
6636 (w32_note_current_window, show_hourglass, hide_hourglass):
6637 New functions, in support of hourglass cursor display similar to other
6638 window systems.
6639 (syms_of_w32fns): Don't initialize hourglass_timer.
6640
6641 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6642 WINDOWSNT as well.
6643 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6644
6645 * w32.h (init_timers, term_timers): Add prototypes.
6646
66472012-09-30 Kenichi Handa <handa@gnu.org>
6648
6649 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6650 to the buffer relocation which may be caused by ccl_driver.
6651
66522012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6653
6654 * xfns.c (Fx_file_dialog): Update comment.
6655
6656 * w32fns.c (Fx_file_dialog): Update comment.
6657
6658 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6659 Initialize panel name field if OSX >= 10.6.
6660
6661 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6662
6663 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6664
6665 * nsterm.m (NEW_STYLE_FS): New define.
6666 (ns_fullscreen_hook, windowWillEnterFullScreen)
6667 (windowDidEnterFullScreen, windowWillExitFullScreen)
6668 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6669 (setFSValue): New functions.
6670 (EmacsFSWindow): New implementation.
6671 (canBecomeKeyWindow): New function for EmacsFSWindow.
6672 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6673 (dealloc): Release nonfs_window if in fullscreen.
6674 (updateFrameSize:): Call windowDidMove to update top/left.
6675 (windowWillResize:toSize:): Check if frame is still maximized.
6676 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6677 next_maximized, maximized_width, maximized_height and nonfs_window.
6678 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6679 tbar_height.
6680 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6681 fullscreen. Set maximized_width/height. Act on next_maximized.
6682
6683 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6684 (EmacsView): Add variables for fullscreen.
6685 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6686 (EmacsFSWindow): New interface for fullscreen.
6687
66882012-09-30 Juanma Barranquero <lekktu@gmail.com>
6689
6690 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6691
66922012-09-30 Chong Yidong <cyd@gnu.org>
6693
6694 * fns.c (Frandom): Doc fix.
6695
66962012-09-30 Martin Rudalics <rudalics@gmx.at>
6697
6698 * window.c (Vwindow_combination_limit): New default value.
6699 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6700
67012012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6702
6703 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6704 Suggested by Eli Zaretskii in
6705 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6706
67072012-09-30 Eli Zaretskii <eliz@gnu.org>
6708
6709 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6710 HAVE_TIMER_SETTIME is defined.
6711
67122012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6713
6714 Profiler improvements: more-accurate timers, overflow checks.
6715 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6716 signal.h, setjmp.h. Include systime.h instead.
6717 (saturated_add): New function.
6718 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6719 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6720 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6721 New static vars.
6722 (enum profiler_cpu_running): New enum.
6723 (profiler_cpu_running): Now of that enum type, not bool.
6724 All uses changed to store the new value.
6725 (handle_profiler_signal): Rename from sigprof_handler_1,
6726 for consistency with other handlers. Do not check whether
6727 cpu_log is a hash-table if garbage collecting, since it
6728 doesn't matter in that case.
6729 (deliver_profiler_signal): Rename from sigprof_handler,
6730 for consistency with other handlers.
6731 (setup_cpu_timer): New function, with much of what used to be in
6732 Fprofiler_cpu_start. Check for out-of-range argument.
6733 Prefer timer_settime if available, and prefer
6734 thread cputime clocks, then process cputime clocks, then
6735 monotonic clocks, to the old realtime clock. Use make_timeval
6736 to round more-correctly when falling back to setitimer.
6737 (Fprofiler_cpu_start): Use it.
6738 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6739 Don't assume that passing NULL as the 2nd argument of setitimer
6740 is the same as passing a pointer to all-zero storage.
6741 Ignore SIGPROF afterwards.
6742 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6743 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6744 non-fatal signal handlers. Ignore SIGPROF on startup.
6745 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6746 in profiler.c, since sysdep.c now uses it.
6747
6748 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6749 Suggested by Eli Zaretskii in
6750 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6751
67522012-09-29 Juanma Barranquero <lekktu@gmail.com>
6753
6754 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6755
67562012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6757
6758 * lisp.h (struct backtrace): Remove indirection for `function' field.
6759 * xdisp.c (redisplay_internal):
6760 * profiler.c (record_backtrace, sigprof_handler_1):
6761 * alloc.c (Fgarbage_collect):
6762 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6763 (Fbacktrace_frame): Adjust accordingly.
6764
67652012-09-28 Glenn Morris <rgm@gnu.org>
6766
6767 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6768 (Frun_hook_with_args_until_failure): Doc fixes.
6769
67702012-09-28 Eli Zaretskii <eliz@gnu.org>
6771
6772 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6773 Qautomatic_redisplay and change the symbol name. All users changed.
6774
67752012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6776
6777 * profiler.c (sigprof_handler): Fix race condition.
6778
67792012-09-28 Glenn Morris <rgm@gnu.org>
6780
6781 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6782
67832012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6784
6785 Check more robustly for timer_settime.
6786 * Makefile.in (LIB_TIMER_TIME): New macro.
6787 (LIBES): Add it.
6788 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6789 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6790 call timer_settime.
6791
67922012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6793
6794 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6795
67962012-09-26 Juanma Barranquero <lekktu@gmail.com>
6797
6798 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6799
68002012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6801
6802 * character.h (MAYBE_UNIFY_CHAR): Remove.
6803 * charset.c, charset.h (maybe_unify_char): Now static.
6804 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6805 Since this stuff is now private to charset.c, there's no need for
6806 a public macro and no need to inline by hand.
6807
68082012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6809 Stefan Monnier <monnier@iro.umontreal.ca>
6810 Juanma Barranquero <lekktu@gmail.com>
6811
6812 * profiler.c: New file.
6813 * Makefile.in (base_obj): Add profiler.o.
6814 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6815 ($(BLD)/profiler.$(O)): New target.
6816 * emacs.c (main): Call syms_of_profiler.
6817 * alloc.c (Qautomatic_gc): New constant.
6818 (MALLOC_PROBE): New macro.
6819 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6820 (total_bytes_of_live_objects): New function.
6821 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6822 Call malloc_probe for the memory profiler.
6823 (syms_of_alloc): Define Qautomatic_gc.
6824 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6825 race condition.
6826 (struct backtrace): Move definition...
6827 * lisp.h (struct backtrace): ..here.
6828 (Qautomatic_gc, profiler_memory_running): Declare vars.
6829 (malloc_probe, syms_of_profiler): Declare functions.
6830 * xdisp.c (Qautomatic_redisplay): New constant.
6831 (redisplay_internal): Record itself in backtrace_list.
6832 (syms_of_xdisp): Define Qautomatic_redisplay.
6833
68342012-09-25 Eli Zaretskii <eliz@gnu.org>
68352012-09-25 Juanma Barranquero <lekktu@gmail.com>
6836
6837 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6838
68392012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6840
6841 Prefer POSIX timers if available.
6842 They avoid a race if the timer is too close to the current time.
6843 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6844 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6845 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6846
68472012-09-25 Eli Zaretskii <eliz@gnu.org>
6848
6849 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6850 CHAR_STRING_ADVANCE.
6851 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6852 STRING_CHAR_ADVANCE.
6853
68542012-09-25 Juanma Barranquero <lekktu@gmail.com>
6855
6856 Move Vlibrary_cache to emacs.c and reset before dumping.
6857
6858 * lisp.h (reset_image_types): Declare.
6859 [WINDOWSNT] (Vlibrary_cache): Declare.
6860
6861 * image.c (reset_image_types): New function.
6862
6863 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6864 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6865 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6866
6867 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6868 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6869
6870 * w32.h (Vlibrary_cache): Do not declare.
6871
68722012-09-25 Eli Zaretskii <eliz@gnu.org>
6873
6874 * w32proc.c (sys_signal): Handle all signals defined by the
6875 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6876 handlers for signals supported by Windows. Don't override
6877 term_ntproc as the handler for SIGABRT.
6878 (sigaction): Rewrite to call sys_signal instead of duplicating its
6879 code.
6880 (sys_kill): Improve commentary.
6881
6882 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6883 consistency with a signature of a signal handler. All callers
6884 changed.
6885 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6886 install term_ntproc as a signal handler for SIGABRT, as that
6887 should be done by the dumped Emacs.
6888
6889 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6890
6891 * w32select.c (term_w32select): Protect against repeated
6892 invocation by setting clipboard_owner to NULL after calling
6893 DestroyWindow.
6894
6895 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6896 and term_ntproc to their modified signatures.
6897
6898 * character.c (char_string, string_char): Remove calls to
6899 MAYBE_UNIFY_CHAR. See the discussion starting at
6900 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6901 for the details.
6902
69032012-09-25 Chong Yidong <cyd@gnu.org>
6904
6905 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6906
69072012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6908
6909 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6910 when encountering an unknown bytecode.
6911
69122012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6913
6914 image.c, indent.c: Use bool for booleans.
6915 * dispextern.h (struct image_type): Members valid_p, load, init
6916 now return bool, not int. All uses changed.
6917 * image.c: Omit unnecessary static decls.
6918 (x_create_bitmap_mask, x_build_heuristic_mask):
6919 Return void, not int, since callers don't care about the return value.
6920 (x_create_bitmap_mask, define_image_type, valid_image_p)
6921 (struct image_keyword, parse_image_spec, image_spec_value)
6922 (check_image_size, image_background)
6923 (image_background_transparent, x_clear_image_1)
6924 (postprocess_image, lookup_image, x_check_image_size)
6925 (x_create_x_image_and_pixmap, xbm_image_p)
6926 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6927 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6928 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6929 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6930 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6931 (png_image_p, init_png_functions, png_load_body, png_load)
6932 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6933 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6934 (init_gif_functions, gif_load, imagemagick_image_p)
6935 (imagemagick_load_image, imagemagick_load, svg_image_p)
6936 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6937 (gs_load):
6938 * nsimage.m (ns_load_image):
6939 * nsterm.m (ns_defined_color):
6940 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6941 * xfns.c (x_defined_color):
6942 * xterm.c (x_alloc_lighter_color_for_widget)
6943 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6944 (x_alloc_lighter_color):
6945 * indent.c (disptab_matches_widthtab, current_column)
6946 (scan_for_column, string_display_width, indented_beyond_p)
6947 (compute_motion, vmotion, Fvertical_motion):
6948 Use bool for booleans.
6949
69502012-09-24 Chong Yidong <cyd@gnu.org>
6951
6952 * chartab.c (Fset_char_table_default): Obsolete function removed.
6953
69542012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6955
6956 Move pid_t related decls out of lisp.h.
6957 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6958 (interruptible_wait_for_termination):
6959 Move these decls from lisp.h to syswait.h, since they use pid_t.
6960 Needed on FreeBSD; see Herbert J. Skuhra in
6961 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6962 * callproc.c: Include syswait.h.
6963
6964 gnutls.c, gtkutil.c: Use bool for boolean.
6965 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6966 (emacs_gnutls_handle_error):
6967 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6968 (xg_hide_tooltip, xg_create_frame_widgets)
6969 (create_dialog, xg_uses_old_file_dialog)
6970 (xg_get_file_with_chooser, xg_get_file_with_selection)
6971 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6972 (xg_item_label_same_p, xg_update_menubar)
6973 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6974 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6975 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6976 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6977 (update_frame_tool_bar, free_frame_tool_bar):
6978 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6979 * nsmenu.m (ns_update_menubar):
6980 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6981 * xfns.c (Fx_show_tip) [USE_GTK]:
6982 Use bool for boolean.
6983 * gtkutil.c (xg_update_frame_menubar):
6984 * xmenu.c (update_frame_menubar):
6985 Return void, not int, since caller ignores return value.
6986 * gtkutil.c (xg_change_toolbar_position):
6987 Return void, not 1.
6988
69892012-09-23 Juanma Barranquero <lekktu@gmail.com>
6990
6991 * makefile.w32-in (BLOCKINPUT_H): Remove.
6992 (SYSSIGNAL_H): New macro.
6993 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6994 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6995 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6996 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6997 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6998 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6999 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
7000 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
7001 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
7002 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
7003 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
7004 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
7005 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
7006 ($(BLD)/w32xfns.$(O)): Update dependencies.
7007
70082012-09-23 Eli Zaretskii <eliz@gnu.org>
7009
7010 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
7011 fatal_error_backtrace.
7012
7013 * w32proc.c (sys_kill): Undo last change: don't do anything when
7014 invoked to deliver SIGABRT to our own process. This is now
7015 handled by emacs_raise.
7016
70172012-09-23 Juanma Barranquero <lekktu@gmail.com>
7018
7019 * w32term.c (w32_read_socket): Remove leftover reference to
7020 interrupt_input_pending.
7021
70222012-09-23 Paul Eggert <eggert@cs.ucla.edu>
7023
7024 Do not use SA_NODEFER.
7025 Problem reported by Dani Moncayo in
7026 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
7027 * alloc.c (die):
7028 * sysdep.c (emacs_abort): Do not reset signal handler.
7029 * emacs.c (terminate_due_to_signal): Reset signal handler here.
7030 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
7031 wanted even on POSIXish hosts, and it doesn't work on Windows.
7032
70332012-09-23 Jan Djärv <jan.h.d@swipnet.se>
7034
7035 * xterm.c (x_term_init): Call fixup_locale before and after calling
7036 gtk_init (Bug#12392).
7037
70382012-09-23 Chong Yidong <cyd@gnu.org>
7039
7040 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
7041 Vdynamic_library_alist.
7042
7043 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
7044 (Fgnutls_available_p): Caller changed.
7045
7046 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
7047 (Flibxml_parse_xml_region): Likewise.
7048
7049 * dispextern.h (struct image_type): Remove arg from init function.
7050
7051 * image.c (Finit_image_library, lookup_image_type)
7052 (define_image_type): Remove now-unneeded second arg.
7053 (init_xpm_functions, init_png_functions, init_jpeg_functions)
7054 (init_tiff_functions, init_gif_functions, init_svg_functions):
7055 Arglist and w32_delayed_load calling convention changed.
7056 (gs_type): Remove init_gs_functions; there is no such function.
7057 (valid_image_p, make_image): Fix caller to lookup_image_type.
7058
70592012-09-23 Paul Eggert <eggert@cs.ucla.edu>
7060
7061 Simplify and avoid signal-handling races (Bug#12471).
7062 * alloc.c (die):
7063 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
7064 Avoid recursive loop if there's a fatal error in the function itself.
7065 * atimer.c (pending_atimers):
7066 * blockinput.h: Don't include "atimer.h"; no longer needed.
7067 (interrupt_input_pending): Remove. All uses removed.
7068 pending_signals now counts both atimers and ordinary interrupts.
7069 This is less racy than having three separate pending-signal flags.
7070 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
7071 (input_blocked_p):
7072 Rename from their upper-case counterparts BLOCK_INPUT,
7073 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
7074 INPUT_BLOCKED_P, and turn into functions. All uses changed.
7075 This makes it easier to access volatile variables more accurately.
7076 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
7077 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
7078 that's more reliable if the code is buggy and sets
7079 interrupt_input_blocked to a negative value. All uses changed.
7080 * atimer.c (deliver_alarm_signal):
7081 Remove. No need to deliver this to the parent; any thread can
7082 handle this signal now. All uses replaced by underlying handler.
7083 * atimer.c (turn_on_atimers):
7084 * dispnew.c (handle_window_change_signal):
7085 * emacs.c (handle_danger_signal):
7086 * keyboard.c (kbd_buffer_get_event):
7087 Don't reestablish signal handler; not needed with sigaction.
7088 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
7089 (UNBLOCK_INPUT_TO):
7090 Rework to avoid unnecessary accesses to volatile variables.
7091 (UNBLOCK_INPUT_TO): Now a function.
7092 (totally_unblock_input, unblock_input): New decls.
7093 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
7094 (init_data): Remove. Necessary stuff now done in init_signal.
7095 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
7096 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
7097 (fatal_error_code): Remove; no longer needed.
7098 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
7099 it doesn't always backtrace. All uses changed. No need to reset
7100 signal to default, since sigaction and/or die does that for us now.
7101 Use emacs_raise (FOO), not kill (getpid (), FOO).
7102 (main): Check more-accurately whether we're dumping.
7103 Move fatal-error setup to sysdep.c
7104 * floatfns.c: Do not include "syssignal.h"; no longer needed.
7105 * gtkutil.c (xg_get_file_name, xg_get_font):
7106 Remove no-longer-needed signal-mask manipulation.
7107 * keyboard.c, process.c (POLL_FOR_INPUT):
7108 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
7109 * keyboard.c (read_avail_input): Remove.
7110 All uses replaced by gobble_input.
7111 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
7112 (kbd_buffer_store_event_hold, gobble_input):
7113 (record_asynch_buffer_change) [USABLE_SIGIO]:
7114 (store_user_signal_events):
7115 No need to mess with signal mask.
7116 (gobble_input): If blocking input and there are terminals, simply
7117 set pending_signals to 1 and return. All hooks changed to not
7118 worry about whether input is blocked.
7119 (process_pending_signals): Clear pending_signals before processing
7120 them, in case a signal comes in while we're processing.
7121 By convention callers now test pending_signals before calling us.
7122 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
7123 New functions, to support changes to blockinput.h.
7124 (handle_input_available_signal): Now extern.
7125 (reinvoke_input_signal): Remove. All uses replaced by
7126 handle_async_input.
7127 (quit_count): Now volatile, since a signal handler uses it.
7128 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
7129 All callers changed. Block SIGINT only if not already blocked.
7130 Clear sigmask reliably, even if Fsignal returns, which it can.
7131 Omit unnecessary accesses to volatile var.
7132 (quit_throw_to_read_char): No need to restore sigmask.
7133 * keyboard.c (gobble_input, handle_user_signal):
7134 * process.c (wait_reading_process_output):
7135 Call signal-handling code rather than killing ourselves.
7136 * lisp.h: Include <float.h>, for...
7137 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
7138 (pending_signals): Now volatile.
7139 (syms_of_data): Now const if IEEE floating point.
7140 (handle_input_available_signal) [USABLE_SIGIO]:
7141 (terminate_due_to_signal, record_child_status_change): New decls.
7142 * process.c (create_process): Avoid disaster if memory is exhausted
7143 while we're processing a vfork, by tightening the critical section
7144 around the vfork.
7145 (send_process_frame, process_sent_to, handle_pipe_signal)
7146 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
7147 ignores SIGPIPE.
7148 (send_process): No need for setjmp/longjmp any more, since the
7149 SIGPIPE stuff is now gone. Instead, report an error if errno
7150 is EPIPE.
7151 (record_child_status_change): Now extern. PID and W are now args.
7152 Return void, not bool. All callers changed.
7153 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
7154 Remove. All uses removed. This bug should be fixed now in a
7155 different way.
7156 (wait_for_termination_1): Use waitpid rather than sigsuspend,
7157 and record the child status change directly. This avoids the
7158 need to futz with the signal mask.
7159 (process_fatal_action): Move here from emacs.c.
7160 (emacs_sigaction_flags): New function, containing
7161 much of what used to be in emacs_sigaction_init.
7162 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
7163 caught by emacs, to make races less likely.
7164 (deliver_process_signal): Rename from handle_on_main_thread.
7165 All uses changed.
7166 (BACKTRACE_LIMIT_MAX): Now at top level.
7167 (thread_backtrace_buffer, threadback_backtrace_pointers):
7168 New static vars.
7169 (deliver_thread_signal, deliver_fatal_thread_signal):
7170 New functions, for more-accurate delivery of thread-specific signals.
7171 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
7172 (deliver_arith_signal): Handle in this thread, not
7173 in the main thread, since it's triggered by this thread.
7174 (maybe_fatal_sig): New function.
7175 (init_signals): New arg DUMPING so that we can be more accurate
7176 about whether we're dumping. Caller changed.
7177 Treat thread-specific signals differently from process-general signals.
7178 Block all signals while handling fatal error; that's safer.
7179 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
7180 on IEEE hosts.
7181 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
7182 Ignore SIGPIPE unless batch.
7183 (emacs_backtrace): Output backtrace for the appropriate thread,
7184 which is not necessarily the main thread.
7185 * syssignal.h: Include <stdbool.h>.
7186 (emacs_raise): New macro.
7187 * xterm.c (x_connection_signal): Remove; no longer needed
7188 now that we use sigaction.
7189 (x_connection_closed): No need to mess with sigmask now.
7190 (x_initialize): No need to reset SIGPIPE handler here, since
7191 init_signals does this for us now.
7192
71932012-09-23 Jan Djärv <jan.h.d@swipnet.se>
7194
7195 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
7196 background rect may be larger (Bug#12245).
7197
71982012-09-23 Chong Yidong <cyd@gnu.org>
7199
7200 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
7201
72022012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7203
7204 * .gdbinit: Just stop at fatal_error_backtrace.
7205 See Stefan Monnier's request in
7206 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
7207 Remove no-longer-used query of system type.
7208
72092012-09-22 Chong Yidong <cyd@gnu.org>
7210
7211 * search.c (Freplace_match): Doc fix (Bug#12325).
7212
7213 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
7214
7215 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
7216 (Fline_end_position): Doc fix.
7217
7218 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
7219
72202012-09-22 Chong Yidong <cyd@gnu.org>
7221
7222 * dispextern.h (struct image_type): Add new slot, storing a type
7223 initialization function.
7224
7225 * image.c (define_image_type): Call the image initializer function
7226 if it is defined. Arguments and return value changed.
7227 (valid_image_p, make_image): Callers changed.
7228 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
7229 (gif_type, imagemagick_type, svg_type, gs_type):
7230 Add initialization functions.
7231 (Finit_image_library): Call lookup_image_type.
7232 (CHECK_LIB_AVAILABLE): Macro deleted.
7233 (lookup_image_type): Call define_image_type here, rather than via
7234 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
7235 (syms_of_image): Move define_image_type calls for xbm_type and
7236 pbm_type to lookup_image_type.
7237
72382012-09-22 Eli Zaretskii <eliz@gnu.org>
7239
7240 * keyboard.c (timer_check_2): Move calculation of 'timers' and
7241 'idle_timers' from here ...
7242 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
7243 lists, to avoid infloops when the timer does something stupid,
7244 like reinvoke itself with the same or smaller time-out.
7245 (Bug#12447)
7246
72472012-09-22 Martin Rudalics <rudalics@gmx.at>
7248
7249 * window.c (Fsplit_window_internal): Handle only Qt value of
7250 Vwindow_combination_limit separately.
7251 (Qtemp_buffer_resize): New symbol.
7252 (Vwindow_combination_limit): New default value.
7253 Rewrite doc-string.
7254
72552012-09-22 Eli Zaretskii <eliz@gnu.org>
7256
7257 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
7258 the new overlay string. (Bug#10159)
7259
72602012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7261
7262 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
7263 or that fprintf is async-signal-safe. POSIX doesn't require
7264 either assumption.
7265
72662012-09-22 Chong Yidong <cyd@gnu.org>
7267
7268 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
7269 (Bug#8207).
7270
72712012-09-22 Kenichi Handa <handa@gnu.org>
7272
7273 * composite.c (composition_reseat_it): Handle the case that a
7274 grapheme cluster is not covered by a single font (Bug#12352).
7275
72762012-09-21 Chong Yidong <cyd@gnu.org>
7277
7278 * image.c (define_image_type): Avoid adding duplicate types to
7279 image_types (Bug#12463). Suggested by Jörg Walter.
7280
72812012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7282
7283 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
7284 (print_load_command_name): Add case LC_DATA_IN_CODE.
7285 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
7286
72872012-09-21 Glenn Morris <rgm@gnu.org>
7288
7289 * eval.c (Frun_hook_with_args_until_success)
7290 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
7291
72922012-09-21 Andreas Schwab <schwab@linux-m68k.org>
7293
7294 * fileio.c (Ffile_selinux_context): Only call freecon when
7295 lgetfilecon succeeded.
7296 (Fset_file_selinux_context): Likewise. (Bug#12444)
7297
72982012-09-21 Eli Zaretskii <eliz@gnu.org>
7299
7300 * xdisp.c (try_window_reusing_current_matrix): Under bidi
7301 reordering, locate the cursor by calling set_cursor_from_row; if
7302 that fails, clear the desired glyph matrix before returning a
7303 failure indication to the caller. Fixes leaving garbled display
7304 when fast scrolling with a down-key. (Bug#12403)
7305 (compute_stop_pos_backwards): Fix a typo that caused crashes while
7306 scrolling through multibyte text.
7307
73082012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
7309
7310 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
7311 calling mark_vectorlike since that's the one that marks the window.
7312 (mark_discard_killed_buffers): Mark the final cdr.
7313 * window.h (struct window): Move prev/next_buffers to the
7314 non-standard fields.
7315 * window.c (make_window): Initialize prev/next_buffers manually.
7316
73172012-09-20 Paul Eggert <eggert@cs.ucla.edu>
7318
7319 Omit unused arg EXPECTED from socket hooks.
7320 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
7321 * nsterm.m (ns_term_init):
7322 * termhooks.h (struct terminal.read_socket_hook):
7323 * w32inevt.c (w32_console_read_socket):
7324 * w32term.c (w32_read_socket):
7325 * xterm.c (XTread_socket):
7326 Omit unused arg EXPECTED. All callers changed.
7327 (store_user_signal_events): Return void, not int, since callers no
7328 longer care about the return value. All uses changed.
7329
73302012-09-20 Juanma Barranquero <lekktu@gmail.com>
7331
7332 * w32gui.h (XParseGeometry): Do not declare.
7333
73342012-09-19 Paul Eggert <eggert@cs.ucla.edu>
7335
7336 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
7337 Ignore 'expected'. See Eli Zaretskii in
7338 <http://bugs.gnu.org/12471#8> (last line).
7339
7340 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
7341 (XParseGeometry): Now static. Substitute extremal values for
7342 values that are out of range.
7343
73442012-09-19 Jan Djärv <jan.h.d@swipnet.se>
7345
7346 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
7347
7348 * nsfns.m (XParseGeometry): Remove.
7349 (Fx_create_frame): Call x_set_offset to correctly interpret
7350 top_pos in geometry.
7351
7352 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
7353 (Fx_parse_geometry): If there is a space in string, call
7354 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
7355
73562012-09-17 Eli Zaretskii <eliz@gnu.org>
7357
7358 * search.c (scan_buffer): Use character positions in calls to
7359 region_cache_forward and region_cache_backward, not byte
7360 positions. (Bug#12196)
7361
7362 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7363 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7364
7365 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7366 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7367 emacs_blocked_malloc, now deleted.
7368
73692012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7370
7371 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7372 The workaround was for improving performance on Solaris 2.4, but
7373 is getting in the way now. Emacs will still work if someone is
7374 still running Solaris 2.4 in a museum somewhere; Sun dropped
7375 support for Solaris 2.4 in 2003.
7376 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7377 * process.c (create_process) [HAVE_WORKING_VFORK]:
7378 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7379 since Emacs no longer uses vfork on that platform.
7380
73812012-09-17 Glenn Morris <rgm@gnu.org>
7382
7383 * emacs.c: Use COPYRIGHT.
7384
73852012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7386
7387 Remove configure's --without-sync-input option (Bug#12450).
7388 When auditing signal-handling in preparation for cleaning it up,
7389 I found that SYNC_INPUT has race conditions and would be a real
7390 pain to fix. Since it's an undocumented and deprecated
7391 configure-time option, now seems like a good time to remove it.
7392 Also see <http://bugs.gnu.org/11080#16>.
7393 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7394 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7395 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7396 (malloc_hysteresis):
7397 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7398 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7399 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7400 (dont_register_blocks, bytes_used_when_reconsidered)
7401 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7402 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7403 [!SYSTEM_MALLOC && !SYNC_INPUT]:
7404 Remove. All uses removed.
7405 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7406 implementation, one that depends on whether the new macro
7407 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7408 is defined.
7409 * atimer.c (run_timers, handle_alarm_signal):
7410 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7411 (handle_async_input, process_pending_signals)
7412 (handle_input_available_signal, init_keyboard):
7413 * nsterm.m (ns_read_socket):
7414 * process.c (wait_reading_process_output):
7415 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7416 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7417 (emacs_write):
7418 * xterm.c (XTread_socket):
7419 Assume SYNC_INPUT.
7420 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7421 * eval.c (handling_signal): Remove. All uses removed.
7422 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7423 All uses replaced with the SYNC_INPUT version.
7424 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7425 Remove decls.
7426 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7427 Now static.
7428
7429 * font.c (Ffont_shape_gstring): Remove unused local.
7430
74312012-09-16 Glenn Morris <rgm@gnu.org>
7432
7433 * Makefile.in (clean): No longer run nextstep's clean.
7434
7435 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7436 (ns_frag): Remove.
7437 (ns-app): Move here from ns.mk, and simplify.
7438 (clean): Simplify nextstep entry.
7439 * ns.mk: Remove file.
7440
74412012-09-17 Kenichi Handa <handa@gnu.org>
7442
7443 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7444 not covert the last few charactes.
7445
74462012-09-16 Kenichi Handa <handa@gnu.org>
7447
7448 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7449 here, but just check the validity of glyphs in the glyph-string.
7450
74512012-09-16 Martin Rudalics <rudalics@gmx.at>
7452
7453 * window.c (Fwindow_parameter, Fset_window_parameter):
7454 Accept any window as argument (Bug#12452).
7455
74562012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7457
7458 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7459 to ns_term_init to avoid memory leak.
7460
7461 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7462 explicit retain/release.
7463 (ns_term_init): Only allow one display. Initialize outerpool and
7464 ns_*_types.
7465
74662012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7467
7468 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7469 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7470 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7471 the Microsoft problem in a different way, by altering ../nt/config.nt.
7472
74732012-09-15 Eli Zaretskii <eliz@gnu.org>
7474
7475 * w32xfns.c:
7476 * w32uniscribe.c:
7477 * w32term.c:
7478 * w32select.c:
7479 * w32reg.c:
7480 * w32proc.c:
7481 * w32menu.c:
7482 * w32inevt.c:
7483 * w32heap.c:
7484 * w32font.c:
7485 * w32fns.c:
7486 * w32console.c:
7487 * w32.c:
7488 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7489 by lisp.h. This completes removal of setjmp.h inclusion
7490 erroneously announced in the previous commit. (Bug#12446)
7491
7492 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7493 more accurate.
7494
7495 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7496 not defined as a macro. The latter happens on MS-Windows.
7497 (Bug#12446)
7498
74992012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7500
7501 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7502 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7503 Some instances of '#include <setjmp.h>' removed, if the
7504 only reason for the instance was because "lisp.h" was included.
7505 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7506 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7507 and _longjmp with the new symbols. Emacs already uses _setjmp if
7508 available, so this change affects only POSIXish hosts that have
7509 sigsetjmp but not _setjmp, such as some versions of Solaris and
7510 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7511 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7512 (png_load_body) [HAVE_PNG]:
7513 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7514 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7515 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7516 since PNG requires jmp_buf. This is the only exception to the
7517 general rule that we now use sys_setjmp and sys_longjmp.
7518 This exception is OK since this code does not change the signal
7519 mask or longjmp out of a signal handler.
7520
75212012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7522
7523 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7524 Include "syssignal.h", for 'main_thread'.
7525
75262012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7527
7528 Avoid out-of-range marker position (Bug#12426).
7529 * insdel.c (replace_range, replace_range_2):
7530 Adjust markers before overlays, as suggested by comments.
7531 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7532 Remove redundant check before calling offset_intervals.
7533
75342012-09-14 Martin Rudalics <rudalics@gmx.at>
7535
7536 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7537 current buffer (Bug#12387).
7538
75392012-09-14 Juanma Barranquero <lekktu@gmail.com>
7540
7541 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7542
75432012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7544
7545 Use a more backwards-compatible timer format (Bug#12430).
7546 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7547 vector element, not from the 4th, since PSECS is now at the end.
7548 (Fcurrent_idle_time): Doc fix.
7549
75502012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7551
7552 Function to mark objects and remove killed buffers at once.
7553 * alloc.c (discard_killed_buffers): Rename to ...
7554 (mark_discard_killed buffers) ... new name. Add marking
7555 of remaining objects. Fix comment. Adjust users.
7556 (mark_object): Do not touch frame buffer lists here.
7557 * frame.c (delete_frame): Reset frame buffer lists here.
7558
75592012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7560
7561 Better workaround for GNOME bug when --enable-gcc-warnings.
7562 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7563 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7564 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7565
7566 Simplify SIGIO usage (Bug#12408).
7567 The code that dealt with SIGIO was crufty and confusing, e.g., it
7568 played tricks like "#undef SIGIO" but these tricks were not used
7569 consistently. Simplify mostly by not #undeffing standard symbols,
7570 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7571 or not as we please) rather than "defined SIGIO" (standard symbol
7572 that we probably shouldn't #undef).
7573 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7574 Modules that need it can include it.
7575 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7576 * dispextern.h (ignore_sigio): New decl.
7577 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7578 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7579 * emacs.c (shut_down_emacs):
7580 * keyboard.c (kbd_buffer_store_event_hold):
7581 Use ignore_sigio rather than invoking 'signal' directly.
7582 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7583 for FIONREAD.
7584 (FIONREAD, SIGIO): Do not #undef.
7585 (tty_read_avail_input): Use #error rather than a syntax error.
7586 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7587 for I_PIPE, used by SETUP_SLAVE_PTY.
7588 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7589 * sysdep.c (croak): Remove; no longer needed. This bit of
7590 temporary code, with Fred N. Fish's comment that it's temporary,
7591 has been in Emacs since at least 1992!
7592 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7593 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7594 * syssignal.h (croak): Remove decl.
7595 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7596 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7597 now that we're termios-only.
7598 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7599 * term.c (dissociate_if_controlling_tty): Use #error rather than
7600 a run-time error.
7601
7602 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7603 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7604 to work around GNOME bug 683906.
7605 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7606 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7607 This works around GCC bug 54561.
7608
76092012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7610
7611 More fixes for 'volatile' and setjmp/longjmp.
7612 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7613 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7614 (png_load_body) [HAVE_PNG]:
7615 (jpeg_load_body) [HAVE_JPEG]:
7616 New function, with most of the old parent function's body.
7617 (png_load) [HAVE_PNG]:
7618 (jpeg_load) [HAVE_JPEG]:
7619 Invoke the new function, to avoid longjmp munging our locals.
7620 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7621 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7622 longjmp is passed 2, as the C standard doesn't guarantee this.
7623 Instead, store the failure code into mgr->failure_code.
7624
76252012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7626
7627 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7628 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7629 (syms_of_keyboard): Remove support for unread-command-char.
7630
76312012-09-12 Eli Zaretskii <eliz@gnu.org>
7632
7633 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7634 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7635 violation. (Bug#12426)
7636
76372012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7638
7639 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7640
76412012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7642
7643 * eval.c: Add `inhibit-debugger'.
7644 (Qinhibit_debugger): New symbol.
7645 (call_debugger): Bind it instead of Qdebug_on_error.
7646 (maybe_call_debugger): Test Vinhibit_debugger.
7647 (syms_of_eval): Define inhibit-debugger.
7648 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7649 (syms_of_xdisp): Remove inhibit-debug-on-message.
7650
76512012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7652
7653 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7654 If a nonvolatile local variable is written before a _longjmp to
7655 the frame containing the variable, and is read after the _longjmp,
7656 the value read is indeterminate. Some local variables of type
7657 'struct handler' and 'struct catchtag' are used in this way, so
7658 mark each of their slots as volatile if the slot can be set before
7659 _longjmp and read afterwards.
7660 * lisp.h (struct handler): var and chosen_clause are now volatile.
7661 (struct catchtag): val, next, and pdlcount are now volatile.
7662
7663 * bidi.c (bidi_push_it, bidi_pop_it):
7664 * fns.c (copy_hash_table):
7665 * image.c (define_image_type):
7666 * keyboard.c (kbd_buffer_store_event_hold):
7667 * process.c (Fprocess_send_eof):
7668 * xfaces.c (x_create_gc) [HAVE_NS]:
7669 * xgselect.c (xg_select):
7670 Prefer assignment to memcpy when either will do.
7671
7672 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7673 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7674 time an item is removed. No need to mark this function 'inline';
7675 the compiler knows better than we do.
7676
76772012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7678
7679 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7680 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7681 to change_frame_size (Bug#12388).
7682 (windowDidResize:): Pass YES to updateFrameSize.
7683
7684 * nsterm.h: Add delay parameter to updateFrameSize.
7685
76862012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7687
7688 Discard killed buffers from deleted window and frame objects.
7689 This reduces an amount of references to killed buffers and
7690 helps GC to reclaim them faster.
7691 * alloc.c (discard_killed_buffers): New function.
7692 (mark_object): Use it for deleted windows and frames.
7693 (mark_object): If symbol's value is set up for a killed buffer
7694 or deleted frame, restore its global binding.
7695 * data.c (swap_in_global_binding): Add GC notice.
7696 (swap_in_symval_forwarding): Use convenient set_blv_where.
7697 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7698 * window.h: ... to here.
7699
77002012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7701
7702 Convenient macro to check whether the buffer is live.
7703 * buffer.h (BUFFER_LIVE_P): New macro.
7704 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7705 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7706
77072012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7708
7709 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7710 composition cases (Bug#12364).
7711
7712 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7713 overhang of succeeding glyphs overlapping box cursor.
7714
7715 * w32term.c (x_draw_glyph_string): Likewise.
7716
77172012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7718
7719 Simplify, document, and port floating-point (Bug#12381).
7720 The porting part of this patch fixes bugs on non-IEEE platforms
7721 with frexp, ldexp, logb.
7722 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7723 Now static.
7724 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7725 support, by removing commented-out code and briefly listing the
7726 C89 functions excluded. The commented-out stuff was confusing
7727 maintenance, e.g., we thought we needed cbrt but it was commented out.
7728 (logb): Remove decl; no longer needed.
7729 (isfinite): New macro, if not already supplied.
7730 (isnan): Don't replace any existing macro.
7731 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7732 are present on all C89 platforms.
7733 (Ffrexp): Do not special-case zero, as frexp does the right thing
7734 for that case.
7735 (Flogb): Do not use logb, as it doesn't have the desired meaning
7736 on hosts that use non-base-2 floating point. Instead, stick with
7737 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7738 frexp, to avoid getting an unspecified result.
7739
7740 * xdisp.c (Qinhibit_debug_on_message): Now static.
7741
77422012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7743
7744 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7745 NSBezierPath (Bug#12131).
7746
77472012-09-10 Chong Yidong <cyd@gnu.org>
7748
7749 * fns.c (Fdelq, Fdelete): Doc fix.
7750
77512012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7752
7753 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7754 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7755
77562012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7757
7758 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7759 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7760 Use it.
7761
77622012-09-09 Eli Zaretskii <eliz@gnu.org>
7763
7764 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7765 left fringe if the window has a left margin. This avoids leaving
7766 traces of the cursor because its leftmost pixel is not drawn over.
7767
7768 * dispnew.c (update_window_line): When the left margin area of a
7769 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7770 that screen line. (Bug#12277)
7771
77722012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7773
7774 Assume C89 or later for math functions (Bug#12381).
7775 This simplifies the code, and makes it a bit smaller and faster,
7776 and (most important) makes it easier to clean up signal handling
7777 since we can stop worring about floating-point exceptions in
7778 library code. That was a problem before C89, but the problem
7779 went away many years ago on all practical Emacs targets.
7780 * data.c, image.c, lread.c, print.c:
7781 Don't include <math.h>; no longer needed.
7782 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7783 might be autoconfigured, as that never happens.
7784 * data.c (fmod):
7785 * doprnt.c (DBL_MAX_10_EXP):
7786 * print.c (DBL_DIG):
7787 Remove. C89 or later always defines these.
7788 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7789 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7790 (arith_error, domain_error, domain_error2):
7791 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7792 no longer needed -- we simply return what C returns. All uses removed.
7793 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7794 the wrapped code.
7795 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7796 Remove. All uses expanded, as these macros are no longer used
7797 more than once and are now more trouble than they're worth.
7798 (Ftan): Use tan, not sin / cos.
7799 (Flogb): Assume C89 frexp.
7800 (fmod_float): Assume C89 fmod.
7801 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7802 (init_floatfns): Remove. All uses removed.
7803
78042012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7805
7806 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7807 compositeToPoint for OSX < 10.6 (Bug#12390).
7808
78092012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7810
7811 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7812 This produces more-accurate results.
7813
78142012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7815
7816 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7817 changes (Bug#12088).
7818
78192012-09-08 Chong Yidong <cyd@gnu.org>
7820
7821 * syntax.c (Fstring_to_syntax): Doc fix.
7822
78232012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7824
7825 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7826 in the internal border.
7827 (x_set_window_size): Remove static variables and their usage.
7828 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7829 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7830 Remove fringe/internal border adjustment (Bug#11052).
7831 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7832 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7833 (ns_fix_rect_ibw): Remove.
7834 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7835 (ns_dumpglyphs_box_or_relief): Ditto.
7836 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7837 adjustment.
7838 (ns_dumpglyphs_image): Ditto.
7839 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7840 border adjustment.
7841 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7842 their usage. Add fringe_extended_p and its use as in other terms.
7843 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7844 scroll bar was removed.
7845 (updateFrameSize): New function.
7846 (windowDidResize): Move code to updateFrameSize and call it.
7847
7848 * nsterm.h (EmacsView): Add updateFrameSize.
7849
78502012-09-07 Chong Yidong <cyd@gnu.org>
7851
7852 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7853
7854 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7855
78562012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7857
7858 More signal-handler cleanup (Bug#12327).
7859 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7860 Problem introduced when merging patches. Noted by Eli Zaretskii in
7861 <http://bugs.gnu.org/12327#67>.
7862 * floatfns.c: Comment fix.
7863 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7864 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7865 and anyway the declaration is harmless even if SIGDANGER is not defined.
7866 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7867 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7868 source files not surprisingly expected syssignal.h to define, or
7869 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7870 Include <sys/ioctl.h>, for FIONREAD.
7871 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7872 This eliminates a problem whereby other files mysteriously had
7873 to include "syssignal.h" before including "systty.h" if they
7874 wanted to use "#ifdef SIGIO".
7875
78762012-09-07 Eli Zaretskii <eliz@gnu.org>
7877
7878 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7879
7880 * w32.c (sigemptyset): Empty the set.
7881 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7882
7883 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7884
78852012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7886
7887 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7888 (mark_object): Likewise for frame objects.
7889
78902012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7891
7892 * syssignal.h (handle_on_main_thread): Always declare,
7893 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7894 This ports to platforms without HAVE_PTHREAD.
7895
78962012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7897
7898 Signal-handler cleanup (Bug#12327).
7899 Emacs's signal handlers were written in the old 4.2BSD style with
7900 sigblock and sigmask and so forth, and this led to some
7901 inefficiencies and confusion. Rewrite these to use
7902 pthread_sigmask etc. without copying signal sets around. Also,
7903 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7904 'signal', and instead use functions that do not attempt to take
7905 over the system name space. This patch causes Emacs's text
7906 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7907 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7908 Do not include <signal.h> or "syssignal.h", as these
7909 modules do not use signals.
7910 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7911 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7912 Do not include <signal.h>, as "syssignal.h" does that for us now.
7913 * atimer.c (sigmask_atimers): New function.
7914 (block_atimers, unblock_atimers): New functions,
7915 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7916 All uses replaced.
7917 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7918 no longer needed here.
7919 * emacs.c (main): Inspect existing signal handler with sigaction,
7920 so that there's no need to block and unblock SIGHUP.
7921 * sysdep.c (struct save_signal): New member 'action', replacing
7922 old member 'handler'.
7923 (save_signal_handlers, restore_signal_handlers):
7924 Use sigaction instead of 'signal' to save and restore.
7925 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7926 New function. All users of 'signal' modified to use set_sighandler
7927 if they're writeonly, and to use sys_signal if they're read+write.
7928 (emacs_sigaction_init, forwarded_signal): New functions.
7929 (sys_signal): Remove. All uses replaced by calls to sigaction
7930 and emacs_sigaction_init, or by direct calls to 'signal'.
7931 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7932 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7933 all uses replaced by pthread_sigmask etc. calls.
7934 * syssignal.h: Include <signal.h>.
7935 (emacs_sigaction_init, forwarded_signal): New decls.
7936 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7937 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7938 (sigmask, sys_sigmask): Remove; no longer needed.
7939 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7940 (sigblock, sigunblock, sigfree):
7941 (sigsetmask) [!defined sigsetmask]:
7942 Remove. All uses replaced by pthread_sigmask.
7943 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7944 no longer need to be replaced, and its typical old uses
7945 are now done via emacs_sigaction_init and sigaction.
7946 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7947 (sys_sigdel): Remove; unused.
7948 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7949
79502012-09-06 Eli Zaretskii <eliz@gnu.org>
7951
7952 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7953 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7954
79552012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7956
7957 Explicitly mark buffer_defaults and buffer_local_symbols.
7958 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7959 mark_local_symbols here.
7960 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7961 since special buffers aren't marked here any more.
7962 (allocate_buffer): Chain new buffer with all_buffers here...
7963 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7964 not here.
7965 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7966 (syms_of_buffer): Remove staticpro of the above.
7967 (init_buffer_once): Set names for buffer_defaults and
7968 buffer_local_symbols.
7969
79702012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7971
7972 Use bool for booleans in font-related modules.
7973 * font.c (font_intern_prop, font_style_to_value)
7974 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7975 (generate_otf_features, font_check_otf_features, font_check_otf)
7976 (font_match_p, font_list_entities, font_at):
7977 * fontset.c (fontset_id_valid_p, reorder_font_vector
7978 (fontset_find_font, Fset_fontset_font)
7979 (face_suitable_for_char_p) [0]:
7980 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7981 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7982 (m17n_flt_initialized, ftfont_shape_by_flt):
7983 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7984 * nsfont.m (nsfont_draw):
7985 * w32font.c (w32font_draw):
7986 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7987 Use bool for booleans.
7988 * font.h: Adjust to above API changes.
7989 (struct font, struct font_driver, struct font_driver_list):
7990 Use bool for booleans.
7991 (struct font): Remove useless member encoding_type.
7992 All users removed.
7993 * fontset.c, xftfont.c: Omit unnecessary static decls.
7994
79952012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7996
7997 * alloc.c (mark_object): Revert window marking code
7998 since it's unsafe for the Fset_window_configuration.
7999
80002012-09-05 Paul Eggert <eggert@cs.ucla.edu>
8001
8002 Fix race conditions with signal handlers and errno (Bug#12327).
8003 Be more systematic about preserving errno whenever a signal
8004 handler returns, even if it's not in the main thread. Do this by
8005 renaming signal handlers to distinguish between signal delivery
8006 and signal handling. All uses changed.
8007 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
8008 * data.c (deliver_arith_signal): Rename from arith_error.
8009 * dispnew.c (deliver_window_change_signal): Rename from
8010 window_change_signal.
8011 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
8012 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
8013 * keyboard.c (deliver_input_available_signal): Rename from
8014 input_available_signal.
8015 (deliver_user_signal): Rename from handle_user_signal.
8016 (deliver_interrupt_signal): Rename from interrupt_signal.
8017 * process.c (deliver_pipe_signal): Rename from send_process_trap.
8018 (deliver_child_signal): Rename from sigchld_handler.
8019 * atimer.c (handle_alarm_signal):
8020 * data.c (handle_arith_signal):
8021 * dispnew.c (handle_window_change_signal):
8022 * emacs.c (handle_fatal_signal, handle_danger_signal):
8023 * keyboard.c (handle_input_available_signal):
8024 * keyboard.c (handle_user_signal, handle_interrupt_signal):
8025 * process.c (handle_pipe_signal, handle_child_signal):
8026 New functions, with the actual signal-handling code taken from the
8027 original respective signal handlers, sans the sporadic attempts to
8028 preserve errno, since that's now done by handle_on_main_thread.
8029 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
8030 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
8031 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
8032 Move to sysdep.c.
8033 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
8034 Move initialization of main_thread to sysdep.c's init_signals.
8035 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
8036 our usage, and simplifies the mainline code.
8037 (record_child_status_change): New static function, as a helper
8038 for handle_child_signal, and with most of the old child handler's
8039 contents.
8040 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
8041 (handle_child_signal): Use the above.
8042 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
8043 Moved here from emacs.c.
8044 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
8045 code moved here from emacs.c's main function.
8046 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
8047 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
8048 This lets callers save and restore errno properly.
8049
80502012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
8051
8052 Remove redundant or unused things here and there.
8053 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
8054 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
8055 * editfns.c (Fcompare_buffer_substrings): Likewise.
8056 * frame.h (struct terminal, struct font_driver_list):
8057 Remove redundant declarations.
8058 * window.h (Qleft, Qright): Likewise.
8059
80602012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
8061
8062 Do not mark objects from deleted buffers, windows and frames.
8063 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
8064 (mark_object): Likewise for windows and frames.
8065
80662012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
8067
8068 * alloc.c (valid_lisp_object_p): Treat killed buffers,
8069 buffer_defaults and buffer_local_symbols as valid objects.
8070 Return special value to denote them.
8071
80722012-09-05 Paul Eggert <eggert@cs.ucla.edu>
8073
8074 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
8075 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
8076 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
8077 (file_name_absolute_p, Fsubstitute_in_file_name):
8078 (check_executable, check_writable, Ffile_accessible_directory_p)
8079 (Fset_file_selinux_context, Fdefault_file_modes)
8080 (Finsert_file_contents, choose_write_coding_system)
8081 (Fwrite_region, build_annotations, a_write, e_write)
8082 (Fdo_auto_save):
8083 * filelock.c (boot_time_initialized, get_boot_time)
8084 (get_boot_time_1, lock_file_1, within_one_second):
8085 * floatfns.c (in_float):
8086 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
8087 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
8088 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
8089 * lisp.h (struct Lisp_Hash_Table.cmpfn):
8090 * window.c (compare_window_configurations):
8091 Use bool for booleans.
8092 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
8093 (Fdefault_file_modes): Now mode_t, not int, for modes.
8094 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
8095 (internal_delete_file): Now returns void, not a (boolean) int,
8096 since nobody was looking at the return value.
8097 * lisp.h, window.h: Adjust to above API changes.
8098
8099 * xdisp.c (set_message): Simplify and reindent last change.
8100
81012012-09-05 Juanma Barranquero <lekktu@gmail.com>
8102
8103 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
8104
81052012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
8106
8107 * eval.c (call_debugger): Make the function non-static so that we
8108 can call it from set_message.
8109
8110 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
8111 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
8112
81132012-09-04 Paul Eggert <eggert@cs.ucla.edu>
8114
8115 Give more-useful info on a fatal error (Bug#12328).
8116 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
8117 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
8118 of doing the work ourselves.
8119 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
8120 do most of the work.
8121 (fatal_error_backtrace): New function, taken from the guts
8122 of the old fatal_error_signal, but with a new option to output
8123 a backtrace.
8124 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
8125 info about the signal than just its number.
8126 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
8127 * sysdep.c: Include <execinfo.h>
8128 (emacs_backtrace): New function, taken partly from the previous
8129 code of the 'die' function.
8130 (emacs_abort): Call fatal_error_backtrace rather than abort.
8131
81322012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
8133
8134 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
8135 eager (load-time) macro-expansion.
8136 * lisp.mk (lisp): Add macroexp.
8137
81382012-09-04 Paul Eggert <eggert@cs.ucla.edu>
8139
8140 Simplify redefinition of 'abort' (Bug#12316).
8141 Do not try to redefine the 'abort' function. Instead, redo
8142 the code so that it calls 'emacs_abort' rather than 'abort'.
8143 This removes the need for the NO_ABORT configure-time macro
8144 and makes it easier to change the abort code to do a backtrace.
8145 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
8146 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
8147 Remove; sysdep.c's emacs_abort now takes its place.
8148 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
8149 'abort' changed to use 'emacs_abort'.
8150 * msdos.c (dos_abort) [defined abort]: Remove; not used.
8151 (abort) [!defined abort]: Rename to ...
8152 (emacs_abort): ... new name.
8153 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
8154 the place of the old 'abort' in emacs.c.
8155 * w32.c, w32fns.c (abort): Do not #undef.
8156 * w32.c (emacs_abort): Rename from w32_abort.
8157
81582012-09-04 Eli Zaretskii <eliz@gnu.org>
8159
8160 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
8161 offsets[j].dv, since the y axis of the screen coordinates points
8162 down, while the y axis of the font definition coordinates points
8163 up. This fixes display of Arabic diacritics such as KASRA and
8164 KASRATAN. (Bug#11860)
8165
81662012-09-04 Paul Eggert <eggert@cs.ucla.edu>
8167
8168 Be more systematic about _setjmp vs setjmp.
8169 * alloc.c (test_setjmp, mark_stack):
8170 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
8171 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
8172 (png_load, my_error_exit, jpeg_load):
8173 * process.c (send_process_trap, send_process):
8174 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
8175 The underscored versions are up to 30x faster on some hosts.
8176 Formerly, the code used setjmp+longjmp sometimes and
8177 _setjmp+_longjmp at other times, with no particular reason to
8178 prefer setjmp+longjmp.
8179
81802012-09-03 Paul Eggert <eggert@cs.ucla.edu>
8181
8182 Fix minor problem found by static checking.
8183 * buffer.c (Fdelete_all_overlays): Return nil.
8184
81852012-09-03 Martin Rudalics <rudalics@gmx.at>
8186
8187 * buffer.c (Fdelete_all_overlays): New function.
8188
81892012-09-03 Chong Yidong <cyd@gnu.org>
8190
8191 * gtkutil.c: Add extern decl for Qxft.
8192
81932012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8194
8195 * emacs.c, eval.c: Use bool for boolean.
8196 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
8197 (malloc_using_checking) [DOUG_LEA_MALLOC]:
8198 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
8199 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
8200 (main, decode_env_path, Fdaemon_initialized):
8201 * eval.c (call_debugger, Finteractive_p, interactive_p):
8202 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
8203 (maybe_call_debugger, Fbacktrace):
8204 * process.c (read_process_output, exec_sentinel):
8205 Use bool for booleans.
8206 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
8207 All callers changed.
8208 * eval.c (interactive_p): Omit always-true boolean argument
8209 EXCLUDE_SUBRS_P. All callers changed.
8210 * dispextern.h, lisp.h: Reflect above API changes.
8211 * firstfile.c (dummy): Use the address of 'main', whose signature
8212 won't change, instead of the address of 'initialize', whose
8213 signature just changed from int to bool.
8214 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
8215 * msdos.c (fatal_error_in_progress): ... from here.
8216 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
8217 of incrementing it.
8218 (redisplay_internal, unwind_redisplay): Simply clear
8219 REDISPLAYING_P when unwinding, instead of saving its previous,
8220 always-false value and then restoring it.
8221
8222 Clean up some extern decls.
8223 Mostly, this hoists extern decls out of .c files and into .h files.
8224 That way, we're more likely to catch errors if the interfaces change.
8225 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
8226 declare xg_mark_data.
8227 * dispextern.h (x_frame_parm_handlers):
8228 * font.h (Qxft):
8229 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
8230 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
8231 (Qultra_bold, Qoblique, Qitalic):
8232 Move extern decl here from .c file.
8233 * alloc.c (xg_mark_data) [USE_GTK]:
8234 * doc.c (Qclosure):
8235 * eval.c (Qlexical_binding):
8236 * fns.c (time) [!HAVE_UNISTD_H]:
8237 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
8238 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
8239 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
8240 * lread.c (Qinternal_interpreter_environment):
8241 * minibuf.c (Qbuffer):
8242 * process.c (QCfamily, QCfilter):
8243 * widget.c (free_frame_faces):
8244 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
8245 * xfont.c (x_clear_errors):
8246 * xterm.c (x_frame_parm_handlers):
8247 Remove now-redundant extern decls.
8248 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
8249 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
8250 Now static.
8251 * xfaces.c: Remove unnecessary static decls.
8252 * xterm.c (updating_frame): Remove decl of nonexistent object.
8253
8254 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
8255 when building globals.h, as the objects that are not built on
8256 this host are not needed to compile C files on this host.
8257
82582012-09-02 Jan Djärv <jan.h.d@swipnet.se>
8259
8260 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
8261
8262 * frame.h: Add missing prototype for x_wm_set_size_hint.
8263
82642012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8265
8266 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
8267 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
8268 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
8269 (Fsubstitute_command_keys):
8270 * editfns.c (region_limit, find_field, Fconstrain_to_field)
8271 (save_excursion_save, save_excursion_restore)
8272 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
8273 (format_time_string, general_insert_function)
8274 (make_buffer_string, make_buffer_string_both)
8275 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
8276 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
8277 (copy_text, insert_1, insert_1_both, insert_from_string)
8278 (insert_from_string_before_markers, insert_from_string_1)
8279 (insert_from_buffer, insert_from_buffer_1, replace_range)
8280 (replace_range_2, del_range_1, del_range_byte, del_range_both)
8281 (del_range_2, modify_region):
8282 * intervals.c (intervals_equal, balance_possible_root_interval)
8283 (adjust_intervals_for_insertion, merge_properties_sticky)
8284 (graft_intervals_into_buffer, lookup_char_property)
8285 (adjust_for_invis_intang, set_point_both)
8286 (get_property_and_range, compare_string_intervals)
8287 (set_intervals_multibyte_1, set_intervals_multibyte):
8288 * keyboard.c (decode_timer):
8289 Use bool for boolean.
8290 * intervals.h, lisp.h, systime.h: Reflect above API changes.
8291 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
8292
82932012-09-02 Chong Yidong <cyd@gnu.org>
8294
8295 * keymap.c (push_key_description): Print M-TAB as C-M-i
8296 (Bug#11758).
8297
82982012-09-02 Juanma Barranquero <lekktu@gmail.com>
8299
8300 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
8301 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
8302 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
8303 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
8304 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
8305 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
8306 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8307
83082012-09-01 Eli Zaretskii <eliz@gnu.org>
8309
8310 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
8311 more than one grapheme cluster passed to the shaper: compute the
8312 offset adjustment values separately for each cluster. (Bug#11860)
8313
8314 * image.c: Restore mistakenly removed inclusion of w32.h. Without
8315 it, GCC doesn't see prototypes of w32_delayed_load, and complains
8316 about implicit conversions from integer to pointer.
8317
83182012-09-01 Daniel Colascione <dancol@dancol.org>
8319
8320 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
8321 system used too early.
8322
83232012-09-01 Paul Eggert <eggert@cs.ucla.edu>
8324
8325 Better seed support for (random).
8326 * emacs.c (main): Call init_random.
8327 * fns.c (Frandom): Set the seed from a string argument, if given.
8328 Remove long-obsolete Gentzel cruft.
8329 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
8330 (init_random): New function.
8331
83322012-09-01 Daniel Colascione <dancol@dancol.org>
8333
8334 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
8335 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
8336 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
8337 x_wm_set_size_hint, x_query_colors, x_real_positions,
8338 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8339 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
8340 all of which have been moved to common code.
8341
8342 * xfaces.c: Include TERM_HEADER instead of listing all possible
8343 window-system headers.
8344
8345 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
8346 to match header.
8347
8348 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
8349 directly accessing frame internals.
8350
8351 * w32font.h: Include font.h. Define syms_of_w32font and
8352 globals_of_w32font.
8353
8354 * process.c: Include TERM_HEADER instead of listing all possible
8355 window-system headers.
8356
8357 * nsterm.h: Remove declarations now in frame.h.
8358 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
8359
8360 * menu.c: Include TERM_HEADER instead of listing all possible
8361 window-system headers.
8362
8363 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8364 window system.
8365
8366 * keyboard.c: Include TERM_HEADER instead of listing all possible
8367 window-system headers.
8368
8369 * image.c: Include TERM_HEADER instead of listing all possible
8370 window-system headers. Declare Vlibrary_cache when compiling for
8371 Windows.
8372
8373 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8374 window system declarations.
8375
8376 * frame.h: Move common functions here: set_frame_menubar,
8377 x_set_window_size, x_sync, x_get_focus_frame,
8378 x_set_mouse_position, x_set_mouse_pixel_position,
8379 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8380 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8381 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8382 x_activate_menubar, x_real_positions, x_bitmap_icon,
8383 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8384 and x_query_colors.
8385
8386 * frame.c: Include TERM_HEADER instead of listing all possible
8387 window-system headers.
8388
8389 * font.c: Include TERM_HEADER instead of listing all possible
8390 window-system headers.
8391
8392 * emacs.c: Include TERM_HEADER.
8393
8394 * dispnew.c: Include TERM_HEADER instead of listing all possible
8395 window-system headers.
8396
8397 * ccl.h: Include character.h.
8398
8399 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8400 the current window system; include in list of objects to link into
8401 Emacs.
8402
84032012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8404
8405 Remove mark_ttys function and fix tty_display_info initialization.
8406 * lisp.h (mark_ttys): Remove prototype.
8407 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8408 to mark_ttys because all possible values of 'top_frame' slot are
8409 the frames which are reachable from Vframe_list.
8410 * term.c (mark_ttys): Remove.
8411 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8412
84132012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8414
8415 Change struct frame bitfields from unsigned char to unsigned.
8416 * frame.h (struct frame): Change type of 'display_preempted',
8417 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8418 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8419 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8420 bitfields from unsigned char to unsigned.
8421
84222012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8423
8424 Remove unused member of struct x_output and struct w32_output.
8425 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8426 * w32term.h (struct w32_output): Likewise.
8427
84282012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8429
8430 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8431 does not become zero (Bug#12234).
8432
84332012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8434
8435 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8436 for GCC 4.7.1 x86-64.
8437
84382012-08-30 Glenn Morris <rgm@gnu.org>
8439
8440 * lread.c (init_lread): For out-of-tree builds, only add the
8441 source directory's site-lisp dir to the load-path if it exists,
8442 consistent with in-tree builds. (Bug#12302)
8443
84442012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8445
8446 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
8447 button_values to NULL. Call setStykeMask so dialogs get a close button.
8448 (windowShouldClose:): Set window_closed.
8449 (dealloc): New member, free button_values.
8450 (process_dialog:): Make member function. Remove window argument,
8451 replace window with self. Count buttons and allocate and store values
8452 in button_values.
8453 (addButton:value:row:): value is int with the name tag. Call setTag
8454 with tag. Remove return self, declare return value as void.
8455 (addString:row:): Remove return self, declare return value as void.
8456 (addSplit): Remove return self, declare return value as void.
8457 (clicked:): Remove return self, declare return value as void.
8458 Set dialog_return to button_values[seltag]. Code formatting change.
8459 (initFromContents:isQuestion:): Adjust call to process_dialog.
8460 Code formatting change.
8461 (timeout_handler:): Set timer_fired to YES.
8462 (runDialogAt:): Set timer_fired to NO.
8463 Handle click on close button as quit.
8464
8465 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8466 Add window_closed and button_values. Add void as return value for
8467 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8468 Add process_dialog as new member.
8469
84702012-08-28 Eli Zaretskii <eliz@gnu.org>
8471
8472 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8473 is not one of the heaps we manage. (Bug#12242)
8474
84752012-08-28 Glenn Morris <rgm@gnu.org>
8476
8477 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8478
84792012-08-28 Martin Rudalics <rudalics@gmx.at>
8480
8481 * window.c (Fset_window_configuration): Remove handling of
8482 auto-buffer-name window parameter. Install revision of reverted
8483 fix.
8484
84852012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8486
8487 Do not allow to set major mode for a dead buffer.
8488 * buffer.c (Fset_buffer_major_mode): Signal an error
8489 if the buffer is dead.
8490 (Fother_buffer, other_buffer_safely): Remove redundant
8491 nested declaration.
8492
84932012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8494
8495 Always use set_buffer_if_live to restore original buffer at unwind.
8496 * buffer.h (record_unwind_current_buffer): New function.
8497 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8498 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8499 * undo.c, window.c: Adjust users.
8500 * buffer.c (set_buffer_if_live): Fix comment.
8501
85022012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8503
8504 Fix usage of set_buffer_internal.
8505 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8506 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8507 * coding.c (decode_coding): Omit redundant test.
8508 * fileio.c (decide_coding_unwind): Likewise.
8509 * fns.c (secure_hash): Likewise.
8510 * insdel.c (modify_region): Likewise.
8511 * keyboard.c (command_loop_1): Likewise.
8512 * print.c (PRINTFINISH): Likewise.
8513 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8514
85152012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8516
8517 * dispnew.c: Use bool for boolean.
8518 (frame_garbaged, display_completed, delayed_size_change)
8519 (fonts_changed_p, add_window_display_history)
8520 (add_frame_display_history, verify_row_hash)
8521 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8522 (row_equal_p, realloc_glyph_pool)
8523 (allocate_matrices_for_frame_redisplay)
8524 (showing_window_margins_p)
8525 (adjust_frame_glyphs_for_frame_redisplay)
8526 (build_frame_matrix_from_leaf_window, make_current)
8527 (mirrored_line_dance, mirror_line_dance, update_frame)
8528 (update_window_tree, update_single_window)
8529 (check_current_matrix_flags, update_window, update_text_area)
8530 (update_window_line, set_window_update_flags, scrolling_window)
8531 (update_frame_1, scrolling, buffer_posn_from_coords)
8532 (do_pending_window_change, change_frame_size)
8533 (change_frame_size_1, sit_for):
8534 Use bool for boolean.
8535 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8536 and remove last int (actually boolean) argument, which was always 0.
8537 All callers changed.
8538 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8539 * dispextern.h (struct composition_it): Use bool for boolean.
8540 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8541 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8542 * dired.c (file_name_completion):
8543 Use bool for boolean. (This was missed in an earlier change.)
8544
85452012-08-27 Martin Rudalics <rudalics@gmx.at>
8546
8547 * window.c (Fset_window_configuration): Revert first part of
8548 last change.
8549
85502012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8551
8552 * nsterm.h (NSPanel): New class variable dialog_return.
8553
8554 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8555 Initialize dialog_return.
8556 (windowShouldClose:): Use stop instead of stopModalWithCode.
8557 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8558 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8559 event.
8560 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8561 modal loop returns.
8562
85632012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8564
8565 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8566 * composite.c (find_composition, composition_gstring_p)
8567 (composition_reseat_it, find_automatic_composition):
8568 * data.c (let_shadows_buffer_binding_p)
8569 (let_shadows_global_binding_p, set_internal, make_blv)
8570 (Fmake_variable_buffer_local, Fmake_local_variable)
8571 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8572 (cons_to_signed, arith_driver):
8573 * dbusbind.c (xd_in_read_queued_messages):
8574 * dired.c (directory_files_internal, file_name_completion):
8575 Use bool for booleans.
8576 * dired.c (file_name_completion):
8577 * process.h (fd_callback):
8578 Omit int (actually boolean) argument. It wasn't being used.
8579 All uses changed.
8580 * composite.h, lisp.h: Reflect above API changes.
8581
8582 * cmds.c, coding.c: Use bool for booleans.
8583 * cmds.c (move_point, Fself_insert_command):
8584 * coding.h (struct composition status, struct coding_system):
8585 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8586 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8587 (emacs_mule_char, decode_coding_emacs_mule)
8588 (encode_coding_emacs_mule, detect_coding_iso_2022)
8589 (decode_coding_iso_2022, encode_invocation_designation)
8590 (encode_designation_at_bol, encode_coding_iso_2022)
8591 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8592 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8593 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8594 (encode_coding_raw_text, detect_coding_charset)
8595 (decode_coding_charset, encode_coding_charset, detect_eol)
8596 (detect_coding, get_translation_table, produce_chars)
8597 (consume_chars, reused_workbuf_in_use)
8598 (make_conversion_work_buffer, code_conversion_save)
8599 (decode_coding_object, encode_coding_object)
8600 (detect_coding_system, char_encodable_p)
8601 (Funencodable_char_position, code_convert_region)
8602 (code_convert_string, code_convert_string_norecord)
8603 (Fset_coding_system_priority):
8604 * fileio.c (Finsert_file_contents):
8605 Use bool for booleans.
8606 * coding.h, lisp.h: Reflect above API changes.
8607 * coding.c: Remove unnecessary static function decls.
8608 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8609 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8610 not a boolean 'int', since callers never look at the return value.
8611 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8612 * coding.h (decoding_buffer_size, encoding_buffer_size)
8613 (emacs_mule_string_char): Remove unused extern decls.
8614 (struct iso_2022_spec, struct coding_system):
8615 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8616 (struct emacs_mule_spec): Remove unused field 'full_support'.
8617 All initializations removed.
8618 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8619
86202012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8621
8622 Fix spare memory change (Bug#12286).
8623 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8624 (valid_lisp_object_p): Likewise.
8625
86262012-08-27 Martin Rudalics <rudalics@gmx.at>
8627
8628 * window.c (Fset_window_configuration): Record any window's old
8629 buffer if it's replaced (see Bug#8789). If the new current
8630 buffer doesn't appear in the selected window, go to its old
8631 point (Bug#12208).
8632
86332012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8634
8635 Special MEM_TYPE_SPARE to denote reserved memory.
8636 * alloc.c (enum mem_type): New memory type.
8637 (refill_memory_reserve): Use new type for spare memory.
8638 This prevents live_cons_p and live_string_p from incorrect
8639 detection of uninitialized objects from spare memory as live.
8640
86412012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8642
8643 Spelling fixes.
8644 * Makefile.in (.PHONY): versioclean -> versionclean.
8645
8646 Remove unused external symbols.
8647 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8648 * window.c (Qwindow_valid_p, decode_valid_window):
8649 Now static, not extern.
8650 * data.c (Qinterval): Remove; unused.
8651 (syms_of_data): Do not define 'interval'.
8652 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8653 * window.h (decode_valid_window):
8654 Remove decls.
8655
8656 * character.c, charset.c, chartab.c: Use bool for booleans.
8657 * character.c (lisp_string_width, string_count_byte8)
8658 (string_escape_byte8):
8659 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8660 (load_charset_map_from_file, map_charset_chars)
8661 (Fdefine_charset_internal, define_charset_internal)
8662 (Fdeclare_equiv_charset, find_charsets_in_text)
8663 (Ffind_charset_region, char_charset, Fiso_charset):
8664 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8665 (sub_char_table_set, sub_char_table_set_range)
8666 (char_table_set_range, optimize_sub_char_table)
8667 (map_sub_char_table):
8668 Use bool for boolean.
8669 * character.c (str_to_unibyte): Omit last boolean argument; it was
8670 always 0. All callers changed.
8671 * character.h, charset.h: Adjust to match previous changes.
8672 * character.h (char_printable_p): Remove decl of nonexistent function.
8673 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8674 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8675 are all boolean, so make them single-bit bitfields.
8676
8677 * lisp.h (ASET): Remove attempt to detect side effects.
8678 It was meant to be temporary and it often doesn't work,
8679 because when IDX has side effects the behavior of IDX==IDX
8680 is undefined. See Stefan Monnier in
8681 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8682
86832012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8684
8685 * lisp.h (functionp): New function (extracted from Ffunctionp).
8686 (FUNCTIONP): Use it.
8687 * eval.c (Ffunctionp): Use it.
8688
86892012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8690
8691 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8692 as that's faster and simpler than static storage. Don't bother
8693 with the g_main_context_query overhead if g_main_context_pending
8694 says no events are pending.
8695 (gfds, gfds_size): Remove these static vars.
8696 (xgselect_initialize): Remove; no longer needed.
8697 All uses and decls removed.
8698
8699 * emacs.c (fatal_error_signal_hook): Remove.
8700 All uses removed. This leftover from old code was always 0.
8701
8702 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8703 * casefiddle.c (casify_object, casify_region):
8704 * casetab.c (set_case_table):
8705 * category.c, category.h (word_boundary_p):
8706 * category.h (CHAR_HAS_CATEGORY):
8707 Use bool for booleans, instead of int.
8708
87092012-08-25 Eli Zaretskii <eliz@gnu.org>
8710
8711 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8712
87132012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8714
8715 On assertion failure, print backtrace if available.
8716 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8717 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8718 * Makefile.in (LIB_EXECINFO): New macro.
8719 (LIBES): Use it.
8720
8721 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8722 * bytecode.c (exec_byte_code):
8723 * callint.c (check_mark, Fcall_interactively):
8724 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8725 (getenv_internal, sync_process_alive, call_process_exited):
8726 * lisp.h (USE_SAFE_ALLOCA):
8727 Use bool for booleans, instead of int.
8728 * lisp.h, process.h: Adjust prototypes to match above changes.
8729 * callint.c (Fcall_interactively): Don't assume the mark's
8730 offset fits in 'int'.
8731
87322012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8733
8734 * buffer.c, buffer.h: Use bool for boolean.
8735 * buffer.c (reset_buffer_local_variables)
8736 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8737 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8738 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8739 (overlay_touches_p, overlay_strings, Foverlay_put)
8740 (report_overlay_modification, call_overlay_mod_hooks):
8741 (mmap_enlarge, mmap_set_vars):
8742 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8743 Use bool for booleans, instead of int.
8744 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8745 since the 1-or-0 return value is always ignored anyway.
8746 (mmap_initialized_p):
8747 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8748 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8749
87502012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8751
8752 * bidi.c: Use bool for boolean.
8753 This is a bit more readable, and makes the text segment of bidi.o
8754 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8755 Presumably it's faster too.
8756 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8757 Now bool.
8758 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8759 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8760 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8761 (bidi_explicit_dir_char, bidi_level_of_next_char)
8762 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8763 Use bool for booleans, instead of int.
8764 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8765 (bidi_unshelve_cache): Adjust decls to match code.
8766
87672012-08-23 Martin Rudalics <rudalics@gmx.at>
8768
8769 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8770 argument.
8771
87722012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8773
8774 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8775 * atimer.h: Include <stdbool.h>.
8776
87772012-08-22 Dan Nicolaescu <dann@gnu.org>
8778
8779 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8780 compile time tests instead of run time tests on systems that do
8781 not use them.
8782 (FRAME_MAC_P): Remove leftover from deleted code.
8783 * frame.c (syms_of_frame): Remove leftover from deleted code.
8784
87852012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8786
8787 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8788
87892012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8790
8791 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8792 Otherwise, the compiler complains about (A?B:C) where B is void
8793 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8794 (fontset_add): Return void, for FONTSET_ADD.
8795
87962012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8797
8798 * alloc.c: Use bool for booleans.
8799 (gc_in_progress, abort_on_gc)
8800 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8801 (dont_register_blocks) [GC_MALLOC_CHECK]:
8802 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8803 (check_string_bytes, make_specified_string, memory_full)
8804 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8805 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8806 (mark_stack, valid_pointer_p, make_pure_string)
8807 (Fgarbage_collect, survives_gc_p, gc_sweep):
8808 Use bool for booleans, instead of int.
8809 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8810 Remove unused local.
8811 * alloc.c (PURE_POINTER_P):
8812 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8813 * editfns.c (Fformat):
8814 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8815 (Fdo_auto_save):
8816 * fns.c (sweep_weak_table):
8817 * lisp.h (suppress_checking, push_message, survives_gc_p)
8818 (make_pure_string, gc_in_progress, abort_on_gc):
8819 * lread.c (readchar, read1):
8820 * print.c (Fprin1_to_string):
8821 * xdisp.c (push_message):
8822 Use bool for booleans affected directly or indirectly by
8823 alloc.c's changes.
8824
8825 Make recently-introduced setters macros.
8826 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8827 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8828 (set_fontset_default, set_fontset_fallback): Rename from their
8829 upper-case counterparts, and make them functions rather than macros.
8830 This is more consistent with the other recently-introduced setters.
8831 These don't need to be inline, since they're local.
8832
88332012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8834
8835 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8836 the loop (Bug#12247).
8837
88382012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8839
8840 * lisp.h (vcopy): Use memcpy rather than our own loop.
8841 This fixes a performance regression introduced by the recent
8842 addition of vcopy. This means 'vcopy' will need to be modified
8843 for a copying collector, but that's OK. Also, tighten the
8844 checking in the assertion.
8845
88462012-08-21 Eli Zaretskii <eliz@gnu.org>
8847
8848 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8849 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8850 non-base glyph for the width of the base character, according to
8851 what x_draw_composite_glyph_string_foreground expects.
8852 Generate WADJUST value according to composition_gstring_width's
8853 expectations, to produce correct width of the composed character.
8854 Reverse the sign of the DU offset produced by ScriptPlace.
8855
88562012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8857
8858 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8859
88602012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8861
8862 Avoid direct writes to contents member of struct Lisp_Vector.
8863 * lisp.h (vcopy): New function to copy data into vector.
8864 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8865 * fns.c (Ffillarray): Use ASET.
8866 * keyboard.c (timer_check_2): Use AREF and ASET.
8867 (append_tool_bar_item, Frecent_keys): Use vcopy.
8868 * lread.c (read_vector): Use ASET.
8869 * msdos.c (Frecent_doskeys): Use vcopy.
8870 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8871 (Finternal_merge_in_global_face): Use ASET and vcopy.
8872 * xfont.c (xfont_list_pattern): Likewise.
8873
88742012-08-21 Martin Rudalics <rudalics@gmx.at>
8875
8876 * window.c (Fwindow_point): For the selected window always return
8877 the position of its buffer's point.
8878 (Fset_window_point): For the selected window always go in its
8879 buffer to the specified position.
8880
88812012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8882
8883 Setter macros for fontsets.
8884 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8885 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8886 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8887 Adjust users.
8888
88892012-08-20 Glenn Morris <rgm@gnu.org>
8890
8891 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8892 Don't assume that `ln -f' works.
8893
88942012-08-20 Eli Zaretskii <eliz@gnu.org>
8895
8896 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8897 and later about non-assignments with no effect. See discussion at
8898 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8899 details.
8900
89012012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8902
8903 Inline setter functions for Lisp_Objects slots of struct specbinding.
8904 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8905 Adjust users.
8906
89072012-08-20 Martin Rudalics <rudalics@gmx.at>
8908
8909 * window.c (select_window): Always make selected window's buffer
8910 current.
8911
89122012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8913
8914 Use AREF and ASET for docstrings of category tables.
8915 * category.h (CATEGORY_DOCSTRING): Use AREF.
8916 (SET_CATEGORY_DOCSTRING): Use ASET.
8917 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8918
89192012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8920
8921 Inline setter functions for hash table members.
8922 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8923 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8924 (set_hash_key_and_value, set_hash_index, set_hash_next)
8925 (set_hash_hash): New functions.
8926 * charset.c, fns.c: Adjust users.
8927
89282012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8929
8930 Inline getter and setter functions for per-buffer values.
8931 * buffer.h (per_buffer_default, set_per_buffer_default)
8932 (per_buffer_value, set_per_buffer_value): New functions.
8933 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8934 * buffer.c, data.c: Adjust users.
8935
89362012-08-20 Juanma Barranquero <lekktu@gmail.com>
8937
8938 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8939
89402012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8941
8942 Rely on <config.h> + <unistd.h> to declare 'environ',
8943 as gnulib does this if the system doesn't.
8944 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8945 Remove declaration. MS-Windows declares it on stdlib.h which is
8946 included by conf_post.h.
8947 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8948 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8949 * vm-limit.c: Include <unistd.h>, for 'environ'.
8950
8951 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8952 (start_of_data): Remove decl; mem-limits.h provides it.
8953
8954 * xdisp.c (handle_invisible_prop): Make it a bit faster
8955 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8956
89572012-08-19 Chong Yidong <cyd@gnu.org>
8958
8959 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8960 ends (Bug#3874).
8961
89622012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8963
8964 * .gdbinit: Use call instead of set when calling a function in the
8965 inferior.
8966
8967 * data.c (set_internal): Don't use set_blv_found.
8968 (Fkill_local_variable): Likewise.
8969
89702012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8971
8972 * nsfont.m (ns_ascii_average_width): Ensure the string
8973 ascii_printable is initialized with a null-terminated character
8974 array. Otherwise, it can contain undesired extra characters.
8975
89762012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8977
8978 port new setting code to Sun C 5.8 2005/10/13
8979 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8980 Return void, not Lisp_Object. Otherwise, the compiler
8981 complains about (A?B:C) where B is void and C is Lisp_Object
8982 when compiling CHAR_TABLE_SET, due to the recent change to
8983 the API of sub_char_table_set_contents.
8984
89852012-08-18 Chong Yidong <cyd@gnu.org>
8986
8987 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8988 for the string case (Bug#3874).
8989
89902012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8991
8992 * buffer.h (BSET): Remove (Bug#12215).
8993 Replace all uses with calls to new setter functions.
8994 (bset_bidi_paragraph_direction, bset_case_canon_table)
8995 (bset_case_eqv_table, bset_directory, bset_display_count)
8996 (bset_display_time, bset_downcase_table)
8997 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8998 (bset_last_selected_window, bset_local_var_alist)
8999 (bset_mark_active, bset_point_before_scroll, bset_read_only)
9000 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
9001 (bset_width_table):
9002 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
9003 (bset_auto_fill_function, bset_auto_save_file_format)
9004 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
9005 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
9006 (bset_cache_long_line_scans, bset_case_fold_search)
9007 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
9008 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
9009 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
9010 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
9011 (bset_header_line_format, bset_indicate_buffer_boundaries)
9012 (bset_indicate_empty_lines, bset_invisibility_spec)
9013 (bset_left_fringe_width, bset_major_mode, bset_mark)
9014 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
9015 (bset_name, bset_overwrite_mode, bset_pt_marker)
9016 (bset_right_fringe_width, bset_save_length)
9017 (bset_scroll_bar_width, bset_scroll_down_aggressively)
9018 (bset_scroll_up_aggressively, bset_selective_display)
9019 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
9020 (bset_word_wrap, bset_zv_marker):
9021 * category.c (bset_category_table):
9022 * syntax.c (bset_syntax_table):
9023 New setter functions.
9024
9025 * process.h (PSET): Remove (Bug#12215).
9026 Replace all uses with calls to new setter functions.
9027 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9028 (PROCESS_INLINE): New macro.
9029 (pset_childp): New setter function.
9030 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
9031 * process.c (PROCESS_INLINE):
9032 Define to EXTERN_INLINE, so that the corresponding functions
9033 are compiled into code.
9034 (pset_buffer, pset_command, pset_decode_coding_system)
9035 (pset_decoding_buf, pset_encode_coding_system)
9036 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
9037 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
9038 (pset_type, pset_write_queue): New setter functions.
9039
9040 * window.h (WSET): Remove (Bug#12215).
9041 Replace all uses with calls to new setter functions.
9042 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9043 (WINDOW_INLINE): New macro.
9044 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
9045 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
9046 (wset_total_lines, wset_vertical_scroll_bar)
9047 (wset_window_end_pos, wset_window_end_valid)
9048 (wset_window_end_vpos): New setter functions.
9049 * window.c (WINDOW_INLINE):
9050 Define to EXTERN_INLINE, so that the corresponding functions
9051 are compiled into code.
9052 (wset_combination_limit, wset_dedicated, wset_display_table)
9053 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
9054 (wset_new_normal, wset_new_total, wset_next_buffers)
9055 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
9056 (wset_prev_buffers, wset_right_fringe_width)
9057 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
9058 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
9059 (wset_window_parameters):
9060 * xdisp.c (wset_base_line_number, wset_base_line_pos)
9061 (wset_column_number_displayed, wset_region_showing):
9062 New setter functions.
9063
9064 * termhooks.h (TSET): Remove (Bug#12215).
9065 Replace all uses with calls to new setter functions.
9066 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9067 (TERMHOOKS_INLINE): New macro.
9068 (tset_charset_list, tset_selection_alist): New setter functions.
9069 * terminal.c (TERMHOOKS_INLINE):
9070 Define to EXTERN_INLINE, so that the corresponding functions
9071 are compiled into code.
9072 (tset_param_alist): New setter function.
9073
90742012-08-17 Paul Eggert <eggert@cs.ucla.edu>
9075
9076 * keyboard.h (KSET): Remove (Bug#12215).
9077 Replace all uses with calls to new setter functions.
9078 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9079 (KEYBOARD_INLINE): New macro.
9080 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
9081 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
9082 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
9083 New setter functions.
9084 * keyboard.c (KEYBOARD_INLINE):
9085 Define to EXTERN_INLINE, so that the corresponding functions
9086 are compiled into code.
9087 (kset_echo_string, kset_kbd_queue)
9088 (kset_keyboard_translate_table, kset_last_prefix_arg)
9089 (kset_last_repeatable_command, kset_local_function_key_map)
9090 (kset_overriding_terminal_local_map, kset_real_last_command)
9091 (kset_system_key_syms): New setter functions.
9092
9093 * frame.h (FSET): Remove (Bug#12215).
9094 Replace all uses with calls to new setter functions.
9095 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9096 (FRAME_INLINE): New macro.
9097 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
9098 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
9099 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
9100 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
9101 (fset_param_alist, fset_root_window, fset_scroll_bars)
9102 (fset_selected_window, fset_title, fset_tool_bar_items)
9103 (fset_tool_bar_position, fset_tool_bar_window): New functions.
9104 * frame.c (FRAME_INLINE):
9105 Define to EXTERN_INLINE, so that the corresponding functions
9106 are compiled into code.
9107 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
9108
9109 A few more naming-convention fixes for getters and setters.
9110 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
9111 and rename from buffer_overlays_set_before.
9112 (set_buffer_overlays_after): Move here from buffer.h, and rename
9113 from buffer_overlays_set_after.
9114 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
9115 All uses changed.
9116 (set_buffer_intervals): Rename from buffer_set_intervals.
9117 * intervals.c (set_interval_object): Move here from intervals.h,
9118 and rename from interval_set_object.
9119 (set_interval_left): Move here from intervals.h, and rename from
9120 interval_set_left.
9121 (set_interval_right): Move here from intervals.h, and rename from
9122 interval_set_right.
9123 (copy_interval_parent): Move here from intervals.h, and rename from
9124 interval_copy_parent.
9125 * intervals.h (set_interval_parent): Rename from interval_set_parent.
9126 (set_interval_plist): Rename from interval_set_plist.
9127 Return void, not Lisp_Object, since no caller uses the result.
9128 * lisp.h (string_intervals): Rename from string_get_intervals.
9129 (set_string_intervals): Rename from string_set_intervals.
9130
9131 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
9132 (set_char_table_contents): Rename from char_table_set_contents.
9133 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
9134 All uses changed. See the end of
9135 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
9136
9137 * lisp.h (CSET): Remove (Bug#12215).
9138 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
9139 (set_char_table_purpose): New functions,
9140 replacing CSET. All uses changed. For example, replace
9141 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
9142 "set_char_table_parent (char_table, parent);".
9143 The old version was confusing because it used the same name
9144 'parent' for two different things.
9145
91462012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
9147
9148 Functions to get and set Lisp_Object fields of buffer-local variables.
9149 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
9150 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
9151 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
9152 * data.c, eval.c, frame.c: Adjust users.
9153
91542012-08-17 Chong Yidong <cyd@gnu.org>
9155
9156 * xfaces.c (merge_face_vectors): If the target font specfies a
9157 font spec, make the font's attributes take precedence over
9158 directly-specified attributes.
9159 (merge_face_ref): Recognize :font.
9160
91612012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
9162
9163 Do not use memcpy for copying intervals.
9164 * intervals.c (reproduce_interval): New function.
9165 (reproduce_tree, reproduce_tree_obj): Use it.
9166 (reproduce_tree_obj): Remove prototype.
9167
91682012-08-17 Paul Eggert <eggert@cs.ucla.edu>
9169
9170 * lisp.h (duration_to_sec_usec): Remove unused decl.
9171
91722012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
9173
9174 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
9175 to an allocated instance of NSString, not to the class itself.
9176
91772012-08-17 Juanma Barranquero <lekktu@gmail.com>
9178
9179 * makefile.w32-in (C_CTYPE_H): New macro.
9180 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
9181 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
9182 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
9183
91842012-08-16 Paul Eggert <eggert@cs.ucla.edu>
9185
9186 Use ASCII tests for character types.
9187 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
9188 * xfns.c, xterm.c:
9189 Don't include <ctype.h>; was not needed.
9190 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
9191 * sysdep.c, xfaces.c:
9192 Include <c-ctype.h> instead of <ctype.h>.
9193 * nsterm.m: Include <c-ctype.h>.
9194 * charset.c (read_hex):
9195 * doc.c (Fsnarf_documentation):
9196 * fileio.c (IS_DRIVE) [WINDOWSNT]:
9197 (DRIVE_LETTER) [DOS_NT]:
9198 (Ffile_name_directory, Fexpand_file_name)
9199 (Fsubstitute_in_file_name):
9200 * font.c (font_parse_xlfd, font_parse_fcname):
9201 * frame.c (x_set_font_backend):
9202 * gtkutil.c (xg_get_font):
9203 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
9204 * nsimage.m (hexchar):
9205 * nsterm.m (ns_xlfd_to_fontname):
9206 * sysdep.c (system_process_attributes):
9207 * xfaces.c (hash_string_case_insensitive):
9208 Use C-locale tests instead of locale-specific tests for character
9209 types, since we want the ASCII interpretation here, not the
9210 interpretation suitable for whatever happens to be the current locale.
9211
92122012-08-16 Martin Rudalics <rudalics@gmx.at>
9213
9214 Consistently check windows for validity/liveness
9215 (Bug#11984, Bug#12025, Bug#12026).
9216 * lisp.h (CHECK_VALID_WINDOW): New macro.
9217 * window.c (decode_window): Rename to decode_live_window.
9218 (decode_valid_window, Fwindow_valid_p): New functions.
9219 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
9220 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
9221 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
9222 (Fwindow_prev_sibling, Fwindow_combination_limit)
9223 (Fset_window_combination_limit, Fwindow_use_time)
9224 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
9225 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
9226 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
9227 (Fwindow_hscroll, Fset_window_hscroll)
9228 (Fwindow_redisplay_end_trigger)
9229 (Fset_window_redisplay_end_trigger, Fwindow_edges)
9230 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
9231 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9232 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
9233 (Fwindow_end, Fset_window_point, Fset_window_start)
9234 (Fpos_visible_in_window_p, Fwindow_line_height)
9235 (Fwindow_dedicated_p, Fset_window_dedicated_p)
9236 (Fwindow_prev_buffers, Fset_window_prev_buffers)
9237 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
9238 (Fset_window_parameter, Fwindow_display_table)
9239 (Fset_window_display_table, Fdelete_other_windows_internal)
9240 (Fset_window_buffer, Fset_window_new_total)
9241 (Fset_window_new_normal, Fdelete_window_internal)
9242 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
9243 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
9244 (Fwindow_scroll_bars): Check whether argument window is a valid or
9245 live window. Update doc-strings.
9246 (syms_of_window): New symbol Qwindow_valid_p.
9247 * keyboard.c (Fposn_at_x_y): Check whether argument
9248 frame_or_window denotes a valid window.
9249
92502012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9251
9252 Fix previous char table change.
9253 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
9254 * chartab.c (optimize_sub_char_table): Likewise.
9255
92562012-08-16 Chong Yidong <cyd@gnu.org>
9257
9258 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
9259
9260 * xfont.c (xfont_open):
9261 * xftfont.c (xftfont_open): Set the font's max_width field.
9262
9263 * nsfont.m (nsfont_open): Similar to the Xft backend, set
9264 min_width to space_width and average_width to the average over
9265 printable ASCII characters.
9266 (ns_char_width): Code cleanup.
9267 (ns_ascii_average_width): New utility function.
9268
9269 * font.h (struct font): Update comments.
9270
92712012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9272
9273 Simple interface to set Lisp_Object fields of character tables.
9274 * lisp.h (CSET): New macro.
9275 (char_table_set_extras, char_table_set_contents)
9276 (sub_char_table_set_contents): New function.
9277 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
9278 * syntax.c: Adjust users.
9279
92802012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
9281
9282 * eval.c (eval_sub): Bind lexical-binding.
9283 * lread.c (Qlexical_binding): Make non-static.
9284
92852012-08-15 Jan Djärv <jan.h.d@swipnet.se>
9286
9287 * nsmenu.m (popupSession): Remove.
9288 (pop_down_menu): Remove endModalSession.
9289 (timeout_handler:): New method.
9290 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
9291 Call runModalForWindow. Check timer_fired when it returns.
9292 If not set, cancel timer and break out of loop.
9293 Otherwise loop again, with a new timeout.
9294
9295 * nsterm.m: Include fcntl.h if present.
9296 (fd_entry, t_readfds, inNsSelect): Remove.
9297 (select_writefds, select_valid, select_timeout, selfds)
9298 (select_mutex, apploopnr): Add.
9299 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
9300 Otherwise call kbd_buffer_store_event.
9301 (ns_send_appdefined): Remove release of fd_entry.
9302 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
9303 Increment and decrement apploopnr.
9304 (ns_select): If no file descriptors, just do a NSTimer.
9305 Otherwise copy read/write masks and start select thread (fd_handler).
9306 Start main loop and wait for application defined event.
9307 Inform select thread to stop selecting after main loop is exited.
9308 (ns_term_init): Create selfds pipe and set non-blocking.
9309 Initialize select_mutex. Start the select thread (fd_handler).
9310 (fd_handler:): Loop forever, wait for info from the main thread
9311 to either start or stop selecting. When select returns, send
9312 and appdefined event.
9313 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
9314 If not call kbd_buffer_store_event.
9315
9316 * nsterm.h (EmacsApp): fd_handler takes id argument.
9317 (EmacsDialogPanel): Add timer_fired and timeout_handler.
9318
9319 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
9320
93212012-08-15 Eli Zaretskii <eliz@gnu.org>
9322
9323 * region-cache.c (move_cache_gap): Update gap_len using the actual
9324 growth of the boundaries array. Do not change cache_len.
9325 (Bug#12196)
9326
93272012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9328
9329 Generalize and cleanup font subsystem checks.
9330 * font.h (FONT_DEBUG, font_assert): Remove.
9331 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
9332 Change font_assert to eassert. Use eassert where appropriate.
9333
93342012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9335
9336 * gtkutil.c (xg_get_font): Use pango_units_to_double.
9337
93382012-08-15 Chong Yidong <cyd@gnu.org>
9339
9340 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
9341 When using the new font chooser, use gtk_font_chooser_get_font_desc to
9342 extract the font descriptor instead of just the font name.
9343 In that case, return a font spec instead of a string.
9344 (x_last_font_name): Move to this file from xfns.c.
9345
9346 * xfns.c (Fx_select_font): The return value can also be a font
9347 spec. Move x_last_font_name management to gtkutil.c.
9348
9349 * xfaces.c: Make font weight and style symbols non-static.
9350
93512012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
9352
9353 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
9354 (bug#12117).
9355
93562012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
9357
9358 * alloc.c (Fgarbage_collect): Use plural form consistently.
9359
93602012-08-14 Eli Zaretskii <eliz@gnu.org>
9361
9362 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9363 iteration through the command loop. Fixes a problem whereby mouse
9364 movements are ignored until the first mouse click.
9365
93662012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9367
9368 Use bool, not int, for Lisp booleans.
9369 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9370 makes Emacs a bit smaller and presumably a bit faster.
9371 * lisp.h: Include <stdbool.h>.
9372 (struct Lisp_Boolfwd, defvar_bool):
9373 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9374 * regex.c [!emacs]: Include <stdbool.h>.
9375 (false, true): Remove; <stdbool.h> does this for us now.
9376
93772012-08-14 Chong Yidong <cyd@gnu.org>
9378
9379 * character.c (Fcharacterp): Doc fix (Bug#12076).
9380
9381 * data.c (Findirect_variable): Doc fix (Bug#11040).
9382
9383 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9384
9385 * editfns.c (Fformat): Doc fix (Bug#12059).
9386 (Fsave_current_buffer): Doc fix (Bug#11542).
9387
93882012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9389
9390 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9391 (bug#12022).
9392
93932012-08-14 Martin Rudalics <rudalics@gmx.at>
9394
9395 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9396 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9397 * minibuf.c (choose_minibuf_frame, read_minibuf):
9398 * w32fns.c (x_create_tip_frame):
9399 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9400 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9401
94022012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9403
9404 * intervals.c (offset_intervals): Remove obsolete comment.
9405
94062012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9407
9408 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9409
94102012-08-14 Gergely Risko <gergely@risko.hu>
9411
9412 * coding.c (decode_coding): Record buffer modification before
9413 disabling undo_list (Bug#11773).
9414
94152012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9416
9417 Revert and cleanup some recent overlay changes.
9418 * buffer.h (enum overlay_type): Remove.
9419 (buffer_get_overlays, buffer_set_overlays): Likewise.
9420 (buffer_set_overlays_before, buffer_set_overlays_after):
9421 New function. Adjust users.
9422 (unchain_both): Add eassert.
9423
94242012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9425
9426 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9427
94282012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9429
9430 * gtkutil.c (xg_mark_data): Don't assume C99.
9431
94322012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9433
9434 * gtkutil.c (xg_frame_tb_info): New struct.
9435 (TB_INFO_KEY): New define.
9436 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9437 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9438 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9439 if not present.
9440 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
9441 is up to date. Otherwise store new data.
9442 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9443
94442012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9445
9446 Use KSET for write access to Lisp_Object members of struct kboard.
9447 * keyboard.h (KSET): New macro.
9448 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9449 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9450 * xterm.c: Adjust users.
9451
94522012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9453
9454 Use BSET for write access to Lisp_Object members of struct buffer.
9455 * buffer.h (BSET): New macro.
9456 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9457 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9458 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9459 * window.c, xdisp.c, xfns.c: Adjust users.
9460
94612012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9462
9463 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9464
94652012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9466
9467 * nsterm.m (not_in_argv): New function.
9468 (application:openFile, application:openTempFile:):
9469 (application:openFileWithoutUI:, application:openFiles:): Open file
9470 if not_in_argv returns non-zero (bug#12171).
9471
9472 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
9473 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9474 Define for Gtk+ versions less than 3.2.
9475 (xg_get_font_name): Use those functions/macros here.
9476 Reported by Frans Oilinki <moilinki@gmail.com>.
9477
94782012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9479
9480 * unexmacosx.c (copy_data_segment): Copy initialized data in
9481 statically linked libraries from input file rather than memory.
9482
9483 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9484 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9485 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9486
94872012-08-10 Glenn Morris <rgm@gnu.org>
9488
9489 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9490 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9491
94922012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9493
9494 Fix last change to allow compilation with low optimization levels.
9495 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9496 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9497
94982012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9499
9500 Use common inline syntax in intervals.h.
9501 * intervals.h (INTERVALS_INLINE): New macro.
9502 Change all users from LISP_INLINE.
9503
95042012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9505
9506 Define Qnone once for all platforms.
9507 * frame.c (Qnone): Define here.
9508 (syms_of_frame): DEFSYM it.
9509 * lisp.h (Qnone): New declaration.
9510 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9511 * xfns.c: Remove duplication. Adjust users.
9512
95132012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9514
9515 Remove unused macros from intervals.h.
9516 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9517 * intervals.c: Adjust comment.
9518
95192012-08-10 Eli Zaretskii <eliz@gnu.org>
9520
9521 * w32fns.c <w32_unicode_gui>: New static variable.
9522 (globals_of_w32fns): Initialize it according to os_subtype.
9523 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9524 testing os_subtype.
9525
95262012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
9527 Eli Zaretskii <eliz@gnu.org>
9528
9529 Fix bug #10299 with Unicode characters sent by customized
9530 keyboards created by MSKLC.
9531 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9532 (w32_init_class): Use it to initialize the Emacs class with either
9533 ANSI or Unicode API calls.
9534 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9535 later.
9536 (w32_wnd_proc): If the character code sent by WM_CHAR or
9537 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9538 original message. Call DefWindowProcW on NT and later.
9539
95402012-08-10 Glenn Morris <rgm@gnu.org>
9541
9542 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9543
9544 * lisp.h (DIRECTORY_SEP): Let configure set it.
9545
95462012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9547
9548 Use TSET for write access to Lisp_Object slots of struct terminal.
9549 * termhooks.h (TSET): New macro.
9550 * coding.c, terminal.c, xselect.c: Adjust users.
9551
95522012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9553
9554 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9555 the failing expression, include them in the error message.
9556 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9557 * lisp.h (internal_condition_case_n): Update declaration.
9558
95592012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9560
9561 Inline functions to examine and change buffer overlays.
9562 * buffer.c (unchain_both): New function.
9563 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9564 (buffer_has_overlays): New function.
9565 (enum overlay_type): New enum.
9566 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9567 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9568
95692012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9570
9571 Inline functions to examine and change buffer intervals.
9572 * alloc.c (mark_interval_tree): Remove.
9573 (MARK_INTERVAL_TREE): Simplify.
9574 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9575 * intervals.c (buffer_balance_intervals): New function.
9576 (graft_intervals_into_buffer): Adjust indentation.
9577 (set_intervals_multibyte): Simplify.
9578 * buffer.h (BUF_INTERVALS): Remove.
9579 (buffer_get_intervals, buffer_set_intervals): New function.
9580 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9581 * intervals.c, textprop.c: Adjust users.
9582
95832012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9584
9585 Inline functions to examine and change string intervals.
9586 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9587 (string_get_intervals, string_set_intervals): New function.
9588 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9589 * lread.c, print.c, textprop.c: Adjust users.
9590
95912012-08-08 Glenn Morris <rgm@gnu.org>
9592
9593 * lisp.mk (lisp): Remove language/persian.elc.
9594
95952012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9596
9597 Cleanup intervals.
9598 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9599 (NULL_INTERVAL_P): Likewise. Adjust users.
9600 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9601 Adjust comment. Move under #if 0.
9602 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9603 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9604
96052012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9606
9607 Check total length of intervals with eassert.
9608 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9609 * intervals.c: Change all users to eassert.
9610
96112012-08-07 Eli Zaretskii <eliz@gnu.org>
9612
9613 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9614 Rename fields to match removal of FGET and WGET and disuse of
9615 INTERNAL_FIELD in Lisp_Cons.
9616
96172012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9618
9619 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9620 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9621 name since all xname users are fixed long time ago. Do not
9622 use INTERNAL_FIELD.
9623 (set_symbol_name, set_symbol_function, set_symbol_plist):
9624 (set_symbol_next, set_overlay_plist): New function.
9625 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9626 (struct Lisp_Overlay): Likewise.
9627 (CVAR, MVAR, SVAR): Remove.
9628 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9629 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9630 * xterm.c: Adjust users.
9631 * .gdbinit: Change to use name field of struct Lisp_Symbol
9632 where appropriate.
9633
96342012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9635
9636 Basic functions to set Lisp_Object and pointer slots of intervals.
9637 * intervals.h (interval_set_parent, interval_set_object):
9638 (interval_set_left, interval_set_right, interval_set_plist):
9639 (interval_copy_parent): New function.
9640 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9641 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9642 Adjust indentation.
9643 (INTERVAL_SIZE): Remove. Adjust users.
9644 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9645
96462012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9647
9648 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9649 * process.h (PGET): Remove.
9650 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9651 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9652
96532012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9654
9655 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9656 * window.h (WGET): Remove.
9657 (struct window): Do not use INTERNAL_FIELD.
9658 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9659 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9660 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9661 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9662 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9663 Adjust users.
9664
96652012-08-07 Chong Yidong <cyd@gnu.org>
9666
9667 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9668 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9669 (Fdelete_window_internal): Signal an error if the window is not on
9670 a live frame (Bug#12025).
9671
96722012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9673
9674 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9675 * frame.h (FGET): Remove.
9676 (struct frame): Do not use INTERNAL_FIELD.
9677 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9678 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9679 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9680 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9681
96822012-08-06 Juanma Barranquero <lekktu@gmail.com>
9683
9684 * w32.c: Silence compiler warnings.
9685 (map_w32_filename): Remove unused variable `is_fat'.
9686 (chase_symlinks): Add parentheses around expression.
9687
96882012-08-06 Glenn Morris <rgm@gnu.org>
9689
9690 * sysdep.c: Respect BROKEN_GETWD.
9691
9692 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9693 Let configure handle it.
9694 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9695
96962012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9697
9698 Use GCALIGNMENT where appropriate.
9699 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9700 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9701 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9702
97032012-08-06 Eli Zaretskii <eliz@gnu.org>
9704
9705 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9706 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9707
97082012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9709
9710 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9711 that should be sufficient for everyone.
9712
97132012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9714
9715 * keyboard.c (timer_check_2): Add break so timer_check returns next
9716 timeout.
9717
97182012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9719
9720 Fix Windows build errors introduced after converting to WGET and WSET.
9721 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9722 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9723
97242012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9725
9726 * nsterm.m (ns_frame_rehighlight): Use FSET.
9727
9728 * nsmenu.m (ns_update_menubar): Use FSET.
9729
97302012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9731
9732 Separate read and write access to Lisp_Object slots of Lisp_Process.
9733 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9734 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9735
97362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9737
9738 Separate read and write access to Lisp_Object slots of struct window.
9739 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9740 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9741 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9742 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9743 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9744 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9745 Adjust users.
9746
97472012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9748
9749 Fix Windows build errors introduced after converting to FGET and FSET.
9750 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9751 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9752 (w32_judge_scroll_bars): Change to use FSET.
9753 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9754
97552012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9756
9757 Fix replacement typo.
9758 * window.c (replace_window): Set root_window instead of
9759 selected_window. This fixes a total window subsystem
9760 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9761
97622012-08-06 Glenn Morris <rgm@gnu.org>
9763
9764 * lisp.mk (lisp): Add language/persian.elc.
9765
97662012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9767
9768 Separate read and write access to Lisp_Object slots of struct frame.
9769 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9770 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9771 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9772 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9773 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9774
97752012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9776
9777 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9778
97792012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9780
9781 Generalize common compile-time constants.
9782 * lisp.h (header_size, bool_header_size, word_size): Now here.
9783 (struct Lisp_Vector): Add comment.
9784 (struct Lisp_Bool_Vector): Move up to define handy constants.
9785 (VECSIZE, PSEUDOVECSIZE): Simplify.
9786 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9787 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9788 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9789 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9790 * xfont.c, xmenu.c: Use word_size where appropriate.
9791
97922012-08-05 Lawrence Mitchell <wence@gmx.li>
9793
9794 * search.c (Freplace_match): Treat \? in the replacement text
9795 literally (Bug#8161).
9796
97972012-08-05 Chong Yidong <cyd@gnu.org>
9798
9799 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9800 * frame.c (Vdelete_frame_functions):
9801 * emacs.c (Vkill_emacs_hook): Doc fix.
9802
98032012-08-04 Eli Zaretskii <eliz@gnu.org>
9804
9805 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9806 --with-x-toolkit=no builds.
9807 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9808
98092012-08-04 Chong Yidong <cyd@gnu.org>
9810
9811 * syntax.c (Fmodify_syntax_entry): Doc fix.
9812
98132012-08-04 Eli Zaretskii <eliz@gnu.org>
9814
9815 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9816 * w32.c (init_environment): Change the default values of many
9817 environment variables in dflt_envvars[] to NULL, to avoid pushing
9818 them into environment when they were not already defined.
9819 Remove the code that deletes site-lisp subdirectories from the default
9820 value of EMACSLOADPATH, as it is no longer needed.
9821 (check_windows_init_file): Now external, not static.
9822 Use Vload_path as is, without adding anything, as this function is now
9823 called when Vload_path is already set up.
9824
9825 * w32.h (check_windows_init_file): Add prototype.
9826
9827 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9828 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9829 compatibility with Posix platforms.
9830 (main): Move the call to check_windows_init_file to here from
9831 w32.c.
9832 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9833 any, in the DEFALT argument into the root of the Emacs build or
9834 installation tree, as appropriate.
9835
9836 * callproc.c (init_callproc_1): Call decode_env_path instead of
9837 doing its equivalent by hand.
9838 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9839 the code that sets Vexec_path run on MS-Windows.
9840
9841 * lread.c (init_lread): Add comments to #ifdef's.
9842
9843 * msdos.c (dos_set_window_size, IT_update_begin)
9844 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9845 instead of direct references.
9846
98472012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9848
9849 Export DEFAULT_REHASH_* to GDB.
9850 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9851 Now constants, not macros.
9852
98532012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9854
9855 Remove unnecessary casts involving pointers.
9856 These casts are no longer needed now that we assume C89 or later,
9857 since they involve casting to or from void *.
9858 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9859 (make_pure_float, make_pure_vector):
9860 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9861 * macros.c (Fstart_kbd_macro):
9862 * menu.c (find_and_return_menu_selection):
9863 * minibuf.c (read_minibuf_noninteractive):
9864 * sysdep.c (closedir):
9865 * xdisp.c (x_produce_glyphs):
9866 * xfaces.c (compare_fonts_by_sort_order):
9867 * xfns.c (x_real_positions, select_visual):
9868 * xselect.c (x_stop_queuing_selection_requests)
9869 (x_get_window_property, x_get_window_property_as_lisp_data):
9870 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9871 Remove unnecessary pointer casts.
9872 * alloc.c (record_xmalloc): New function.
9873 * lisp.h (record_xmalloc): New decl.
9874 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9875 more like a function. This is because the pointer cast is not
9876 needed. All uses changed.
9877 * print.c (print_string, print_error_message): Avoid length recalc.
9878
9879 Improve fix for macroexp crash with debugging (Bug#12118).
9880 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9881 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9882 not supposed to be invoked from the garbage collector.
9883 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9884 (gc_aset): New function, which is like ASET but can be
9885 used in the garbage collector.
9886 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9887 (set_hash_index): Use it instead of ASET.
9888
98892012-08-03 Eli Zaretskii <eliz@gnu.org>
9890
9891 Support symlinks on latest versions of MS-Windows.
9892 * w32.c: Include winioctl.h and aclapi.h.
9893 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9894 (revert_to_self): Forward declarations of static functions.
9895 <static BOOL g_b_init_get_security_info>:
9896 <g_b_init_create_symbolic_link>: New static flags.
9897 (globals_of_w32): Initialize them to zero.
9898 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9899 (map_w32_filename): Improve commentary. Simplify switch.
9900 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9901 headers (most versions of MinGW w32api don't).
9902 (get_security_info, create_symbolic_link)
9903 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9904 New functions.
9905 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9906 in the argument file name.
9907 (sys_access): Call unc_volume_file_attributes only if
9908 GetFileAttributes fails with network-related error codes.
9909 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9910 have the required privileges.
9911 (get_file_security_desc_by_name): Rename from
9912 get_file_security_desc.
9913 (stat_worker): New function, with most of the guts of 'stat', and
9914 with addition of handling of symlinks and support for 'lstat'.
9915 If possible, get file's attributes and security information by
9916 handle, not by name. Produce S_IFLNK bit for symlinks, when
9917 called from 'lstat'.
9918 (stat, lstat): New functions, call 'stat_worker'.
9919 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9920 symlinks when the underlying filesystem supports them.
9921
99222012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 Fix macroexp crash on Windows with debugging (Bug#12118).
9925 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9926 checking subscripts; problem introduced with the recent
9927 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9928 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9929 since it's used in non-static inline functions now.
9930
9931 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9932 Don't assume buffer size fits in 'int'. Remove unused local.
9933
9934 Use C99-style 'extern inline' if available.
9935 * buffer.h (BUFFER_INLINE):
9936 * category.h (CATEGORY_INLINE):
9937 * character.h (CHARACTER_INLINE):
9938 * charset.h (CHARSET_INLINE):
9939 * composite.h (COMPOSITE_INLINE):
9940 * dispextern.h (DISPEXTERN_INLINE):
9941 * lisp.h (LISP_INLINE):
9942 * systime.h (SYSTIME_INLINE):
9943 New macro, replacing 'static inline' in this header.
9944 * buffer.h, category.h, character.h, charset.h, composite.h:
9945 * dispextern.h, lisp.h, systime.h:
9946 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9947 * alloc.c (LISP_INLINE):
9948 * buffer.c (BUFFER_INLINE):
9949 * category.c (CATEGORY_INLINE):
9950 * character.c (CHARACTER_INLINE):
9951 * charset.c (CHARSET_INLINE):
9952 * composite.c (COMPOSITE_INLINE):
9953 * dispnew.c (DISPEXTERN_INLINE):
9954 * sysdep.c (SYSTIME_INLINE):
9955 Define to EXTERN_INLINE, so that the corresponding functions
9956 are compiled into code.
9957 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9958 (INLINE_HEADER_END): New macros.
9959 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9960 since it's used in non-static inline functions now.
9961 (VALMASK) [!USE_LSB_TAG]: Likewise.
9962
99632012-08-02 Glenn Morris <rgm@gnu.org>
9964
9965 * s/: Remove empty directory.
9966
9967 * s/ms-w32.h: Move to ../nt/inc.
9968 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9969 Update for new ms-w32.h location.
9970
99712012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9972
9973 Port to Solaris 8.
9974 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9975
99762012-08-02 Glenn Morris <rgm@gnu.org>
9977
9978 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9979 hard-coding the path separator.
9980
99812012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9982
9983 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9984 This how ASET and AREF are supposed to work, and makes
9985 it easier to think about future improvements. See
9986 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9987 * charset.h (set_charset_attr): New function.
9988 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9989 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9990 (aref_addr): New function. All uses of &AREF(...) changed.
9991 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9992 (set_hash_index): New functions. All lvalue-style uses of
9993 HASH_KEY etc. changed.
9994 * keyboard.c (set_prop): New function. All lvalue-style uses
9995 of PROP changed.
9996
99972012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9998
9999 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
10000 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
10001 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
10002 * nsfns.m (ns_set_name_as_filename): Likewise.
10003 * nsmenu.m (ns_update_menubar): Likewise.
10004 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
10005
100062012-08-01 Eli Zaretskii <eliz@gnu.org>
10007
10008 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
10009 Adapt to latest changes in field names of the corresponding Lisp
10010 objects.
10011
10012 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
10013
100142012-08-01 Glenn Morris <rgm@gnu.org>
10015
10016 * s/msdos.h: Remove file.
10017 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
10018 * Makefile.in (S_FILE): Remove.
10019 (config_h): Remove S_FILE.
10020
100212012-08-01 Juanma Barranquero <lekktu@gmail.com>
10022
10023 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
10024 Remove; moved to nt/config.nt.
10025
100262012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
10027
10028 Use INTERNAL_FIELD for conses and overlays.
10029 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
10030 Remove obsolete comment.
10031 (MVAR): New macro.
10032 (struct Lisp_Overlay): Use INTERNAL_FIELD.
10033 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
10034
100352012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
10036
10037 Use INTERNAL_FIELD for symbols.
10038 * lisp.h (SVAR): New macro. Adjust users.
10039 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
10040 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
10041
100422012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
10043
10044 Use INTERNAL_FIELD for processes.
10045 * process.h (PVAR): New macro. Adjust style.
10046 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
10047 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
10048
100492012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
10050
10051 Use INTERNAL_FIELD for windows.
10052 * window.h (WVAR): New macro.
10053 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
10054 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
10055 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
10056 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
10057 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
10058 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
10059
100602012-08-01 Paul Eggert <eggert@cs.ucla.edu>
10061
10062 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
10063
100642012-08-01 Glenn Morris <rgm@gnu.org>
10065
10066 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
10067 Move to configure.ac.
10068
100692012-08-01 Juanma Barranquero <lekktu@gmail.com>
10070
10071 * makefile.w32-in (CONFIG_H): Update dependencies.
10072 (CONF_POST_H): New macro.
10073
10074 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
10075
100762012-07-31 Glenn Morris <rgm@gnu.org>
10077
10078 * Makefile.in (S_FILE): No longer set by configure.
10079
10080 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
10081 is available.
10082 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
10083
10084 * process.h (NULL_DEVICE):
10085 * emacs.c (SEPCHAR):
10086 * editfns.c (USER_FULL_NAME): Let configure set them.
10087
10088 * s/README, s/template.h: Remove files.
10089
10090 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
10091
10092 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
10093 Move to configure.ac.
10094
100952012-07-31 Eli Zaretskii <eliz@gnu.org>
10096
10097 * .gdbinit (xframe): Adapt to introduction of FVAR and the
10098 resulting renaming of 'struct frame' members.
10099
10100 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
10101
10102 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
10103 after introduction of FVAR.
10104
101052012-07-31 Jan Djärv <jan.h.d@swipnet.se>
10106
10107 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
10108
10109 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
10110 instead of compositeToPoint.
10111 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
10112
10113 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
10114
101152012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
10116
10117 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
10118 * lisp.h (INTERNAL_FIELD): New macro.
10119 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
10120 (BVAR): Change to use INTERNAL_FIELD.
10121 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
10122 (KVAR): Change to use INTERNAL_FIELD.
10123 * frame.h (FVAR): New macro.
10124 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
10125 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
10126 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
10127 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
10128 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
10129
101302012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
10131
10132 Miscellaneous fixes for non-default X toolkits.
10133 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
10134 * xterm.c (x_frame_of_widget): Remove redundant prototype.
10135 Move under #ifdef USE_LUCID.
10136 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
10137 definition and usage to avoid warnings.
10138
101392012-07-31 Jan Djärv <jan.h.d@swipnet.se>
10140
10141 * nsterm.m (openFiles): Fix previous checkin.
10142
101432012-07-31 Paul Eggert <eggert@cs.ucla.edu>
10144
10145 * indent.c (compute_motion): Remove unused local.
10146
101472012-07-31 Glenn Morris <rgm@gnu.org>
10148
10149 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
10150
10151 * conf_post.h [USG5_4]:
10152 Move remaining contents of s/usg5-4-common.h here.
10153 * s/usg5-4-common.h: Remove file.
10154
10155 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
10156 * s/irix6-5.h: Remove file.
10157
10158 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
10159 * s/darwin.h: Remove file.
10160
10161 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
10162 * s/hpux10-20.h: Remove file, which is now empty.
10163
101642012-07-30 Glenn Morris <rgm@gnu.org>
10165
10166 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
10167 * Makefile.in (config_h): Add conf_post.h.
10168 * makefile.w32-in (CONFIG_H): Add conf_post.h.
10169
101702012-07-30 Jan Djärv <jan.h.d@swipnet.se>
10171
10172 * nsterm.m (ns_do_open_file): New variable.
10173 (ns_term_init): Set ns_do_open_file to YES after run returns.
10174 (openFile, openTempFile, openFileWithoutUI, openFiles):
10175 Open files only if ns_do_open_file.
10176
101772012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10178
10179 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
10180 This no-op macro hasn't been needed for many years.
10181 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
10182
10183 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
10184 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
10185 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
10186 gdb_make_enums_visible.
10187 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
10188 (DIRECTORY_SEP): Now a constant, not a macro.
10189
101902012-07-30 Eli Zaretskii <eliz@gnu.org>
10191
10192 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
10193 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
10194
10195 * w32term.c <w32_keyboard_codepage>: Renamed from
10196 keyboard_codepage and now external. All users changed.
10197
10198 * w32term.h: Add declaration of w32_keyboard_codepage.
10199
10200 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
10201 the codepage to translate keys to Unicode. If this argument is
10202 -1, use the value returned by GetConsoleCP. All callers changed.
10203
102042012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10205
10206 Update .PHONY listings in makefiles.
10207 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
10208 bootstrap-clean, distclean, maintainer-clean, versioclean,
10209 extraclean, frc.
10210
10211 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
10212 This is a bit clearer. Fix some commentary typos.
10213
102142012-07-30 Glenn Morris <rgm@gnu.org>
10215
10216 * s/netbsd.h: Let configure include signal.h if needed.
10217 Remove file, which is now empty.
10218
10219 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
10220 Let configure set them.
10221 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
10222 No more need to undefine.
10223
102242012-07-30 Andreas Schwab <schwab@linux-m68k.org>
10225
10226 * keymap.c (Fkey_description): Don't remove 0x80 bit from
10227 non-single-byte char when adding meta modifier. (Bug#12090)
10228
102292012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10230
10231 Convert safe_call to use variable number of arguments.
10232 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
10233 (safe_call2): Fix comment.
10234 * lisp.h (safe_call): Adjust prototype.
10235 * coding.c (encode_coding_object): Change to use safe_call2.
10236 * xfaces.c (merge_face_heights): Change to use safe_call1.
10237
102382012-07-30 Glenn Morris <rgm@gnu.org>
10239
10240 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
10241 does that unconditionally. Remove file, which is now empty.
10242
10243 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
10244 Remove empty files.
10245
102462012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10247
10248 Export to GDB most of lisp.h's remaining object-like macros.
10249 * lisp.h (min, max): Move earlier, because they're used earlier now.
10250 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
10251 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
10252 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
10253 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
10254 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
10255 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
10256 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
10257 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
10258 Now constants, for GDB. They need not be macros.
10259 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
10260 Now constants, for GDB, as well as macros, for static initializers.
10261 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
10262 Move to after the definition of struct Lisp_Char_Table,
10263 since the former now needs that type defined.
10264 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
10265 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
10266 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
10267 New enums, for gdb_make_enums_visible.
10268 (GLYPH_MODE_LINE_FACE): Remove; unused.
10269 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
10270 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
10271 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
10272 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
10273 enum maxargs, enum MAX_ALLOCA.
10274 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
10275 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
10276 no longer needed, now that they are done in lisp.h.
10277
102782012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10279
10280 Cleanup string bytes checking.
10281 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
10282 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
10283 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
10284 (check_sblock, compact_small_strings): Simplify.
10285
102862012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10287
10288 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
10289 These macros are confusing and no longer need to be defined, as
10290 the enum values now suffice. All uses replaced with definiens.
10291 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
10292
102932012-07-29 Juanma Barranquero <lekktu@gmail.com>
10294
10295 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
10296 ($(BLD)/w32console.$(O)): Update dependencies.
10297
102982012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10299
10300 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
10301 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
10302 time. Adjust users.
10303 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
10304
103052012-07-29 Jan Djärv <jan.h.d@swipnet.se>
10306
10307 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
10308 setting sitelisp (Bug#12010).
10309
103102012-07-29 Eli Zaretskii <eliz@gnu.org>
10311
10312 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
10313
10314 * w32heap.c (cache_system_info):
10315 * w32.c (sys_rename):
10316 * w32proc.c (find_child_console, sys_kill): All users changed.
10317
103182012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10319
10320 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
10321
103222012-07-29 Eli Zaretskii <eliz@gnu.org>
10323
10324 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
10325
103262012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10327
10328 Cleanup statistics calculation in Fgarbage_collect.
10329 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
10330 Fix zombies percentage calculation. Simplify elapsed time calculation.
10331
103322012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10333
10334 Generalize marker debugging code under MARKER_DEBUG and use eassert.
10335 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
10336 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
10337 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
10338 (replace_range, replace_range_2, del_range_2): Change to eassert.
10339 * marker.c (byte_char_debug_check): Adjust style.
10340
103412012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10342
10343 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
10344 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
10345 long-ago-commented-out code that talks about "WIN32".
10346 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
10347 All uses changed.
10348
103492012-07-28 Paul Eggert <eggert@cs.ucla.edu>
10350
10351 Use Gnulib stdalign module (Bug#9772, Bug#9960).
10352 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
10353 Simplify by using alignof.
10354 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
10355 * lisp.h: Include <stdalign.h>.
10356 (GCALIGNMENT): New macro and constant.
10357 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
10358 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
10359 (stdalign): New macro, if not already defined.
10360
103612012-07-28 Eli Zaretskii <eliz@gnu.org>
10362
10363 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10364 * w32inevt.c: Include w32inevt.h.
10365 (w32_read_console_input): New inline function, calls either
10366 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10367 w32_console_unicode_input.
10368 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10369 (w32_kbd_patch_key, key_event): Use the codepage returned by
10370 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10371 (key_event): use uChar.UnicodeChar only if
10372 w32_console_unicode_input is non-zero.
10373
10374 * w32console.c: Include w32heap.h.
10375 <w32_console_unicode_input>: New global variable.
10376 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10377 family of Windows, zero otherwise.
10378
10379 * w32inevt.h: Declare w32_console_unicode_input.
10380
10381 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10382 --without-x. (Bug#11742)
10383
103842012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10385
10386 Adjust GDB to reflect pvec_type changes (Bug#12036).
10387 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
10388 2012-07-04 changes to pseudovector representation.
10389 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
10390
103912012-07-27 Michael Albinus <michael.albinus@gmx.de>
10392
10393 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10394 bus address.
10395 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10396
103972012-07-27 Eli Zaretskii <eliz@gnu.org>
10398
10399 * alloc.c (listn): Fix the order the arguments are consed onto the
10400 list.
10401
10402 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10403 enumeration constants, as PURE and HEAP are too general, and clash
10404 with other headers and sources, such as gmalloc.c and the
10405 MS-Windows system headers. All users changed.
10406
104072012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10408
10409 Revert last save_excursion_save and save_excursion_restore changes.
10410 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10411 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10412
104132012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10414
10415 Fix recently-introduced typos in Windows port.
10416 Reported by Martin Rudalics <rudalics@gmx.at>.
10417 * w32.c (init_environment): Replace comma with semicolon.
10418 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
10419
104202012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10421
10422 Improve GDB symbol export (Bug#12036).
10423 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10424 arms of an 'if', not using conditional expressions; otherwise GDB
10425 complains about the types in the unevaluated arm when the argument
10426 is an integer literal.
10427 (xgetint): Simplify expression.
10428 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10429 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10430 Zaretskii in <http://bugs.gnu.org/12036#13>.
10431 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10432 needed now that we have gdb_make_enums_visible.
10433 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10434 (enum enum_USE_LSB_TAG):
10435 New enum types, packaging up enums that need to be exported to GDB.
10436
104372012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10438
10439 Utility function to make a list from specified amount of objects.
10440 * lisp.h (enum constype): New datatype.
10441 (listn): New prototype.
10442 * alloc.c (listn): New function.
10443 (Fmemory_use_count, syms_of_alloc): Use it.
10444 * buffer.c (syms_of_buffer): Likewise.
10445 * callint.c (syms_of_callint): Likewise.
10446 * charset.c (define_charset_internal): Likewise.
10447 * coding.c (syms_of_coding): Likewise.
10448 * keymap.c (syms_of_keymap): Likewise.
10449 * search.c (syms_of_search): Likewise.
10450 * syntax.c (syms_of_syntax): Likewise.
10451 * w32.c (init_environment): Likewise.
10452 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10453 * xdisp.c (syms_of_xdisp): Likewise.
10454 * xfns.c (syms_of_xfns): Likewise.
10455
104562012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10457
10458 Fast save_excursion_save and save_excursion_restore.
10459 * lisp.h (struct Lisp_Excursion): New data type.
10460 (PVEC_EXCURSION): New pseudovector type.
10461 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10462 to deal with it. Adjust comments.
10463 (init_marker, attach_marker): New prototype.
10464 (unchain_marker): Adjust prototype.
10465 * marker.c (attach_marker): Change to global.
10466 (init_marker): New function.
10467 * alloc.c (Fmake_marker, build_marker): Use it.
10468 (build_marker): More easserts.
10469 (mark_object): Handle struct Lisp_Excursion.
10470 * editfns.c (save_excursion_save, save_excursion_restore):
10471 Reimplement to use struct Lisp_Excursion. Add comments.
10472
104732012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10474
10475 Fix export of symbols to GDB (Bug#12036).
10476 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10477 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10478 emacs.c, as this is a more-suitable home. Had this been done earlier
10479 the fix for 12036 would have avoided some of the problems noted in
10480 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10481 would have been more obvious.
10482 * emacs.c: Do not include <verify.h>; no longer needed.
10483 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
10484 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10485 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10486 Remove; now done in lisp.h.
10487 * lisp.h (PUBLISH_TO_GDB): New macro.
10488 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10489 (DATA_SEG_BITS): Use it.
10490 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10491 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10492 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10493 not be usable in #if. This simplifies things.
10494
104952012-07-26 Juanma Barranquero <lekktu@gmail.com>
10496
10497 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10498
104992012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10500
10501 Simplify export of symbols to GDB (Bug#12036).
10502 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10503 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10504 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10505 Adjust to changes in lisp.h and emacs.c, by using
10506 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10507 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10508 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10509 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10510 instead of gdb_valbits.
10511 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10512 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10513 instead of gdb_array_mark_flag.
10514 (xboolvector): Get size from $->size, not $->header.size.
10515 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10516 (xreload, hook-run, hookpost-run): Remove.
10517 * emacs.c: Include <verify.h>.
10518 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10519 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10520 Remove.
10521 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10522 (gdb_USE_LSB_TAG): New enum constants.
10523 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10524 Also define these as enum constants, so they're visible to GDB.
10525 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10526 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10527 as constants, so they're visible to GDB.
10528 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10529 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10530 Now enum constants, not macros, so they're visible to GDB.
10531 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10532 more convenient now. All uses changed.
10533 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10534 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10535
105362012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10537
10538 Explicitly free restriction data that are not needed anymore.
10539 * editfns.c (save_restriction_restore): Free restriction data.
10540
105412012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10542
10543 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10544 add argument, tune behavior, and adjust all callers.
10545
105462012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10547
10548 Use typedef for EMACS_INT, EMACS_UINT.
10549 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10550 than macros. This simplifies debugging in the usual case, since
10551 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10552 and it allows expressions involving EMACS_INT casts.
10553 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10554
105552012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10556
10557 * nsterm.m (ns_read_socket): Return early if there is a modal
10558 window (Bug#12043).
10559
105602012-07-25 Martin Rudalics <rudalics@gmx.at>
10561
10562 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10563 that FOCUS-FRAME can be omitted.
10564
105652012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10566
10567 Adjust buffer text indirection counters at the end of Fkill_buffer.
10568 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10569 buffer is definitely dead. This should really fix an issue reported
10570 by Christoph Scholtes again. (Bug#12007).
10571 (init_buffer_once): Initialize indirection counters of
10572 buffer_defaults and buffer_local_symbols (for sanity and safety).
10573
105742012-07-24 Eli Zaretskii <eliz@gnu.org>
10575
10576 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10577 and continuation glyphs on tooltip frames, leave them at zero.
10578 Avoids continued lines in tooltips. (Bug#11832)
10579
105802012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10581
10582 Simplify copy_overlay.
10583 * buffer.c (copy_overlay): Simplify. Use build_marker.
10584 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10585
105862012-07-23 Eli Zaretskii <eliz@gnu.org>
10587
10588 * print.c (print_object): Don't crash when a frame's name is nil
10589 or invalid. (Bug#12025)
10590
10591 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10592 it signals an error when a tooltip frame is being created.
10593
105942012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10595
10596 Cleanup miscellaneous objects allocation and initialization.
10597 * alloc.c (allocate_misc): Change to static. Add argument to
10598 specify the subtype. Adjust comment and users.
10599 (build_overlay): New function.
10600 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10601 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10602 (allocate_misc): Remove prototype.
10603 (build_overlay): Add prototype.
10604
106052012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10606
10607 Swap buffer text indirection counters in Fbuffer_swap_text.
10608 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10609 This avoids crash reported by Christoph Scholtes at
10610 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10611
106122012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10613
10614 * nsmenu.m (Popdown_data): New struct.
10615 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10616 free Popdown_data.
10617 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10618 (initWithContentRect): Make imgView and contentView non-static
10619 and autorelease them. Also autorelease img and matrix (Bug#12005).
10620 (dealloc): Remove (Bug#12005).
10621
106222012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10623
10624 Adjust consing_since_gc when objects are explicitly freed.
10625 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10626 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10627 (free_cons, free_misc): Subtract object size from consing_since_gc.
10628
106292012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10630
10631 Simplify and cleanup markers positioning code.
10632 * marker.c (attach_marker): More useful eassert.
10633 (live_buffer, set_marker_internal): New function.
10634 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10635 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10636
106372012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10638
10639 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10640 as it's limited by the amount of memory, not by INT_MAX.
10641
106422012-07-21 Eli Zaretskii <eliz@gnu.org>
10643
10644 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10645 in special-event-map. See the discussion at
10646 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10647 for the reasons.
10648
10649 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10650 info.dwItemData. Fixes crashes on 64-bit Windows.
10651 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10652
106532012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10654
10655 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10656 (conversationIdentifier): Return value is NSInteger.
10657 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10658
106592012-07-21 Chong Yidong <cyd@gnu.org>
10660
10661 * window.c (decode_any_window): Signal an error if the window is
10662 on a dead frame (Bug#11984).
10663
106642012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10665
10666 Add indirection counting to speed up Fkill_buffer.
10667 * buffer.h (struct buffer): New member.
10668 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10669 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10670 base buffer indirection counter.
10671 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10672 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10673 through buffer list if indirection counter is 0.
10674
106752012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10676
10677 Extend the value returned by Fgarbage_collect with heap statistics.
10678 * alloc.c (Qheap): New symbol.
10679 (syms_of_alloc): DEFSYM it.
10680 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10681 (Fmemory_free): Remove.
10682 (syms_of_alloc): Don't defsubr it.
10683 * buffer.c (Fcompact_buffer): Remove.
10684 (syms_of_buffer): Don't defsubr it.
10685
106862012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10687
10688 Make maybe_gc inline.
10689 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10690 * lisp.h (consing_since_gc, gc_relative_threshold)
10691 (memory_full_cons_threshold): Revert declaration.
10692 (maybe_gc): Remove prototype, define as inline.
10693 * alloc.c: Remove old commented-out code.
10694 (consing_since_gc, gc_relative_threshold)
10695 (memory_full_cons_threshold): Revert to global.
10696 (maybe_gc): Remove.
10697
106982012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10699
10700 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10701 * lisp.h (build_unibyte_string): New function.
10702 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10703 * sysdep.c, w32fns.c, xfns.c: Use it.
10704 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10705 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10706 Adjust users accordingly.
10707 * font.h (font_open_by_name): Adjust prototype.
10708
107092012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10710
10711 Cleanup calls to Fgarbage_collect.
10712 * lisp.h (maybe_gc): New prototype.
10713 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10714 Remove declarations.
10715 * alloc.c (maybe_gc): New function.
10716 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10717 Make them static.
10718 * bytecode.c (MAYBE_GC): Use maybe_gc.
10719 * eval.c (eval_sub, Ffuncall): Likewise.
10720 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10721 to avoid dependency from auto-save feature.
10722
107232012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10724
10725 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10726 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10727 'for_each_per_buffer_object_at'.
10728 All uses changed. It's better to use upper-case for macros that
10729 cannot be implemented as functions, to give the reader a clue
10730 that they're special.
10731
107322012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10733
10734 * alloc.c (Fgarbage_collect): Tweak docstring.
10735
107362012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10737
10738 Tweak the value returned from Fgarbage_collect again.
10739 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10740 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10741 Adjust documentation.
10742 (total_vector_bytes): Rename to total_vector_slots, adjust
10743 accounting.
10744 (total_free_vector_bytes): Rename to total_free_vector_slots,
10745 adjust accounting.
10746 (Qstring_bytes, Qvector_slots): New symbols.
10747 (syms_of_alloc): DEFSYM them.
10748
107492012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10750
10751 Buffer compaction primitive which may be used from Lisp.
10752 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10753 (syms_of_buffer): Register Fcompact_buffer.
10754 * alloc.c (Fgarbage_collect): Use compact_buffer.
10755 * buffer.h (compact_buffer): New prototype.
10756 (struct buffer_text): New member.
10757
107582012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10759
10760 New macro to iterate over all buffers, miscellaneous cleanups.
10761 * lisp.h (all_buffers): Remove declaration.
10762 * buffer.h (all_buffers): Add declaration, with comment.
10763 (for_each_buffer): New macro.
10764 * alloc.c (Fgarbage_collect, mark_object): Use it.
10765 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10766 (init_buffer): Likewise.
10767 * data.c (Fset_default): Likewise.
10768 * coding.c (code_conversion_restore): Remove redundant check
10769 for dead buffer.
10770 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10771
107722012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10773
10774 Fix bug that created negative-length intervals.
10775 * intervals.c (merge_interval_right, merge_interval_left):
10776 Do not zero out this interval if it is absorbed by its children,
10777 as this interval's total length doesn't change in that case. See
10778 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10779
107802012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10781
10782 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10783 when invoking (make-bool-vector N t) and N is a positive
10784 multiple of 8 -- the last 8 bits were mistakenly cleared.
10785
10786 Remove some struct layout assumptions in bool vectors.
10787 * alloc.c (bool_header_size): New constant.
10788 (header_size, word_size): Move earlier, as they're now used earlier.
10789 Use 'word_size' in a few more places, where it's appropriate.
10790 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10791 padding before the data member of a bool vector.
10792 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10793 than doing the check by hand with an abort ().
10794
107952012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10796
10797 * eval.c (Fdefvar): Don't check constants since we only set the var if
10798 it's not yet defined anyway (bug#11904).
10799
10800 * lisp.h (last_undo_boundary): Declare new var.
10801 * keyboard.c (command_loop_1): Set it.
10802 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10803 were auto-added by the command loop (bug#11774).
10804
108052012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10806
10807 * w32font.c (Qsymbol): Remove local definition.
10808 (syms_of_w32font): Don't DEFSYM it.
10809
108102012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10811
10812 Fix sweep_vectors to handle large bool vectors correctly.
10813 * alloc.c (sweep_vectors): Account total_vector_bytes for
10814 bool vectors larger than VBLOCK_BYTES_MAX.
10815
108162012-07-18 Chong Yidong <cyd@gnu.org>
10817
10818 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10819 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10820
108212012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10822
10823 Return more descriptive data from Fgarbage_collect.
10824 Suggested by Stefan Monnier in
10825 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10826 * alloc.c (bounded_number): New function.
10827 (total_buffers, total_vectors): New variable.
10828 (total_string_size): Rename to total_string_bytes, adjust users.
10829 (total_vector_size): Rename to total_vector_bytes, adjust users.
10830 (sweep_vectors): Account total_vectors and total_vector_bytes.
10831 (Fgarbage_collect): New return value. Adjust documentation.
10832 (gc_sweep): Account total_buffers.
10833 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10834 (VECTOR_SIZE): Remove.
10835 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10836 (Qinterval, Qmisc): New symbols.
10837 (syms_of_data): Initialize them.
10838 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10839 (Qcons, Qbuffer): New declarations.
10840
108412012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10842
10843 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10844 Round up, not down. Improve doc.
10845
108462012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10847
10848 Restore old code in allocate_string_data to avoid Faset breakage.
10849 Reported by Julien Danjou <julien@danjou.info> in
10850 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10851 * alloc.c (allocate_string_data): Restore old code with minor
10852 adjustments, fix comment to explain this subtle issue.
10853
108542012-07-17 Eli Zaretskii <eliz@gnu.org>
10855
10856 Remove FILE_SYSTEM_CASE.
10857 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10858
10859 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10860 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10861 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10862 call-process-region passes it through expand-file-name.
10863
10864 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10865
108662012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10867
10868 Fix crash when creating indirect buffer (Bug#11917)
10869 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10870 Don't handle unbound variables specially if non-zero.
10871 (Fbuffer_local_variables): Pass zero.
10872 (clone_per_buffer_values): Pass non-zero.
10873
108742012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10875
10876 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10877 to make the loop interruptible.
10878
108792012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10880
10881 * gnutls.c (emacs_gnutls_handshake): Only retry if
10882 GNUTLS_E_INTERRUPTED.
10883
108842012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10885
10886 Cleanup and convert miscellaneous checks to eassert.
10887 * alloc.c (mark_interval): Fix comment, partially rephrase
10888 old comment from intervals.h (see below).
10889 * intervals.c (find_interval, adjust_intervals_for_insertion)
10890 (delete_interval, adjust_intervals_for_deletion)
10891 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10892 Convert to eassert.
10893 (adjust_intervals_for_insertion, make_new_interval):
10894 Remove obsolete and unused code.
10895 * intervals.h (struct interval): Remove obsolete comment.
10896 * textprotp.c (erase_properties): Remove unused code.
10897 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10898 (Fremove_list_of_text_properties): Convert to eassert.
10899
109002012-07-17 Chong Yidong <cyd@gnu.org>
10901
10902 * editfns.c (Finsert_char): Doc fix.
10903
109042012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10905
10906 Fix previous change to make Fmemory_free always accurate.
10907 * alloc.c (make_interval): Update total_free_intervals.
10908 (make_float): Likewise for total_free_floats.
10909 (free_cons, Fcons): Likewise for total_free_conses.
10910 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10911 Likewise for total_free_vector_bytes.
10912 (Fmake_symbol): Likewise for total_free_symbols.
10913 (bytes_free): Remove.
10914
109152012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10916
10917 Simple free memory accounting feature.
10918 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10919 (sweep_vectors): Accumulate size of free vectors.
10920 (Fgarbage_collect): Setup bytes_free.
10921 (Fmemory_free): New function.
10922 (syms_of_alloc): Register it.
10923
109242012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10925
10926 Cleanup overlays checking.
10927 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10928 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10929 eassert and OVERLAYP.
10930 (sort_overlays): Change to use OVERLAYP.
10931
109322012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10933
10934 * editfns.c (Finsert_char): Make it interactive, and make the
10935 second arg optional. Copy interactive spec and docstring from
10936 ucs-insert.
10937
109382012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10939
10940 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10941 Unlike the other wrapped functions, fabs has an unspecified
10942 effect on errno.
10943
109442012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10945
10946 * nsterm.m (keyDown): Interpret flags without left/right bits
10947 as the left key (Bug#11670).
10948
109492012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10950
10951 Remove empty and useless init functions.
10952 * lisp.h (init_character_once, init_fns, init_image)
10953 (init_filelock, init_sound): Remove prototype.
10954 * character.c (init_character_once): Remove.
10955 * filelock.c (init_filelock): Likewise.
10956 * fns.c (init_fns): Likewise.
10957 * image.c (init_image): Likewise.
10958 * sound.c (init_sound): Likewise.
10959 * emacs.c (main): Adjust accordingly.
10960
109612012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10962
10963 * gtkutil.h: Tiny cleanups.
10964 (use_old_gtk_file_dialog): Remove useless declaration.
10965 (xg_uses_old_file_dialog): Add suggested const attribute.
10966
109672012-07-15 Eli Zaretskii <eliz@gnu.org>
10968
10969 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10970 (bidi_paragraph_init): Use it to limit search forward for a strong
10971 directional character in abnormally large paragraphs full of
10972 neutral or weak characters. (Bug#11943)
10973
109742012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10975
10976 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10977 the toolbar (Bug#9451).
10978 (xg_make_tool_item): Give the widget event box a transparent
10979 background.
10980
109812012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10982
10983 Cleanup basic allocation variables and functions.
10984 * alloc.c (ignore_warnings, init_intervals, init_float)
10985 (init_cons, init_symbol, init_marker): Remove.
10986 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10987 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10988 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10989 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10990 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10991 (staticidx, init_alloc_once, init_strings, free_ablock):
10992 Remove redundant initialization.
10993 * fns.c (init_weak_hash_tables): Remove.
10994 * lisp.h (init_weak_hash_tables): Remove prototype.
10995
109962012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10997
10998 Use zero_vector where appropriate.
10999 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
11000 accordingly.
11001 * lisp.h (zero_vector): New declaration.
11002 * font.c (null_vector): Remove.
11003 (syms_of_font): Remove initialization and staticpro.
11004 (font_list_entities, font_find_for_lface): Change to use zero_vector.
11005 * keymap.c (Faccessible_keymaps): Likewise.
11006
110072012-07-15 Leo Liu <sdl.web@gmail.com>
11008
11009 * fringe.c: Fix typo in comments.
11010
110112012-07-14 Leo Liu <sdl.web@gmail.com>
11012
11013 * fringe.c: Add a new bitmap exclamation-mark.
11014
110152012-07-14 Eli Zaretskii <eliz@gnu.org>
11016
11017 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
11018
11019 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
11020 (HAVE_MENUS): Don't define, defined by editing config.in with
11021 msdos/sed2v2.inp.
11022 (GMALLOC_INHIBIT_VALLOC): Don't define.
11023 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
11024
110252012-07-14 Juanma Barranquero <lekktu@gmail.com>
11026
11027 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
11028
110292012-07-14 Glenn Morris <rgm@gnu.org>
11030
11031 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
11032 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
11033 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
11034
110352012-07-13 Glenn Morris <rgm@gnu.org>
11036
11037 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
11038
11039 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
11040 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
11041
110422012-07-13 Jan Djärv <jan.h.d@swipnet.se>
11043
11044 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
11045 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
11046 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
11047 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
11048 where appropriate.
11049 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
11050 as boolean expression.
11051 (x_set_window_size): Remove unused variable toolbar.
11052 (ns_get_color_default, ns_mod_to_lisp): Remove.
11053 (ns_mouse_position): Remove unused variables xchar and ychar.
11054 (ns_compute_glyph_string_overhangs): Remove unused variable face.
11055 (ns_set_vertical_scroll_bar): Remove unused variable count.
11056 (ns_delete_terminal): Remove unused variable i.
11057 (ns_term_init): Remove unused variables r, g and b.
11058 (mouseDown): Remove unused variable window.
11059 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
11060 (initFrameFromEmacs): Remove unused variable vbextra.
11061 (mouseEntered): Remove unused variables p and dpyinfo.
11062 (mouseExited): Remove unused variables p and r.
11063 (ns_define_frame_cursor, ns_clear_frame_area)
11064 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
11065 (menuDown): Assign [sender tag] to variable and cast the variable.
11066
11067 * nsterm.h (menuDown): Add id as type to argument sender.
11068 (ns_display_info_for_name): Add Lisp_Object argument.
11069 (ns_term_init): Add Lisp_Object argument.
11070 (ns_map_event_to_object): Add void argument.
11071 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
11072 prototype with arguments and only declare if __OBJC__.
11073 (nxatoms_of_nsselect): Add void argument.
11074 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
11075 (ns_alloc_autorelease_pool): Add void argument.
11076 (ns_release_autorelease_pool): Add void* argument.
11077 (ns_get_defaults_value): Add const char* argument.
11078
11079 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
11080 (initFromContents): Use SSDATA where appropriate.
11081 (ns_update_menubar): Add braces to ambigous if-else.
11082 (initWithTitle): Put () around assignment in if statement.
11083 (ns_menu_show): Remove unused variables window and keymap.
11084 (update_frame_tool_bar): Remove unused variable selected_p.
11085 (initWithContentRect): Remove unused variable this_cmd_name.
11086
11087 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
11088 appropriate.
11089 (setXBMColor): Remove unused variable len.
11090 (setPixmapData): Put () around assignment in loop statement.
11091
11092 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
11093 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
11094 where appropriate.
11095 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
11096 around assignment in loop statement.
11097 (nsfont_open): Remove unused variable i.
11098 (nsfont_open): Remove unused variable len.
11099 (nsfont_draw): Remove unused variable cs.
11100
11101 * nsfns.m (x_set_icon_name, ns_set_name_internal)
11102 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
11103 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
11104 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
11105 (Fns_font_name, Fns_perform_service)
11106 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
11107 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
11108 (ns_set_name): Remove unused variable view.
11109 (x_set_menu_bar_lines): Remove unused variable olines.
11110 (x_set_tool_bar_lines): Remove unused variable root_window.
11111 (Fns_list_colors): Put () around assignment in while statement.
11112 (Fns_perform_service): Remove unused variable len.
11113 (Fns_display_usable_bounds): Remove unused variable top.
11114 (syms_of_nsfns): Remove unused variable i.
11115
11116 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
11117 memcpy (Bug#11907).
11118
111192012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
11120
11121 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
11122 and free it with DestroyExceptionInfo (Bug#11558).
11123
111242012-07-13 Juanma Barranquero <lekktu@gmail.com>
11125
11126 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
11127 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
11128 Set here, not in nt/config.nt.
11129
111302012-07-13 Eli Zaretskii <eliz@gnu.org>
11131
11132 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
11133 cursor overflow into the last glyph on display line when the right
11134 fringe is off. (Bug#11832)
11135
111362012-07-13 Paul Eggert <eggert@cs.ucla.edu>
11137
11138 * xdisp.c (produce_special_glyphs): Now static.
11139 * dispextern.h (produce_special_glyphs): Remove decl.
11140
111412012-07-13 Glenn Morris <rgm@gnu.org>
11142
11143 * s/bsd-common.h, s/cygwin.h: Remove empty files.
11144 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
11145
11146 * s/usg5-4-common.h (USG, USG5):
11147 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
11148 * s/sol2-6.h (SOLARIS2):
11149 * s/irix6-5.h (IRIX6_5):
11150 * s/hpux10-20.h (USG, USG5, HPUX):
11151 * s/gnu-linux.h (USG, GNU_LINUX):
11152 * s/freebsd.h (BSD_SYSTEM):
11153 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
11154 * s/cygwin.h (CYGWIN):
11155 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
11156 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
11157
111582012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
11159
11160 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
11161
111622012-07-13 Glenn Morris <rgm@gnu.org>
11163
11164 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
11165
11166 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
11167
11168 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
11169 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
11170
111712012-07-12 Glenn Morris <rgm@gnu.org>
11172
11173 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
11174
11175 * process.c (init_process_emacs): Rename from init_process.
11176 The old name is also the name of a Mach system call.
11177 * lisp.h, emacs.c: Update for this name change.
11178 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
11179 longer needed.
11180
111812012-07-12 Eli Zaretskii <eliz@gnu.org>
11182
11183 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
11184 memmove call that removes glyphs covered by the left truncation
11185 glyph. Improve commentary.
11186 (display_line): Fix display of continuation glyphs on GUI frames
11187 when the right fringe is turned off and variable-size fonts are
11188 used in the window. Move the code that appends a stretch glyph to
11189 produce_special_glyphs, so that it could be used for truncation
11190 and continuation glyphs alike.
11191 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
11192 glyph of a suitably computed width, to align the special glyphs at
11193 the window margin. Code moved from display_line. (Bug#11832)
11194
111952012-07-12 Glenn Morris <rgm@gnu.org>
11196
11197 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
11198
11199 * s/gnu-linux.h, s/hpux10-20.h:
11200 Do not unconditionally define HAVE_XRMSETDATABASE.
11201
11202 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
11203
112042012-07-12 Paul Eggert <eggert@cs.ucla.edu>
11205
11206 Fix typos that broke OS X build.
11207 Reported by Randal L. Schwartz in
11208 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
11209 * nsterm.m (ns_timeout): Add missing local decl.
11210 (ns_get_color): snprintf -> sprintf, to fix typo.
11211
112122012-07-12 Glenn Morris <rgm@gnu.org>
11213
11214 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
11215 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
11216 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
11217 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
11218
11219 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
11220 Move PTY_OPEN to configure.
11221
11222 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11223 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
11224 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
11225
112262012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
11227
11228 Use empty_unibyte_string where applicable.
11229 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
11230 * lread.c (read1): Likewise.
11231 * xsettings.c (syms_of_xsettings): Likewise.
11232
112332012-07-12 Glenn Morris <rgm@gnu.org>
11234
11235 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
11236 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
11237 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
11238 * s/hpux10-20.h (RUN_TIME_REMAP):
11239 * s/bsd-common.h (TABDLY): Move to configure.
11240
11241 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
11242
11243 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
11244
11245 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11246 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
11247
11248 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
11249
11250 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
11251 * s/template.h: Move NARROWPROTO to configure.
11252
112532012-07-11 Glenn Morris <rgm@gnu.org>
11254
11255 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
11256 unused since 2011-01-17 change to systty.h.
11257
11258 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
11259 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11260 Move HAVE_PTYS and HAVE_SOCKETS to configure.
11261
112622012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11263
11264 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
11265
112662012-07-11 Glenn Morris <rgm@gnu.org>
11267
11268 * s/darwin.h, s/gnu-linux.h, s/template.h:
11269 Move INTERRUPT_INPUT to configure.
11270
112712012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11272
11273 Minor adjustments to interning code.
11274 * lisp.h (intern, intern_c_string): Redefine as static inline
11275 wrappers for intern_1 and intern_c_string_1, respectively.
11276 (intern_1, intern_c_string_1): Rename prototypes.
11277 * lread.c (intern_1, intern_c_string_1, oblookup):
11278 Simplify Vobarray checking.
11279 * font.c (font_intern_prop): Likewise. Adjust comment.
11280 * w32font.c (intern_font_name): Likewise.
11281
112822012-07-11 Andreas Schwab <schwab@linux-m68k.org>
11283
11284 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
11285
11286 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
11287 of Fcar/Fcdr if possible.
11288 * font.c (check_otf_features): Likewise.
11289 * fontset.c (Fnew_fontset): Likewise.
11290 * gnutls.c (Fgnutls_boot): Likewise.
11291 * minibuf.c (read_minibuf): Likewise.
11292 * msdos.c (IT_set_frame_parameters): Likewise.
11293 * xmenu.c (Fx_popup_dialog): Likewise.
11294 * w32menu.c (Fx_popup_dialog): Likewise.
11295
112962012-07-11 Glenn Morris <rgm@gnu.org>
11297
11298 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
11299 since nothing has defined it on these platforms.
11300
11301 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
11302 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
11303
11304 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11305 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11306 Move CLASH_DETECTION to configure.
11307
11308 * s/gnu.h: Remove file, which is now empty.
11309
11310 * s/gnu.h, s/gnu-linux.h:
11311 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
11312
113132012-07-11 John Wiegley <johnw@newartisans.com>
11314
11315 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
11316 function attribute, so we only use it if it exists in the
11317 compiler.
11318
113192012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11320
11321 Avoid call to strlen in fast_c_string_match_ignore_case.
11322 * search.c (fast_c_string_match_ignore_case): Change to use
11323 length argument. Adjust users accordingly.
11324 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
11325
113262012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11327
11328 Assume mkdir, rmdir.
11329 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
11330 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
11331
11332 Assume rename.
11333 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
11334
11335 Assume perror.
11336 * s/hpux10-20.h (HAVE_PERROR): Remove.
11337 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
11338 Remove dummy definition, as this problem was obsolete long ago.
11339
11340 Assume strerror.
11341 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
11342
113432012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11344
11345 Avoid calls to strlen in font processing functions.
11346 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
11347 (font_open_by_name): Change to use length argument.
11348 Adjust users accordingly.
11349 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
11350 Adjust prototypes.
11351 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
11352 Change to return ptrdiff_t.
11353 (xfont_list_pattern, xfont_match): Use length returned by
11354 xfont_decode_coding_xlfd.
11355 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
11356
113572012-07-11 Glenn Morris <rgm@gnu.org>
11358
11359 * s/darwin.h, s/freebsd.h, s/netbsd.h:
11360 Move DONT_REOPEN_PTY to configure.
11361
11362 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11363 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11364
113652012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11366
11367 Remove "#define unix" that is no longer needed (Bug#11905).
11368 * s/aix4-2.h (unix): Remove; no longer needed.
11369
11370 EMACS_TIME simplification (Bug#11875).
11371 This replaces macros (which typically do not work in GDB)
11372 with functions, typedefs and enums, making the code easier to debug.
11373 The functional style also makes code easier to read and maintain.
11374 * systime.h: Include <sys/time.h> on all hosts, not just if
11375 WINDOWSNT, since 'struct timeval' is needed in general.
11376 (EMACS_TIME): Now a typedef, not a macro.
11377 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11378 not macros.
11379 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11380 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11381 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11382 (EMACS_TIME_LE): Now functions, not macros.
11383 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11384 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11385 which are not functions. All uses rewritten to use:
11386 (make_emacs_time): New function.
11387 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11388 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11389 not functions. All uses rewritten to use the following, respectively:
11390 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11391 (add_emacs_time, sub_emacs_time): New functions.
11392 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
11393 * fileio.c (Fcopy_file):
11394 * xterm.c (XTflash): Get the current time closer to when it's used.
11395 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11396
11397 * bytecode.c (targets): Suppress -Woverride-init warnings.
11398
11399 Simplify by avoiding confusing use of strncpy etc.
11400 * doc.c (Fsnarf_documentation):
11401 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11402 * frame.c (Fmake_terminal_frame):
11403 * gtkutil.c (get_utf8_string):
11404 * lread.c (openp):
11405 * nsmenu.m (ns_update_menubar):
11406 * regex.c (regerror):
11407 Prefer memcpy to strncpy and strncat when either will do.
11408 * fileio.c (Fsubstitute_in_file_name):
11409 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11410 (menu_separator_name_p):
11411 * nsmenu.m (ns_update_menubar):
11412 Prefer memcmp to strncmp when either will do.
11413 * nsterm.m: Include <ftoastr.h>.
11414 (ns_get_color):
11415 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11416 Prefer snprintf to strncpy.
11417 * nsterm.m (ns_term_init):
11418 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11419 * nsterm.m (ns_term_init):
11420 Avoid the need for strncpy, by using build_string or
11421 make_unibyte_string directly. Use dtoastr, not snprintf.
11422 * process.c (Fmake_network_process): Diagnose service names that
11423 are too long, rather than silently truncating them or creating
11424 non-null-terminated names.
11425 (Fnetwork_interface_info): Likewise, for interface names.
11426 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11427 Prefer sprintf to strncat.
11428 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11429 Prefer vsnprintf to vsprintf + strncpy.
11430
114312012-07-10 Glenn Morris <rgm@gnu.org>
11432
11433 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11434 Clarify fallback case.
11435
114362012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11437
11438 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11439 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11440 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
11441 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
11442 where argument type is known to be a Lisp_Cons.
11443
114442012-07-10 Tom Tromey <tromey@redhat.com>
11445
11446 * bytecode.c (BYTE_CODE_THREADED): New macro.
11447 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11448 (enum byte_code_op): New type.
11449 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11450 (exec_byte_code): Use them. Use token threading when applicable.
11451
114522012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11453
11454 Optimize pure C strings initialization.
11455 * lisp.h (make_pure_string): Fix prototype.
11456 (build_pure_c_string): New function, defined as static inline. This
11457 provides a better opportunity to optimize away calls to strlen when
11458 the function is called with compile-time constant argument.
11459 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11460 argument, adjust users accordingly. Use build_pure_c_string where
11461 appropriate.
11462 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11463 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11464 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11465
114662012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11467
11468 Avoid calls to strlen in miscellaneous functions.
11469 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11470 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11471 * lread.c (openp): Likewise.
11472
114732012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11474
11475 Avoid calls to strlen in path processing functions.
11476 * fileio.c (file_name_as_directory): Add comment. Change to add
11477 srclen argument and return the length of result. Adjust users
11478 accordingly.
11479 (directory_file_name): Fix comment. Change to add srclen argument,
11480 swap 1st and 2nd arguments to obey the common convention.
11481 Adjust users accordingly.
11482 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11483
114842012-07-10 Glenn Morris <rgm@gnu.org>
11485
11486 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11487 Move PENDING_OUTPUT_COUNT definition to configure.
11488
11489 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11490 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11491 * s/gnu.h (DATA_START): Move definitions to configure.
11492
11493 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11494 We include usg5-4-common.h, which defines them both.
11495
11496 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11497 O_RDONLY already includes it).
11498
11499 Stop ns builds setting the EMACSLOADPATH environment variable.
11500 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11501 Now it does not set EMACSLOADPATH, just returns the load-path string.
11502 * nsterm.h: Update accordingly.
11503 * lread.c [HAVE_NS]: Include nsterm.h.
11504 (init_lread) [HAVE_NS]: Use ns_load_path.
11505 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11506
115072012-07-09 Glenn Morris <rgm@gnu.org>
11508
11509 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11510 since the included bsd-common.h does so.
11511
11512 Stop ns builds setting the EMACSPATH environment variable.
11513 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11514 (ns_init_paths): Do not set EMACSPATH.
11515 * nsterm.h (ns_exec_path): Add it.
11516 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11517 Use ns_exec_path.
11518
11519 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11520
115212012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11522
11523 * process.c (wait_reading_process_output): 'waitchannels' was unset
11524 when read_kbd || !NILP (wait_for_cell); fix this.
11525
11526 Add GCC-style 'const' attribute to functions that can use it.
11527 * character.h (char_resolve_modifier_mask):
11528 * keyboard.h (make_ctrl_char):
11529 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11530 (init_character_once, next_almost_prime, init_fns, init_image)
11531 (flush_pending_output, init_sound):
11532 * mem-limits.h (start_of_data):
11533 * menu.h (finish_menu_items):
11534 Add ATTRIBUTE_CONST.
11535 * emacs.c (DEFINE_DUMMY_FUNCTION):
11536 Declare the dummy function with ATTRIBUTE_CONST.
11537 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11538 Add decls with ATTRIBUTE_CONST.
11539
11540 Minor improvements to make_formatted_string.
11541 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11542 where int is good enough, as vsprintf returns an int.
11543 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11544
115452012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11546
11547 Use make_formatted_string to avoid double length calculation.
11548 * lisp.h (make_formatted_string): New prototype.
11549 * alloc.c (make_formatted_string): New function.
11550 * buffer.c (Fgenerate_new_buffer_name): Use it.
11551 * dbusbind.c (syms_of_dbusbind): Likewise.
11552 * editfns.c (Fcurrent_time_zone): Likewise.
11553 * filelock.c (get_boot_time): Likewise.
11554 * frame.c (make_terminal_frame, set_term_frame_name)
11555 (x_report_frame_params): Likewise.
11556 * image.c (gs_load): Likewise.
11557 * minibuf.c (get_minibuffer): Likewise.
11558 * msdos.c (dos_set_window_size): Likewise.
11559 * process.c (make_process): Likewise.
11560 * xdisp.c (ensure_echo_area_buffers): Likewise.
11561 * xsettings.c (apply_xft_settings): Likewise.
11562
115632012-07-09 Glenn Morris <rgm@gnu.org>
11564
11565 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11566 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11567 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11568 * nsterm.h (ns_etc_directory): Add it.
11569 * callproc.c [HAVE_NS]: Include nsterm.h.
11570 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11571
115722012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11573
11574 Move marker debugging code under MARKER_DEBUG.
11575 * marker.c (MARKER_DEBUG): Move marker debugging code under
11576 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11577 for bootstrap with --enable-checking (~3x slowdown reported
11578 by Juanma Barranquero <lekktu@gmail.com>).
11579 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11580
115812012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11582
11583 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11584 See <http://bugs.gnu.org/11825#29>.
11585
115862012-07-08 Eli Zaretskii <eliz@gnu.org>
11587
11588 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11589 has no font, use the frame's font. (Bug#11813)
11590 (display_line): Add commentary about displaying truncation glyphs
11591 on GUI frames.
11592 (produce_special_glyphs): Move here from term.c.
11593
11594 * term.c (produce_special_glyphs): Move to xdisp.c.
11595
11596 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11597 section.
11598
115992012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11600
11601 * xdisp.c (display_line): Avoid warning about implicit declaration
11602 of FRAME_FONT.
11603
11604 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11605
11606 * lisp.h: Remove empty conditional.
11607
116082012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11609
11610 * lread.c (load_path_check): Now static.
11611
11612 Fix some minor --with-ns problems found by static checking.
11613 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11614 (x_set_font) [!HAVE_X_WINDOWS]:
11615 * image.c (xpm_load_image) [HAVE_NS]:
11616 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11617 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11618 Remove unused local.
11619 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11620 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11621 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11622 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11623 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11624 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11625 Fix pointer signedness problem.
11626 * xfaces.c (FRAME_X_FONT_TABLE):
11627 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11628
116292012-07-07 Glenn Morris <rgm@gnu.org>
11630
11631 * lread.c (load_path_check): New function, split from init_lread.
11632 (init_lread): Reorganize. Motivation:
11633 If EMACSLOADPATH is set, check/warn about that rather than the
11634 defaults, which we are not going to use. Hence we can remove
11635 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11636 Don't warn if site-lisp directories are missing.
11637 If not installed, start from a blank load-path, since
11638 PATH_LOADSEARCH refers to the eventual installation directories.
11639
116402012-07-07 Eli Zaretskii <eliz@gnu.org>
11641
11642 Support truncation and continuation glyphs on GUI frames, when
11643 fringes are disabled. (Bug#11832)
11644 * xdisp.c (init_iterator): Get dimensions of truncation and
11645 continuation glyphs even if on GUI frames.
11646 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11647 or both, are absent.
11648 (start_display, move_it_in_display_line_to): Handle the case of a
11649 GUI frame without a fringe to display continuation or truncation
11650 glyphs.
11651 (insert_left_trunc_glyphs): Support GUI frames: make sure
11652 truncation glyphs overwrite enough glyphs from the current line to
11653 have sufficient space in pixels.
11654 (display_line): Support truncation and continuation glyphs on GUI
11655 frames. If some spare pixels are left on the line after inserting
11656 the truncation glyphs, fill that space with a stretch glyph of a
11657 suitably computed width.
11658
11659 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11660 produce_glyphs, to support GUI sessions.
11661
116622012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11663
11664 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11665
11666 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11667
11668 Do not require float-time's arg to fit in time_t (Bug#11825).
11669 This works better on hosts where time_t is unsigned, and where
11670 float-time is applied to the (negative) difference between two times.
11671 * editfns.c (decode_time_components): Last arg is now double *,
11672 not int *, and means to store all the result as a double, without
11673 worrying about whether the seconds part fits in time_t.
11674 All callers changed.
11675 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11676 All callers changed.
11677 (Ffloat_time): Do not fail merely because the specified time falls
11678 outside of time_t range.
11679
116802012-07-07 Glenn Morris <rgm@gnu.org>
11681
11682 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11683 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11684 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11685
116862012-07-07 Juanma Barranquero <lekktu@gmail.com>
11687
11688 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11689 Update dependencies.
11690
11691 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11692
116932012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11694
11695 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11696 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11697 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11698 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11699 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11700 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11701
11702 * xfont.c (compare_font_names): Redo to omit the need for casts.
11703
117042012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11705
11706 * xfns.c (Fx_change_window_property): Doc fix.
11707 * w32fns.c (Fx_change_window_property): Doc fix.
11708
11709 * w32fns.c (Fx_window_property): Accept the same arguments as the
11710 X Windows version. Doc fix.
11711 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11712
117132012-07-06 Juanma Barranquero <lekktu@gmail.com>
11714 Eli Zaretskii <eliz@gnu.org>
11715
11716 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11717 Windows-specific code from nt/config.nt moved here.
11718 Obsolete settings removed.
11719
117202012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11721
11722 * process.c: Avoid unnecessary calls to gettime.
11723 (wait_reading_process_output): Don't get the time of day
11724 when gobbling data immediately and not waiting, as there's no need
11725 for it in that case. This removes a FIXME.
11726
117272012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11728
11729 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11730 is defined (Bug#11768).
11731
117322012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11733
11734 Fix marker debugging code.
11735 * marker.c (byte_char_debug_check): Do not perform the check
11736 if buffer is not multibyte.
11737 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11738 Call byte_char_debug_check with correct arguments.
11739
117402012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11741
11742 Compile marker debugging code only if ENABLE_CHECKING is defined.
11743 * marker.c (byte_char_debug_check, count_markers):
11744 Use only if ENABLE_CHECKING is defined.
11745 (byte_debug_flag): Remove.
11746 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11747 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11748
117492012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11750
11751 Avoid code repetition in marker-related functions.
11752 * marker.c (attach_marker): New function.
11753 (Fset_marker, set_marker_restricted, set_marker_both)
11754 (set_marker_restricted_both): Use it.
11755 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11756 Consistently rename charno to charpos.
11757 (marker_position): Add eassert.
11758 (marker_byte_position): Convert to eassert.
11759
117602012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11761
11762 Simplify list operations in unchain_overlay and unchain_marker.
11763 * buffer.c (unchain_overlay): Simplify. Add comment.
11764 * marker.c (unchain_marker): Simplify. Fix comments.
11765
117662012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11767
11768 Introduce fast path for the widely used marker operation.
11769 * alloc.c (build_marker): New function.
11770 * lisp.h (build_marker): New prototype.
11771 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11772 * composite.c (autocmp_chars): Likewise.
11773 * editfns.c (buildmark): Remove.
11774 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11775 (save_restriction_save): Use build_marker.
11776 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11777 * window.c (save_window_save): Likewise.
11778
117792012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11780
11781 Do not use Fdelete_overlay in delete_all_overlays
11782 to avoid redundant calls to unchain_overlay.
11783 * buffer.c (drop_overlay): New function.
11784 (delete_all_overlays, Fdelete_overlay): Use it.
11785 * minibuf.c (get_minibuffer): Fix comment.
11786
117872012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11788
11789 Port to OpenBSD 5.1 amd64.
11790 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11791 This is needed for OpenBSD, and should be harmless on all BSD systems.
11792 Also, include <sys/sysctl.h>, as it should be available on all
11793 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11794 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11795 use p_pid member, not kp_proc.pid.
11796
117972012-07-06 Glenn Morris <rgm@gnu.org>
11798
11799 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11800
118012012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11802
11803 More xmalloc and related cleanup.
11804 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11805 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11806 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11807 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11808 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11809 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11810 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11811 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11812 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11813 * xterm.c:
11814 Omit needless casts involving void * pointers and allocation.
11815 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11816 as the former is more robust if P's type is changed.
11817 Prefer xzalloc to xmalloc + memset 0.
11818 Simplify malloc-or-realloc to realloc.
11819 Don't worry about xmalloc returning a null pointer.
11820 Prefer xstrdup to xmalloc + strcpy.
11821 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11822 growing it.
11823 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11824 alloca of a constant.
11825
118262012-07-05 Eli Zaretskii <eliz@gnu.org>
11827
11828 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11829 hscroll is larger than the line width. Fixes long and futile
11830 looping inside extend_face_to_end_of_line (on a TTY) producing
11831 glyphs that are not needed and thrown away.
11832
118332012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11834
11835 * marker.c (set_marker_restricted_both): Simplify by using
11836 clip_to_bounds.
11837
118382012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11839
11840 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11841
118422012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11843
11844 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11845 not defined (Bug#11768).
11846 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11847 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11848 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11849 followed by gtk_box_set_homogeneous (Bug#11768).
11850 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11851 (update_theme_scrollbar_width, xg_create_scroll_bar):
11852 Use gtk_scrollbar_new (Bug#11768).
11853 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11854 (is_box_type): New function (Bug#11768).
11855 (xg_tool_item_stale_p): Call is_box_type.
11856 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11857 with default display (Bug#11768).
11858
118592012-07-05 Eli Zaretskii <eliz@gnu.org>
11860
11861 * xdisp.c (window_hscroll_limited): New function.
11862 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11863 coordinates when window's hscroll is set to insanely large
11864 values. (Bug#11857)
11865
118662012-07-05 Juanma Barranquero <lekktu@gmail.com>
11867
11868 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11869 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11870
118712012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11872
11873 Cleanup xmalloc.
11874 * lisp.h (xzalloc): New prototype. Omit needless casts.
11875 * alloc.c (xzalloc): New function. Omit needless casts.
11876 * charset.c: Omit needless casts. Convert all calls to
11877 xmalloc with following memset to xzalloc.
11878 * dispnew.c: Likewise.
11879 * fringe.c: Likewise.
11880 * image.c: Likewise.
11881 * sound.c: Likewise.
11882 * term.c: Likewise.
11883 * w32fns.c: Likewise.
11884 * w32font.c: Likewise.
11885 * w32term.c: Likewise.
11886 * xfaces.c: Likewise.
11887 * xfns.c: Likewise.
11888 * xterm.c: Likewise.
11889 * atimer.c: Omit needless casts.
11890 * buffer.c: Likewise.
11891 * callproc.c: Likewise.
11892 * ccl.c: Likewise.
11893 * coding.c: Likewise.
11894 * composite.c: Likewise.
11895 * doc.c: Likewise.
11896 * doprnt.c: Likewise.
11897 * editfns.c: Likewise.
11898 * emacs.c: Likewise.
11899 * eval.c: Likewise.
11900 * filelock.c: Likewise.
11901 * fns.c: Likewise.
11902 * gtkutil.c: Likewise.
11903 * keyboard.c: Likewise.
11904 * lisp.h: Likewise.
11905 * lread.c: Likewise.
11906 * minibuf.c: Likewise.
11907 * msdos.c: Likewise.
11908 * print.c: Likewise.
11909 * process.c: Likewise.
11910 * region-cache.c: Likewise.
11911 * search.c: Likewise.
11912 * sysdep.c: Likewise.
11913 * termcap.c: Likewise.
11914 * terminal.c: Likewise.
11915 * tparam.c: Likewise.
11916 * w16select.c: Likewise.
11917 * w32.c: Likewise.
11918 * w32reg.c: Likewise.
11919 * w32select.c: Likewise.
11920 * w32uniscribe.c: Likewise.
11921 * widget.c: Likewise.
11922 * xdisp.c: Likewise.
11923 * xmenu.c: Likewise.
11924 * xrdb.c: Likewise.
11925 * xselect.c: Likewise.
11926
119272012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11928
11929 * fileio.c (time_error_value): Check the right error number.
11930 Problem reported by Troels Nielsen in
11931 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11932
119332012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11934
11935 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11936 This should be fixed in a better way; see Eli Zaretskii in
11937 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11938 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11939
11940 * fileio.c (time_error_value): Rename from special_mtime.
11941 The old name's problems were noted by Eli Zaretskii in
11942 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11943
11944 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11945 This variable's comment says Emacs needs at least one GDB-visible
11946 symbol of type enum pvec_type, to work around GDB problems.
11947 The symbol's value doesn't matter.
11948
11949 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11950 that causes compilation to fail on pre-C99 compilers.
11951
119522012-07-04 Juanma Barranquero <lekktu@gmail.com>
11953
11954 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11955 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11956
119572012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11958
11959 * buffer.c (init_buffer_once): Fix initialization of
11960 headers for buffer_defaults and buffer_local_symbols.
11961 Reported by Juanma Barranquero <lekktu@gmail.com>.
11962
119632012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11964
11965 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11966 * lisp.h (enum pvec_type): Use fewer bits.
11967 (PSEUDOVECTOR_SIZE_BITS): New constant.
11968 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11969 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11970 change in pvec_type.
11971 (PSEUDOVECTOR_TYPEP): New macro.
11972 (TYPED_PSEUDOVECTORP): Use it.
11973 * fns.c (internal_equal): Adapt code to extract pvectype.
11974 * emacs.c (gdb_pvec_type): Update type.
11975 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11976 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11977 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11978 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11979 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11980 abusing vector->header.next.nbytes.
11981 (live_vector_p): Use PVEC_TYPE.
11982 (mark_object): Adapt code to extract pvectype. Use switch.
11983
119842012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11985
11986 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11987 Tighten new eassert a bit.
11988
119892012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11990
11991 Fix compilation with --enable-gcc-warnings and -O1
11992 optimization level.
11993 * doprnt.c (doprnt): Change type of tem to int, initialize
11994 to avoid compiler warning. Add eassert.
11995 * search.c (simple_search): Initialize match_byte to avoid
11996 compiler warning. Add eassert.
11997
119982012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11999
12000 Avoid weird behavior with large horizontal scrolls.
12001 Without this change, for example, large hscroll values would
12002 mess up Emacs's display on Fedora 15 x86, presumably due to
12003 overflows in int calculations in the display code.
12004 Also, if buffers had long lines, Emacs would freeze.
12005 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
12006 (set_window_hscroll): New function, containing the old guts of
12007 Fset_window_hscroll. Return the clipped value.
12008 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
12009 This avoids the need to check against PTRDIFF_MAX.
12010
12011 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
12012
120132012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
12014
12015 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
12016
120172012-07-04 Paul Eggert <eggert@cs.ucla.edu>
12018
12019 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
12020 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
12021 since GCC 4.4.6 issues a bogus warning for them.
12022
12023 Fix bugs in file timestamp newness comparisons.
12024 * fileio.c (Ffile_newer_than_file_p):
12025 * lread.c (Fload): Use full timestamp resolution of files,
12026 not just the 1-second resolution, so that files that are only
12027 slightly newer still count as newer.
12028 * fileio.c (Ffile_newer_than_file_p): Don't assume file
12029 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
12030
120312012-07-03 Paul Eggert <eggert@cs.ucla.edu>
12032
12033 * fileio.c: Improve handling of file time marker. (Bug#11852)
12034 (special_mtime): New function.
12035 (Finsert_file_contents, Fverify_visited_file_modtime):
12036 Use it to set special mtime values consistently.
12037
120382012-07-03 Andreas Schwab <schwab@linux-m68k.org>
12039
12040 * fileio.c (Finsert_file_contents): Properly handle st_mtime
12041 marker for non-existing file. (Bug#11852)
12042
120432012-07-03 Glenn Morris <rgm@gnu.org>
12044
12045 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
12046 and did not make it into globals.h).
12047
120482012-07-03 Tom Tromey <tromey@redhat.com>
12049
12050 * window.c (Fset_window_margins, Fset_window_fringes)
12051 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
12052 * textprop.c (Fprevious_property_change): No longer static.
12053 * syntax.c (Fsyntax_table_p): No longer static.
12054 * process.c (Fget_process, Fprocess_datagram_address): No longer
12055 static.
12056 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
12057 * keyboard.c (Fcommand_execute): No longer static.
12058 Remove EXFUN.
12059 * insdel.c (Fcombine_after_change_execute): No longer static.
12060 * image.c (Finit_image_library): No longer static.
12061 * fileio.c (Fmake_symbolic_link): No longer static.
12062 * eval.c (Ffetch_bytecode): No longer static.
12063 * editfns.c (Fuser_full_name): No longer static.
12064 * doc.c (Fdocumentation_property, Fsnarf_documentation):
12065 No longer static.
12066 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
12067 static.
12068 * dired.c (Ffile_attributes): No longer static.
12069 * composite.c (Fcomposition_get_gstring): No longer static.
12070 * callproc.c (Fgetenv_internal): No longer static.
12071
12072 * ccl.h: Remove EXFUNs.
12073 * buffer.h: Remove EXFUNs.
12074 * dispextern.h: Remove EXFUNs.
12075 * intervals.h: Remove EXFUNs.
12076 * fontset.h: Remove EXFUN.
12077 * font.h: Remove EXFUNs.
12078 * dosfns.c (system_process_attributes): Remove EXFUN.
12079 * keymap.h: Remove EXFUNs.
12080 * lisp.h: Remove EXFUNs.
12081 * w32term.h: Remove EXFUNs.
12082 * window.h: Remove EXFUNs.
12083 * xsettings.h: Remove EXFUN.
12084 * xterm.h: Remove EXFUN.
12085
120862012-07-03 Glenn Morris <rgm@gnu.org>
12087
12088 * lisp.h (Frandom): Make it visible to C.
12089 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
12090 buffer for invisible buffers. (Bug#1229)
12091
120922012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
12093
12094 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
12095 values which aren't power of 2.
12096 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
12097 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
12098 accordingly.
12099
121002012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
12101
12102 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
12103
12104 * alloc.c (mark_object): Revert part of last patch to use `switch'.
12105
121062012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
12107
12108 * alloc.c (allocate_vector_block): Remove redundant
12109 calls to mallopt if DOUG_LEA_MALLOC is defined.
12110 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
12111 avoid calls to mallopt if zero_vector is returned.
12112
121132012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
12114
12115 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
12116 is enabled, avoid dereferencing NULL current_sblock if
12117 running undumped.
12118
121192012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
12120
12121 Cleanup basic buffer management.
12122 * buffer.h (struct buffer): Change layout to use generic vector
12123 marking code. Fix some comments. Change type of 'clip_changed'
12124 to bitfield. Remove unused #ifndef old.
12125 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
12126 (GET_OVERLAYS_AT): Fix indentation.
12127 (for_each_per_buffer_object_at): New macro.
12128 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
12129 (Fbuffer_local_variables): Use it.
12130 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
12131 * alloc.c (allocate_buffer): Adjust to match new layout of
12132 struct buffer. Fix comment.
12133 (mark_overlay): New function.
12134 (mark_buffer): Use it. Use mark_vectorlike to mark normal
12135 Lisp area of struct buffer.
12136 (mark_object): Use it. Adjust marking of misc objects
12137 and related comments.
12138
121392012-07-02 Paul Eggert <eggert@cs.ucla.edu>
12140
12141 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
12142 wrapper that is not needed because the wrapped code is a no-op (zero
12143 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
12144 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
12145
121462012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
12147
12148 * alloc.c (mark_buffer): Simplify. Remove prototype.
12149 (mark_object): Add comment. Reorganize marking of vector-like
12150 objects. Use CHECK_LIVE for all vector-like objects except buffers
12151 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
12152 Avoid redundant calls to mark_vectorlike for bool vectors.
12153
121542012-06-30 Glenn Morris <rgm@gnu.org>
12155
12156 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
12157
12158 * epaths.in (PATH_SITELOADSEARCH): New.
12159 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
12160 This is rather than relying on --enable-locallisppath elements
12161 having "site-lisp" in their names. (Bug#10208#25, 11658)
12162
121632012-06-30 Eli Zaretskii <eliz@gnu.org>
12164
12165 * w32proc.c (sys_select): Accept and ignore one more argument.
12166
12167 * w32.c (emacs_gnutls_pull): Call select with one more argument.
12168
12169 * sysselect.h [DOS_NT]: Don't include sys/select.h.
12170 (pselect) [!MS_DOS]: Redirect to sys_select.
12171
12172 * sysdep.c: Don't include dos.h and dosfns.h.
12173
12174 * process.c (sys_select):
12175 * msdos.c (sys_select): Accept one more argument and ignore it.
12176
12177 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
12178 adapt data types and code to that.
12179
12180 * dosfns.c:
12181 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
12182 which clashes with the gnulib function of the same name.
12183
121842012-06-30 Andreas Schwab <schwab@linux-m68k.org>
12185
12186 * font.c (font_style_to_value, font_style_symbolic)
12187 (font_prop_validate_style): Add type checks for values in
12188 font_style_table.
12189
12190 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
12191 argument.
12192 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
12193 uses.
12194
121952012-06-29 Eli Zaretskii <eliz@gnu.org>
12196
12197 * xdisp.c (try_window_id): Undo last change.
12198
12199 * w32.c (getwd): Adjust commentary about startup_dir.
12200 (init_environment): Always call sys_access, even in non-MSVC
12201 builds. Don't chdir to the directory of the Emacs executable.
12202 This undoes code from 1997 which was justified by the need to
12203 "avoid conflicts when removing and renaming directories". But its
12204 downside was that every relative file name was being interpreted
12205 relative to the directory of the Emacs executable, which can never
12206 be TRT. In particular, it broke sys_access when called with
12207 relative file names.
12208 (sys_access): Map GetLastError to errno.
12209
122102012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12211
12212 * window.h (struct window): Change type of 'fringes_outside_margins'
12213 to bitfield. Fix comment. Adjust users accordingly.
12214 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
12215 Adjust comment.
12216 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
12217 to ptrdiff_t.
12218
122192012-06-29 Andreas Schwab <schwab@linux-m68k.org>
12220
12221 * gnutls.c (emacs_gnutls_handshake):
12222 Add QUIT to make the loop interruptible.
12223
122242012-06-29 Glenn Morris <rgm@gnu.org>
12225
12226 * charset.c (init_charset): Make lack of etc/charsets fatal.
12227
122282012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12229
12230 * editfns.c (region_limit): Fix type mismatch.
12231
122322012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12233
12234 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
12235 undefined. Convert from xassert to eassert.
12236 * nsmenu.m: Convert from xassert to eassert.
12237 * nsterm.m: Likewise.
12238
122392012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
12240
12241 * editfns.c (region_limit): Clip to narrowing (bug#11770).
12242
122432012-06-28 Paul Eggert <eggert@cs.ucla.edu>
12244
12245 Avoid integer overflow on scroll-left and scroll-right.
12246 * window.c (HSCROLL_MAX): New macro.
12247 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
12248 overflow when requested scroll falls outside ptrdiff_t range.
12249
122502012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12251
12252 * window.h (struct window): Change type of 'hscroll',
12253 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
12254 'last_modified' and 'last_overlay_modified' to EMACS_INT.
12255 Adjust users accordingly.
12256 * xdisp.c (try_cursor_movement): Replace type check with eassert.
12257 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
12258 from EMACS_INT to ptrdiff_t.
12259 (make_window): Omit redundant initialization.
12260
122612012-06-28 Juanma Barranquero <lekktu@gmail.com>
12262
12263 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
12264
122652012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12266
12267 * window.h (struct window): Change type of 'use_time' and
12268 'sequence_number' from Lisp_Object to int.
12269 * frame.c (make_frame): Adjust users accordingly.
12270 * print.c (print_object): Likewise.
12271 * window.c (select_window, Fwindow_use_time, make_parent_window)
12272 (make_window): Likewise.
12273
122742012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12275
12276 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
12277 enabled with --enable-checking=[all,glyphs] configure option.
12278 Fix GLYPH_DEBUG usage assuming that it may be undefined,
12279 adjust comments accordingly.
12280 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
12281 undefined, adjust comments accordingly.
12282 * image.c: Likewise.
12283 * scroll.c: Likewise.
12284 * w32fns.c: Likewise.
12285 * w32term.c: Likewise.
12286 * xdisp.c: Likewise.
12287 * xfaces.c: Likewise.
12288 * xfns.c: Likewise.
12289 * xterm.c: Likewise.
12290
122912012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12292
12293 Generalize run-time debugging checks.
12294 * dispextern.h (XASSERTS): Remove.
12295 * fontset.c (xassert): Remove.
12296 Convert from xassert to eassert.
12297 * alloc.c: Convert from xassert to eassert.
12298 * bidi.c: Likewise.
12299 * dispnew.c: Likewise.
12300 * fns.c: Likewise.
12301 * fringe.c: Likewise.
12302 * ftfont.c: Likewise.
12303 * gtkutil.c: Likewise.
12304 * image.c: Likewise.
12305 * keyboard.c: Likewise.
12306 * menu.c: Likewise.
12307 * process.c: Likewise.
12308 * scroll.c: Likewise.
12309 * sound.c: Likewise.
12310 * term.c: Likewise.
12311 * w32console.c: Likewise.
12312 * w32fns.c: Likewise.
12313 * w32term.c: Likewise.
12314 * window.c: Likewise.
12315 * xdisp.c: Likewise.
12316 * xfaces.c: Likewise.
12317 * xfns.c: Likewise.
12318 * xselect.c: Likewise.
12319 * xterm.c: Likewise.
12320
123212012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
12322
12323 * fns.c (maybe_resize_hash_table): Output message when growing the
12324 purify-hashtable.
12325
123262012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12327
12328 * alloc.c (allocate_string_data): Remove dead code.
12329 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
12330 avoid GCC warning about unused macro.
12331
123322012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12333
12334 * alloc.c (allocate_string): Omit intervals initialization.
12335 * alloc.c (make_uninit_multibyte_string): Initialize intervals
12336 as in make_pure_string and make_pure_c_string.
12337
123382012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12339
12340 * alloc.c (allocate_string): Fix last change.
12341
123422012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12343
12344 * alloc.c (allocate_string): Remove two redundant calls
12345 to memset, add explicit initialization where appropriate.
12346
123472012-06-27 Glenn Morris <rgm@gnu.org>
12348
12349 * lisp.mk (lisp): Remove paths.elc.
12350
123512012-06-27 Chong Yidong <cyd@gnu.org>
12352
12353 * doc.c (Fsubstitute_command_keys): Fix punctuation.
12354
123552012-06-26 John Wiegley <johnw@newartisans.com>
12356
12357 * unexmacosx.c (copy_data_segment): Add two section names used
12358 on Mac OS X Lion: __mod_init_func and __mod_term_func.
12359
12360 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
12361 when building with Clang.
12362
123632012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12364
12365 * eval.c (Fapply): Allow calling it with a single argument.
12366
123672012-06-26 Eli Zaretskii <eliz@gnu.org>
12368
12369 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12370 _stricmp and _strnicmp.
12371 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12372
123732012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12374
12375 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12376 allocated window.
12377 (allocate_process): Likewise for new process.
12378 (allocate_terminal): Change to use offsetof.
12379 (allocate_frame): Likewise.
12380 * frame.c (make_frame): Omit redundant initialization.
12381 * window.c (make_parent_window): Use memset.
12382 (make_window): Omit redundant initialization.
12383 * process.c (make_process): Omit redundant initialization.
12384 * terminal.c (create_terminal): Likewise.
12385
123862012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12387
12388 * term.c (delete_tty): Remove redundant call to memset.
12389
123902012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12391
12392 * alloc.c: Remove build_string.
12393 * lisp.h: Define build_string as static inline. This provides
12394 a better opportunity to optimize away calls to strlen when the
12395 function is called with compile-time constant argument.
12396 * image.c (imagemagick_error): Convert to build_string.
12397 * w32proc.c (sys_spawnve): Likewise.
12398 * xterm.c (x_term_init): Likewise.
12399
124002012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12401
12402 Use sprintf return value instead of invoking strlen on result.
12403 In the old days this wasn't portable, since some sprintf
12404 implementations returned char *. But they died out years ago and
12405 Emacs already assumes sprintf returns int.
12406 Similarly for float_to_string.
12407 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12408 * ccl.c (ccl_driver):
12409 * character.c (string_escape_byte8):
12410 * data.c (Fnumber_to_string):
12411 * doprnt.c (doprnt):
12412 * print.c (print_object):
12413 * xdisp.c (message_dolog):
12414 * xfns.c (syms_of_xfns):
12415 Use sprintf or float_to_string result to avoid need to call strlen.
12416 * data.c (Fnumber_to_string):
12417 Use make_unibyte_string, since the string must be ASCII.
12418 * lisp.h, print.c (float_to_string): Now returns int length.
12419 * term.c (produce_glyphless_glyph):
12420 Use sprintf result rather than recomputing it.
12421
12422 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12423 * Makefile.in (ALL_CFLAGS):
12424 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12425 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12426
124272012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12428
12429 * dispextern.h (xstrcasecmp): Define to library function
12430 strcasecmp if available.
12431 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12432
124332012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12434
12435 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12436 Avoid comma operator.
12437 * menu.c (push_submenu_start, push_submenu_end)
12438 (push_left_right_boundary, push_menu_pane): Likewise.
12439 * msdos.c (dos_rawgetc): Likewise.
12440
124412012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12442
12443 * xfns.c (xic_create_fontsetname): Remove redundant calls
12444 to memset.
12445
124462012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12447
12448 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12449 sprintf already null-terminates its output.
12450
12451 * xfns.c (x_window): Remove redundant cast.
12452
124532012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12454
12455 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12456 `const char *' to `char *' to avoid compiler warning.
12457
124582012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12459
12460 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12461 instead of truncating it to 63 (admittedly a generous limit).
12462
12463 * process.c: Fix spelling and caps in comments.
12464
124652012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12466
12467 * emacs.c (setpgrp): Remove definition, unused.
12468 * sysdep.c (setpgrp): Remove definition, not used in this file.
12469
124702012-06-24 Juanma Barranquero <lekktu@gmail.com>
12471
12472 * makefile.w32-in: Update dependencies.
12473
124742012-06-24 Eli Zaretskii <eliz@gnu.org>
12475
12476 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12477 (SYSTIME_H): Add nt/inc/sys/time.h.
12478
12479 * systime.h [WINDOWSNT]: Include sys/time.h.
12480
12481 * s/ms-w32.h (struct timespec): Definition moved from
12482 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12483
124842012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12485
12486 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12487 * buffer.h (buffer_slot_type_mismatch):
12488 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12489 * eval.c (unwind_to_catch):
12490 * image.c (my_png_error, my_error_exit):
12491 * keyboard.c (quit_throw_to_read_char, user_error)
12492 (Fexit_recursive_edit, Fabort_recursive_edit):
12493 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12494 (wrong_type_argument, buffer_overflow, __executable_start)
12495 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12496 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12497 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12498 (fatal):
12499 (child_setup) [!DOS_NT]:
12500 * lread.c (end_of_file_error, invalid_syntax):
12501 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12502 * puresize.h (pure_write_error):
12503 * search.c (matcher_overflow):
12504 * sound.c (sound_perror, alsa_sound_perror):
12505 * sysdep.c, syssignal.h (croak):
12506 * term.c (maybe_fatal, vfatal):
12507 * textprop.c (text_read_only):
12508 * undo.c (user_error):
12509 * unexmacosx.c (unexec_error):
12510 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12511 Use _Noreturn rather than NO_RETURN.
12512 No need for separate decl merely because of _Noreturn.
12513 * sound.c (sound_warning, parse_sound):
12514 Remove unnecessary forward decls.
12515
125162012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12517
12518 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12519 * lisp.h (WAIT_READING_MAX): New macro.
12520 * dispnew.c (Fsleep_for, sit_for):
12521 * keyboard.c (kbd_buffer_get_event):
12522 * process.c (Faccept_process_output):
12523 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12524 This improves on the previous patch, which introduced a bug
12525 when time_t is unsigned and as wide as intmax_t.
12526 See <http://bugs.gnu.org/9000#51>.
12527
125282012-06-23 Eli Zaretskii <eliz@gnu.org>
12529
12530 * dispnew.c (sit_for, Fsleep_for):
12531 * keyboard.c (kbd_buffer_get_event):
12532 * process.c (Faccept_process_output): Avoid compiler warnings when
12533 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12534
125352012-06-23 Juanma Barranquero <lekktu@gmail.com>
12536
12537 * makefile.w32-in: Update dependencies.
12538
12539 * w32.c (ltime): Add return type and declare static.
12540 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12541
125422012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12543
12544 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12545 Privately reported by Herbert J. Skuhra.
12546 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12547 All uses changed.
12548 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12549 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12550
125512012-06-23 Eli Zaretskii <eliz@gnu.org>
12552
12553 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12554 last argument of make_unibyte_string.
12555
12556 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12557 language ID in the event parameters.
12558
12559 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12560 event.code, not the obscure "character set ID".
12561
125622012-06-23 Chong Yidong <cyd@gnu.org>
12563
12564 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12565
125662012-06-23 Eli Zaretskii <eliz@gnu.org>
12567
12568 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12569 * w32.c (fdutimens): New function.
12570
12571 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12572
12573 * s/ms-w32.h (pselect): Redirect to sys_select.
12574
12575 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12576
12577 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12578 in the logic of incrementing and decrementing the value of
12579 use_relocatable_buffers.
12580
125812012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12582
12583 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12584 Privately reported by Herbert J. Skuhra.
12585 [__FreeBSD__]: Remove "*/" typo after "#include".
12586 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12587 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12588 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12589 Don't assume EMACS_TIME and struct timeval are the same type.
12590
125912012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12592
12593 Support higher-resolution time stamps (Bug#9000).
12594 The time stamps are only nanosecond-resolution at the C level,
12595 since that's the best that any real-world system supports now.
12596 But they are picosecond-resolution at the Lisp level, as that's
12597 easy, and leaves room for future OS improvements.
12598
12599 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12600 (LIBES): Use it.
12601
12602 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12603 Don't get current time unless it's needed.
12604
12605 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12606 now provides it if it's absent.
12607 (start_atimer): Port to higher-res time stamps.
12608 Check for time stamp overflow. Don't get current time more
12609 often than is needed.
12610
12611 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12612 Include systime.h, not time.h.
12613 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12614
12615 * dired.c: Include stat-time.h.
12616 (Ffile-attributes): File times now have higher resolution.
12617
12618 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12619 (struct image): Timestamp now has higher resolution.
12620
12621 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12622 has at least microseconds now. All uses removed.
12623 (update_frame, update_single_window, update_window, update_frame_1)
12624 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12625 (duration_to_sec_usec): Remove; no longer needed.
12626
12627 * editfns.c (time_overflow): Now extern.
12628 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12629 (float-time, Fformat_time_string, Fcurrent_time_string)
12630 (Fcurrent_time_zone): Accept and generate higher-resolution
12631 time stamps.
12632 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12633 (decode_time_components, lisp_seconds_argument): New functions.
12634 (make_time): Now static.
12635 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12636 Report an error if the time is invalid, rather than having the caller
12637 do that.
12638
12639 * fileio.c: Include <stat-time.h>
12640 (Fcopy_file): Copy higher-resolution time stamps.
12641 Prefer to set the time stamp via a file descriptor if that works.
12642 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12643 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12644 (Fvisited_file_modtime, Fset_visited_file_modtime):
12645 Support higher-resolution time stamps.
12646
12647 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12648
12649 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12650
12651 * image.c (prepare_image_for_display, clear_image_cache)
12652 (lookup_image): Port to higer-resolution time stamps.
12653
12654 * keyboard.c (start_polling, bind_polling_period):
12655 Check for time stamp overflow.
12656 (read_char, kbd_buffer_get_event, timer_start_idle)
12657 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12658 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12659 Port to higher-resolution time stamps. Do not assume time_t is signed.
12660 (decode_timer): New function. Timers are now vectors of length 9,
12661 not 8, to accommodate the picosecond component.
12662 (timer_check_2): Use it.
12663
12664 * nsterm.m (select_timeout, timeval_subtract): Remove.
12665 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12666 as they're a bit more accurate and handle overflow better.
12667 (ns_select): Change prototype to be compatible with pselect.
12668 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12669 * nsterm.h (ns_select): Adjust prototype.
12670
12671 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12672 us-resolution time stamps.
12673 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12674
12675 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12676
12677 * lisp.h (time_overflow): New decl.
12678 (wait_reading_process_output): First arg is now intmax_t, not int,
12679 to accommodate larger waits.
12680
12681 * process.h (struct Lisp_Process.read_output_delay):
12682 Now counts nanoseconds, not microseconds.
12683 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12684 EMACS_HAS_USECS.
12685 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12686 (wait_reading_process_output):
12687 Port to ns-resolution time stamps.
12688 (Faccept_process_output, wait_reading_process_output):
12689 Check for time stamp overflow. Do not assume time_t is signed.
12690 (select_wrapper): Remove; we now use pselect.
12691 (Fprocess_attributes): Now generates ns-resolution time stamps.
12692
12693 * sysdep.c: Include utimens.h. Don't include utime.h
12694 or worry about struct utimbuf; gnulib does that for us now.
12695 (gettimeofday): Remove; gnulib provides a substitute.
12696 (make_timeval): New function.
12697 (set_file_times): Now sets ns-resolution time stamps.
12698 New arg FD; all uses changed.
12699 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12700 (system_process_attributes):
12701 Now returns ns-resolution time stamp. All uses changed.
12702 Check for time stamp overflow.
12703
12704 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12705 provides a substitute now.
12706
12707 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12708 since it guarantees struct timespec.
12709 (EMACS_TIME): Now struct timespec, so that we can support
12710 ns-resolution time stamps.
12711 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12712 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12713 (EMACS_USECS): Remove.
12714 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12715 so multiply the arg by 1000 before storing it.
12716 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12717 New macros.
12718 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12719 Port to ns-resolution time stamps.
12720 (EMACS_TIME_NEG_P): Remove; replaced by....
12721 (EMACS_TIME_SIGN): New macro.
12722 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12723 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12724 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12725 (make_timeval, make_lisp_time, decode_time_components): New decls.
12726 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12727 that it mishandled time_t overflow. You can't compare by subtracting!
12728 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12729 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12730
12731 * term.c: Include <sys/time.h>.
12732 (timeval_to_Time): New function, for proper overflow wraparound.
12733 (term_mouse_position, term_mouse_click): Use it.
12734
12735 * undo.c (record_first_change): Support higher-resolution time stamps
12736 in the undo buffer.
12737 (Fprimitive_undo): Use them when restoring time stamps.
12738
12739 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12740 (w32_get_internal_run_time):
12741 Port to higher-resolution Emacs time stamps.
12742 (ltime): Now accepts single 64-bit integer, as that's more convenient
12743 for callers.
12744
12745 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12746
12747 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12748 for compatibility with pselect. Support ns-resolution time stamps.
12749
12750 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12751
12752 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12753 Check for time stamp overflow, and support ns-resolution time stamps.
12754
12755 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12756 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12757 (timeval_subtract): Remove; no longer needed.
12758 (XTflash, XTring_bell, x_wait_for_event):
12759 Port to ns-resolution time stamps. Don't assume time_t is signed.
12760
127612012-06-22 Chong Yidong <cyd@gnu.org>
12762
12763 * xdisp.c (x_consider_frame_title): Revert last change.
12764
127652012-06-22 Eli Zaretskii <eliz@gnu.org>
12766
12767 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12768 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12769 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12770 staticidx goes up to 1597 out of 1600 = 0x640.)
12771
127722012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12773
12774 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12775 Otherwise, the umask might be mistakenly 0 while handling input signals.
12776
127772012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12778
12779 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12780
127812012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12782
12783 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12784 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12785 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12786 access to `contents' member of Lisp_Vector objects with AREF and ASET
12787 where appropriate.
12788
127892012-06-19 Chong Yidong <cyd@gnu.org>
12790
12791 * frame.c (delete_frame): When selecting a frame on a different
12792 text terminal, do not alter the terminal's top-frame.
12793
12794 * xdisp.c (format_mode_line_unwind_data): Record the target
12795 frame's selected window and its terminal's top-frame.
12796 (unwind_format_mode_line): Restore them.
12797 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12798 Callers changed.
12799 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12800 since tty frames can be explicitly named.
12801 (prepare_menu_bars): Likewise.
12802
12803 * term.c (Ftty_top_frame): New function.
12804
128052012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12806
12807 Port byte-code-meter to modern targets.
12808 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12809 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12810 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12811 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12812 (METER_1, METER_2): Simplify.
12813
128142012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12815
12816 * data.c (Fdefalias): Return `symbol' (bug#11686).
12817
128182012-06-18 Martin Rudalics <rudalics@gmx.at>
12819
12820 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12821 gets killed during executing of this function (Bug#11665).
12822 Try to always return Qt when the buffer has been actually killed.
12823 (Vkill_buffer_query_functions): In doc-string say that functions
12824 run by this hook should not change the current buffer.
12825
128262012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12827
12828 Fix recently-introduced process.c problems found by static checking.
12829 * process.c (write_queue_push, write_queue_pop, send_process):
12830 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12831 (write_queue_pop): Fix pointer signedness problem.
12832 (send_process): Remove unused local.
12833
128342012-06-17 Chong Yidong <cyd@gnu.org>
12835
12836 * xdisp.c (redisplay_internal): No need to redisplay terminal
12837 frames that are not on top.
12838
128392012-06-17 Troels Nielsen <bn.troels@gmail.com>
12840
12841 * process.c (make_process): Initialize write_queue.
12842 (write_queue_push, write_queue_pop): New functions.
12843 (send_process): Use them to maintain correct ordering of process
12844 writes (Bug#10815).
12845
128462012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12847
12848 * lisp.h (eassert): Assume C89 or later.
12849 This removes the need for CHECK.
12850 (CHECK): Remove. Its comments about always evaluating its
12851 argument were confusing, as 'eassert' typically does not evaluate
12852 its argument.
12853
12854 * coding.c (produce_chars): Use ptrdiff_t, not int.
12855
12856 * xterm.c (x_draw_underwave): Check for integer overflow.
12857 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12858
128592012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12860
12861 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12862 referenced (Bug#11583).
12863
128642012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12865
12866 Implement wave-style variant of underlining.
12867 * dispextern.h (face_underline_type): New enum.
12868 (face): Add field for underline type.
12869 * nsterm.m (ns_draw_underwave): New function.
12870 (ns_draw_text_decoration): Use it.
12871 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12872 New functions.
12873 (x_draw_glyph_string): Use them.
12874 * xfaces.c (Qline, Qwave): New Lisp objects.
12875 (check_lface_attrs, merge_face_ref)
12876 (Finternal_set_lisp_face_attribute, realize_x_face):
12877 Handle wave-style underline face attributes.
12878 * xterm.c (x_draw_underwave): New function.
12879 (x_draw_glyph_string): Use it.
12880
128812012-06-16 Juanma Barranquero <lekktu@gmail.com>
12882
12883 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12884 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12885 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12886 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12887 ($(BLD)/w32select.$(O)): Update dependencies.
12888
128892012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12890
12891 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12892 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12893 * character.c (_fetch_multibyte_char_p): Remove.
12894 * alloc.c: Include "character.h" before "buffer.h".
12895 * bidi.c: Likewise.
12896 * buffer.c: Likewise.
12897 * bytecode.c: Likewise.
12898 * callint.c: Likewise.
12899 * callproc.c: Likewise.
12900 * casefiddle.c: Likewise.
12901 * casetab.c: Likewise.
12902 * category.c: Likewise.
12903 * cmds.c: Likewise.
12904 * coding.c: Likewise.
12905 * composite.c: Likewise.
12906 * dired.c: Likewise.
12907 * dispnew.c: Likewise.
12908 * doc.c: Likewise.
12909 * dosfns.c: Likewise.
12910 * editfns.c: Likewise.
12911 * emacs.c: Likewise.
12912 * fileio.c: Likewise.
12913 * filelock.c: Likewise.
12914 * font.c: Likewise.
12915 * fontset.c: Likewise.
12916 * fringe.c: Likewise.
12917 * indent.c: Likewise.
12918 * insdel.c: Likewise.
12919 * intervals.c: Likewise.
12920 * keyboard.c: Likewise.
12921 * keymap.c: Likewise.
12922 * lread.c: Likewise.
12923 * macros.c: Likewise.
12924 * marker.c: Likewise.
12925 * minibuf.c: Likewise.
12926 * nsfns.m: Likewise.
12927 * nsmenu.m: Likewise.
12928 * print.c: Likewise.
12929 * process.c: Likewise.
12930 * regex.c: Likewise.
12931 * region-cache.c: Likewise.
12932 * search.c: Likewise.
12933 * syntax.c: Likewise.
12934 * term.c: Likewise.
12935 * textprop.c: Likewise.
12936 * undo.c: Likewise.
12937 * unexsol.c: Likewise.
12938 * w16select.c: Likewise.
12939 * w32fns.c: Likewise.
12940 * w32menu.c: Likewise.
12941 * window.c: Likewise.
12942 * xdisp.c: Likewise.
12943 * xfns.c: Likewise.
12944 * xmenu.c: Likewise.
12945 * xml.c: Likewise.
12946 * xselect.c: Likewise.
12947
129482012-06-16 Eli Zaretskii <eliz@gnu.org>
12949
12950 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12951 If all the glyphs of the glyph row came from strings, and we have no
12952 cursor positioning clues, put the cursor on the first glyph of the
12953 row.
12954 (handle_face_prop): Use chunk-relative overlay string index when
12955 indexing into it->string_overlays array. (Bug#11653)
12956 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12957 the rightmost. (Bug#11720)
12958
129592012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12960
12961 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12962 (CATEGORY_MEMBER): Enforce 1/0 value.
12963 * category.c (_temp_category_set): Remove.
12964
129652012-06-16 Eli Zaretskii <eliz@gnu.org>
12966
12967 * window.c (Fdelete_other_windows_internal)
12968 (Fdelete_window_internal): Don't access frame's mouse highlight
12969 info of the initial frame. (Bug#11677)
12970
129712012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12972
12973 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12974 Assume USE_2_TAGS_FOR_INTS.
12975 (xreload): Adjust $tagmask width to match recent lisp.h change.
12976
12977 Simplify lisp.h in minor ways that should not affect code.
12978 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12979 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12980 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12981 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12982 (INTTYPEBITS): New macro, for clarity.
12983 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12984 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12985 Simplify now that USE_LSB_TAG is always defined.
12986 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12987 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12988
129892012-06-13 Juanma Barranquero <lekktu@gmail.com>
12990
12991 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12992
129932012-06-13 Glenn Morris <rgm@gnu.org>
12994
12995 * s/bsd-common.h (BSD4_3):
12996 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12997
129982012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12999
13000 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
13001 instead of union.
13002 (XLI, XIL): Define.
13003 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
13004 Use them.
13005 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
13006 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
13007 * alloc.c (widen_to_Lisp_Object): Remove.
13008 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
13009 * frame.c (delete_frame): Remove outdated comment.
13010 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
13011 USE_LISP_UNION_TYPE.
13012 (Fw32_unregister_hot_key): Likewise.
13013 (Fw32_toggle_lock_key): Likewise.
13014 * w32menu.c (add_menu_item): Likewise.
13015 (w32_menu_display_help): Use XIL instead of checking
13016 USE_LISP_UNION_TYPE.
13017 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
13018 (init_heap): Likewise.
13019 * w32term.c (w32_read_socket): Update comment.
13020
130212012-06-13 Glenn Morris <rgm@gnu.org>
13022
13023 * s/usg5-4-common.h, src/s/unixware.h:
13024 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
13025
13026 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
13027
130282012-06-13 Paul Eggert <eggert@cs.ucla.edu>
13029
13030 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
13031 * alloc.c (make_number) [!defined make_number]:
13032 Remove, as lisp.h always defines this now.
13033 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
13034 (roundup_size): Verify that it is a power of 2.
13035 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
13036 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
13037 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
13038 -DUSE_LSB_TAG=0, to override the automatically-selected default.
13039 USE_LSB_TAG now is always defined to be either 0 or 1.
13040 All uses changed.
13041 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
13042 code works fine either way, and efficiency is not a concern here,
13043 as the union type is for debugging, not for production.
13044 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
13045 Use an inline function on all platforms when using the union type,
13046 since this is simpler and 'static inline' can be used portably
13047 within Emacs now.
13048 (LISP_INITIALLY_ZERO): New macro.
13049 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
13050 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
13051
130522012-06-12 Glenn Morris <rgm@gnu.org>
13053
13054 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
13055
13056 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
13057
13058 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
13059 Move BROKEN_SIGIO to configure.
13060
13061 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
13062 Move NO_TERMIO to configure.
13063
130642012-06-12 Chong Yidong <cyd@gnu.org>
13065
13066 * image.c (imagemagick_load_image): Use MagickFlattenImage if
13067 MagickMergeImageLayers is undefined. Use pixel pusher loop if
13068 MagickExportImagePixels is undefined.
13069
130702012-06-12 Paul Eggert <eggert@cs.ucla.edu>
13071
13072 * image.c (imagemagick_load_image): Remove unused label.
13073
130742012-06-11 Glenn Morris <rgm@gnu.org>
13075
13076 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
13077 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
13078 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
13079 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
13080
130812012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
13082
13083 * alloc.c (make_byte_code): New function.
13084 (Fmake_byte_code): Use it. Don't purify here.
13085 * lread.c (read1): Use it as well to avoid extra allocation.
13086
130872012-06-11 Chong Yidong <cyd@gnu.org>
13088
13089 * image.c (imagemagick_load_image): Implement transparency.
13090
130912012-06-10 Andreas Schwab <schwab@linux-m68k.org>
13092
13093 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
13094 account for preceding backslashes. (Bug#11663)
13095
130962012-06-09 Chong Yidong <cyd@gnu.org>
13097
13098 * term.c: Support italics in capable terminals (Bug#9652).
13099 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
13100 (turn_on_face): Output using TS_enter_italic_mode if available.
13101 Don't handle unused blinking and alt-charset cases.
13102 (turn_off_face): Handle italic case; discard unused tty_blinking_p
13103 and tty_alt_charset_p cases.
13104 (tty_capable_p, init_tty): Support italics.
13105
13106 * termchar.h (struct tty_display_info): Add field for italics.
13107 Remove unused blink field.
13108
13109 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
13110 Handle slant.
13111
13112 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
13113 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
13114 tty_alt_charset_p. Add tty_italic_p.
13115
131162012-06-09 Michael Albinus <michael.albinus@gmx.de>
13117
13118 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
13119 dbus_type_is_basic if available.
13120 (xd_extract_signed, xd_extract_unsigned): Rename from
13121 extract_signed and extract_unsigned, respectively. Adapt callers.
13122
131232012-06-09 Chong Yidong <cyd@gnu.org>
13124
13125 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
13126
13127 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
13128 case (Bug#9752).
13129
131302012-06-08 Paul Eggert <eggert@cs.ucla.edu>
13131
13132 * xdisp.c (vmessage): Treat frame message as multibyte.
13133 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
13134 would generate the diagnostic "Making \302\247 buffer-local while
13135 let-bound!".
13136
131372012-06-08 Eli Zaretskii <eliz@gnu.org>
13138
13139 * dispnew.c (showing_window_margins_p): Undo last change, which
13140 was done due to an inadvertent commit.
13141 (adjust_frame_glyphs_for_frame_redisplay): Do call
13142 showing_window_margins_p.
13143
131442012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
13145
13146 * eval.c (Fmake_var_non_special): New primitive.
13147 (syms_of_eval): Defsubr it.
13148 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
13149
131502012-06-08 Juanma Barranquero <lekktu@gmail.com>
13151
13152 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
13153 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
13154
131552012-06-08 Eli Zaretskii <eliz@gnu.org>
13156
13157 * alloc.c (allocate_vectorlike): Fix last change.
13158
131592012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
13160
13161 Block-based vector allocation of small vectors.
13162 * lisp.h (struct vectorlike_header): New field `nbytes',
13163 adjust comment accordingly.
13164 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
13165 to denote vector blocks. Adjust users (live_vector_p,
13166 mark_maybe_pointer, valid_lisp_object_p) accordingly.
13167 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
13168 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
13169 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
13170 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
13171 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
13172 (roundup_size): New constant.
13173 (struct vector_block): New data type.
13174 (vector_blocks, vector_free_lists, zero_vector): New variables.
13175 (all_vectors): Rename to `large_vectors'.
13176 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
13177 (sweep_vectors): New functions.
13178 (allocate_vectorlike): Return `zero_vector' as the only vector of
13179 0 items. Allocate new vector from block if vector size is less than
13180 or equal to VBLOCK_BYTES_MAX.
13181 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
13182 (init_alloc_once): Add call to init_vectors.
13183
131842012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
13185
13186 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
13187
131882012-06-07 Paul Eggert <eggert@cs.ucla.edu>
13189
13190 * doprnt.c (doprnt): Truncate multibyte char correctly.
13191 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
13192 would mishandle a string argument "Xc" if X was a multibyte
13193 character of length 2: it would truncate after X's first byte
13194 rather than including all of X.
13195
131962012-06-06 Chong Yidong <cyd@gnu.org>
13197
13198 * buffer.c (word_wrap): Doc fix.
13199
132002012-06-04 Paul Eggert <eggert@cs.ucla.edu>
13201
13202 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
13203
132042012-06-03 Glenn Morris <rgm@gnu.org>
13205
13206 * xdisp.c (tool-bar-style): Doc fix.
13207
132082012-06-03 Ulrich Müller <ulm@gentoo.org>
13209
13210 * Makefile.in (PAXCTL): Define.
13211 (temacs$(EXEEXT)): Disable memory randomization for the temacs
13212 binary via PaX flags if the paxctl utility is available.
13213 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
13214 Restore PaX flags to their default. (Bug#11398)
13215
132162012-06-03 Chong Yidong <cyd@gnu.org>
13217
13218 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
13219 buffer (Bug#11226).
13220
132212012-06-03 Chong Yidong <cyd@gnu.org>
13222
13223 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
13224 (note_mode_line_or_margin_highlight): If there is no help echo,
13225 use mode-line-default-help-echo. Handle the case where the mouse
13226 position is past the end of the mode line string.
13227
13228 * buffer.c (buffer_local_value_1): New function, split from
13229 Fbuffer_local_value; can return Qunbound.
13230 (Fbuffer_local_value): Use it.
13231 (Vmode_line_format): Docstring tweaks.
13232
132332012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13234
13235 * sysdep.c (system_process_attributes): Improve comment.
13236
132372012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
13238
13239 * keyboard.c: Export real-this-command to Elisp.
13240 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
13241 and DEFVAR it. Update all users.
13242
132432012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13244
13245 * minibuf.c (Fassoc_string): Remove duplicate declaration.
13246
13247 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
13248 Convert pctcpu and pctmem to Lisp float properly.
13249 Let the compiler fold better, as 100.0/0x8000 is exact.
13250
132512012-06-02 Andreas Schwab <schwab@linux-m68k.org>
13252
13253 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
13254 cons_block.
13255
132562012-06-01 Paul Eggert <eggert@cs.ucla.edu>
13257
13258 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
13259
132602012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
13261
13262 For a 'struct window', replace some Lisp_Object fields to
13263 bitfields where appropriate, remove unused fields.
13264 * window.h (struct window): Remove unused 'last_mark_x' and
13265 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
13266 change its type from Lisp_Object to bitfield.
13267 Change type of 'force_start', 'optional_new_start',
13268 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
13269 fields from Lisp_Object to bitfield. Adjust users accordingly.
13270
132712012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13272
13273 Pacify gcc -Wdouble-precision when using Xaw.
13274 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
13275 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
13276 Use 'float' consistently, rather than 'float' in most places
13277 and 'double' in a couple of places.
13278
132792012-05-31 Eli Zaretskii <eliz@gnu.org>
13280
13281 * xdisp.c (handle_stop): Detect whether we have overlay strings
13282 loaded by testing it->current.overlay_string_index to be
13283 non-negative, instead of checking whether n_overlay_strings is
13284 positive. (Bug#11587)
13285
132862012-05-31 Chong Yidong <cyd@gnu.org>
13287
13288 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
13289
13290 * doc.c (Fsubstitute_command_keys): Doc fix.
13291
132922012-05-31 Eli Zaretskii <eliz@gnu.org>
13293
13294 * search.c (search_buffer): Remove calls to
13295 r_alloc_inhibit_buffer_relocation, as it is now called by
13296 maybe_unify_char, which was the cause of relocation of buffer text
13297 in bug#11519.
13298
132992012-05-31 Eli Zaretskii <eliz@gnu.org>
13300
13301 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
13302 for the duration of call to load_charset, to avoid problems with
13303 callers of maybe_unify_char that access buffer text through C
13304 pointers.
13305
13306 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
13307 decrement the inhibition flag, instead of just setting or
13308 resetting it.
13309
133102012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13311
13312 Remove obsolete '#define static' cruft.
13313 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
13314 This #undef was "temporary" in 2000; it is no longer needed
13315 now that '#define static' has gone away.
13316 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
13317 (gray_bitmap_bits): Remove; no longer needed.
13318 All uses replaced with definiens.
13319 * xterm.c: Include "bitmaps/gray.xbm".
13320
133212012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13322
13323 Clean up __executable_start, monstartup when --enable-profiling.
13324 The following changes affect the code only when profiling.
13325 * dispnew.c (__executable_start): Rename from safe_bcopy.
13326 Define only on platforms that need it.
13327 * emacs.c: Include <sys/gmon.h> when profiling.
13328 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
13329 (__executable_start): Remove decl, since lisp.h does it now.
13330 (safe_bcopy): Remove decl; no longer has that name.
13331 (main): Coalesce #if into single bit of code, for simplicity.
13332 Cast pointers to uintptr_t, since standard libraries want integers
13333 and not pointers.
13334 * lisp.h (__executable_start): New decl.
13335
133362012-05-31 Glenn Morris <rgm@gnu.org>
13337
13338 * image.c (Fimagemagick_types): Doc fix.
13339
133402012-05-30 Jim Meyering <meyering@redhat.com>
13341
13342 * callproc.c (Fcall_process_region): Include directory component
13343 in mkstemp error message (Bug#11586).
13344
133452012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13346
13347 * alloc.c, lisp.h (make_pure_vector): Now static.
13348
133492012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
13350
13351 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
13352 Move to byte-run.el.
13353 (Fautoload): Do the hash-doc more carefully.
13354 * data.c (Fdefalias): Purify definition, except for keymaps.
13355 (Qdefun): Move from eval.c.
13356 * lisp.h (Qdefun): Remove.
13357 * lread.c (read1): Tiny simplification.
13358
133592012-05-29 Troels Nielsen <bn.troels@gmail.com>
13360
13361 Do not create empty overlays with the evaporate property (Bug#9642).
13362 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13363 Bug#9642, but explicitly check that the buffer the overlay would
13364 be moved to is live and rearrange lines to make sure that errors
13365 will not put the overlay in an inconsistent state.
13366 (Fdelete_overlay): Cosmetics.
13367
133682012-05-28 Eli Zaretskii <eliz@gnu.org>
13369
13370 * w32term.c (my_bring_window_to_top): New function.
13371 (x_raise_frame): Use handle returned by DeferWindowPos, which
13372 could be different from the original one.
13373 Call my_bring_window_to_top instead of my_set_foreground_window.
13374 (Bug#11513)
13375
13376 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13377 by calling BringWindowToTop.
13378
13379 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13380 (WM_EMACS_END): Increase by one.
13381
133822012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13383
13384 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13385 This avoids undefined behavior that might cause the eassert
13386 to not catch an out-of-range value.
13387
133882012-05-28 Juanma Barranquero <lekktu@gmail.com>
13389
13390 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13391 Update dependencies.
13392
133932012-05-27 Eli Zaretskii <eliz@gnu.org>
13394
13395 * bidi.c (bidi_mirror_char): Fix last change.
13396
133972012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13398
13399 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13400 when referring to sectname field in printf format.
13401
134022012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13403
13404 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13405 Only r_alloc_inhibit_buffer_relocation needed to be added;
13406 the others were already declared.
13407
13408 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13409 before checking whether it's out of range. Put the check inside
13410 eassert. See
13411 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13412
134132012-05-27 Ken Brown <kbrown@cornell.edu>
13414
13415 * callproc.c (Fcall_process): Restore a line that was accidentally
13416 commented out in the 2011-02-13 change (bug#11547).
13417
134182012-05-27 Eli Zaretskii <eliz@gnu.org>
13419
13420 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13421 defined on ralloc.c.
13422
13423 * buffer.c [REL_ALLOC]: Remove prototypes of
13424 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13425 they are now on lisp.h.
13426
13427 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13428
13429 * search.c (search_buffer): Use it to inhibit relocation of buffer
13430 text while re_search_2 is doing its job, because re_search_2 is
13431 passed C pointers to buffer text. (Bug#11519)
13432
13433 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13434 Update value to 24.
13435
13436 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13437 state after an additional call to move_it_in_display_line_to, keep
13438 the values of it->max_ascent and it->max_descent found for the
13439 entire line.
13440 (pos_visible_p): Revert the comparison against bottom_y to what it
13441 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13442 (Bug#11464)
13443
134442012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13445
13446 Fix coding-related core dumps with gcc -ftrapv.
13447 The code was computing A - B, where A and B are pointers, and B is
13448 random garbage. This can lead to core dumps on platforms that
13449 have special pointer registers, and it also leads to core dumps on
13450 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13451 A - B only when B is initialized properly.
13452 * coding.c (coding_set_source, coding_set_destination): Return void.
13453 (coding_change_source, coding_change_destinations): New functions,
13454 with the old behaviors of coding_set_source and coding_set_destination.
13455 All callers that need an offset changed to use these new functions.
13456
134572012-05-26 Glenn Morris <rgm@gnu.org>
13458
13459 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13460
134612012-05-26 Eli Zaretskii <eliz@gnu.org>
13462
13463 Extend mouse support on W32 text-mode console.
13464 * xdisp.c (draw_row_with_mouse_face):
13465 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
13466
13467 * w32console.c: Include window.h.
13468 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13469 New functions.
13470 (initialize_w32_display): Initialize mouse-highlight data.
13471
13472 * w32inevt.c: Include termchar.h and window.h.
13473 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13474 moves, call note_mouse_highlight. If help_echo changed, call
13475 gen_help_event to produce help-echo message in the echo area.
13476 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13477 highlight info.
13478
134792012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13480
13481 * lread.c (read1): Simplify slightly to avoid an overflow warning
13482 with GCC 4.7.0 on x86-64.
13483
134842012-05-26 Eli Zaretskii <eliz@gnu.org>
13485
13486 * bidi.c (bidi_mirror_char): Revert last change: an int is
13487 definitely wide enough here.
13488
134892012-05-25 Paul Eggert <eggert@cs.ucla.edu>
13490
13491 Fix integer width and related bugs (Bug#9874).
13492 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
13493 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13494 (string_bytes, check_sblock, allocate_string_data):
13495 (compact_small_strings, Fmake_bool_vector, make_string)
13496 (make_unibyte_string, make_multibyte_string)
13497 (make_string_from_bytes, make_specified_string)
13498 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13499 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13500 (mark_vectorlike):
13501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13502 (allocate_pseudovector):
13503 Use int, not EMACS_INT, where int is wide enough.
13504 (inhibit_garbage_collection, Fgarbage_collect):
13505 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13506 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13507 int might not be wide enough.
13508 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13509 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13510 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13511 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13512 (bidi_level_of_next_char, bidi_move_to_visually_next):
13513 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13514 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13515 (Fkill_buffer, Fset_buffer_major_mode)
13516 (advance_to_char_boundary, Fbuffer_swap_text)
13517 (Fset_buffer_multibyte, overlays_at, overlays_in)
13518 (overlay_touches_p, struct sortvec, record_overlay_string)
13519 (overlay_strings, recenter_overlay_lists)
13520 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13521 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13522 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13523 (Foverlay_recenter, last_overlay_modification_hooks_used)
13524 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13526 (validate_region): Omit unnecessary test for b <= e,
13527 since that's guaranteed by the previous test.
13528 (adjust_overlays_for_delete): Avoid pos + length overflow.
13529 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13530 (report_overlay_modification):
13531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13532 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13533 Omit pointer cast, which isn't needed anyway, and doesn't work
13534 after the EMACS_INT -> ptrdiff_t change.
13535 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
13536 * buffer.h: Adjust decls to match defn changes elsewhere.
13537 (struct buffer_text, struct buffer):
13538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13539 Use EMACS_INT, not int, where int might not be wide enough.
13540 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13541 not int, to avoid needless 32-bit limit on 64-bit hosts.
13542 (exec_byte_code): Use tighter memory-full test, one that checks
13543 for alloca overflow. Don't compute the address of the object just
13544 before an array, as that's not portable. Use EMACS_INT, not
13545 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
13546 * callint.c (Fcall_interactively):
13547 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13548 * callproc.c (call_process_kill, Fcall_process):
13549 Don't assume pid_t fits into an Emacs fixnum.
13550 (call_process_cleanup, Fcall_process, child_setup):
13551 Don't assume pid_t fits into int.
13552 (call_process_cleanup, Fcall_process, delete_temp_file)
13553 (Fcall_process_region):
13554 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13555 (Fcall_process): Simplify handling of volatile integers.
13556 Use int, not EMACS_INT, where int will do.
13557 * casefiddle.c (casify_object, casify_region, operate_on_word)
13558 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13560 (casify_object): Avoid integer overflow when overallocating buffer.
13561 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
13562 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
13563 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13564 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13565 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13566 integers are now checked earlier. All uses replaced with XINT.
13567 (ccl_driver):
13568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13569 For CCL_MapSingle, check that content and value are in int range.
13570 (ccl_driver, Fregister_code_conversion_map):
13571 Check that Vcode_version_map_vector is a vector.
13572 (resolve_symbol_ccl_program): Check that vector header is in range.
13573 Always copy the vector, so that we can check its contents reliably
13574 now rather than having to recheck each instruction as it's being
13575 executed. Check that vector words fit in 'int'.
13576 (ccl_get_compiled_code, Fregister_ccl_program)
13577 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13578 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13579 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13580 contents are in range.
13581 (Fccl_execute_on_string): Check that status is in range.
13582 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13583 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13584 Accept and return EMACS_INT, not int, because callers can pass values
13585 out of 'int' range.
13586 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13587 (multibyte_chars_in_text, parse_str_as_multibyte)
13588 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13589 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13590 (string_escape_byte8, Fget_byte):
13591 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13592 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13593 avoid mishandling large integers.
13594 * character.h: Adjust decls to match defn changes elsewhere.
13595 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13596 (Ffind_charset_region):
13597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13598 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13599 (load_charset_map_from_vector, Fdefine_charset_internal):
13600 Don't assume fixnum fits in int.
13601 (load_charset_map_from_vector, Fmap_charset_chars):
13602 Remove now-unnecessary CHECK_NATNUMs.
13603 (Fdefine_charset_internal): Check ranges here, more carefully.
13604 Don't rely on undefined behavior with signed left shift overflow.
13605 Don't assume unsigned int fits into fixnum, or that fixnum fits
13606 into unsigned int. Don't require max_code to be a valid fixnum;
13607 that's not true for gb10830 4-byte on a 32-bit host. Allow
13608 invalid_code to be a cons, for the same reason. Require code_offset
13609 to be a character. Avoid int overflow if max_char is close
13610 to INT_MAX.
13611 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13612 this is intended anyway and avoids some undefined behavior.
13613 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13614 INDEX_TO_CODE_POINT, as that's what it expects.
13615 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13616 * charset.h (DECODE_CHAR): Return int, not unsigned;
13617 this is what was intended anyway, and it avoids undefined behavior.
13618 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13619 integer-overflow issues.
13620 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13621 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13622 where the argument is EMACS_INT, and this behavior is not intended.
13623 * chartab.c (Fmake_char_table, Fset_char_table_range)
13624 (uniprop_get_decoder, uniprop_get_encoder):
13625 Don't assume fixnum fits in int.
13626 * cmds.c (move_point): New function, that does the gist of
13627 Fforward_char and Fbackward_char, but does so while checking
13628 for integer overflow more accurately.
13629 (Fforward_char, Fbackward_char): Use it.
13630 (Fforward_line, Fend_of_line, internal_self_insert)
13631 (internal_self_insert):
13632 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13633 Fix a FIXME, by checking for integer overflow when calculating
13634 target_clm and actual_clm.
13635 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13636 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13637 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13638 (coding_alloc_by_making_gap, alloc_destination)
13639 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13640 (encode_coding_utf_16, detect_coding_emacs_mule)
13641 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13642 (detect_coding_iso_2022, decode_coding_iso_2022)
13643 (encode_invocation_designation, encode_designation_at_bol)
13644 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13645 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13646 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13647 (encode_coding_ccl, encode_coding_raw_text)
13648 (detect_coding_charset, decode_coding_charset)
13649 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13650 (produce_composition, produce_charset, produce_annotation)
13651 (decode_coding, handle_composition_annotation)
13652 (handle_charset_annotation, consume_chars, decode_coding_gap)
13653 (decode_coding_object, encode_coding_object, detect_coding_system)
13654 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13655 (code_convert_region, code_convert_string)
13656 (Fdefine_coding_system_internal)
13657 (coding_set_source, coding_set_destination):
13658 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13659 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13660 (Fdefine_coding_system_internal):
13661 Don't assume fixnums fit in int.
13662 (decode_coding_gap, decode_coding_object, encode_coding_object)
13663 (Fread_coding_system, Fdetect_coding_region)
13664 (Funencodable_char_position, Fcheck_coding_systems_region)
13665 (get_translation, handle_composition_annotation, consume_chars):
13666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13667 (consume_chars): Rewrite to not calculate an address outside buffer.
13668 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13669 Don't access memory outside of the args array.
13670 (Fdefine_coding_system_internal): Check for charset-id overflow.
13671 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13672 result of ENCODE_CHAR.
13673 * coding.h: Adjust decls to match defn changes elsewhere.
13674 (struct coding_system):
13675 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13676 * composite.c (get_composition_id, find_composition)
13677 (run_composition_function, update_compositions)
13678 (compose_text, composition_gstring_put_cache)
13679 (composition_gstring_p, composition_gstring_width)
13680 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13681 (composition_compute_stop_pos, composition_reseat_it)
13682 (composition_update_it, struct position_record)
13683 (find_automatic_composition, composition_adjust_point)
13684 (Fcomposition_get_gstring, Ffind_composition_internal):
13685 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13686 (update_compositions):
13687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13688 * composite.h: Adjust decls to match defn changes elsewhere.
13689 (struct composition):
13690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13691 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13692 Do not attempt to compute the address of the object just before a
13693 buffer; this is not portable.
13694 (Faref, Faset):
13695 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13696 (Faset): Use int, not EMACS_INT, where int is wide enough.
13697 (Fstring_to_number): Don't assume fixnums fit in int.
13698 (Frem): Don't assume arg is nonnegative.
13699 * dbusbind.c (xd_append_arg): Check for integers out of range.
13700 (Fdbus_call_method): Don't overflow the timeout int.
13701 (extract_signed, extract_unsigned): New functions.
13702 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13703 (xd_get_connection_references): Return ptrdiff_t, not int.
13704 All uses changed.
13705 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13706 (xd_read_message_1):
13707 Use int, not unsigned, where the dbus API uses int.
13708 (Fdbus_message_internal): Don't overflow mtype.
13709 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13710 * dired.c (directory_files_internal, file_name_completion, scmp)
13711 (file_name_completion_stat):
13712 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13713 (file_name_completion): Don't overflow matchcount.
13714 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13715 * dispextern.h: Adjust decls to match defn changes elsewhere.
13716 (struct text_pos, struct glyph, struct bidi_saved_info)
13717 (struct bidi_string_data, struct bidi_it, struct composition_it)
13718 (struct it):
13719 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13720 (struct display_pos, struct composition_it, struct it):
13721 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13722 * dispnew.c (increment_matrix_positions)
13723 (increment_row_positions, mode_line_string)
13724 (marginal_area_string):
13725 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13726 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13727 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13728 (duration_to_sec_usec): New function, to check for overflow better.
13729 (Fsleep_for, sit_for): Use it.
13730 * doc.c (get_doc_string, store_function_docstring):
13731 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13732 (get_doc_string, Fsnarf_documentation):
13733 Use int, not EMACS_INT, where int is wide enough.
13734 (get_doc_string):
13735 Use SAFE_ALLOCA, not alloca.
13736 Check for overflow when converting EMACS_INT to off_t.
13737 * doprnt.c (doprnt):
13738 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13739 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13740 Don't assume uid_t fits into fixnum.
13741 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13742 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13743 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13744 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13745 (general_insert_function)
13746 (Finsert_char, make_buffer_string, make_buffer_string_both)
13747 (update_buffer_properties, Fbuffer_substring)
13748 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13749 (Fsubst_char_in_region, check_translation)
13750 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13751 (transpose_markers, Ftranspose_regions):
13752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13753 (clip_to_bounds): Move to lisp.h as an inline function).
13754 (Fconstrain_to_field): Don't assume integers are nonnegative.
13755 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13756 (Fsubst_char_in_region, Fsave_restriction):
13757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13758 (Femacs_pid): Don't assume pid_t fits into fixnum.
13759 (lo_time): Use int, not EMACS_INT, when int suffices.
13760 (lisp_time_argument): Check for usec out of range.
13761 (Fencode_time): Don't assume fixnum fits in int.
13762 (Fuser_login_name, Fuser_full_name): Signal an error
13763 if a uid argument is out of range, rather than relying on
13764 undefined behavior.
13765 (Fformat_time_string): Remove now-unnecessary check.
13766 lisp_time_argument checks for out-of-range usec now.
13767 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13768 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13769 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13770 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13771 (init_cmdargs, Fdump_emacs):
13772 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13773 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13774 the bottom (typically) 32 bits of the fixnum.
13775 * eval.c (specpdl_size, call_debugger):
13776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13777 (when_entered_debugger, Fbacktrace_debug):
13778 Don't assume fixnum can fit in int.
13779 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13780 the object just before a buffer; this is not portable.
13781 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13782 (grow_specpdl, unbind_to):
13783 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13784 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13785 (grow_specpdl): Simplify allocation by using xpalloc.
13786 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13787 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13788 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13790 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13791 (a_write, e_write):
13792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13793 (Fcopy_file, non_regular_nbytes, read_non_regular)
13794 (Finsert_file_contents):
13795 Use int, not EMACS_INT, where int is wide enough.
13796 (READ_BUF_SIZE): Verify that it fits in int.
13797 (Finsert_file_contents): Check that counts are in proper range,
13798 rather than assuming fixnums fit into ptrdiff_t etc.
13799 Don't assume fixnums fit into int.
13800 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13801 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13802 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13803 (string_char_to_byte, string_byte_to_char)
13804 (string_make_multibyte, string_to_multibyte)
13805 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13806 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13807 (substring_both, Fdelete, internal_equal, Ffillarray)
13808 (Fclear_string, mapcar1)
13809 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13810 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13811 (larger_vector, make_hash_table, maybe_resize_hash_table)
13812 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13813 (Fmaphash, secure_hash):
13814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13815 (concat): Check for string index and length overflow.
13816 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13817 (Frequire):
13818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13819 (larger_vector): New API (vec, incr_min, size_max) replaces old
13820 one (vec, new_size, init). This catches size overflow.
13821 INIT was removed because it was always Qnil.
13822 All callers changed.
13823 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13824 the upper bound on a hash table index size.
13825 (make_hash_table, maybe_resize_hash_table): Use it.
13826 (secure_hash): Computer start_byte and end_byte only after
13827 they're known to be in ptrdiff_t range.
13828 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13829 (Ffont_get_glyphs, Ffont_at):
13830 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13831 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13832 (Flist_fonts, Fopen_font):
13833 Don't assume fixnum can fit in int.
13834 (check_gstring): Don't assume index can fit in int.
13835 (font_match_p): Check that fixnum is a character, not a nonnegative
13836 fixnum, since the later code needs to stuff it into an int.
13837 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13838 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13839 conversion overflow issues.
13840 (Fopen_font): Check for integer out of range.
13841 (Ffont_get_glyphs): Don't assume index can fit in int.
13842 * font.h: Adjust decls to match defn changes elsewhere.
13843 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13844 integer overflow.
13845 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13846 printmax_t, where ptrdiff_t is wide enough.
13847 (Finternal_char_font):
13848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13849 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13850 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13851 (Fset_frame_position, x_set_frame_parameters)
13852 (x_set_line_spacing, x_set_border_width)
13853 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13854 Check that fixnums are in proper range for system types.
13855 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13856 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13857 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13858 Use SAFE_ALLOCA_LISP, not alloca.
13859 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13860 intptr_t is wide enough.
13861 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13862 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13863 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13864 Check for fixnum out of range.
13865 * ftfont.c (ftfont_list): Don't assume index fits in int.
13866 Check that fixnums are in proper range for system types.
13867 (ftfont_shape_by_flt):
13868 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13869 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13870 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13871 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13872 Check that fixnums are in proper range for system types.
13873 * gnutls.h: Adjust decls to match defn changes elsewhere.
13874 * gtkutil.c (xg_dialog_run):
13875 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13876 (update_frame_tool_bar):
13877 Check that fixnums are in proper range for system types.
13878 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13879 (lookup_image): Check that fixnums are in range for system types.
13880 * indent.c (last_known_column, last_known_column_point):
13881 (current_column_bol_cache):
13882 (skip_invisible, current_column, check_display_width):
13883 (check_display_width, scan_for_column, current_column_1)
13884 (Findent_to, Fcurrent_indentation, position_indentation)
13885 (indented_beyond_p, Fmove_to_column, compute_motion):
13886 (Fcompute_motion, Fvertical_motion):
13887 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13888 (last_known_column_modified): Use EMACS_INT, not int.
13889 (check_display_width):
13890 (Fcompute_motion):
13891 Check that fixnums and floats are in proper range for system types.
13892 (compute_motion): Don't assume index or fixnum fits in int.
13893 (compute_motion, Fcompute_motion):
13894 Use int, not EMACS_INT, when it is wide enough.
13895 (vmotion): Omit local var start_hpos that is always 0; that way
13896 we don't need to worry about overflow in expressions involving it.
13897 * indent.h: Adjust decls to match defn changes elsewhere.
13898 (struct position):
13899 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13900 Use int, not EMACS_INT, where int is wide enough.
13901 Remove unused members ovstring_chars_done and tab_offset;
13902 all uses removed.
13903 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13904 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13905 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13906 (make_gap, copy_text, insert, insert_and_inherit)
13907 (insert_before_markers, insert_before_markers_and_inherit)
13908 (insert_1, count_combining_before, count_combining_after)
13909 (insert_1_both, insert_from_string)
13910 (insert_from_string_before_markers, insert_from_string_1)
13911 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13912 (adjust_after_replace, adjust_after_insert, replace_range)
13913 (replace_range_2, del_range, del_range_1, del_range_byte)
13914 (del_range_both, del_range_2, modify_region)
13915 (prepare_to_modify_buffer, signal_before_change)
13916 (signal_after_change, Fcombine_after_change_execute):
13917 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13918 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13919 (balance_an_interval, split_interval_right, split_interval_left)
13920 (find_interval, next_interval, update_interval)
13921 (adjust_intervals_for_insertion, delete_node, delete_interval)
13922 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13923 (static_offset_intervals, offset_intervals)
13924 (merge_interval_right, merge_interval_left, make_new_interval)
13925 (graft_intervals_into_buffer, temp_set_point_both)
13926 (temp_set_point, set_point, adjust_for_invis_intang)
13927 (set_point_both, move_if_not_intangible, get_property_and_range)
13928 (get_local_map, copy_intervals, copy_intervals_to_string)
13929 (compare_string_intervals, set_intervals_multibyte_1):
13930 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13931 * intervals.h: Adjust decls to match defn changes elsewhere.
13932 (struct interval):
13933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13934 * keyboard.c (this_command_key_count, this_single_command_key_start)
13935 (before_command_key_count, before_command_echo_length, echo_now)
13936 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13937 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13938 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13939 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13940 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13941 (last_non_minibuf_size, last_point_position, echo_truncate)
13942 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13943 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13944 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13945 (stuff_buffered_input):
13946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13947 (last_auto_save, command_loop_1, read_char):
13948 Use EMACS_INT, not int, to avoid integer overflow.
13949 (record_char): Avoid overflow in total_keys computation.
13950 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13951 * keyboard.h: Adjust decls to match defn changes elsewhere.
13952 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13953 (Fkey_description, Fdescribe_vector, Flookup_key):
13954 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13955 (click_position): New function, to check that positions are in range.
13956 (Fcurrent_active_maps):
13957 (describe_command):
13958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13959 (Faccessible_keymaps, Fkey_description):
13960 (preferred_sequence_p):
13961 Don't assume fixnum can fit into int.
13962 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13963 Check for integer overflow in size calculations.
13964 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13965 avoid mishandling large integers.
13966 * lisp.h: Adjust decls to match defn changes elsewhere.
13967 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13968 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13969 (struct Lisp_Marker):
13970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13971 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13972 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13973 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13974 All callers changed.
13975 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13976 Assume the arg has valid form, since it always does.
13977 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13978 unsigned integer system type.
13979 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13980 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13982 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13983 (duration_to_sec_usec): New decl.
13984 * lread.c (read_from_string_index, read_from_string_index_byte)
13985 (read_from_string_limit, readchar, unreadchar, openp)
13986 (read_internal_start, read1, oblookup):
13987 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13988 (Fload, readevalloop, Feval_buffer, Feval_region):
13989 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13990 (openp): Check for out-of-range argument to 'access'.
13991 (read1): Use int, not EMACS_INT, where int is wide enough.
13992 Don't assume fixnum fits into int.
13993 Fix off-by-one error that can read outside a buffer.
13994 (read_filtered_event): Use duration_to_sec_usec
13995 to do proper overflow checking on durations.
13996 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13997 in size calculation.
13998 (Fexecute_kbd_macro):
13999 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14000 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
14001 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
14002 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
14003 (set_marker_both, set_marker_restricted_both, marker_position)
14004 (marker_byte_position, Fbuffer_has_markers_at):
14005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14006 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
14007 * menu.c (ensure_menu_items): Rename from grow_menu_items.
14008 It now merely ensures that the menu is large enough, without
14009 necessarily growing it, as this avoids some integer overflow issues.
14010 All callers changed.
14011 (keymap_panes, parse_single_submenu, Fx_popup_menu):
14012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14013 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
14014 Use SAFE_ALLOCA_LISP, not alloca.
14015 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
14016 to EMACS_INT. Check that fixnums are in proper range for system types.
14017 * minibuf.c (minibuf_prompt_width, string_to_object)
14018 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
14019 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
14020 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14021 (get_minibuffer, read_minibuf_unwind):
14022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14023 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
14024 this simplifies overflow checking. All callers changed.
14025 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
14026 (Ftest_completion):
14027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14028 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
14029 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
14030 Check that fixnums are in proper range for system types.
14031 (Fx_create_frame, Fx_show_tip):
14032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14033 * nsfont.m (ns_findfonts, nsfont_list_family):
14034 Don't assume fixnum fits in long.
14035 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
14036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14037 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
14038 wide enough.
14039 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
14040 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14041 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
14042 (PRINTDECLARE, PRINTPREPARE):
14043 (strout, print_string):
14044 (print, print_preprocess, print_check_string_charset_prop)
14045 (print_object):
14046 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14047 (PRINTDECLARE):
14048 (temp_output_buffer_setup, Fprin1_to_string, print_object):
14049 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14050 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
14051 (printchar, strout): Use xpalloc to catch size calculation overflow.
14052 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
14053 (print_error_message): Use SAFE_ALLOCA, not alloca.
14054 (print_object): Use int, not EMACS_INT, where int is wide enough.
14055 (print_depth, new_backquote_output, print_number_index):
14056 Use ptrdiff_t, not int, where int might not be wide enough.
14057 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
14058 (Fset_process_window_size, Fformat_network_address)
14059 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
14060 (sigchld_handler):
14061 Check that fixnums are in proper range for system types.
14062 (Fsignal_process): Simplify by avoiding a goto.
14063 Check for process-ids out of pid_t range rather than relying on
14064 undefined behavior.
14065 (process_tick, update_tick): Use EMACS_INT, not int.
14066 (Fformat_network_address, read_process_output, send_process)
14067 (Fprocess_send_region, status_notify):
14068 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14069 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
14070 (wait_reading_process_output, read_process_output, exec_sentinel):
14071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14072 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
14073 (Faccept_process_output): Use duration_to_sec_usec to do proper
14074 overflow checking on durations.
14075 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
14076 Don't assume pid_t fits in int.
14077 * process.h (struct Lisp_Process): Members tick and update_tick
14078 are now of type EMACS_INT, not int.
14079 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
14080 configured --with-wide-int.
14081 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
14082 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
14083 * search.c (looking_at_1, string_match_1):
14084 (fast_string_match, fast_c_string_match_ignore_case)
14085 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
14086 (scan_newline, find_before_next_newline, search_command)
14087 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
14088 (set_search_regs, wordify):
14089 (Freplace_match):
14090 (Fmatch_data):
14091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14092 (string_match_1, search_buffer, set_search_regs):
14093 (Fmatch_data):
14094 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14095 (wordify): Check for overflow in size calculation.
14096 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
14097 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
14098 Check that fixnums are in proper range for system types.
14099 * sound.c (struct sound_device)
14100 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
14101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14102 (Fplay_sound_internal):
14103 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14104 * syntax.c (struct lisp_parse_state, find_start_modiff)
14105 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
14106 (Fparse_partial_sexp):
14107 Don't assume fixnums can fit in int.
14108 (struct lisp_parse_state, find_start_pos, find_start_value)
14109 (find_start_value_byte, find_start_begv)
14110 (update_syntax_table, char_quoted, dec_bytepos)
14111 (find_defun_start, prev_char_comend_first, back_comment):
14112 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
14113 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
14114 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14115 (Finternal_describe_syntax_value): Check that match_lisp is a
14116 character, not an integer, since the code stuffs it into int.
14117 (scan_words, scan_sexps_forward):
14118 Check that fixnums are in proper range for system types.
14119 (Fforward_word):
14120 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14121 (scan_sexps_forward):
14122 Use CHARACTERP, not INTEGERP, since the value must fit into int.
14123 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
14124 * syntax.h: Adjust decls to match defn changes elsewhere.
14125 (struct gl_state_s):
14126 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14127 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
14128 MOST_POSITIVE_FIXNUM.
14129 * sysdep.c (wait_for_termination_1, wait_for_termination)
14130 (interruptible_wait_for_termination, mkdir):
14131 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
14132 (emacs_read, emacs_write):
14133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14134 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
14135 and double all fit in int.
14136 * term.c (set_tty_color_mode):
14137 Check that fixnums are in proper range for system types.
14138 * termhooks.h (struct input_event):
14139 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14140 * textprop.c (validate_interval_range, interval_of)
14141 (Fadd_text_properties, set_text_properties_1)
14142 (Fremove_text_properties, Fremove_list_of_text_properties)
14143 (Ftext_property_any, Ftext_property_not_all)
14144 (copy_text_properties, text_property_list, extend_property_ranges)
14145 (verify_interval_modification):
14146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14147 (Fnext_single_char_property_change)
14148 (Fprevious_single_char_property_change):
14149 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14150 (copy_text_properties):
14151 Check for integer overflow in index calculation.
14152 * undo.c (last_boundary_position, record_point, record_insert)
14153 (record_delete, record_marker_adjustment, record_change)
14154 (record_property_change):
14155 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14156 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
14157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14158 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
14159 (Fx_hide_tip, Fx_file_dialog):
14160 * w32menu.c (set_frame_menubar):
14161 Use ptrdiff_t, not int, for consistency with rest of code.
14162 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
14163 (select_window, Fdelete_other_windows_internal)
14164 (window_scroll_pixel_based, window_scroll_line_based)
14165 (Frecenter, Fset_window_configuration):
14166 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14167 (Fset_window_hscroll, run_window_configuration_change_hook)
14168 (set_window_buffer, temp_output_buffer_show, scroll_command)
14169 (Fscroll_other_window, Frecenter):
14170 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14171 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
14172 Don't assume fixnum fits in int.
14173 (Fset_window_scroll_bars):
14174 Check that fixnums are in proper range for system types.
14175 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
14176 (string_pos, c_string_pos, number_of_chars, init_iterator)
14177 (in_ellipses_for_invisible_text_p, init_from_display_pos)
14178 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
14179 (compute_display_string_end, handle_face_prop)
14180 (face_before_or_after_it_pos, handle_invisible_prop)
14181 (handle_display_prop, handle_display_spec, handle_single_display_spec)
14182 (display_prop_intangible_p, string_buffer_position_lim)
14183 (string_buffer_position, handle_composition_prop, load_overlay_strings)
14184 (get_overlay_strings_1, get_overlay_strings)
14185 (iterate_out_of_display_property, forward_to_next_line_start)
14186 (back_to_previous_visible_line_start, reseat, reseat_to_string)
14187 (get_next_display_element, set_iterator_to_next)
14188 (get_visually_first_element, compute_stop_pos_backwards)
14189 (handle_stop_backwards, next_element_from_buffer)
14190 (move_it_in_display_line_to, move_it_in_display_line)
14191 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14192 (add_to_log, message_dolog, message_log_check_duplicate)
14193 (message2, message2_nolog, message3, message3_nolog
14194 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
14195 (current_message_1, truncate_echo_area, truncate_message_1)
14196 (set_message, set_message_1, store_mode_line_noprop)
14197 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
14198 (text_outside_line_unchanged_p, check_point_in_composition)
14199 (reconsider_clip_changes)
14200 (redisplay_internal, set_cursor_from_row, try_scrolling)
14201 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
14202 (redisplay_window, find_last_unchanged_at_beg_row)
14203 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
14204 (trailing_whitespace_p, find_row_edges, display_line)
14205 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
14206 (display_mode_element, store_mode_line_string)
14207 (pint2str, pint2hrstr, decode_mode_spec)
14208 (display_count_lines, display_string, draw_glyphs)
14209 (x_produce_glyphs, x_insert_glyphs)
14210 (rows_from_pos_range, mouse_face_from_buffer_pos)
14211 (fast_find_string_pos, mouse_face_from_string_pos)
14212 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14214 (safe_call, init_from_display_pos, handle_fontified_prop)
14215 (handle_single_display_spec, load_overlay_strings)
14216 (with_echo_area_buffer, setup_echo_area_for_printing)
14217 (display_echo_area, echo_area_display)
14218 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
14219 (update_tool_bar, hscroll_window_tree, redisplay_internal)
14220 (redisplay_window, dump_glyph_row, display_mode_line)
14221 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
14222 (handle_display_spec, display_prop_string_p):
14223 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14224 (handle_single_display_spec, build_desired_tool_bar_string)
14225 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
14226 (get_specified_cursor_type):
14227 Check that fixnums are in proper range for system types.
14228 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
14229 (Flookup_image_map):
14230 Don't assume fixnums fit in int.
14231 (compare_overlay_entries):
14232 Avoid mishandling comparisons due to subtraction overflow.
14233 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
14234 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
14235 (handle_tool_bar_click):
14236 Use int, not unsigned, since we prefer signed and the signedness
14237 doesn't matter here.
14238 (get_next_display_element, next_element_from_display_vector):
14239 Use int, not EMACS_INT, when int is wide enough.
14240 (start_hourglass): Use duration_to_sec_usec to do proper
14241 overflow checking on durations.
14242 * xfaces.c (Fbitmap_spec_p):
14243 Check that fixnums are in proper range for system types.
14244 (compare_fonts_by_sort_order):
14245 Avoid mishandling comparisons due to subtraction overflow.
14246 (Fx_family_fonts, realize_basic_faces):
14247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14248 (Fx_family_fonts):
14249 Don't assume fixnum fits in int.
14250 Use SAFE_ALLOCA_LISP, not alloca.
14251 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
14252 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
14253 (face_at_buffer_position, face_for_overlay_string)
14254 (face_at_string_position):
14255 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14256 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
14257 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
14258 (Fx_show_tip):
14259 Check that fixnums are in proper range for system types.
14260 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
14261 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
14262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14263 (Fx_change_window_property): Don't assume fixnums fit in int.
14264 * xfont.c (xfont_chars_supported):
14265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14266 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
14267 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
14268 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14269 * xml.c (parse_region):
14270 * xrdb.c (magic_file_p):
14271 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14272 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
14273 (x_get_local_selection, x_reply_selection_request)
14274 (x_handle_selection_request, wait_for_property_change):
14275 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14276 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
14277 short is wide enough.
14278 (x_send_client_event): Don't assume fixnum fits in int.
14279 * xterm.c (x_x_to_emacs_modifiers):
14280 Don't assume EMACS_INT overflows nicely into int.
14281 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
14282 may come from Lisp.
14283 (handle_one_xevent): NATNUMP can eval its arg twice.
14284 (x_connection_closed):
14285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14286 * xterm.h: Adjust decls to match defn changes elsewhere.
14287 (struct scroll_bar): Use struct vectorlike_header
14288 rather than rolling our own approximation.
14289 (SCROLL_BAR_VEC_SIZE): Remove; not used.
14290
142912012-05-25 Glenn Morris <rgm@gnu.org>
14292
14293 * lisp.mk (lisp): Update for more files being compiled now.
14294
142952012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
14296
14297 * lread.c: Remove `read_pure' which makes no difference.
14298 (read_pure): Remove var.
14299 (unreadpure): Remove function.
14300 (readevalloop): Don't call read_list with -1 flag.
14301 (read1, read_vector): Don't test read_pure any more.
14302 (read_list): Simplify.
14303
14304 * fileio.c, character.h: Minor style tweaks.
14305
143062012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
14307
14308 * window.h (clip_changed): Remove useless declaration.
14309
143102012-05-22 Juanma Barranquero <lekktu@gmail.com>
14311
14312 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
14313 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
14314
143152012-05-22 Paul Eggert <eggert@cs.ucla.edu>
14316
14317 Remove src/m/*.
14318 This directory predates autoconf and is no longer needed nowadays.
14319 Move its few remaining bits of functionality to where they're needed.
14320 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
14321 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
14322 * m/template.h: Remove.
14323 * Makefile.in (M_FILE): Remove. All uses removed.
14324 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
14325 * lisp.h (USE_LSB_TAG):
14326 * mem-limits.h (EXCEEDS_LISP_PTR):
14327 Use VAL_MAX, not VALBITS, in #if.
14328 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
14329 (EMACS_UINT): Define unconditionally now.
14330 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
14331 (BITS_PER_EMACS_INT): New constants, replacing
14332 what used to be in config.h, but not useful in #if.
14333 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
14334 define them any more.
14335 (VAL_MAX): New macro.
14336 (VALMASK): Use it.
14337 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
14338 BITS_PER_EMACS_INT, in #if.
14339 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
14340 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
14341 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
14342 * s/ms-w32.h (DATA_START):
14343 Move here from removed file m/intel386.h.
14344 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
14345 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
14346
143472012-05-21 Paul Eggert <eggert@cs.ucla.edu>
14348
14349 Assume C89 or later.
14350 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
14351 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
14352 (xrealloc):
14353 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
14354 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
14355 * textprop.c, tparam.c (NULL): Remove.
14356 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
14357 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
14358 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
14359 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14360 * xterm.c (input_signal_count): Assume volatile works.
14361
143622012-05-21 Ken Brown <kbrown@cornell.edu>
14363
14364 * xgselect.c (xg_select): Fix first argument in call to 'select'
14365 (bug#11508).
14366
143672012-05-20 Ken Brown <kbrown@cornell.edu>
14368
14369 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
14370 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
14371
143722012-05-19 Ken Brown <kbrown@cornell.edu>
14373
14374 * xfns.c (x_in_use): Remove `static' qualifier.
14375 * xterm.h (x_in_use): Declare.
14376 * xgselect.c: Include xterm.h.
14377 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14378 and `display_arg' (bug#9754).
14379
143802012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14381
14382 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14383
14384 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14385 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14386
143872012-05-18 Eli Zaretskii <eliz@gnu.org>
14388
14389 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14390
14391 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
14392 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
14393
14394 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14395 reference to image_cache->refcount.
14396 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14397
143982012-05-17 Juri Linkov <juri@jurta.org>
14399
14400 * search.c (Fword_search_regexp, Fword_search_backward)
14401 (Fword_search_forward, Fword_search_backward_lax)
14402 (Fword_search_forward_lax): Move functions to isearch.el
14403 (bug#10145, bug#11381).
14404
144052012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14406
14407 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14408
144092012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14410
14411 * lread.c (init_obarray): Declare Qt and Qnil as special.
14412
144132012-05-14 Glenn Morris <rgm@gnu.org>
14414
14415 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
14416 Put "libexec" before "bin", for the sake of init_callproc_1.
14417
144182012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14419
14420 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14421
14422 * unexaix.c: Port to more-recent AIX compilers.
14423 (report_error, report_error_1, make_hdr, copy_sym)
14424 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14425 Make arguments const char *, not char *, to avoid violations of C
14426 standard and to fix some AIX warnings reported by Gilles Pion.
14427
144282012-05-14 Eli Zaretskii <eliz@gnu.org>
14429
14430 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14431 already have overlays loaded.
14432 (handle_single_display_spec): Before returning without displaying
14433 fringe bitmap, synchronize the bidi iterator with the main display
14434 iterator, by calling iterate_out_of_display_property.
14435 (iterate_out_of_display_property): Detect buffer iteration by
14436 testing that it->string is a Lisp string.
14437 (get_next_display_element): When the current object is exhausted,
14438 and there's something on it->stack, call set_iterator_to_next to
14439 proceed with what's on the stack, instead of returning zero.
14440 (set_iterator_to_next): If called at the end of a Lisp string,
14441 proceed to consider_string_end without incrementing string
14442 position. Don't increment display vector index past the end of
14443 the display vector. (Bug#11417)
14444 (pos_visible_p): Don't report a position visible when move_it_to
14445 stopped at the last line of window, which happens to be scanned
14446 backwards by the bidi iteration. (Bug#11464)
14447
144482012-05-14 Eli Zaretskii <eliz@gnu.org>
14449
14450 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14451 and right-margin display specs even if the spec is invalid or we
14452 are on a TTY, and thus unable to display on the fringes.
14453 That's because the text with the property will not be displayed anyway,
14454 so we need to signal to the caller that this is a "replacing"
14455 display spec. This fixes display when the spec is invalid or we
14456 are on a TTY.
14457
144582012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14459
14460 * unexaix.c (make_hdr): Fix typo in prototype.
14461 This bug broke the build on AIX. Problem reported by Gilles Pion.
14462
144632012-05-14 Michael Albinus <michael.albinus@gmx.de>
14464
14465 * keyboard.c (kbd_buffer_get_event): Read special events also in
14466 batch mode. (Bug#11415)
14467
144682012-05-12 Glenn Morris <rgm@gnu.org>
14469
14470 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14471
144722012-05-12 Eli Zaretskii <eliz@gnu.org>
14473
14474 * lisp.mk (lisp): Add newcomment.elc.
14475
144762012-05-12 Glenn Morris <rgm@gnu.org>
14477
14478 * Makefile.in (MKDIR_P): New, set by configure.
14479 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14480
144812012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14482
14483 Remove unused function hourglass_started.
14484 * dispextern.h (hourglass_started):
14485 * w32fns.c (hourglass_started):
14486 * xdisp.c (hourglass_started): Remove.
14487
144882012-05-10 Juanma Barranquero <lekktu@gmail.com>
14489
14490 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14491 Update dependencies.
14492
144932012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14494
14495 * xgselect.c (xg_select): Put maxfds+1 into a var.
14496 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14497
14498 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14499
145002012-05-10 Dave Abrahams <dave@boostpro.com>
14501
14502 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14503 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14504
145052012-05-09 Michael Albinus <michael.albinus@gmx.de>
14506
14507 * dbusbind.c (xd_registered_buses): New internal Lisp object.
14508 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
14509 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14510 Initialize xd_registered_buses.
14511
145122012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14513
14514 Untag more efficiently if USE_LSB_TAG.
14515 This is based on a proposal by YAMAMOTO Mitsuharu in
14516 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14517 For an admittedly artificial (nth 8000 longlist) benchmark on
14518 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14519 Emacs's overall text size by 1%.
14520 * lisp.h (XUNTAG): New macro.
14521 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14522 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14523 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14524 * eval.c (Fautoload):
14525 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14526 * frame.h (XFRAME): Use XUNTAG.
14527
14528 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14529 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14530 Remove unportable assumptions about print widths of types like
14531 dbus_uint32_t.
14532 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14533 intptr_t when converting between pointer and integer, to avoid GCC
14534 warnings about wrong width.
14535
145362012-05-09 Eli Zaretskii <eliz@gnu.org>
14537
14538 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14539 stack for each reader_thread, instead of defaulting to 8MB
14540 determined by the linker. This avoids failures in creating
14541 subprocesses on Windows 7, see the discussion in this thread:
14542 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14543
145442012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14545
14546 Fix up display of the *Minibuf-0* buffer in the mini window.
14547 * keyboard.c (read_char): Don't clear the echo area if there's no
14548 message to clear.
14549 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
14550 contents of *Minibuf-0*) if there's no message displayed in its stead.
14551
145522012-05-07 Michael Albinus <michael.albinus@gmx.de>
14553
14554 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14555 batch mode.
14556
145572012-05-06 Chong Yidong <cyd@gnu.org>
14558
14559 * lisp.mk (lisp): Update.
14560
145612012-05-05 Jim Meyering <meyering@redhat.com>
14562
14563 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14564
145652012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14566
14567 * data.c (PUT_ERROR): New macro.
14568 (syms_of_data): Use it. Add new error type `user-error'.
14569 * undo.c (user_error): New function.
14570 (Fprimitive_undo): Use it.
14571 * print.c (print_error_message): Adjust print style for `user-error'.
14572 * keyboard.c (user_error): New function.
14573 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14574
145752012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14576
14577 Do not limit current-time-string to years 1000..9999.
14578 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14579 (Fcurrent_time_string): Support any year that is supported by the
14580 underlying localtime representation. Don't use asctime, as it
14581 has undefined behavior for years outside the range -999..9999.
14582
145832012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14584
14585 Fix race conditions involving setenv, gmtime, localtime, asctime.
14586 Without this fix, interrupts could mess up code that uses these
14587 nonreentrant functions, since setting TZ invalidates existing
14588 tm_zone or tzname values, and since most of these functions return
14589 pointers to static storage.
14590 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14591 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14592 Grow the critical sections to include not just invoking
14593 localtime/gmtime, but also accessing these functions' results
14594 including their tm_zone values if any, and any related TZ setting.
14595 (format_time_string): Last arg is now struct tm *, not struct tm **,
14596 so that the struct tm is saved in the critical section.
14597 All callers changed. Simplify allocation of initial buffer, partly
14598 motivated by the fact that memory allocation needs to be outside
14599 the critical section.
14600
146012012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14602
14603 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14604 with RESET_INTERVAL.
14605
14606 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14607 Remove duplicated buffer name initialization.
14608
146092012-05-02 Jim Meyering <jim@meyering.net>
14610
14611 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14612
14613 * xfns.c (x_window): Use xstrdup (Bug#11375).
14614
146152012-05-02 Eli Zaretskii <eliz@gnu.org>
14616
14617 * xdisp.c (pos_visible_p): If already at a newline from the
14618 display string before the 'while' loop, don't walk back the glyphs
14619 from it3.glyph_row. Solves assertion violation when the display
14620 string begins with a newline (egg.el). (Bug#11367)
14621
146222012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14623
14624 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14625 Move to simple.el.
14626
146272012-05-01 Glenn Morris <rgm@gnu.org>
14628
14629 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14630 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14631 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14632 All were removed before 23.1.
14633
14634 * dispnew.c: Remove HAVE_LIBNCURSES test;
14635 it is always true on relevant platforms.
14636
14637 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14638 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14639
14640 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14641
146422012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14643
14644 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14645 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14646 Remove.
14647
146482012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14649
14650 Do not avoid creating empty evaporating overlays (Bug#9642).
14651 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14652 That is, do not delete an evaporating overlay if it becomes
14653 empty after its bounds are adjusted to fit within its buffer.
14654 This fix caused other problems, and I'm reverting it until we get
14655 to the bottom of them.
14656
146572012-04-27 Chong Yidong <cyd@gnu.org>
14658
14659 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14660
146612012-04-27 Eli Zaretskii <eliz@gnu.org>
14662
14663 * xdisp.c (pos_visible_p): If the window start position is beyond
14664 ZV, start the display from buffer beginning. Prevents assertion
14665 violation in init_iterator when the minibuffer window is scrolled
14666 via the scroll bar.
14667
14668 * window.c (window_scroll_pixel_based): Likewise.
14669
146702012-04-27 Chong Yidong <cyd@gnu.org>
14671
14672 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14673
146742012-04-27 Glenn Morris <rgm@gnu.org>
14675
14676 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14677 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14678
146792012-04-27 Eli Zaretskii <eliz@gnu.org>
14680
14681 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14682 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14683
146842012-04-26 Eli Zaretskii <eliz@gnu.org>
14685
14686 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14687 display element, check also the underlying string or buffer
14688 character. (Bug#11341)
14689
14690 * w32menu.c: Include w32heap.h.
14691 (add_menu_item): If the call to AppendMenuW (via
14692 unicode_append_menu) fails, disable Unicode menus only if we are
14693 running on Windows 9X/Me.
14694
146952012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14696
14697 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14698 (xgetint): Add missing shift for LSB tags.
14699
147002012-04-24 Martin Rudalics <rudalics@gmx.at>
14701
14702 * keyboard.c (read_char): Don't wipe echo area for select window
14703 events: These might get delayed via `mouse-autoselect-window'
14704 (Bug#11304).
14705
147062012-04-24 Juanma Barranquero <lekktu@gmail.com>
14707
14708 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14709 manipulation of :loaded-from data.
14710
147112012-04-23 Juanma Barranquero <lekktu@gmail.com>
14712
14713 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14714 now a cons (bug#11311).
14715
147162012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14717
14718 Do not create empty overlays with the evaporate property (Bug#9642).
14719 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14720 if it becomes empty after its bounds are adjusted to fit within
14721 its buffer. Without this fix, in a nonempty buffer (let ((o
14722 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14723 yields an empty overlay that has the evaporate property, which is
14724 not supposed to happen.
14725
14726 Fix minor GTK3 problems found by static checking.
14727 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14728 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14729 (struct _EmacsFixedClass, emacs_fixed_get_type):
14730 Move decls here from emacsgtkfixed.h, since they needn't be public.
14731 (emacs_fixed_get_type): Now static.
14732 (emacs_fixed_class_init): Omit unused local.
14733 (emacs_fixed_child_type): Remove; unused.
14734 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14735 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14736 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14737 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14738 (EMACS_FIXED_GET_CLASS): Remove; unused.
14739 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14740
14741 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14742 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14743
147442012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14745
14746 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14747 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14748 (__malloc_size_t, __malloc_ptrdiff_t):
14749 Remove. All uses removed, replaced by the definiens if needed,
14750 since we can assume C89 or better now.
14751 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14752 (protect_malloc_state, align, get_contiguous_space)
14753 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14754 (malloc_atfork_handler_child, malloc_enable_thread)
14755 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14756 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14757 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14758 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14759 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14760 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14761 Define using prototypes, not old style.
14762 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14763 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14764 (align): Don't assume that signed integer overflow wraps around.
14765 Omit unused local var.
14766 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14767 (_free_internal_nolock, memalign, mallochook, reallochook):
14768 Omit no-longer-needed casts.
14769 (valloc): Use getpagesize, not __getpagesize.
14770 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14771 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14772
14773 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14774
147752012-04-22 Michael Albinus <michael.albinus@gmx.de>
14776
14777 Move functions from C to Lisp. Make non-blocking method calls
14778 the default. Implement further D-Bus standard interfaces.
14779
14780 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14781 (QCdbus_request_name_allow_replacement)
14782 (QCdbus_request_name_replace_existing)
14783 (QCdbus_request_name_do_not_queue)
14784 (QCdbus_request_name_reply_primary_owner)
14785 (QCdbus_request_name_reply_in_queue)
14786 (QCdbus_request_name_reply_exists)
14787 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14788 (QCdbus_registered_serial, QCdbus_registered_method)
14789 (QCdbus_registered_signal): New Lisp objects.
14790 (XD_DEBUG_MESSAGE): Use sizeof.
14791 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14792 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14793 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14794 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14795 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14796 (xd_signature, xd_append_arg): Allow float for integer types.
14797 (xd_get_connection_references): New function.
14798 (xd_get_connection_address): Rename from xd_initialize.
14799 Return cached address.
14800 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14801 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14802 level.
14803 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14804 Return number of refcounts.
14805 (Fdbus_get_unique_name): Make stronger parameter check.
14806 (Fdbus_message_internal): New defun.
14807 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14808 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14809 (Fdbus_send_signal, Fdbus_register_service)
14810 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14811 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14812 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14813 (Vdbus_compiled_version, Vdbus_runtime_version)
14814 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14815 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14816 (Vdbus_message_type_signal): New defvars.
14817 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14818 Adapt docstring.
14819
148202012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14821
14822 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14823 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14824 Do not assume ptrdiff_t is the same width as 'int'.
14825
14826 * alloc.c: Handle unusual debugging option combinations.
14827 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14828 since the two debugging options are incompatible.
14829 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14830 is defined.
14831 (mem_init, mem_insert, mem_insert_fixup):
14832 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14833 (NEED_MEM_INSERT): Remove; no longer needed.
14834
148352012-04-22 Leo Liu <sdl.web@gmail.com>
14836
14837 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14838
148392012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14840
14841 * sysdep.c [__FreeBSD__]: Minor cleanups.
14842 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14843 Use Emacs indenting style more consistently. Avoid some casts.
14844 Use 'double' consistently rather than mixing 'float' and 'double'.
14845
148462012-04-21 Eduard Wiebe <usenet@pusto.de>
14847
14848 * sysdep.c (list_system_processes, system_process_attributes):
14849 Add implementation for FreeBSD (Bug#5243).
14850
148512012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14852
14853 * lisp.mk (lisp): Update.
14854
148552012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14856
14857 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14858 It is never used otherwise.
14859
148602012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14861
14862 * print.c (print_preprocess): Only check print_depth if print-circle
14863 is nil.
14864 (print_object): Check for cycles even when print-circle is nil and
14865 print-gensym is t, but only check print_depth if print-circle is nil.
14866
148672012-04-20 Chong Yidong <cyd@gnu.org>
14868
14869 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14870 set the status to "failed" and ensure that sentinel is run.
14871
148722012-04-20 Glenn Morris <rgm@gnu.org>
14873
14874 * process.c (Fset_process_inherit_coding_system_flag)
14875 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14876 (Fmake_network_process, Fmake_serial_process): Doc fix.
14877
148782012-04-20 Eli Zaretskii <eliz@gnu.org>
14879
14880 * xdisp.c (string_buffer_position_lim): Limit starting position to
14881 BEGV.
14882 (set_cursor_from_row): If called for a mode-line or header-line
14883 row, return zero immediately.
14884 (try_cursor_movement): If inside continuation line, don't back up
14885 farther than the first row after the header line, if any.
14886 Don't consider the header-line row as "partially visible", even if
14887 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14888
148892012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14890
14891 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14892 (bug#11238).
14893
148942012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
148952012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14896
14897 configure: new option --enable-gcc-warnings (Bug#11207)
14898 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14899 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14900 (ALL_CFLAGS): Use new macros rather than old.
14901 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14902 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14903 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14904 -Wunused-result, -Wunused-variable. This should go away once
14905 the Emacs and Gnulib regex code is merged.
14906 (xmalloc, xrealloc): Now static.
14907
149082012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14909
14910 * dired.c (Fsystem_groups): Remove unused local.
14911
149122012-04-17 Glenn Morris <rgm@gnu.org>
14913
14914 * dired.c (Fsystem_users): Doc fix.
14915
149162012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14917
14918 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14919 (syms_of_dired): Add them.
14920
149212012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14922
14923 Fix minor alloc.c problems found by static checking.
14924 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14925 New extern decls, to avoid calling undeclared functions.
14926 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14927 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14928 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14929 (NEED_MEM_INSERT): New macro.
14930 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14931 Remove one incorrect comment and fix another.
14932
14933 Fix minor ralloc.c problems found by static checking.
14934 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14935 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14936 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14937 (r_alloc_sbrk): Now static.
14938
14939 Improve ralloc.c interface checking.
14940 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14941 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14942 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14943 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14944 [REL_ALLOC]: ... to here, to check interface.
14945 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14946 Remove decls. This fixes an "It stinks!".
14947
14948 * alloc.c (which_symbols): Fix alignment issue / type clash.
14949
149502012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14951
14952 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14953 (struct Lisp_Misc_Any): Likewise.
14954 (struct Lisp_Free): Likewise.
14955 * alloc.c (union aligned_Lisp_Symbol): Define.
14956 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14957 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14958 (union aligned_Lisp_Misc): Define.
14959 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14960 aligned_Lisp_Misc instead of union Lisp_Misc.
14961 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14962
149632012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14964
14965 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14966 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14967 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14968 * s/netbsd.h, s/sol2-6.h:
14969 Remove definition of GC_MARK_STACK, since the default now works.
14970 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14971 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14972 no longer the default.
14973 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14974
149752012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14976
14977 * lread.c (lisp_file_lexically_bound_p):
14978 Fix hang at ";-*-\n" (bug#11238).
14979
149802012-04-14 Eli Zaretskii <eliz@gnu.org>
14981
14982 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14983 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14984
149852012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14986
14987 * nsterm.m (constrainFrameRect): Always constrain when there is only
14988 one screen (Bug#10962).
14989
149902012-04-13 Ken Brown <kbrown@cornell.edu>
14991
14992 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14993
149942012-04-13 Reuben Thomas <rrt@sc3d.org>
14995
14996 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14997
149982012-04-11 Daniel Colascione <dancol@dancol.org>
14999
15000 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
15001 against is gone. It's better to use vfork now so that when Cygwin
15002 gains a new, working vfork, we use it automatically (bug#10398).
15003
150042012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
15005
15006 * window.c (save_window_save): Obey window-point-insertion-type.
15007
150082012-04-11 Glenn Morris <rgm@gnu.org>
15009
15010 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
15011
150122012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
15013
15014 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
15015
150162012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
15017
15018 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
15019 (force_quit_count): New var.
15020 (handle_interrupt): Use it.
15021
150222012-04-10 Juanma Barranquero <lekktu@gmail.com>
15023
15024 * w32.c (w32_delayed_load): Record the full path of the library
15025 being loaded (bug#10424).
15026
150272012-04-09 Glenn Morris <rgm@gnu.org>
15028
15029 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
15030 not just in the obarray, before snarfing them. (Bug#11036)
15031
15032 * Makefile.in ($(leimdir)/leim-list.el):
15033 Pass EMACS rather than BUILT_EMACS.
15034
150352012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
15036
15037 * process.c (make_process):
15038 * process.h: Add integer `gnutls_handshakes_tried' member to
15039 process struct.
15040
15041 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
15042 Add convenience `GNUTLS_LOG2i' macro.
15043
15044 * gnutls.c (gnutls_log_function2i): Convenience log function.
15045 (emacs_gnutls_read): Use new log functions,
15046 `gnutls_handshakes_tried' process member, and
15047 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
15048 attempts per process (connection).
15049
150502012-04-09 Chong Yidong <cyd@gnu.org>
15051
15052 * eval.c (Fuser_variable_p, user_variable_p_eh)
15053 (lisp_indirect_variable): Functions deleted.
15054 (Fdefvar): Caller changed.
15055
15056 * callint.c (Finteractive, Fcall_interactively):
15057 * minibuf.c (Fread_variable): Callers changed.
15058
150592012-04-09 Eli Zaretskii <eliz@gnu.org>
15060
15061 * xdisp.c (set_cursor_from_row): If the display string appears in
15062 the buffer at position that is closer to point than the position
15063 after the display string, display the cursor on the first glyph of
15064 the display string. Fixes cursor display when a 'display' text
15065 property immediately follows invisible text. (Bug#11094)
15066
150672012-04-09 Paul Eggert <eggert@cs.ucla.edu>
15068
15069 composite.c: use 'double' consistently
15070 * composite.c (get_composition_id): Use 'double' consistently
15071 instead of converting 'float' to 'double' and vice versa; this is
15072 easier to understand and avoids a GCC warning.
15073
150742012-04-09 Glenn Morris <rgm@gnu.org>
15075
15076 * Makefile.in: Generate leim-list with bootstrap-emacs, in
15077 preparation for dumping it with emacs. (Bug#4789)
15078 (leimdir): New variable.
15079 ($(leimdir)/leim-list.el): New rule.
15080 (emacs$(EXEEXT)): Depend on leim-list.el.
15081
15082 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
15083 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
15084 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
15085
150862012-04-08 Andreas Schwab <schwab@linux-m68k.org>
15087
15088 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
15089 proper alignment.
15090
150912012-04-07 Juanma Barranquero <lekktu@gmail.com>
15092
15093 * xml.c (init_libxml2_functions) [WINDOWSNT]:
15094 Remove unused local variable.
15095
150962012-04-07 Paul Eggert <eggert@cs.ucla.edu>
15097
15098 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
15099 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
15100 (mark_memory): Mark Lisp_Objects only if pointers might hide in
15101 objects, as mark_maybe_pointer will catch them otherwise.
15102 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
15103 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
15104
151052012-04-07 Paul Eggert <eggert@cs.ucla.edu>
15106
15107 Fix typo that broke non-Windows builds.
15108 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
15109
151102012-04-07 Eli Zaretskii <eliz@gnu.org>
15111
15112 Support building on MS-Windows with libxml2.
15113
15114 * makefile.w32-in (OBJ2): Add xml.$(O).
15115 (GLOBAL_SOURCES): Add xml.c.
15116 ($(BLD)/xml.$(O)): New dependency list.
15117
15118 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
15119 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
15120 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
15121 [!WINDOWSNT]: New macros.
15122 (init_libxml2_functions, libxml2_loaded_p): New functions.
15123 (parse_region): Call fn_xmlCheckVersion instead of using the macro
15124 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
15125 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
15126 Calls xmlCleanupParser only if libxml2 was loaded (or statically
15127 linked in).
15128 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
15129 Call init_libxml2_functions before calling libxml2 functions.
15130 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
15131
15132 * emacs.c: Don't include libxml/parser.h.
15133 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
15134 xmlCleanupParser directly.
15135
15136 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
15137
151382012-04-07 Eli Zaretskii <eliz@gnu.org>
15139
15140 * indent.c (Fvertical_motion): If there is a display string at
15141 point, use it.vpos to compute how many lines to backtrack after
15142 move_it_to point. (Bug#11133)
15143
151442012-04-06 Eli Zaretskii <eliz@gnu.org>
15145
15146 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
15147 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
15148 about subtle differences between FETCH_CHAR* and STRING_CHAR*
15149 macros related to unification of CJK characters. For the details,
15150 see the discussion following the message here:
15151 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
15152
151532012-04-04 Chong Yidong <cyd@gnu.org>
15154
15155 * keyboard.c (Vdelayed_warnings_list): Doc fix.
15156
151572012-04-01 Eli Zaretskii <eliz@gnu.org>
15158
15159 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
15160 instead of alloca. (Bug#11138)
15161
151622012-04-01 Andreas Schwab <schwab@linux-m68k.org>
15163
15164 * w32menu.c (is_simple_dialog): Properly check lisp types.
15165 (Bug#11141)
15166
151672012-03-31 Eli Zaretskii <eliz@gnu.org>
15168
15169 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
15170 position we get to after a call to move_it_to fails the
15171 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
15172 only if we wind up in a string from display property. (Bug#11063)
15173
15174 * window.c (Fdelete_other_windows_internal): Invalidate the row
15175 and column information about mouse highlight, so that redisplay
15176 restores it after reallocating the glyph matrices. (Bug#7464)
15177
15178 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
15179 string comes from a `display' text property, use the buffer
15180 position of that property as if we actually saw that position in
15181 the row's glyphs.
15182 (move_it_by_lines): Remove the assertion that
15183 "it->current_x == 0 && it->hpos == 0" which can be legitimately
15184 violated when there's a before-string at the beginning of a line.
15185 (Bug#11063)
15186
151872012-03-30 Eli Zaretskii <eliz@gnu.org>
15188
15189 * xdisp.c (append_space_for_newline): If the default face was
15190 remapped, use the remapped face for the appended newline.
15191 (extend_face_to_end_of_line): Use the remapped default face for
15192 extending the face to the end of the line.
15193 (display_line): Call extend_face_to_end_of_line when the default
15194 face was remapped. (Bug#11068)
15195
151962012-03-29 Eli Zaretskii <eliz@gnu.org>
15197
15198 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
15199
152002012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15201
15202 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
15203
152042012-03-27 Glenn Morris <rgm@gnu.org>
15205
15206 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
15207 Doc fixes.
15208
152092012-03-26 Kenichi Handa <handa@m17n.org>
15210
15211 * dispextern.h (struct glyph): Fix previous change. Change the
15212 bit length of glyphless.ch to 25 (Bug#11082).
15213
152142012-03-26 Chong Yidong <cyd@gnu.org>
15215
15216 * keyboard.c (Vselection_inhibit_update_commands): New variable.
15217 (command_loop_1): Use it; inhibit selection update for
15218 handle-select-window too (Bug#8996).
15219
152202012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
15221
15222 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
15223
152242012-03-25 Kenichi Handa <handa@m17n.org>
15225
15226 * dispextern.h (struct glyph): Change the bit length of
15227 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
15228
152292012-03-24 Eli Zaretskii <eliz@gnu.org>
15230
15231 * s/ms-w32.h (tzname): Include time.h before redirecting to
15232 _tzname. Fixes the MSVC build. (Bug#9960)
15233
152342012-03-24 Andreas Schwab <schwab@linux-m68k.org>
15235
15236 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
15237 characters.
15238
15239 * xterm.c (XTread_socket): Only modify handling_signal if
15240 !SYNC_INPUT. (Bug#11080)
15241
152422012-03-23 Eli Zaretskii <eliz@gnu.org>
15243
15244 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
15245 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
15246 when fetching a multibyte character consumes more bytes than
15247 CHAR_BYTES returns, due to unification of CJK characters in
15248 string_char. (Bug#11073)
15249
152502012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
15251
15252 * process.c (wait_reading_process_output): Handle pty disconnect
15253 by refraining from sending oneself a SIGCHLD (bug#10933).
15254
152552012-03-22 Chong Yidong <cyd@gnu.org>
15256
15257 * dispextern.h (struct it): New member string_from_prefix_prop_p.
15258
15259 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
15260 Mark string as coming from a prefix property.
15261 (handle_face_prop): Use default face for prefix strings (Bug#4281).
15262 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
15263
152642012-03-21 Chong Yidong <cyd@gnu.org>
15265
15266 * xfaces.c (Vface_remapping_alist): Doc fix.
15267
152682012-03-20 Eli Zaretskii <eliz@gnu.org>
15269
15270 * w32proc.c (Fw32_set_console_codepage)
15271 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
15272 Doc fixes.
15273
152742012-03-20 Chong Yidong <cyd@gnu.org>
15275
15276 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
15277 to reflect default non-nil value of redisplay-dont-pause.
15278
152792012-03-19 Kenichi Handa <handa@m17n.org>
15280
15281 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
15282 it fit in a valid range (Bug#11003).
15283
152842012-03-18 Eli Zaretskii <eliz@gnu.org>
15285
15286 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
15287 that is not from display property, accept the row as a "cursor
15288 row" if one of the string's character has a non-nil `cursor'
15289 property. Fixes cursor positioning when there are newlines in
15290 overlay strings, e.g. in icomplete.el. (Bug#11035)
15291
152922012-03-12 Paul Eggert <eggert@cs.ucla.edu>
15293
15294 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
15295
152962012-03-12 Chong Yidong <cyd@gnu.org>
15297
15298 * eval.c (inhibit_lisp_code): Rename from
15299 inhibit_window_configuration_change_hook; move from window.c.
15300
15301 * xfns.c (unwind_create_frame_1, Fx_create_frame):
15302 * window.c (run_window_configuration_change_hook)
15303 (syms_of_window): Callers changed.
15304
153052012-03-11 Chong Yidong <cyd@gnu.org>
15306
15307 * keymap.c (Fkey_description): Doc fix (Bug#9700).
15308
15309 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
15310
153112012-03-10 Chong Yidong <cyd@gnu.org>
15312
15313 * frame.c (other_visible_frames): Don't assume the selected frame
15314 is visible (Bug#10955).
15315
153162012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
15317
15318 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
15319
153202012-03-08 Jan Djärv <jan.h.d@swipnet.se>
15321
15322 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
15323 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
15324 zero (Bug#10954).
15325
153262012-03-03 Glenn Morris <rgm@gnu.org>
15327
15328 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
15329
153302012-03-02 Eli Zaretskii <eliz@gnu.org>
15331
15332 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
15333 position past the first glyph_row that ends at ZV. (Bug#10902)
15334 (redisplay_window, next_element_from_string): Fix typos in
15335 comments.
15336 (redisplay_window): Pass to move_it_vertically the margin in
15337 pixels, not in screen lines.
15338
153392012-03-02 Glenn Morris <rgm@gnu.org>
15340
15341 * buffer.c (buffer-list-update-hook): Doc fix.
15342
153432012-02-29 Eli Zaretskii <eliz@gnu.org>
15344
15345 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
15346 push_it before setting up the iterator for the first overlay
15347 string, even if we have an empty string loaded.
15348 (next_overlay_string): If there's an empty string on the iterator
15349 stack, pop the stack. (Bug#10903)
15350
153512012-02-25 Paul Eggert <eggert@cs.ucla.edu>
15352
15353 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
15354 Suggested by Stefan Monnier in
15355 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
15356 * alloc.c (widen_to_Lisp_Object): New static function.
15357 (mark_memory): Also mark Lisp_Objects by fetching pointer words
15358 and widening them to Lisp_Objects. This would work even if
15359 USE_LSB_TAG is defined and wide integers are used, which might
15360 happen in a future version of Emacs.
15361
153622012-02-25 Chong Yidong <cyd@gnu.org>
15363
15364 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15365 Doc fix.
15366
15367 * xselect.c (Fx_selection_exists_p): Doc fix.
15368 (x_clipboard_manager_save_all): Print an informative message
15369 before saving to clipboard manager.
15370
153712012-02-24 Chong Yidong <cyd@gnu.org>
15372
15373 * keyboard.c (process_special_events): Handle all X selection
15374 requests in kbd_buffer, not just the next one (Bug#8869).
15375
153762012-02-23 Chong Yidong <cyd@gnu.org>
15377
15378 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15379 call when setting menu-bar-lines and tool-bar-lines parameters.
15380 (unwind_create_frame_1): New helper function.
15381
15382 * window.c (inhibit_window_configuration_change_hook): New var.
15383 (run_window_configuration_change_hook): Obey it.
15384 (syms_of_window): Initialize it.
15385
153862012-02-22 Chong Yidong <cyd@gnu.org>
15387
15388 * xterm.c (x_draw_image_relief): Add missing type check for
15389 Vtool_bar_button_margin (Bug#10743).
15390
153912012-02-21 Chong Yidong <cyd@gnu.org>
15392
15393 * fileio.c (Vfile_name_handler_alist): Doc fix.
15394
15395 * buffer.c (Fget_file_buffer): Protect against invalid file
15396 handler return value.
15397
153982012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15399
15400 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15401 when computing $valmask.
15402
15403 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15404 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15405 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15406 It's useless in that case, and it can cause problems on hosts
15407 that allocate halves of EMACS_INT values separately.
15408 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15409 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15410 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15411 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15412 it avoids undefined behavior on hosts where shifting right by more
15413 than the word width has undefined behavior.
15414
154152012-02-19 Chong Yidong <cyd@gnu.org>
15416
15417 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15418 (Funhandled_file_name_directory, Ffile_name_as_directory)
15419 (Fdirectory_file_name, Fexpand_file_name)
15420 (Fsubstitute_in_file_name): Protect against invalid file handler
15421 return values (Bug#10845).
15422
154232012-02-18 Eli Zaretskii <eliz@gnu.org>
15424
15425 * .gdbinit (pitx): Fix incorrect references to fields of the
15426 iterator stack.
15427
154282012-02-17 Chong Yidong <cyd@gnu.org>
15429
15430 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15431
154322012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15433
15434 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15435 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15436
154372012-02-15 Chong Yidong <cyd@gnu.org>
15438
15439 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15440 marked as special. Also, starting docstrings with * is obsolete.
15441
154422012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15443
15444 * gnutls.c (emacs_gnutls_write): Fix last change.
15445
154462012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15447
15448 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15449 send_process.
15450
154512012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15452
15453 * keymap.c (Fsingle_key_description): Handle char ranges.
15454
154552012-02-12 Chong Yidong <cyd@gnu.org>
15456
15457 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15458 as that creates a dangerous corner case.
15459
15460 * window.c (Fdelete_window_internal): Invalidate the mouse
15461 highlight (Bug#9904).
15462
154632012-02-12 Glenn Morris <rgm@gnu.org>
15464
15465 * xselect.c (Fx_own_selection_internal)
15466 (Fx_get_selection_internal, Fx_disown_selection_internal)
15467 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15468 * nsselect.m (Fx_own_selection_internal)
15469 (Fx_disown_selection_internal, Fx_selection_exists_p)
15470 (Fx_selection_owner_p, Fx_get_selection_internal):
15471 Sync docs and argument specs with the xselect.c versions.
15472
154732012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15474
15475 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15476
154772012-02-11 Eli Zaretskii <eliz@gnu.org>
15478
15479 * w32select.c (Fx_selection_exists_p): Sync doc string and
15480 argument list with xselect.c. (Bug#10783)
15481
15482 * w16select.c (Fx_selection_exists_p): Sync doc string and
15483 argument list with xselect.c. (Bug#10783)
15484
154852012-02-10 Glenn Morris <rgm@gnu.org>
15486
15487 * fns.c (Fsecure_hash): Doc fix.
15488
154892012-02-09 Kenichi Handa <handa@m17n.org>
15490
15491 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15492
154932012-02-07 Chong Yidong <cyd@gnu.org>
15494
15495 * buffer.c (Fbuffer_local_variables)
15496 (buffer_lisp_local_variables): Handle unbound vars correctly;
15497 don't let Qunbound leak into Lisp.
15498
154992012-02-07 Glenn Morris <rgm@gnu.org>
15500
15501 * image.c (Fimagemagick_types): Doc fix.
15502
15503 * image.c (imagemagick-render-type): Change it from a lisp object
15504 to an integer. Move the doc here from the lisp manual.
15505 Treat all values not equal to 0 the same.
15506
155072012-02-06 Chong Yidong <cyd@gnu.org>
15508
15509 * doc.c (store_function_docstring): Avoid applying docstring of
15510 alias to base function (Bug#2603).
15511
155122012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15513
15514 * .gdbinit (pp1, pv1): Remove redundant defines.
15515 (pr): Use pp.
15516
155172012-02-04 Chong Yidong <cyd@gnu.org>
15518
15519 * nsterm.m: Declare a global (Bug#10694).
15520
155212012-02-04 Eli Zaretskii <eliz@gnu.org>
15522
15523 * w32.c (get_emacs_configuration_options):
15524 Include --enable-checking, if specified, in the return value.
15525
155262012-02-04 Martin Rudalics <rudalics@gmx.at>
15527
15528 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15529 after rounding frame sizes. (Bug#9723)
15530
155312012-02-04 Eli Zaretskii <eliz@gnu.org>
15532
15533 * keyboard.c (adjust_point_for_property): Don't position point
15534 before BEGV. (Bug#10696)
15535
155362012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15537
15538 Handle overflow when computing char display width (Bug#9496).
15539 * character.c (char_width): Return EMACS_INT, not int.
15540 (char_width, c_string_width): Check for overflow when
15541 computing the width; this is possible now that individual
15542 characters can have unbounded width. Problem introduced
15543 by merge from Emacs 23 on 2012-01-19.
15544
155452012-02-02 Michael Albinus <michael.albinus@gmx.de>
15546
15547 * dbusbind.c (Fdbus_register_method): Mention the return value
15548 :ignore in the docstring.
15549
155502012-02-02 Glenn Morris <rgm@gnu.org>
15551
15552 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15553
15554 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15555 Unconditionally set to t. (Bug#10673)
15556 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15557 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15558 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15559
155602012-02-02 Kenichi Handa <handa@m17n.org>
15561
15562 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15563 0, do not call append_composite_glyph.
15564
155652012-02-02 Kenichi Handa <handa@m17n.org>
15566
15567 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15568 NULL (Bug#6988).
15569 (x_produce_glyphs): If the component of a composition is a null
15570 string, set it->pixel_width to 1 to avoid zero-width glyph.
15571
155722012-02-01 Eli Zaretskii <eliz@gnu.org>
15573
15574 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15575 first 2 arguments are identical. This makes inserting large
15576 output from a subprocess an order of magnitude faster on
15577 MS-Windows, where all sbrk'ed memory is always contiguous.
15578
155792012-01-31 Glenn Morris <rgm@gnu.org>
15580
15581 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15582 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15583 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15584
155852012-01-29 Glenn Morris <rgm@gnu.org>
15586
15587 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15588
155892012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15590
15591 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15592
155932012-01-28 Chong Yidong <cyd@gnu.org>
15594
15595 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15596
155972012-01-26 Chong Yidong <cyd@gnu.org>
15598
15599 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15600
15601 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15602 repeat counts (Bug#10507).
15603
156042012-01-26 Glenn Morris <rgm@gnu.org>
15605
15606 * lread.c (syms_of_lread): Doc fix.
15607
156082012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15609
15610 * coding.c (encode_designation_at_bol): Change return value to
15611 EMACS_INT.
15612
156132012-01-25 Chong Yidong <cyd@gnu.org>
15614
15615 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15616
156172012-01-21 Chong Yidong <cyd@gnu.org>
15618
15619 * floatfns.c (Fcopysign): Make the second argument non-optional,
15620 since nil is not allowed anyway.
15621
156222012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15623
15624 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15625 (send_process): Likewise.
15626
156272012-01-19 Martin Rudalics <rudalics@gmx.at>
15628
15629 * window.c (save_window_save, Fcurrent_window_configuration)
15630 (Vwindow_persistent_parameters): Do not use Qstate.
15631 Rewrite doc-strings.
15632
156332012-01-19 Kenichi Handa <handa@m17n.org>
15634
15635 * character.c (char_width): New function.
15636 (Fchar_width, c_string_width, lisp_string_width):
15637 Use char_width (Bug#9496).
15638
156392012-01-16 Martin Rudalics <rudalics@gmx.at>
15640
15641 * window.c (Vwindow_persistent_parameters): New variable.
15642 (Fset_window_configuration, save_window_save): Handle persistent
15643 window parameters.
15644
156452012-01-14 Eli Zaretskii <eliz@gnu.org>
15646
15647 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15648 thrashing the stack of the thread. (Bug#9087)
15649
156502012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15651
15652 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15653
156542012-01-11 Eli Zaretskii <eliz@gnu.org>
15655
15656 * xdisp.c (rows_from_pos_range): Handle the case where the
15657 highlight ends on a newline. (Bug#10464)
15658 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15659 he end column for display of highlight that ends on a newline
15660 before a R2L line.
15661
156622012-01-11 Glenn Morris <rgm@gnu.org>
15663
15664 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15665 from load-path also when installation-directory is nil. (Bug#10208)
15666
156672012-01-10 Glenn Morris <rgm@gnu.org>
15668
15669 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15670
15671 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15672 Update template values to be closer to their typical values these days.
15673
156742012-01-09 Eli Zaretskii <eliz@gnu.org>
15675
15676 * xdisp.c (rows_from_pos_range): Accept additional argument
15677 DISP_STRING, and accept any glyph in a row whose object is that
15678 string as eligible for mouse highlight. Fixes mouse highlight of
15679 display strings from overlays. (Bug#10464)
15680
156812012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15682
15683 emacs: fix an auto-save permissions race condition (Bug#10400)
15684 * fileio.c (auto_saving_dir_umask): New static var.
15685 (Fmake_directory_internal): Use it.
15686 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15687 creating the directory. The old code temporarily assigns
15688 too-generous permissions to the directory.
15689 (do_auto_save_eh): Clear it.
15690 (Fdo_auto_save): Catch all errors, not just file errors, so
15691 that the var is always cleared.
15692
156932012-01-07 Eli Zaretskii <eliz@gnu.org>
15694
15695 * search.c (scan_buffer): Pass character positions to
15696 know_region_cache, not byte positions. (Bug#6540)
15697
156982012-01-07 LynX <_LynX@bk.ru> (tiny change)
15699
15700 * w32.c (sys_rename): Report EXDEV when rename of a directory
15701 fails because the target is on another logical disk. (Bug#10284)
15702
157032012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15704
15705 * xterm.c (x_embed_request_focus): New function.
15706
15707 * xterm.h: Add prototype.
15708
15709 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15710
157112012-01-05 Glenn Morris <rgm@gnu.org>
15712
15713 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15714
157152012-01-01 Eli Zaretskii <eliz@gnu.org>
15716
15717 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15718 Load gnutls_transport_set_lowat only if GnuTLS version is below
15719 2.11.1.
15720 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15721 GnuTLS versions below 2.11.1.
15722
157232011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15724
15725 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15726 to the doc string advising against its use for altering the way
15727 windows are scrolled.
15728
157292011-12-28 Kenichi Handa <handa@m17n.org>
15730
15731 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15732 coding-system ASCII compatible only when it does not produce BOM
15733 on encoding (Bug#10383).
15734
157352011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15736
15737 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15738 can scroll.
15739 (create_and_show_popup_menu): Always use menu_position_func for
15740 Gtk3 (Bug#10361).
15741
157422011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15743
15744 * callint.c (Fcall_interactively): Don't truncate prompt string.
15745
157462011-12-23 Eli Zaretskii <eliz@gnu.org>
15747
15748 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15749 property that ends at ZV, so that the bidi iteration could be
15750 resumed from there (after widening). (Bug#10360)
15751
157522011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15753
15754 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15755
157562011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15757
15758 * nsterm.m (x_free_frame_resources):
15759 Release f->output_data.ns->miniimage.
15760 (ns_index_color): Fix indentation. Do not retain
15761 color_table->colors[i].
15762
15763 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15764 before returning.
15765
15766 * nsfns.m (x_set_background_color): Assign return value from
15767 ns_index_color to face-background instead of NSColor*.
15768 (ns_implicitly_set_icon_type): Fix indentation.
15769 Change assignment in for loop to comparison.
15770
15771 * emacs.c (ns_pool): New variable.
15772 (main): Assign ns_pool.
15773 (Fkill_emacs): Call ns_release_autorelease_pool.
15774
15775 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15776 autorelease fdesc, release fdAttrs and tdict.
15777 (ns_get_covering_families): Release charset.
15778 (ns_findfonts): Release NSFontDescriptor created with new.
15779 (ns_uni_to_glyphs): Fix indentation.
15780 (setString): Release attrStr before assigning new value.
15781
157822011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15783
15784 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15785 and NS_IMPL_COCOA.
15786 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15787 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15788
157892011-12-18 David Reitter <reitter@cmu.edu>
15790
15791 * nsterm.m (ns_term_init): Subscribe for notifications
15792 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15793 to method trackingNotification in EmacsMenu.
15794
15795 * nsmenu.m (trackingMenu): New variable.
15796 (trackingNotification): New method (from Aquamacs).
15797 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15798 from Aquamacs (Bug#7030).
15799
158002011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15801
15802 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15803 (symbol_to_nsstring): Fix indentation.
15804 (ns_symbol_to_pb): New function.
15805 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15806 (Fns_rotate_cut_buffers_internal): Remove.
15807 (Fns_store_selection_internal): Rename from
15808 Fns_store_cut_buffer_internal.
15809 (ns_get_foreign_selection, Fx_own_selection_internal)
15810 (Fx_disown_selection_internal, Fx_selection_exists_p)
15811 (Fns_get_selection_internal, Fns_store_selection_internal):
15812 Use ns_symbol_to_pb and check if return value is nil.
15813 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15814 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15815 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15816 renamed to Sns_store_selection_internal.
15817 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15818 and remove this function.
15819 (ns_handle_selection_clear): Remove, never used.
15820 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15821 here.
15822
158232011-12-17 Ken Brown <kbrown@cornell.edu>
15824
15825 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15826 GID is unknown (Bug#10257).
15827
158282011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15829
15830 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15831 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15832 which caused a build failure on GNU/Linux IA-64. This problem was
15833 introduced by my 2011-10-07 patch.
15834
158352011-12-15 Juri Linkov <juri@jurta.org>
15836
15837 * image.c (imagemagick_error): New function. (Bug#10112)
15838 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15839 Use `imagemagick_error' where ImageMagick functions return
15840 `MagickFalse'.
15841 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15842 proper order.
15843
158442011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15845
15846 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15847 fill background (Bug#8992).
15848
158492011-12-13 Martin Rudalics <rudalics@gmx.at>
15850
15851 * window.c (Vwindow_combination_resize)
15852 (Vwindow_combination_limit): Use t instead of non-nil in
15853 doc-strings.
15854 (Vrecenter_redisplay): Add first sentence of doc-string on
15855 separate line.
15856 (Frecenter): Fix doc-string typo.
15857
158582011-12-11 Kenichi Handa <handa@m17n.org>
15859
15860 * coding.c (Funencodable_char_position): Pay attention to the
15861 buffer text relocation (Bug#9389).
15862
158632011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15864
15865 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15866 gtk_init (Bug#10100).
15867
158682011-12-10 Eli Zaretskii <eliz@gnu.org>
15869
15870 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15871 IT->string is nil. (Bug#10263)
15872
158732011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15874
15875 * nsterm.h (x_free_frame_resources): Declare.
15876
15877 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15878 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15879
15880 * nsterm.h (ns_get_defaults_value): Declare.
15881
15882 * nsterm.m (ns_default): Call ns_get_defaults_value.
15883
158842011-12-09 Eli Zaretskii <eliz@gnu.org>
15885
15886 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15887 (Bug#10170)
15888
158892011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15890
15891 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15892 that where the value of an _OBJC_* symbol points to is in the .bss
15893 section (Bug#10240).
15894
158952011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15896
15897 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15898 after the loop to call ccl_driver at least once (Bug#8619).
15899
159002011-12-08 Kenichi Handa <handa@m17n.org>
15901
15902 * ftfont.c (get_adstyle_property): Fix previous change
15903 (Bug#10233).
15904
159052011-12-07 Juanma Barranquero <lekktu@gmail.com>
15906
15907 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15908 dirs from the default value of EMACSLOADPATH (bug#10208).
15909
159102011-12-07 Glenn Morris <rgm@gnu.org>
15911
15912 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15913 installation and source directories as well. (Bug#10208)
15914
159152011-12-06 Chong Yidong <cyd@gnu.org>
15916
15917 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15918
159192011-12-06 Glenn Morris <rgm@gnu.org>
15920
15921 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15922 as an error, not just -1. (Bug#10217)
15923
159242011-12-05 Chong Yidong <cyd@gnu.org>
15925
15926 * keyboard.c (process_special_events): New function.
15927 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15928
159292011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15930
15931 * coding.c (encode_designation_at_bol): Don't use uninitialized
15932 local variable (Bug#9318).
15933
159342011-12-05 Kenichi Handa <handa@m17n.org>
15935
15936 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15937 return Qnil (Bug#8046, Bug#10193).
15938
159392011-12-05 Kenichi Handa <handa@m17n.org>
15940
15941 * coding.c (encode_designation_at_bol): New args charbuf_end and
15942 dst. Return the number of produced bytes. Callers changed.
15943 (coding_set_source): Return how many bytes coding->source was
15944 relocated.
15945 (coding_set_destination): Return how many bytes
15946 coding->destination was relocated.
15947 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15948 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15949
159502011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15951
15952 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15953 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15954 macro (Bug#9318).
15955
159562011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15957
15958 The following changes are to fix Bug#9318.
15959
15960 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15961 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15962 (encode_coding_iso_2022, encode_coding_sjis)
15963 (encode_coding_big5, encode_coding_charset): Use the above macros.
15964
159652011-12-05 Juanma Barranquero <lekktu@gmail.com>
15966
15967 * lisp.h (process_quit_flag): Fix external declaration.
15968
159692011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15970
15971 Don't macro-inline non-performance-critical code.
15972 * eval.c (process_quit_flag): New function.
15973 * lisp.h (QUIT): Use it.
15974
159752011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15976
15977 * nsfns.m (get_geometry_from_preferences): New function.
15978 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15979
159802011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15981
15982 * emacs.c (Qkill_emacs): Define.
15983 (syms_of_emacs): Initialize it.
15984 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15985 Qquit_flag to `kill-emacs' instead.
15986 (quit_throw_to_read_char): Add parameter `from_signal'.
15987 All callers changed. Call Fkill_emacs if requested and safe.
15988 * lisp.h (QUIT): Call Fkill_emacs if requested.
15989
159902011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15991
15992 * widget.c (update_wm_hints): Return if wmshell is null.
15993 (widget_update_wm_size_hints): New function.
15994
15995 * widget.h (widget_update_wm_size_hints): Declare.
15996
15997 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15998 widget_update_wm_size_hints (Bug#10104).
15999
160002011-12-03 Eli Zaretskii <eliz@gnu.org>
16001
16002 * xdisp.c (handle_invisible_prop): If the invisible text ends just
16003 before a newline, prepare the bidi iterator for consuming the
16004 newline, and keep the current paragraph direction. (Bug#10183)
16005 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
16006
160072011-12-02 Juri Linkov <juri@jurta.org>
16008
16009 * search.c (Fword_search_regexp): New Lisp function created from
16010 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
16011 (Fword_search_backward, Fword_search_forward)
16012 (Fword_search_backward_lax, Fword_search_forward_lax):
16013 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
16014 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
16015
160162011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
16017
16018 * fileio.c (Finsert_file_contents): Move after-change-function call
16019 to before the "handled:" label, since all "goto handled" appear in
16020 cases where the *-change-functions have already been properly called
16021 (bug#10117).
16022
160232011-12-01 Andreas Schwab <schwab@linux-m68k.org>
16024
16025 * keyboard.c (interrupt_signal): Don't call kill-emacs when
16026 waiting for input. (Bug#10169)
16027
160282011-11-30 Eli Zaretskii <eliz@gnu.org>
16029
16030 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
16031 verifies glyph row's hash code--we have just reallocated the
16032 glyphs, so their contents can be complete garbage. (Bug#10164)
16033
160342011-11-30 Juanma Barranquero <lekktu@gmail.com>
16035
16036 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
16037
160382011-11-30 Eli Zaretskii <eliz@gnu.org>
16039
16040 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
16041 attributes are tested _before_ calling verify_row_hash, to protect
16042 against GCC re-ordering of the tests. (Bug#10164)
16043
160442011-11-29 Jan Djärv <jan.h.d@swipnet.se>
16045
16046 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
16047
16048 * xterm.c (handle_one_xevent): Only set async_visible and friends
16049 if net_wm_state_hidden_seen is non-zero (Bug#10002)
16050 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
16051 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
16052
160532011-11-28 Paul Eggert <eggert@cs.ucla.edu>
16054
16055 Remove GCPRO-related macros that exist only to avoid shadowing locals.
16056 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
16057 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
16058 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
16059 All uses changed to use GCPRO1 etc.
16060 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
16061 Revert to old implementation (i.e., before 2011-03-11).
16062
160632011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16064
16065 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
16066 of scroll runs so as to avoid assigning disabled bogus rows and
16067 unnecessary graphics copy operations.
16068
160692011-11-27 Eli Zaretskii <eliz@gnu.org>
16070
16071 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
16072 (snprintf) [_MSC_VER]: Redirect to _snprintf.
16073 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
16074 (malloc, free, realloc, calloc): Redirect to e_* only when
16075 compiling Emacs.
16076
16077 * lisp.h (GCTYPEBITS): Move before first use.
16078 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
16079 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
16080 this macro definition.
16081
16082 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
16083 _MSC_VER.
16084
160852011-11-27 Jan Djärv <jan.h.d@swipnet.se>
16086
16087 * gtkutil.c (xg_create_frame_widgets):
16088 Call gtk_window_set_has_resize_grip (FALSE) if that function is
16089 present with Gtk+ 2.0.
16090
160912011-11-26 Paul Eggert <eggert@cs.ucla.edu>
16092
16093 * fileio.c (Finsert_file_contents): Undo previous change; see
16094 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
16095
160962011-11-26 Paul Eggert <eggert@cs.ucla.edu>
16097
16098 Rename locals to avoid shadowing.
16099 * fileio.c (Finsert_file_contents):
16100 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
16101 * process.c (wait_reading_process_output):
16102 Rename inner 'proc' to 'p' to avoid shadowing.
16103 Indent for consistency with usual Emacs style.
16104
161052011-11-25 Eli Zaretskii <eliz@gnu.org>
16106
16107 * xdisp.c (redisplay_window): If cursor row is not fully visible
16108 after recentering, and scroll-conservatively is set to a large
16109 number, scroll window by a few more lines to make the cursor fully
16110 visible and out of scroll-margin. (Bug#10105)
16111 (start_display): Don't move to the next line if the display should
16112 start at a newline that is part of a display vector or an overlay
16113 string. (Bug#10119)
16114
161152011-11-24 Juri Linkov <juri@jurta.org>
16116
16117 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
16118 after the `MagickPingImage' call. (Bug#10112)
16119
161202011-11-23 Chong Yidong <cyd@gnu.org>
16121
16122 * window.c (Fcoordinates_in_window_p): Accept only live windows.
16123
161242011-11-23 Martin Rudalics <rudalics@gmx.at>
16125
16126 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
16127 making another buffer current. (Bug#10114)
16128
161292011-11-23 Glenn Morris <rgm@gnu.org>
16130
16131 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
16132
161332011-11-23 Chong Yidong <cyd@gnu.org>
16134
16135 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
16136 using it (Bug#5984).
16137
161382011-11-22 Eli Zaretskii <eliz@gnu.org>
16139
16140 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
16141 and header-lines, as they don't have one computed for them.
16142 (Bug#10098)
16143
16144 * .gdbinit (prow): Make displayed values more self-explaining.
16145 Add row's hash code.
16146
161472011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
16148
16149 * process.c (wait_reading_process_output): Fix asynchrounous
16150 GnuTLS socket handling on some versions of the GnuTLS library.
16151 (wait_reading_process_output): Add comment and URL.
16152
161532011-11-21 Jan Djärv <jan.h.d@swipnet.se>
16154
16155 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
16156
161572011-11-21 Chong Yidong <cyd@gnu.org>
16158
16159 * window.c (Fnext_window, Fprevious_window): Doc fix.
16160
161612011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
16162
16163 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
16164
161652011-11-20 Juanma Barranquero <lekktu@gmail.com>
16166
16167 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
16168
161692011-11-20 Martin Rudalics <rudalics@gmx.at>
16170
16171 * window.c (Fset_window_combination_limit): Rename argument
16172 STATUS to LIMIT.
16173 (Vwindow_combination_limit): Remove "status" from doc-string.
16174
161752011-11-20 Andreas Schwab <schwab@linux-m68k.org>
16176
16177 * m/ibms390.h: Remove.
16178 * m/ibms390x.h: Don't include "ibms390.h".
16179
161802011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
16181
16182 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
16183 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
16184
161852011-11-20 Juanma Barranquero <lekktu@gmail.com>
16186
16187 * casetab.c (Fset_case_table):
16188 * charset.c (Fcharset_after): Fix typos.
16189
161902011-11-20 Paul Eggert <eggert@cs.ucla.edu>
16191
16192 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
16193 Otherwise, valgrind does not work on some platforms.
16194 Problem reported by Andreas Schwab in
16195 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
16196 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
16197 is set, removing the need for VIRT_ADDRESS_VARIES.
16198 (PURE_P): Use a more-efficient implementation that needs just one
16199 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
16200 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
16201 to 4 (xorl, subq, cmpq, setbe).
16202 * alloc.c (pure): Always extern now, since that's the
16203 VIRT_ADDR_VARIES behavior.
16204 (PURE_POINTER_P): Use a single comparison, not two, for
16205 consistency with the new puresize.h.
16206 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
16207 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
16208 Remove VIRT_ADDR_VARIES no longer needed.
16209
162102011-11-19 Eli Zaretskii <eliz@gnu.org>
16211
16212 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
16213 (erase_phys_cursor, update_window_cursor, show_mouse_face)
16214 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
16215 behave as if the cursor position were at the window margin.
16216
16217 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
16218 and the cursor position is out of bounds, behave as if the cursor
16219 position were at the window margin. (Bug#10075)
16220
162212011-11-18 Chong Yidong <cyd@gnu.org>
16222
16223 * window.c (Fwindow_combination_limit): Make first argument
16224 non-optional, since it is meaningless for live windows like the
16225 selected window.
16226
162272011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
16228
16229 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
16230
162312011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
16232
16233 * intervals.c: Fix grafting over the whole buffer (bug#10071).
16234 (graft_intervals_into_buffer): Simplify.
16235
162362011-11-18 Eli Zaretskii <eliz@gnu.org>
16237
16238 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
16239 hash values of the two rows.
16240 (copy_row_except_pointers): Preserve the used[] arrays and the
16241 hash values of the two rows. (Bug#10035)
16242 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
16243
16244 * xdisp.c (row_hash): New function, body extracted from
16245 compute_line_metrics.
16246 (compute_line_metrics): Call row_hash, instead of computing the
16247 hash code inline.
16248
16249 * dispnew.c (verify_row_hash): Call row_hash for computing the
16250 hash code of a row, instead of duplicating code from xdisp.c.
16251
16252 * dispextern.h (row_hash): Add prototype.
16253
162542011-11-18 Tassilo Horn <tassilo@member.fsf.org>
16255
16256 * frame.c (delete_frame): Don't delete the terminal when the last
16257 X frame is closed if emacs is built with GTK toolkit.
16258
162592011-11-17 Juanma Barranquero <lekktu@gmail.com>
16260
16261 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
16262
162632011-11-17 Martin Rudalics <rudalics@gmx.at>
16264
16265 * window.c (Vwindow_splits): Rename to
16266 Vwindow_combination_resize. Suggested by Juri Linkov.
16267 (Fsplit_window_internal): Use Vwindow_combination_resize instead
16268 of Vwindow_splits.
16269
162702011-11-16 Juanma Barranquero <lekktu@gmail.com>
16271
16272 * nsfns.m (Fns_font_name):
16273 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
16274
162752011-11-16 Martin Rudalics <rudalics@gmx.at>
16276
16277 * window.h (window): Rename slot "nest" to "combination_limit".
16278 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
16279 (Fset_window_nest): Rename to Fset_window_combination_limit.
16280 (Vwindow_nest): Rename to Vwindow_combination_limit.
16281 (recombine_windows, make_parent_window, make_window)
16282 (Fsplit_window_internal, saved_window)
16283 (Fset_window_configuration, save_window_save): Rename all
16284 occurrences of window_nest to window_combination_limit.
16285
162862011-11-15 Juanma Barranquero <lekktu@gmail.com>
16287
16288 * image.c (imagemagick_load_image): Fix typo.
16289
162902011-11-14 Eli Zaretskii <eliz@gnu.org>
16291
16292 * xdisp.c (display_line): Move the call to
16293 highlight_trailing_whitespace before the call to
16294 compute_line_metrics, since the latter needs to see the final
16295 faces of all the glyphs to compute ROW's hash value.
16296 Fixes assertion violations in row_equal_p. (Bug#10035)
16297
162982011-11-14 Juanma Barranquero <lekktu@gmail.com>
16299
16300 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
16301 just return (bug#10044).
16302
163032011-11-12 Eli Zaretskii <eliz@gnu.org>
16304
16305 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
16306 with user-defined heap size. Bump the default size of the temacs
16307 heap to 27MB, to avoid memory warning when running temacs.
16308 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
16309
16310 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
16311 current_matrix and desired_matrix. (Bug#9990)
16312 (verify_row_hash) [XASSERTS]: New function.
16313 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
16314 that the hash value of glyph rows is correct.
16315
163162011-11-12 Martin Rudalics <rudalics@gmx.at>
16317
16318 * window.h (window): Remove splits slot.
16319 * window.c (Fwindow_splits, Fset_window_splits): Remove.
16320 (Fdelete_other_windows_internal, make_parent_window)
16321 (make_window, Fsplit_window_internal, Fdelete_window_internal)
16322 (Fset_window_configuration, save_window_save): Don't deal with
16323 split status of windows.
16324 (saved_window): Remove splits slot.
16325 (Vwindow_splits): Rewrite doc-string.
16326
163272011-11-11 Jan Djärv <jan.h.d@swipnet.se>
16328
16329 * xfns.c (unwind_create_frame):
16330 * nsfns.m (unwind_create_frame):
16331 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
16332 Vframe_list (Bug#9999).
16333
163342011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
16335
16336 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
16337
163382011-11-11 Kenichi Handa <handa@m17n.org>
16339
16340 * callproc.c (Fcall_process): Set the member dst_multibyte of
16341 process_coding.
16342
163432011-11-11 Johan Bockgård <bojohan@gnu.org>
16344
16345 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
16346 avoid a crash (bug#9496).
16347
163482011-11-09 Chong Yidong <cyd@gnu.org>
16349
16350 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
16351 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
16352
163532011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16354
16355 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
16356
163572011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16358
16359 Avoid some portability problems by eschewing 'extern inline' functions.
16360 The trivial performance wins aren't worth the portability hassles; see
16361 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16362 et seq.
16363 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16364 (window_box_width, window_box_left, window_box_left_offset)
16365 (window_box_right, window_box_right_offset): Undo previous change,
16366 by removing the "extern"s.
16367 * intervals.c (adjust_intervals_for_insertion)
16368 (adjust_intervals_for_deletion): Undo previous change,
16369 making these static again.
16370 (offset_intervals, temp_set_point_both, temp_set_point)
16371 (copy_intervals_to_string): No longer inline.
16372 * xdisp.c (window_text_bottom_y, window_box_width)
16373 (window_box_height, window_box_left_offset)
16374 (window_box_right_offset, window_box_left, window_box_right)
16375 (window_box): No longer inline.
16376
163772011-11-08 Chong Yidong <cyd@gnu.org>
16378
16379 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
16380 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16381 Signal an error if not a live window.
16382 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16383 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16384
163852011-11-07 Juanma Barranquero <lekktu@gmail.com>
16386
16387 * lisp.h (syms_of_abbrev): Remove declaration.
16388 Reported by CHENG Gao <chenggao@royau.me>.
16389
163902011-11-07 Eli Zaretskii <eliz@gnu.org>
16391
16392 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16393 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16394 of temacs in GUI mode.
16395
163962011-11-07 Martin Rudalics <rudalics@gmx.at>
16397
16398 * window.h: Declare delete_all_child_windows instead of
16399 delete_all_subwindows.
16400 * window.c (Fwindow_nest, Fset_window_nest)
16401 (Fset_window_new_total, Fset_window_new_normal)
16402 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16403 (delete_all_subwindows): Rename to delete_all_child_windows.
16404 (Fdelete_other_windows_internal, Fset_window_configuration):
16405 Call delete_all_child_windows instead of delete_all_subwindows.
16406 * frame.c (delete_frame): Call delete_all_child_windows instead
16407 of delete_all_subwindows.
16408
164092011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16410
16411 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16412 This is also needed for porting to any host where GC_MARK_STACK is
16413 not GC_MAKE_GCPROS_NOOPS.
16414 (which_symbols): Use it.
16415
164162011-11-07 Kenichi Handa <handa@m17n.org>
16417
16418 * coding.c (coding_set_destination): Check coding->src_pos only
16419 when coding->src_object is a buffer (bug#9910).
16420
16421 * process.c (send_process): Set the member src_multibyte of coding
16422 to 0 (bug#9911) when sending a unibyte text.
16423
16424 * callproc.c (Fcall_process): Set the member src_multibyte of
16425 process_coding to 0 (bug#9912).
16426
164272011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16428
16429 * xmenu.c (cleanup_widget_value_tree): New function.
16430 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16431 calling free_menubar_widget_value_tree directly (Bug#9830).
16432
164332011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16434
16435 Fix some portability problems with 'inline'.
16436 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16437 (window_box_width, window_box_left, window_box_left_offset)
16438 (window_box_right, window_box_right_offset): Declare extern.
16439 Otherwise, these inline functions do not conform to C99 and
16440 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16441 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16442 * intervals.c (adjust_intervals_for_insertion)
16443 (adjust_intervals_for_deletion): Now extern, because otherwise the
16444 extern inline functions 'offset_intervals' couldn't refer to it.
16445 (static_offset_intervals): Remove.
16446 (offset_intervals): Rewrite using the old contents of
16447 static_offset_intervals. The old version didn't conform to C99
16448 because an extern inline function contained a reference to an
16449 identifier with static linkage.
16450
164512011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16452
16453 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16454 GC.
16455
164562011-11-06 Eli Zaretskii <eliz@gnu.org>
16457
16458 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16459 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16460 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16461 return Qleft_to_right.
16462
164632011-11-06 Chong Yidong <cyd@gnu.org>
16464
16465 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16466 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16467 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16468 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16469 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16470 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16471 (Fwindow_vscroll): Doc fix.
16472 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16473 argument, since it makes no sense to pass a live window and for
16474 consistency with window-child.
16475
164762011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16477
16478 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16479 support MSVC.
16480
164812011-11-05 Jason Rumney <jasonr@gnu.org>
16482
16483 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16484 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16485 fonts (Bug#6029).
16486 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16487 bitwise arithmetic preventing use of unicode-sip and non-truetype
16488 opentype fonts.
16489
164902011-11-05 Eli Zaretskii <eliz@gnu.org>
16491
16492 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16493 "emacs"-only part.
16494
16495 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16496 initialization code to keep similarity to xfns.c after changes
16497 from 2011-11-05.
16498
164992011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16500
16501 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16502 (unwind_create_frame): New function (Bug#9943).
16503 (Fx_create_frame): Restructure code to be more similar to the one in
16504 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16505 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16506 Move terminal->reference_count++ just before making the frame official
16507 (Bug#9943).
16508
16509 * nsterm.m (x_free_frame_resources): New function.
16510 (x_destroy_window): Move code to x_free_frame_resources.
16511
16512 * xfns.c (unwind_create_frame): Fix comment.
16513 (Fx_create_frame, x_create_tip_frame):
16514 Move terminal->reference_count++ just before making the frame
16515 official. Move initialization of image_cache_refcount and
16516 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16517
165182011-11-05 Eli Zaretskii <eliz@gnu.org>
16519
16520 Support MSVC build with newer versions of Visual Studio.
16521 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16522 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16523 nt/gmake.defs.
16524
16525 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16526 which are not supported by MSVC.
16527 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16528 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16529 bitfields.
16530 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16531 types in bitfields.
16532 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16533
16534 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16535
165362011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
16537
16538 Support MSVC build with newer versions of Visual Studio.
16539 * w32.c: Don't include w32api.h for MSVC.
16540 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16541
16542 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16543 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16544 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16545 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16546 e_* cousins.
16547 (alloca) [_MSC_VER]: Define to _alloca.
16548
16549 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16550
16551 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16552
165532011-11-04 Eli Zaretskii <eliz@gnu.org>
16554
16555 * xdisp.c (note_mouse_highlight): If either of
16556 previous/next-single-property-change returns nil, treat that as
16557 the beginning or the end of the buffer. (Bug#9955)
16558
165592011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16560
16561 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
16562 label is not null (Bug#9951).
16563 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16564 may be NULL.
16565
165662011-11-04 Eli Zaretskii <eliz@gnu.org>
16567
16568 * window.c (Fwindow_body_size): Mention in the doc string that the
16569 return value is in frame's canonical units. (Bug#9949)
16570
165712011-11-03 Eli Zaretskii <eliz@gnu.org>
16572
16573 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16574
16575 * w32fns.c (unwind_create_frame): If needed, free the glyph
16576 matrices of the partially constructed frame. (Bug#9943)
16577 * xfns.c (unwind_create_frame): Likewise.
16578
165792011-11-01 Eli Zaretskii <eliz@gnu.org>
16580
16581 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16582 Don't stop backward scan on the continuation glyph, even though
16583 its CHARPOS is positive.
16584 (mouse_face_from_buffer_pos, note_mouse_highlight):
16585 Rename cover_string to disp_string.
16586
165872011-11-01 Martin Rudalics <rudalics@gmx.at>
16588
16589 * window.c (temp_output_buffer_show): Don't use
16590 Vtemp_buffer_show_specifiers.
16591 (Vtemp_buffer_show_specifiers): Remove unused variable.
16592
165932011-10-30 Eli Zaretskii <eliz@gnu.org>
16594
16595 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16596 past the beginning of the current glyph matrix.
16597
165982011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16599
16600 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16601 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16602 HAVE_GTK3 (Bug#9869).
16603
16604 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16605 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16606
16607 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16608
16609 * xterm.c: Declare x_handle_net_wm_state to return int.
16610 (handle_one_xevent): Check if we are iconified but don't have
16611 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16612 (get_current_wm_state): Return non-zero if not hidden,
16613 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16614 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16615 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16616 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16617
166182011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16619
16620 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16621 so that this new function doesn't get optimized away by a
16622 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16623
166242011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16625
16626 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16627
166282011-10-29 Eli Zaretskii <eliz@gnu.org>
16629
16630 Fix the `xbytecode' command.
16631 * .gdbinit (xprintbytestr): New command.
16632 (xwhichsymbols): Rename from `which'; all callers changed.
16633 (xbytecode): Print the byte-code string as well.
16634
166352011-10-29 Kim Storm <storm@cua.dk>
16636
16637 * alloc.c (which_symbols): New function.
16638
166392011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16640
16641 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16642 line. (Bug#9903)
16643
166442011-10-29 Glenn Morris <rgm@gnu.org>
16645
16646 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16647 Not clear what it was for, and it causes various bugs. (Bug#9839)
16648
166492011-10-28 Eli Zaretskii <eliz@gnu.org>
16650
16651 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16652 possible random value that matches one of those tested as
16653 condition to clear the mouse face.
16654
166552011-10-28 Chong Yidong <cyd@gnu.org>
16656
16657 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16658
166592011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16660
16661 * window.c (make_window): Initialize phys_cursor_on_p.
16662
166632011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16664
16665 * lisp.h (struct Lisp_Symbol): Update comments.
16666
166672011-10-28 Juanma Barranquero <lekktu@gmail.com>
16668
16669 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16670
166712011-10-28 Eli Zaretskii <eliz@gnu.org>
16672
16673 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16674 <oslsachem@gmail.com> for helping to debug this.
16675
16676 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16677 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16678 (g_b_init_get_glyph_outline_w): New static variables.
16679 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16680 (GetGlyphOutlineW_Proc): New typedefs.
16681 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16682 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16683 New functions.
16684 (w32font_open_internal, compute_metrics):
16685 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16686 instead of calling the "wide" APIs directly.
16687
16688 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16689
16690 * w32.h (syms_of_w32font): Add prototype.
16691
166922011-10-27 Juanma Barranquero <lekktu@gmail.com>
16693
16694 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16695 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16696 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16697 (Fmove_to_window_line): Doc fix.
16698
166992011-10-27 Chong Yidong <cyd@gnu.org>
16700
16701 * process.c (make_process): Set gnutls_state to NULL.
16702
16703 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16704 non-NULL, regardless of GNUTLS_INITSTAGE.
16705 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16706 an error. Set process slots as soon as we allocate them.
16707
16708 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16709
167102011-10-27 Chong Yidong <cyd@gnu.org>
16711
16712 * gnutls.c (emacs_gnutls_deinit): New function.
16713 Deallocate credentials structures as well as calling gnutls_deinit.
16714 (Fgnutls_deinit, Fgnutls_boot): Use it.
16715
16716 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16717 (deactivate_process): Call emacs_gnutls_deinit.
16718
167192011-10-27 Juanma Barranquero <lekktu@gmail.com>
16720
16721 * image.c (x_create_x_image_and_pixmap):
16722 * w32.c (sys_rename, w32_delayed_load):
16723 * w32font.c (fill_in_logfont):
16724 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16725
167262011-10-26 Juanma Barranquero <lekktu@gmail.com>
16727
16728 * w32fns.c (w32_default_color_map): New function,
16729 extracted from Fw32_default_color_map.
16730 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16731
167322011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16733
16734 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16735
167362011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16737
16738 * keyboard.c (test_undefined): New function (bug#9751).
16739 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16740
167412011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16742
16743 * sysdep.c (init_sys_modes): Fix the check for the controlling
16744 terminal (Bug#6649).
16745
167462011-10-20 Eli Zaretskii <eliz@gnu.org>
16747
16748 * dispextern.h (struct bidi_it): New member next_en_type.
16749
16750 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16751 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16752 current character, check also for next_en_type being WEAK_EN.
16753 (bidi_resolve_weak): Don't enter the expensive loop if the current
16754 position is before next_en_pos. Record the bidi type of the first
16755 non-ET, non-BN character we find, in addition to its position.
16756 (bidi_level_of_next_char): Invalidate next_en_type when
16757 next_en_pos is over-stepped.
16758
167592011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16760
16761 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16762 * editfns.c: Rewrite current-time-zone so that it invokes
16763 the equivalent of (format-time-string "%Z") to get the time zone name.
16764 This fixes a bug when the time zone name contains characters that
16765 need converting from the system time locale to Emacs internal format.
16766 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16767 that patch fixed format-time-string to do the conversion, but
16768 I forgot to fix current-time-zone.
16769 (format_time_string): New function, containing most of
16770 what Fformat_time_string used to contain.
16771 (Fformat_time_string): Rewrite in terms of format_time_string.
16772 This doesn't change this function's behavior.
16773 (current-time-zone): Rewrite to use format_time_string.
16774 This fixes the bug reported by Michael Schierl in
16775 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16776 Jason Rumney's 2007-06-07 change worked around this bug, but
16777 didn't fix it.
16778 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16779
167802011-10-19 Eli Zaretskii <eliz@gnu.org>
16781
16782 * xdisp.c (start_display): If the character at POS is displayed
16783 via a display vector, reset IT->current.dpvec_index to zero.
16784 (try_window_reusing_current_matrix): If a line ends in a display
16785 vector or the next line starts in a display vector, continue
16786 redrawing the window even though the character position of
16787 start_row was reached.
16788 (Bug#9771, part 2)
16789
167902011-10-18 Chong Yidong <cyd@gnu.org>
16791
16792 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16793 with nobreak-char-display too.
16794
167952011-10-18 Eli Zaretskii <eliz@gnu.org>
16796
16797 Fix part 3 of bug#9771.
16798 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16799 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16800 non-neutral characters if the current character is a paragraph
16801 separator (a.k.a. Newline). This avoids running the same
16802 expensive loop twice, once when we consume the preceding newline
16803 and the other time when the line actually needs to be displayed.
16804 Avoid the loop when we see neutrals on the base embedding level
16805 following a character whose directionality is the same as the
16806 paragraph's. This avoids running the expensive loop when a line
16807 ends in a long sequence of neutrals, like control characters.
16808 Add assertion against STRONG_AL type. Slightly rearrange code
16809 that determines the type of a neutral given the first non-neutral
16810 that follows it.
16811 (bidi_level_of_next_char): Set next_en_pos to zero when
16812 invalidating its info.
16813
168142011-10-17 Eli Zaretskii <eliz@gnu.org>
16815
16816 * xdisp.c (push_display_prop): Determine whether to record string
16817 or buffer position by IT->string, not by IT->method. Allow
16818 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16819 (move_it_vertically_backward): Don't look for character position
16820 immediately after the newline when in a continuation line.
16821 (Bug#9771, part 1)
16822
168232011-10-15 Martin Rudalics <rudalics@gmx.at>
16824
16825 * window.c (coordinates_in_window): Rewrite and delabelize
16826 vertical border check. (Bug#5357) (Bug#9618)
16827
168282011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16829
16830 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16831 errors in XSetWindowBorder (bug#9310).
16832
168332011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16834
16835 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16836 avoid crash when xmalloc overrun checking is enabled.
16837
168382011-10-13 Eli Zaretskii <eliz@gnu.org>
16839
16840 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16841 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16842 cursor motion with <left> and <right> arrow keys.
16843
16844 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16845 some callers set that themselves.
16846
168472011-10-12 Eli Zaretskii <eliz@gnu.org>
16848
16849 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16850 display string and the previous row comes from the same string and
16851 is empty. (Bug#9739) (Bug#9738)
16852
168532011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16854
16855 * doc.c (get_doc_string): Encode file name (bug#9735).
16856
168572011-10-12 Eli Zaretskii <eliz@gnu.org>
16858
16859 * bidi.c (bidi_level_of_next_char):
16860 * xdisp.c (get_visually_first_element): Remove old incorrect
16861 comments regarding the Unicode Line Separator character.
16862
16863 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16864
168652011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16866
16867 * alloc.c (Fgc_status): Do not access beyond zombies array
16868 boundary if nzombies > MAX_ZOMBIES.
16869 * alloc.c (dump_zombies): Add missing format specifier.
16870
168712011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16872
16873 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16874 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16875
16876 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16877 Some packages use them to denote characters with modifiers.
16878
168792011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16880
16881 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16882 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16883 matching a pp-number. Rename parameter var to var1.
16884
168852011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16886
16887 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16888
168892011-10-08 Glenn Morris <rgm@gnu.org>
16890
16891 * callint.c (Fcall_interactively): Give a more explicit error for the
16892 'c' case with a non-character input. (Bug#8479)
16893
168942011-10-08 Eli Zaretskii <eliz@gnu.org>
16895
16896 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16897 lines.
16898 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16899 lines that are hscrolled on the left.
16900
16901 * dispnew.c (buffer_posn_from_coords): Account for a possible
16902 presence of header-line. (Bug#4426)
16903
169042011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16905
16906 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16907 Don't advertise functionality which we discourage or doesn't work.
16908
169092011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16910
16911 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16912 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16913 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16914 this makes Emacs dump core during garbage collection on rare
16915 occasions. sizeof is obviously inferior to offsetof here, so
16916 stick with offsetof.
16917 (GC_POINTER_ALIGNMENT): New macro.
16918 (mark_memory): Omit 3rd (offset) arg; caller changed.
16919 Don't assume EMACS_INT alignment is the same as pointer alignment.
16920
169212011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16922
16923 * keyboard.c (read_key_sequence_remapped): New var.
16924 (read_key_sequence): Compute remapping in the right buffer.
16925 (command_loop_1): Use read_key_sequence's remapping directly.
16926
169272011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16928
16929 * dired.c (file_name_completion): Don't expand file name.
16930 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16931 before checking file name handler.
16932
16933 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16934 they've been requested explicitly (bug#9591).
16935
169362011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16937
16938 * keymap.c (Fsingle_key_description): Use make_specified_string
16939 instead of build_string to build string from push_key_description.
16940 (Bug#5193)
16941
169422011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16943
16944 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16945 This fixes a Y2038 bug on 64-bit hosts.
16946 * buffer.c (reset_buffer):
16947 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16948 (Fclear_buffer_auto_save_failure):
16949 Use 0, not -1, to represent an unset failure time, since time_t
16950 might not be signed.
16951
16952 Remove dependency on glibc malloc internals.
16953 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16954 Move back here from lisp.h, but with their new implementations.
16955 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16956 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16957 * charset.c (charset_table_init): New static var.
16958 (syms_of_charset): Use it instead of xmalloc. This removes a
16959 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16960 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16961 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16962 Move back to alloc.c.
16963 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16964 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16965
169662011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16967
16968 * nsterm.m (windowDidResize): Call x_set_window_size only when
16969 ns_in_resize is true. Otherwise set pixelwidth/height and
16970 call change_frame_size (Bug#9628).
16971
169722011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16973
16974 Port --enable-checking=all to Fedora 14 x86-64.
16975 * charset.c (syms_of_charset): Also account for glibc malloc's
16976 internal overhead when calculating the initial malloc maximum.
16977
16978 Port --enable-checking=all to Fedora 14 x86.
16979 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16980 Move to lisp.h.
16981 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16982 (overrun_check_realloc, overrun_check_free):
16983 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16984 That way, xmalloc returns a properly-aligned pointer even if
16985 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16986 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16987 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16988 into account when calculating the initial malloc maximum.
16989 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16990 Move here from alloc.c, so that charset.c can use it too.
16991 Properly align; the old code wasn't right for common 32-bit hosts
16992 when configured with --enable-checking=all.
16993 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16994 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16995
169962011-09-29 Eli Zaretskii <eliz@gnu.org>
16997
16998 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16999 use EDOM.
17000
170012011-09-28 Eli Zaretskii <eliz@gnu.org>
17002
17003 * xdisp.c (compute_display_string_end): If there's no display
17004 string at CHARPOS, return -1.
17005
17006 * bidi.c (bidi_fetch_char): When compute_display_string_end
17007 returns a negative value, treat the character as a normal
17008 character not covered by a display string. (Bug#9624)
17009
170102011-09-28 Juanma Barranquero <lekktu@gmail.com>
17011
17012 * lread.c (Fread_from_string): Fix typo in docstring.
17013
170142011-09-27 Eli Zaretskii <eliz@gnu.org>
17015
17016 * xdisp.c (handle_invisible_prop): If invisible text ends on a
17017 newline, reseat the iterator instead of bidi-iterating there one
17018 character at a time. (Bug#9610)
17019 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
17020 TO_CHARPOS if the bidi iterator is at base embedding level.
17021
170222011-09-27 Andreas Schwab <schwab@linux-m68k.org>
17023
17024 * lread.c (readevalloop): Use correct code for NBSP.
17025 (read1): Likewise. (Bug#9608)
17026
170272011-09-25 Michael Albinus <michael.albinus@gmx.de>
17028
17029 * dbusbind.c (Fdbus_register_signal): When service is not
17030 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
17031
170322011-09-25 Glenn Morris <rgm@gnu.org>
17033
17034 * buffer.c (truncate-lines): Doc fix.
17035
170362011-09-24 Chong Yidong <cyd@stupidchicken.com>
17037
17038 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
17039 (Fset_window_next_buffers): Doc fix.
17040
170412011-09-24 Glenn Morris <rgm@gnu.org>
17042
17043 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
17044
170452011-09-24 Paul Eggert <eggert@cs.ucla.edu>
17046
17047 Fix minor problems found by static checking.
17048 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
17049 * indent.c (Fvertical_motion): Fix == vs = typo.
17050
170512011-09-24 Eli Zaretskii <eliz@gnu.org>
17052
17053 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
17054 Default value is now t. Doc fix.
17055
17056 * indent.c (Fvertical_motion): Compute and apply the overshoot
17057 logic when moving up, not only when moving down. Fix the
17058 confusing name and values of the it_overshoot_expected variable;
17059 logic changes accordingly. (Bug#9254) (Bug#9549)
17060
17061 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
17062 CHARPOS is covered by a display string which includes newlines.
17063 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
17064 is covered by a display string with embedded newlines.
17065
170662011-09-24 Michael Albinus <michael.albinus@gmx.de>
17067
17068 * dbusbind.c (Fdbus_register_signal): Add match rule to
17069 Vdbus_registered_objects_table. (Bug#9581)
17070 (Fdbus_register_method, Vdbus_registered_objects_table):
17071 Fix docstring.
17072
170732011-09-24 Jim Meyering <meyering@redhat.com>
17074
17075 do not ignore write error for any output size
17076 The previous change was incomplete.
17077 While it makes emacs --batch detect the vast majority of stdout
17078 write failures, errors were still ignored whenever the output size is
17079 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
17080 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
17081 && echo FAIL: ignored write error
17082 FAIL: ignored write error
17083 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
17084 && echo FAIL: ignored write error
17085 FAIL: ignored write error
17086 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
17087
170882011-09-23 Andreas Schwab <schwab@linux-m68k.org>
17089
17090 * emacs.c (Fkill_emacs): In noninteractive mode exit
17091 non-successfully if a write error occurred on stdout. (Bug#9574)
17092
170932011-09-21 Eli Zaretskii <eliz@gnu.org>
17094
17095 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
17096 the xassert test.
17097
17098 * dispextern.h (struct it): Update the comment documenting what
17099 can it->OBJECT be.
17100
171012011-09-20 Eli Zaretskii <eliz@gnu.org>
17102
17103 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
17104 a display string, extend search for cursor position to end of row.
17105 (find_row_edges): If the row ends in a newline from a display
17106 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
17107 Handle the case of a display string with multiple newlines.
17108 (Fcurrent_bidi_paragraph_direction): Fix search for previous
17109 non-empty line. Fixes confusing cursor motion with arrow keys at
17110 the beginning of a line that starts with whitespace.
17111
171122011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17113
17114 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
17115 (bug#9493).
17116
171172011-09-18 Chong Yidong <cyd@stupidchicken.com>
17118
17119 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
17120 boolean (Bug#9154).
17121
171222011-09-18 Eli Zaretskii <eliz@gnu.org>
17123
17124 * xdisp.c (display_line): Record maximum and minimum buffer
17125 positions even if no glyphs were produced (e.g., by a zero-width
17126 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
17127 buffer positions that will be removed from the glyph row because
17128 they don't fit.
17129 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
17130 column is beyond frame width: don't subtract 1 "pixel" when
17131 computing width of the stretch.
17132 (reseat_at_next_visible_line_start): Undo the change made on
17133 2011-09-17 that saved paragraph information and restored it after
17134 the call to `reseat'. (Bug#9545)
17135
171362011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17137
17138 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
17139 and turn window cursor on if cleared (Bug#9415).
17140
171412011-09-18 Andreas Schwab <schwab@linux-m68k.org>
17142
17143 * search.c (boyer_moore): Take unibyte characters from pattern
17144 literally. (Bug#9458)
17145
171462011-09-18 Eli Zaretskii <eliz@gnu.org>
17147
17148 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
17149
171502011-09-18 Paul Eggert <eggert@cs.ucla.edu>
17151
17152 Fix minor problem found by static checking.
17153 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
17154 initialized, to pacify gcc -Wuninitialized.
17155
17156 * fileio.c: Report proper errno when syscall falls.
17157 (Finsert_file_contents): Save and restore errno,
17158 so that report_file_error outputs the correct diagnostic.
17159 (Fwrite_region) [CLASH_DETECTION]: Likewise.
17160
171612011-09-18 Eli Zaretskii <eliz@gnu.org>
17162
17163 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
17164
171652011-09-17 Eli Zaretskii <eliz@gnu.org>
17166
17167 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
17168 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
17169
171702011-09-17 Eli Zaretskii <eliz@gnu.org>
17171
17172 * xdisp.c (reseat_at_next_visible_line_start): Keep information
17173 about the current paragraph and restore it after the call to reseat.
17174
17175 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
17176 (bidi_find_paragraph_start): Search back for paragraph beginning
17177 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
17178 (bidi_move_to_visually_next): Only trigger paragraph-related
17179 computations when the last character is a newline or at EOB, not
17180 just any NEUTRAL_B. (Bug#9470)
17181
17182 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
17183 truncated lines if point is covered by a display string. (Bug#9524)
17184
171852011-09-16 Paul Eggert <eggert@cs.ucla.edu>
17186
17187 * xselect.c: Relax test for outgoing X longs (Bug#9498).
17188 (cons_to_x_long): New function.
17189 (lisp_data_to_selection_data): Use it. Correct the test for
17190 short-versus-long data; it was negated. Break out of vector
17191 loop, for efficiency, when a long datum is discovered.
17192
171932011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
17194
17195 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
17196
171972011-09-16 Eli Zaretskii <eliz@gnu.org>
17198
17199 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
17200 GCC PR/17406) by declaring this function with external scope.
17201
172022011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17203
17204 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
17205 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
17206
172072011-09-15 Andreas Schwab <schwab@linux-m68k.org>
17208
17209 * editfns.c (Fformat): Correctly handle text properties on "%%".
17210
172112011-09-15 Eli Zaretskii <eliz@gnu.org>
17212
17213 * xterm.c (x_draw_composite_glyph_string_foreground):
17214 * w32term.c (x_draw_composite_glyph_string_foreground):
17215 * term.c (encode_terminal_code):
17216 * composite.c (composition_update_it, get_composition_id):
17217 * xdisp.c (get_next_display_element)
17218 (fill_composite_glyph_string): Add comments about special meaning
17219 of TAB characters in a composition.
17220
172212011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17222
17223 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
17224 This occurs when processing a multibyte format.
17225 Problem reported by Wolfgang Jenker.
17226
172272011-09-15 Johan Bockgård <bojohan@gnu.org>
17228
17229 * xdisp.c (try_cursor_movement): Only check for exact match if
17230 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
17231
172322011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17233
17234 Remove unused external symbols.
17235 * dispextern.h (calc_pixel_width_or_height): Remove decl.
17236 * xdisp.c (calc_pixel_width_or_height): Now static.
17237 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
17238 * indent.c (check_display_width):
17239 * w32term.c: Fix comment to match code.
17240 * xterm.c, xterm.h (x_catching_errors): Remove.
17241
172422011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17243
17244 * xselect.c: Use signed conversions more consistently (Bug#9498).
17245 (selection_data_to_lisp_data): Assume incoming selection data are
17246 signed integers, not unsigned. This is to be consistent with
17247 outgoing selection data, which was modified to use signed integers
17248 in as part of the fix to Bug#9196 in response to Jan D.'s comment
17249 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
17250 expects long, not unsigned long.
17251
172522011-09-14 Eli Zaretskii <eliz@gnu.org>
17253
17254 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
17255 computation of loop end. Reported by Johan Bockgård
17256 <bojohan@gnu.org>.
17257
172582011-09-13 Chong Yidong <cyd@stupidchicken.com>
17259
17260 * frame.c (Fother_visible_frames_p): Function deleted.
17261
172622011-09-12 Eli Zaretskii <eliz@gnu.org>
17263
17264 * indent.c (compute_motion): Process display vector front to back
17265 rather than the other way around. (Bug#2496)
17266
172672011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
17268
17269 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
17270
172712011-09-11 Chong Yidong <cyd@stupidchicken.com>
17272
17273 * minibuf.c (Fread_from_minibuffer): Doc fix.
17274
172752011-09-11 Eli Zaretskii <eliz@gnu.org>
17276
17277 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
17278 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
17279
172802011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17281
17282 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
17283 value for non-existent files.
17284
172852011-09-11 Eli Zaretskii <eliz@gnu.org>
17286
17287 * fileio.c (Finsert_file_contents): If the file cannot be opened,
17288 set its "size" to -1. This will set the modtime_size field of
17289 the corresponding buffer to -1, which is what
17290 verify-visited-file-modtime expects for files that do not exist.
17291 (Bug#9139)
17292
172932011-09-11 Paul Eggert <eggert@cs.ucla.edu>
17294
17295 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
17296 here ...
17297 * lisp.h: ... from here. push_key_description is no longer
17298 defined in keyboard.c, so its declaration should not be in
17299 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
17300 logically belongs with push_key_description.
17301
173022011-09-10 Paul Eggert <eggert@cs.ucla.edu>
17303
17304 * buffer.h: Include <sys/types.h> instead of <time.h>.
17305 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
17306 Problem reported by Herbert J. Skuhra.
17307
173082011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
17309
17310 * xml.c (parse_region): Make the parsing work for
17311 non-comment-starting XML files again (bug#9144).
17312
173132011-09-10 Andreas Schwab <schwab@linux-m68k.org>
17314
17315 * image.c (gif_load): Fix calculation of bottom and right corner.
17316 (Bug#9468)
17317
173182011-09-10 Eli Zaretskii <eliz@gnu.org>
17319
17320 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
17321 redisplay in small windows.
17322
173232011-09-09 Eli Zaretskii <eliz@gnu.org>
17324
17325 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
17326
173272011-09-08 Martin Rudalics <rudalics@gmx.at>
17328
17329 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
17330 Operate on live windows only.
17331
173322011-09-08 Juanma Barranquero <lekktu@gmail.com>
17333
17334 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
17335
173362011-09-07 Eli Zaretskii <eliz@gnu.org>
17337
17338 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
17339 only under bidi iteration.
17340
173412011-09-07 Jan Djärv <jan.h.d@swipnet.se>
17342
17343 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
17344
173452011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17346
17347 isnan: Fix porting problem to Solaris 10 with bundled gcc.
17348 Without this fix, the command to link temacs failed due to an
17349 undefined symbol __builtin_isnan. This is because
17350 /usr/include/iso/math_c99.h #defines isnan(x) to
17351 __builtin_isnan(x), but the bundled gcc, which identifies itself
17352 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
17353 a __builtin_isnan.
17354 * floatfns.c (isnan): #undef, and then #define to a clone of
17355 what's in data.c.
17356 (Fisnan): Always define, since it's always available now.
17357 (syms_of_floatfns): Always define isnan at the Lisp level.
17358
173592011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17360
17361 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17362
173632011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17364
17365 * fileio.c: Fix bugs with large file offsets (Bug#9428).
17366 The previous code assumed that file offsets (off_t values) fit in
17367 EMACS_INT variables, which is not true on typical 32-bit hosts.
17368 The code messed up by falsely reporting buffer overflow in cases
17369 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17370 when "big" contains more than 2**29 bytes, even though this
17371 inserts just one byte and does not overflow the buffer.
17372 (Finsert_file_contents): Store file offsets as off_t
17373 values, not as EMACS_INT values. Check for overflow when
17374 converting between EMACS_INT and off_t. When checking for
17375 buffer overflow or for overlap, take the offsets into account.
17376 Don't use EMACS_INT for small values where int suffices.
17377 When checking for overlap, fix a typo: ZV was used where
17378 ZV_BYTE was intended.
17379 (Fwrite_region): Don't assume off_t fits into 'long'.
17380 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17381
173822011-09-05 Michael Albinus <michael.albinus@gmx.de>
17383
17384 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17385
173862011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17387
17388 sprintf-related integer and memory overflow issues (Bug#9412).
17389
17390 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
17391 (esprintf, exprintf, evxprintf): New functions.
17392 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
17393 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
17394 (modify_event_symbol): Do not assume that the length of
17395 name_alist_or_stem is safe to alloca and fits in int.
17396 (Fexecute_extended_command): Likewise for function name and binding.
17397 (Frecursion_depth): Wrap around reliably on integer overflow.
17398 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17399 since some callers pass EMACS_INT values.
17400 (Fsingle_key_description): Don't crash if symbol name contains more
17401 than MAX_ALLOCA bytes.
17402 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17403 (get_minibuffer): Arg is now EMACS_INT, not int.
17404 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
17405 (esprintf, exprintf, evxprintf): New decls.
17406 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17407
17408 * dbusbind.c (signature_cat): New function.
17409 (xd_signature, Fdbus_register_signal):
17410 Do not overrun buffer; instead, report string overflow.
17411
17412 * dispnew.c (add_window_display_history): Don't overrun buffer.
17413 Truncate instead; this is OK since it's just a log.
17414
17415 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17416 even if the time zone offset is outlandishly large.
17417 Don't mishandle offset == INT_MIN.
17418
17419 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17420 when creating daemon; the previous buffer-overflow check was incorrect.
17421
17422 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17423 which has the guts of the old verror function.
17424
17425 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17426 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17427
17428 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17429 (font_unparse_xlfd): Don't blindly alloca long strings.
17430 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
17431 fits in int, when using sprintf. Use single snprintf to count
17432 length of string rather than counting it via multiple sprintfs;
17433 that's simpler and more reliable.
17434 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17435 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17436 sprintf, in case result does not fit in int.
17437
17438 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17439 (fontset_from_font): Print it.
17440
17441 * frame.c (tty_frame_count): Now printmax_t, not int.
17442 (make_terminal_frame, set_term_frame_name): Print it.
17443 (x_report_frame_params): In X, window IDs are unsigned long,
17444 not signed long, so print them as unsigned.
17445 (validate_x_resource_name): Check for implausibly long names,
17446 and don't assume name length fits in 'int'.
17447 (x_get_resource_string): Don't blindly alloca invocation name;
17448 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17449 not fit in int.
17450
17451 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17452 (xg_check_special_colors, xg_set_geometry):
17453 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17454
17455 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17456 Use esprintf, not sprintf, in case result does not fit in int.
17457
17458 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17459 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17460 it as a large positive number.
17461 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17462 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17463
17464 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17465 in case result does not fit in int.
17466
17467 * print.c (float_to_string): Detect width overflow more reliably.
17468 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17469 buffer overrun. Don't assume list length fits in 'int'. Treat
17470 print length of 0 as 0, not as infinity; to be consistent with other
17471 uses of print length in this function. Don't overflow print length
17472 index. Don't assume hash table size fits in 'long', or that
17473 vectorlike size fits in 'unsigned long'.
17474
17475 * process.c (make_process): Use printmax_t, not int, to format
17476 process-name gensyms.
17477
17478 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17479
17480 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17481 to avoid potential buffer overrun.
17482
17483 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17484 if X resource line is longer than 512 bytes.
17485
17486 * xfns.c (x_window): Make sprintf buffer a bit bigger
17487 to avoid potential buffer overrun.
17488
17489 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17490
17491 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17492
174932011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17494
17495 Integer overflow fixes for scrolling, etc.
17496 Without these, Emacs silently mishandles large integers sometimes.
17497 For example, "C-u 4294967297 M-x recenter" was treated as if
17498 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17499
17500 * xdisp.c (try_window_id): Check Emacs fixnum range before
17501 converting to 'int'.
17502
17503 * window.c (window_scroll_line_based, Frecenter):
17504 Check that an Emacs fixnum is in range before assigning it to 'int'.
17505 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17506 values converted from Emacs fixnums.
17507 (Frecenter): Don't wrap around a line count if it is out of 'int'
17508 range; instead, treat it as an extreme value.
17509 (Fset_window_configuration, compare_window_configurations):
17510 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17511
17512 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17513 that can exceed INT_MAX. Check that EMACS_INT value is in range
17514 before assigning it to the (possibly-narrower) index.
17515 (match_limit): Don't assume that a fixnum can fit in 'int'.
17516
17517 * print.c (print_object): Use ptrdiff_t, not int, for index that can
17518 exceed INT_MAX.
17519
17520 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
17521 (Fvertical_motion): Don't wrap around LINES values that don't fit
17522 in 'int'. Instead, treat them as extreme values. This is good
17523 enough for windows, which can't have more than INT_MAX lines anyway.
17524
175252011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17526
17527 * Require libxml/parser.h to avoid compilation warning.
17528
17529 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17530
17531 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17532 since this reportedly can destroy thread storage.
17533
175342011-08-30 Chong Yidong <cyd@stupidchicken.com>
17535
17536 * syntax.c (find_defun_start): Update all cache variables if
17537 exiting early (Bug#9401).
17538
175392011-08-30 Eli Zaretskii <eliz@gnu.org>
17540
17541 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17542
17543 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17544 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17545 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17546
17547 * term.c (tty_append_glyph): New function.
17548 (produce_stretch_glyph): Static function and its prototype deleted.
17549
17550 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17551 Add prototypes.
17552
175532011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17554
17555 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17556 when checking :margin (Bug#9390).
17557 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
17558 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
17559 so that the name doesn't mislead. All uses changed.
17560
175612011-08-28 Johan Bockgård <bojohan@gnu.org>
17562
17563 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17564 set_tty_hooks.
17565
175662011-08-27 Eli Zaretskii <eliz@gnu.org>
17567
17568 * xdisp.c (move_it_to): Don't bail out early when reaching
17569 position beyond to_charpos, if we are scanning backwards.
17570 (move_it_vertically_backward): When DY == 0, make sure we get to
17571 the first character in the line after the newline.
17572
175732011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17574
17575 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17576 (ccl_driver): Do not generate an out-of-range pointer.
17577 (Fccl_execute_on_string): Remove unnecessary check for
17578 integer overflow, noted by Stefan Monnier in
17579 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17580 Remove a FIXME that didn't need fixing.
17581 Simplify the newly-introduced buffer reallocation code.
17582
175832011-08-27 Juanma Barranquero <lekktu@gmail.com>
17584
17585 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17586
175872011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17588
17589 Integer and memory overflow issues (Bug#9196).
17590
17591 * doc.c (get_doc_string): Rework so that
17592 get_doc_string_buffer_size is the actual buffer size, rather than
17593 being 1 less than the actual buffer size; this makes xpalloc more
17594 convenient.
17595
17596 * image.c (x_allocate_bitmap_record, cache_image):
17597 * xselect.c (Fx_register_dnd_atom):
17598 Simplify previous changes by using xpalloc.
17599
17600 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17601 since either will do and ptrdiff_t is convenient with xpalloc.
17602
17603 * charset.c (charset_table_size)
17604 (struct charset_sort_data.priority): Now ptrdiff_t.
17605 (charset_compare): Don't overflow if priorities differ greatly.
17606 (Fsort_charsets): Don't assume list length fits in int.
17607 Check for size-calculation overflow when allocating sort data.
17608 (syms_of_charset): Allocate an initial charset table that is
17609 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17610
17611 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17612
17613 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17614 The actual value is always <= INT_MAX, and leaving it unsigned made
17615 overflow checking harder.
17616
17617 * dispextern.h (struct glyph_matrix.rows_allocated)
17618 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17619 with xpalloc. The values are still always <= INT_MAX.
17620
17621 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17622
17623 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17624 (SAFE_NALLOCA): New macro.
17625
17626 * region-cache.c (struct boundary.pos, find_cache_boundary)
17627 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17628 (set_cache_region, invalidate_region_cache)
17629 (revalidate_region_cache, know_region_cache, region_cache_forward)
17630 (region_cache_backward, pp_cache):
17631 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17632 so that ptrdiff_t * can be passed to xpalloc.
17633 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17634 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17635 (pp_cache): Don't assume cache_len fits in int.
17636 * region-cache.h: Adjust extern decls to match.
17637
17638 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17639 EMACS_INT, since either will do, for xpalloc.
17640
17641 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17642 (xnmalloc, xnrealloc, xpalloc): New functions.
17643
17644 * bidi.c (bidi_shelve_header_size): New constant.
17645 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17646 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17647
17648 * bidi.c (bidi_cache_shrink):
17649 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17650 (overlay_strings):
17651 Don't update size of array until after memory allocation succeeds,
17652 because xmalloc/xrealloc may not return.
17653 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17654 now that we have proper integer overflow checking.
17655 (record_overlay_string, overlay_strings): Catch overflows when
17656 calculating size of overlay_str_buf.
17657
17658 * callproc.c (Fcall_process): Check for size overflow when
17659 calculating size of args2.
17660 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17661 Normally we prefer signed values, but sticking with ptrdiff_t would
17662 require adding more-complicated checks.
17663
17664 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17665 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17666 Redo buffer-overflow calculations to avoid integer overflow.
17667 Add a FIXME comment where memory seems to be over-allocated.
17668
17669 * character.c (Fstring): Check for size-calculation overflow.
17670
17671 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17672 unnecessary integer overflow. Check for size overflow.
17673 (encode_coding_object): Don't update size until xmalloc succeeds.
17674
17675 * composite.c (get_composition_id): Check for overflow in glyph
17676 length calculations.
17677
17678 Integer and memory overflow fixes for display code.
17679 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17680 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17681 (scrolling_window): Check for overflow in size calculations.
17682 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17683 Don't assume glyph table len fits in int.
17684 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17685 (row_table_size): Now ptrdiff_t, not int.
17686 (scrolling_window): Avoid overflow in size calculations.
17687 Don't update size until allocation succeeds.
17688 * fns.c (concat): Check for overflow in size calculations.
17689 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17690 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17691 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17692
17693 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17694 (get_doc_string): Check for size calculation overflow.
17695 Don't update size until allocation succeeds.
17696 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17697 EMACS_INT, where ptrdiff_t will do.
17698 (Fsubstitute_command_keys): Check for string overflow.
17699
17700 * editfns.c (set_time_zone_rule): Don't assume environment length
17701 fits in int.
17702 (message_length): Now ptrdiff_t, not int.
17703 (Fmessage_box): Don't update size until allocation succeeds.
17704 Don't assume message length fits in int.
17705 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17706
17707 * emacs.c (main): Do not reallocate argv, since there is a null at
17708 the end that can be overwritten, and this way there's no need to
17709 worry about size-calculation overflow.
17710 (sort_args): Check for size-calculation overflow.
17711
17712 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17713 alloc succeeds.
17714 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17715
17716 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17717 (x_set_scroll_bar_width, x_figure_window_size):
17718 Check for integer overflow.
17719 (x_set_alpha): Do not assume XINT fits in int.
17720
17721 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17722 This is for the members text_lines, text_cols, total_lines, total_cols,
17723 where the system imposes an 'int' limit.
17724
17725 * fringe.c (Fdefine_fringe_bitmap):
17726 Don't update size until alloc works.
17727
17728 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17729 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17730
17731 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17732 Check for size-calculation overflow.
17733 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17734 do, as we prefer signed integers.
17735 (id_to_widget.max_size, id_to_widget.used)
17736 (xg_store_widget_in_map, xg_remove_widget_from_map)
17737 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17738 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17739 Use and return ptrdiff_t, not int.
17740 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17741 * gtkutil.h: Change prototypes to match the above.
17742
17743 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17744 are duplicate now that they've been promoted to lisp.h.
17745 (x_allocate_bitmap_record, x_alloc_image_color)
17746 (make_image_cache, cache_image, xpm_load):
17747 Don't update size until alloc is done.
17748 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17749 (x_detect_edges):
17750 Check for size calculation overflow.
17751 (ct_colors_allocated_max): New constant.
17752 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17753 overflow.
17754
17755 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17756 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17757 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17758 Use ptrdiff_t, not int, to count maps.
17759 (read_char_minibuf_menu_prompt): Check for overflow in size
17760 calculations. Don't update size until allocation succeeds.
17761 Redo calculations to avoid overflow.
17762 * keyboard.h: Change prototypes to match the above.
17763
17764 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17765 to count maps.
17766 (current_minor_maps): Check for size calculation overflow.
17767 * keymap.h: Change prototypes to match the above.
17768
17769 * lread.c (read1, init_obarray): Don't update size until alloc done.
17770
17771 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17772 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17773
17774 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17775 Now ptrdiff_t, not int.
17776 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17777 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17778
17779 * process.c (Fnetwork_interface_list): Check for overflow
17780 in size calculation.
17781
17782 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17783
17784 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17785 overflow. Don't bother calling xmalloc when xrealloc will do.
17786
17787 * search.c (Freplace_match): Check for size calculation overflow.
17788 (Fset_match_data): Don't assume list lengths fit in 'int'.
17789
17790 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17791 for command line length. Do not attempt to address one before the
17792 beginning of an array, as that's not portable.
17793
17794 * term.c (max_frame_lines): Remove; unused.
17795 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17796 not int.
17797 (encode_terminal_code, calculate_costs): Check for size
17798 calculation overflow.
17799 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17800 table lengths and related sizes. Don't update size until alloc
17801 done. Redo calculations to avoid overflow.
17802 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17803
17804 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17805 subtracting pointers.
17806 (gobble_line): Check for overflow more carefully. Don't update size
17807 until alloc done.
17808
17809 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17810 Don't update size until alloc done.
17811 Redo size calculations to avoid overflow.
17812 Check for size calculation overflow.
17813 (main) [DEBUG]: Fix typo in invoking tparam1.
17814
17815 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17816 Use ptrdiff_t, not int, for sizes.
17817 (store_mode_line_noprop_char): Don't update size until alloc done.
17818
17819 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17820 Use ptrdiff_t, not int, for sizes.
17821 (Finternal_make_lisp_face, cache_face):
17822 Check for size calculation overflow.
17823 (cache_face): Treat size calculation overflows as if they were
17824 memory exhaustion (the usual treatment), rather than aborting.
17825
17826 * xfns.c (x_encode_text, x_set_name_internal)
17827 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17828 sizes, since they can exceed INT_MAX in size. Check for size
17829 calculation overflow.
17830
17831 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17832 (xg_select): Check for size calculation overflow.
17833 Don't update size until alloc done.
17834
17835 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17836 as sprintf is limited to int lengths.
17837
17838 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17839 (X_LONG_MIN): New macros.
17840 Use them to make the following changes clearer.
17841 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17842 This change doesn't affect the value now, but it may help remind
17843 future maintainers not to raise the value too much later.
17844 (SELECTION_QUANTUM): Remove, replacing with ...
17845 (selection_quantum): ... new function, which avoids overflow.
17846 All uses changed.
17847 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17848 assumption that selection length fits in 'int'.
17849 (x_reply_selection_request, x_handle_selection_request)
17850 (x_get_window_property, receive_incremental_selection)
17851 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17852 (lisp_data_to_selection_data, clean_local_selection_data):
17853 Use ptrdiff_t, not int, to record length of selection.
17854 (x_reply_selection_request, x_get_window_property)
17855 (receive_incremental_selection, x_property_data_to_lisp):
17856 Redo calculations to avoid overflow.
17857 (x_reply_selection_request): When sending hint, ceiling it at
17858 X_LONG_MAX rather than relying on wraparound overflow to send
17859 something.
17860 (x_get_window_property, receive_incremental_selection)
17861 (lisp_data_to_selection_data, x_property_data_to_lisp):
17862 Check for size-calculation overflow.
17863 (x_get_window_property, receive_incremental_selection)
17864 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17865 Don't store size until memory allocation succeeds.
17866 (x_get_window_property): Plug memory leak on memory exhaustion.
17867 Don't double-block input; malloc is safe here. Don't assume 2**34
17868 - 4 fits in unsigned long. Add an xassert to check
17869 XGetWindowProperty overflow. Be more careful about overflow
17870 calculations, and distinguish size from memory overflow better.
17871 (receive_incremental_selection): When tracing, don't assume
17872 unsigned int is less than INT_MAX.
17873 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17874 harmful) conversions of unsigned short to int.
17875 (lisp_data_to_selection_data): Don't assume that integers
17876 in the range -65535 through -1 fit in an X unsigned short.
17877 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17878 result parameters unless successful. Rely on cons_to_unsigned
17879 to report problems with elements; the old code wasn't right anyway.
17880 (x_check_property_data): Check for int overflow; we cannot use
17881 a wider type due to X limits.
17882 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17883
17884 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17885
17886 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17887 (x_term_init): Check for size calculation overflow.
17888 (x_color_cells): Don't store size until memory allocation succeeds.
17889 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17890 Don't assume alloca size is less than MAX_ALLOCA.
17891 (x_term_init): Don't assume length fits in int (sprintf is limited
17892 to int size).
17893
17894 Use ptrdiff_t for composition IDs.
17895 * character.c (lisp_string_width):
17896 * composite.c (composition_table_size, n_compositions)
17897 (get_composition_id, composition_gstring_from_id):
17898 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17899 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17900 * window.c (Frecenter):
17901 Use ptrdiff_t, not int, for composition IDs.
17902 * composite.c (get_composition_id): Check for integer overflow.
17903 * composite.h: Adjust prototypes to match the above changes.
17904
17905 Use ptrdiff_t for hash table indexes.
17906 * category.c (hash_get_category_set):
17907 * ccl.c (ccl_driver):
17908 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17909 * coding.c (coding_system_charset_list, detect_coding_system):
17910 * coding.h (struct coding_system.id):
17911 * composite.c (get_composition_id, gstring_lookup_cache):
17912 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17913 * image.c (xpm_get_color_table_h):
17914 * lisp.h (hash_lookup, hash_put):
17915 * minibuf.c (Ftest_completion):
17916 Use ptrdiff_t for hash table indexes, not int (which is too
17917 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17918 32-bit --with-wide-int hosts).
17919
17920 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17921 Add a FIXME comment about memory leaks.
17922 (syms_of_charset): Don't assume xmalloc returns.
17923
17924 Don't assume that stated character widths fit in int.
17925 * character.c (Fchar_width, c_string_width, lisp_string_width):
17926 * character.h (CHAR_WIDTH):
17927 * indent.c (MULTIBYTE_BYTES_WIDTH):
17928 Use sanitize_char_width to avoid undefined and/or bad behavior
17929 with outlandish widths.
17930 * character.h (sanitize_tab_width): Rename from sanitize_width,
17931 now that we have two such functions. All uses changed.
17932 (sanitize_char_width): New inline function.
17933
17934 Don't assume that tab-width fits in int.
17935 * character.h (sanitize_width): New inline function.
17936 (SANE_TAB_WIDTH): New macro.
17937 (ASCII_CHAR_WIDTH): Use it.
17938 * indent.c (sane_tab_width): Remove. All uses replaced by
17939 SANE_TAB_WIDTH (current_buffer).
17940 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17941
17942 * fileio.c: Integer overflow issues with file modes.
17943 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17944
17945 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17946 Remove unreachable code.
17947 (read_hex, load_charset_map_from_file): Check for integer overflow.
17948
17949 * xterm.c: Don't go over XClientMessageEvent limit.
17950 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17951 (x_send_scroll_bar_event): Likewise. Check that the size does not
17952 exceed limits imposed by XClientMessageEvent, as well as the usual
17953 ptrdiff_t and size_t limits.
17954
17955 * keyboard.c: Overflow, signedness and related fixes.
17956 (make_lispy_movement): Use same integer type in forward decl
17957 that is used in the definition.
17958 (read_key_sequence, keyremap_step):
17959 Change bufsize argument back to int, undoing my 2011-03-30 change.
17960 We prefer signed types, and int is wide enough here.
17961 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17962 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17963 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17964 length, not size_t. Use ptrdiff_t for index, not int.
17965 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17966 possibility of integer overflow.
17967
17968 Overflow, signedness and related fixes for images.
17969
17970 * dispextern.h (struct it.stack[0].u.image.image_id)
17971 (struct_it.image_id, struct image.id, struct image_cache.size)
17972 (struct image_cache.used, struct image_cache.ref_count):
17973 * gtkutil.c (update_frame_tool_bar):
17974 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17975 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17976 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17977 * nsmenu.m (update_frame_tool_bar):
17978 * xdisp.c (calc_pixel_width_or_height):
17979 * xfns.c (image_cache_refcount):
17980 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17981 on typical 64-bit hosts.
17982
17983 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17984 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17985 Omit unnecessary casts to int.
17986 (parse_image_spec): Check that integers fall into 'int' range
17987 when the callers expect that.
17988 (image_ascent): Redo ascent calculation to avoid int overflow.
17989 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17990 (lookup_image): Remove unnecessary tests.
17991 (xbm_image_p): Locals are now of int, not EMACS_INT,
17992 since parse_image_check makes sure they fit into int.
17993 (png_load, gif_load, svg_load_image):
17994 Prefer int to unsigned where either will do.
17995 (tiff_handler): New function, combining the cores of the
17996 old tiff_error_handler and tiff_warning_handler.
17997 This function is rewritten to use vsnprintf and thereby avoid
17998 stack buffer overflows. It uses only the features of vsnprintf
17999 that are common to both POSIX and native Microsoft.
18000 (tiff_error_handler, tiff_warning_handler): Use it.
18001 (tiff_load, gif_load, imagemagick_load_image):
18002 Don't assume :index value fits in 'int'.
18003 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
18004 (imagemagick_load_image): Check that crop parameters fit into
18005 the integer types that MagickCropImage accepts. Don't assume
18006 Vimagemagick_render_type has a nonnegative value. Don't assume
18007 size_t fits in 'long'.
18008 (gs_load): Use printmax_t to print the widest integers possible.
18009 Check for integer overflow when computing image height and width.
18010
180112011-08-26 Eli Zaretskii <eliz@gnu.org>
18012
18013 * xdisp.c (redisplay_window): Don't force window start if point
18014 will be invisible in the resulting window. (Bug#9324)
18015
180162011-08-25 Eli Zaretskii <eliz@gnu.org>
18017
18018 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
18019 the display spec is of the form `(space ...)'.
18020 (handle_display_spec): Return the value returned by
18021 handle_single_display_spec, not just 1 or zero.
18022 (handle_single_display_spec): If the display spec is of the form
18023 `(space ...)', and specifies display in the text area, return 2
18024 rather than 1.
18025 (try_cursor_movement): Check for the need to scroll more
18026 accurately, and prefer exact match for point under bidi.
18027 Don't advance `row' beyond the last row of the window.
18028
18029 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
18030 into disp_prop; all users changed.
18031
18032 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
18033 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
18034 for the text covered by the display property.
18035
180362011-08-25 Chong Yidong <cyd@stupidchicken.com>
18037
18038 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
18039 Change return value to nil.
18040 (Frecord_buffer): Delete unused function.
18041
180422011-08-24 Eli Zaretskii <eliz@gnu.org>
18043
18044 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
18045 buffers, return left-to-right.
18046 (set_cursor_from_row): Consider candidate row a win if its glyph
18047 represents a newline and point is on that newline. Fixes cursor
18048 positioning on the newline at EOL of R2L text within L2R
18049 paragraph, and vice versa.
18050 (try_cursor_movement): Check continued rows, in addition to
18051 continuation rows. Fixes unwarranted scroll when point enters a
18052 continued line of R2L text within an L2R paragraph, or vice versa.
18053 (cursor_row_p): Consider the case of point being equal to
18054 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
18055 from the end of a short line to the beginning of a continued line
18056 of R2L text within L2R paragraph.
18057 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
18058 composed characters.
18059
18060 * bidi.c (bidi_check_type): Use xassert.
18061 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
18062 members.
18063
180642011-08-23 Eli Zaretskii <eliz@gnu.org>
18065
18066 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
18067 a character.
18068
180692011-08-23 Chong Yidong <cyd@stupidchicken.com>
18070
18071 * nsfont.m (ns_otf_to_script): Fix typo.
18072
180732011-08-22 Kenichi Handa <handa@m17n.org>
18074
18075 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
18076 extra slot even if the purpose is char-code-property-table.
18077
180782011-08-23 Eli Zaretskii <eliz@gnu.org>
18079
18080 * xdisp.c (redisplay_window): When computing centering_position,
18081 account for the height of the header line. (Bug#8874)
18082
18083 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
18084 instead of CHAR_TO_BYTE. Fixes a crash when a completion
18085 candidate is selected by the mouse, and that candidate has a
18086 composed character under the mouse.
18087
18088 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
18089 coordinates reported by pos-visible-in-window-p for a composed
18090 character in column zero.
18091
180922011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
18093
18094 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
18095
180962011-08-22 Eli Zaretskii <eliz@gnu.org>
18097
18098 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
18099 consider it a hit if to_charpos is anywhere in the range of the
18100 composed buffer positions.
18101
181022011-08-22 Chong Yidong <cyd@stupidchicken.com>
18103
18104 * image.c (gif_load): Don't assume that each subimage has the same
18105 dimensions as the base image. Handle disposal method that is
18106 "undefined" by the gif spec (Bug#9335).
18107
181082011-08-20 Chong Yidong <cyd@stupidchicken.com>
18109
18110 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
18111 (Fcondition_case): Document `debug' symbol in error handler.
18112
181132011-08-19 Eli Zaretskii <eliz@gnu.org>
18114
18115 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
18116 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
18117 from an Org mode buffer to a Speedbar frame.
18118
18119 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
18120 a composition, take its buffer position from IT->cmp_it.charpos.
18121 Fixes cursor positioning at the beginning of a line that begins
18122 with a composed character.
18123
181242011-08-18 Eli Zaretskii <eliz@gnu.org>
18125
18126 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
18127 character bidirectional type, use STRONG_L instead. Fixes crashes
18128 in a buffer produced by `describe-categories'.
18129
18130 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
18131 members before the level stack, so they would be saved and
18132 restored when copying iterator state. Fixes incorrect reordering
18133 around TABs covered by display properties.
18134
181352011-08-18 Andreas Schwab <schwab@linux-m68k.org>
18136
18137 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
18138
181392011-08-17 Chong Yidong <cyd@stupidchicken.com>
18140
18141 * eval.c (internal_condition_case, internal_condition_case_1)
18142 (internal_condition_case_2, internal_condition_case_n):
18143 Remove unnecessary aborts (Bug#9081).
18144
181452011-08-17 Eli Zaretskii <eliz@gnu.org>
18146
18147 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
18148 has no `load' handler, try opening the file locally. (Bug#9311)
18149
181502011-08-16 Ken Brown <kbrown@cornell.edu>
18151
18152 * gmalloc.c: Expand comment.
18153
181542011-08-16 Eli Zaretskii <eliz@gnu.org>
18155
18156 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
18157 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
18158
181592011-08-16 Ken Brown <kbrown@cornell.edu>
18160
18161 Fix memory allocation problems in Cygwin build (Bug#9273).
18162
18163 * unexcw.c (__malloc_initialized): Declare external variable.
18164 (fixup_executable): Force the dumped emacs to reinitialize malloc.
18165
18166 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
18167 New variables.
18168 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
18169 dumped emacs.
18170 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
18171 in the static heap.
18172 [CYGWIN] (special_realloc): New function.
18173 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
18174 requests to realloc storage in the static heap.
18175
181762011-08-15 Paul Eggert <eggert@cs.ucla.edu>
18177
18178 * bidi.c (bidi_initialize): Remove unused local.
18179
181802011-08-15 Eli Zaretskii <eliz@gnu.org>
18181
18182 * bidimirror.h:
18183 * biditype.h: Remove file.
18184 * makefile.w32-in ($(BLD)/bidi.$(O)):
18185 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
18186
18187 * dispextern.h: Fix a typo in the comment to bidi_type_t.
18188
18189 * chartab.c: Improve commentary for the uniprop_table API.
18190
18191 * bidi.c (bidi_paragraph_init): Support zero value of
18192 bidi_ignore_explicit_marks_for_paragraph_level.
18193 (bidi_initialize): Use uniprop_table instead of including
18194 biditype.h and bidimirror.h.
18195
18196 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
18197 coordinates of the iterator when restoring from ppos_it.
18198 (Bug#9296)
18199
182002011-08-14 Kenichi Handa <handa@m17n.org>
18201
18202 * process.c (create_process): Call setup_process_coding_systems
18203 after the pid of the process is set to -1 (Bug#8162).
18204
182052011-08-14 Eli Zaretskii <eliz@gnu.org>
18206
18207 * xdisp.c (move_it_in_display_line_to): Don't invoke
18208 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
18209 ppos_it. Fixes vertical cursor motion when line beginning is
18210 covered by an image. (Bug#9296)
18211
182122011-08-14 Jan Djärv <jan.h.d@swipnet.se>
18213
18214 * nsterm.h (ns_run_ascript): Declare.
18215 (NSAPP_DATA2_RUNASSCRIPT): Define.
18216
18217 * nsfns.m (as_script, as_result, as_status): New static variables.
18218 (ns_run_ascript): New function.
18219 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
18220 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
18221 the event loop. Get status from as_status (Bug#7276).
18222
18223 * nsterm.m (sendEvent): If event is NSApplicationDefined and
18224 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
18225 the event loop (Bug#7276).
18226
182272011-08-14 Andreas Schwab <schwab@linux-m68k.org>
18228
18229 * gnutls.c (QCgnutls_bootprop_priority)
18230 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
18231 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
18232 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
18233 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
18234 (QCgnutls_bootprop_verify_hostname_error)
18235 (QCgnutls_bootprop_callbacks_verify): Rename from
18236 Qgnutls_bootprop_..., all uses changed.
18237
18238 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
18239 uses changed.
18240
182412011-08-14 Paul Eggert <eggert@cs.ucla.edu>
18242
18243 * xfaces.c (Qframe_set_background_mode): Now static.
18244 * dispextern.h (Qframe_set_background_mode): Remove decl.
18245
18246 * process.c (Fnetwork_interface_info): Declare local only if needed.
18247
182482011-08-13 Jan Djärv <jan.h.d@swipnet.se>
18249
18250 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
18251 (Fnetwork_interface_list): Allocate in increments of bytes instead
18252 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
18253 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
18254 sockaddr.
18255 (struct ifflag_def): notrailers is smart on OSX.
18256 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
18257 Get hardware address with getifaddrs if available.
18258
182592011-08-12 Eli Zaretskii <eliz@gnu.org>
18260
18261 * xdisp.c (iterate_out_of_display_property): xassert that
18262 IT->position is set to within IT->object's boundaries. Break from
18263 the loop as soon as EOB is reached; avoids infloops in redisplay
18264 when IT->position is set up wrongly due to some bug.
18265 Set IT->current to match the bidi iterator unconditionally.
18266 (push_display_prop): Allow GET_FROM_STRING as IT->method on
18267 entry. Force push_it to save on the stack the current
18268 buffer/string position, to be restored by pop_it. Fix flags in
18269 the iterator structure wrt the object coming from a display
18270 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
18271 properties. (Bug#9284)
18272
182732011-08-09 Andreas Schwab <schwab@linux-m68k.org>
18274
18275 * fontset.c (fontset_get_font_group): Add proper type checks.
18276 (Bug#9172)
18277
182782011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18279
18280 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
18281 and LC_VERSION_MIN_MACOSX.
18282 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
18283 (dump_it) [LC_FUNCTION_STARTS]: Use it.
18284
182852011-08-08 Eli Zaretskii <eliz@gnu.org>
18286
18287 * xdisp.c (forward_to_next_line_start): Allow to use the
18288 no-display-properties-and-no-overlays under bidi display.
18289 Set disp_pos in the bidi iterator to avoid searches for display
18290 properties and overlays.
18291
182922011-08-08 Chong Yidong <cyd@stupidchicken.com>
18293
18294 * editfns.c (Fset_time_zone_rule): Document relationship with the
18295 setenv function.
18296
18297 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
18298 the font entity extracted from the cache (Bug#8109).
18299
183002011-08-07 Chong Yidong <cyd@stupidchicken.com>
18301
18302 * composite.c (autocmp_chars): Don't reset point. That is done by
18303 restore_point_unwind (Bug#5984).
18304
183052011-08-07 Juri Linkov <juri@jurta.org>
18306
18307 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
18308 to show the arg `TIME' instead of `TIMEVAL'.
18309
183102011-08-06 Eli Zaretskii <eliz@gnu.org>
18311
18312 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
18313 display property strides EOL and includes a newline, as in
18314 longlines-mode. (Bug#9254)
18315 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
18316 word-wrap under bidirectional display. (Bug#9224)
18317
18318 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
18319 is non-zero, even if the data buffer is NULL. Fixes a crash in
18320 vertical-motion with longlines-mode. (Bug#9254)
18321
183222011-08-05 Eli Zaretskii <eliz@gnu.org>
18323
18324 * bidi.c <bidi_cache_total_alloc>: Now static.
18325 (bidi_initialize): Initialize bidi_cache_total_alloc.
18326
18327 * xdisp.c (display_line): Release buffer allocated for shelved bidi
18328 cache. (Bug#9221)
18329
18330 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
18331 amount allocated this far in `bidi_cache_total_alloc'.
18332 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
18333 non-zero, only free the data buffer without restoring the cache
18334 contents. All callers changed.
18335
18336 * dispextern.h (bidi_unshelve_cache): Update prototype.
18337
18338 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
18339 (move_it_in_display_line, move_it_to)
18340 (move_it_vertically_backward, move_it_by_lines): Replace the call
18341 to xfree to an equivalent call to bidi_unshelve_cache.
18342 (move_it_in_display_line_to): Fix logic of returning
18343 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
18344
183452011-08-05 Eli Zaretskii <eliz@gnu.org>
18346
18347 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
18348 came from a string character with a `cursor' property. (Bug#9229)
18349
183502011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18351
18352 * Makefile.in (LIB_PTHREAD): New variable.
18353 (LIBES): Add LIB_PTHREAD (Bug#9216).
18354
18355 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
18356 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
18357
183582011-08-04 Andreas Schwab <schwab@linux-m68k.org>
18359
18360 * regex.c (re_iswctype): Remove some redundant boolean conversions.
18361
183622011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18363
18364 * xterm.c (x_find_topmost_parent): New function.
18365 (x_set_frame_alpha): Find topmost parent window with
18366 x_find_topmost_parent and set the property there also (bug#9181).
18367 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18368
183692011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18370
18371 * callproc.c (Fcall_process): Avoid vfork clobbering
18372 the local vars buffer, coding_systems, current_dir.
18373
183742011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18375
18376 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18377
183782011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18379
18380 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18381 so that it is not optimized away.
18382
18383 * xdisp.c (compute_display_string_pos): Remove unused local.
18384
183852011-08-02 Eli Zaretskii <eliz@gnu.org>
18386
18387 Fix slow cursor motion and scrolling in large buffers with
18388 selective display, like Org Mode buffers. (Bug#9218)
18389
18390 * dispextern.h (struct bidi_it): New member disp_prop_p.
18391
18392 * xdisp.c: Remove one-slot cache of display string positions.
18393 (compute_display_string_pos): Accept an additional argument
18394 DISP_PROP_P; callers changed. Scan at most 5K characters forward
18395 for a display string or property. If found, set DISP_PROP_P
18396 non-zero.
18397
18398 * bidi.c (bidi_fetch_char): Accept an additional argument
18399 DISP_PROP_P, and pass it to compute_display_string_pos.
18400 Only handle text covered by a display string if DISP_PROP_P is returned
18401 non-zero. All callers of bidi_fetch_char changed.
18402
184032011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18404
18405 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18406
184072010-12-03 Don March <don@ohspite.net>
18408
18409 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18410 last character M-[char] is translated to ESC [char] (bug#7541).
18411
184122011-08-02 Kenichi Handa <handa@m17n.org>
18413
18414 * lisp.h (uniprop_table): Extern it.
18415
18416 * chartab.c (uniprop_table): Make it non-static.
18417
184182011-08-01 Eli Zaretskii <eliz@gnu.org>
18419
18420 * xdisp.c (forward_to_next_line_start): Accept additional argument
18421 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18422 on the newline.
18423 (reseat_at_next_visible_line_start): Use the bidi iterator state
18424 returned by forward_to_next_line_start to restore the state of
18425 it->bidi_it after backing up to previous newline. (Bug#9212)
18426
184272011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18428
18429 * regex.c (re_comp): Protoize.
18430 (re_exec): Fix return type.
18431 (regexec): Fix type of `ret'. (Bug#9203)
18432
184332011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18434
18435 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18436 This is needed if max-image-size is a floating-point number.
18437
184382011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18439
18440 * print.c (print_object): Print empty symbol as ##.
18441
18442 * lread.c (read1): Read ## as empty symbol.
18443
184442011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18445
18446 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18447 setting frame foreground color (Bug#9175).
18448 (x_set_background_color): Likewise.
18449
18450 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18451 contents (Bug#9176).
18452 (EmacsTooltip -init): Remove bezels and add shadows to
18453 tooltip windows.
18454
18455 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18456 or scroll bar (Bug#8470).
18457
18458 * nsfont.m (nsfont_open): Remove assignment to voffset and
18459 unnecessary vars hshink, expand, hd, full_height, min_height.
18460 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18461
18462 * nsterm.h (nsfont_info): Remove voffset field.
18463
184642011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18465
18466 Implement strike-through and overline on NextStep (Bug#8863).
18467
18468 * nsfont.m (nsfont_open): Use underline position provided by font,
18469 instead of hard-coded value of 2.
18470 (nsfont_draw): Call ns_draw_text_decoration instead.
18471
18472 * nsterm.h: Add declaration for ns_draw_text_decoration.
18473
18474 * nsterm.m (ns_draw_text_decoration): New function for drawing
18475 underline, overline, and strike-through.
18476 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18477 ns_draw_text_decoration. Change treatment of cursor drawing to
18478 accommodate underlining, etc.
18479
184802011-07-28 Eli Zaretskii <eliz@gnu.org>
18481
18482 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18483 default.
18484
184852011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18486
18487 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18488 Without this fix, if a signal arrives just after memory fills up,
18489 'malloc' might be invoked reentrantly.
18490
18491 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18492 In other words, assume that every image size is allowed, on non-X
18493 hosts. This assumption is probably wrong, but it lets Emacs compile.
18494
184952011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18496
18497 * regex.c (re_iswctype): Convert return values to boolean.
18498
184992011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18500
18501 * xdisp.c (compute_display_string_pos): Don't use cached display
18502 string position if the buffer had its restriction changed.
18503 (Bug#9184)
18504
185052011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18506
18507 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18508
185092011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18510
18511 Integer signedness and overflow and related fixes. (Bug#9079)
18512
18513 * bidi.c: Integer size and overflow fixes.
18514 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18515 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18516 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18517 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18518 (bidi_find_other_level_edge):
18519 Use ptrdiff_t instead of EMACS_INT where either will do.
18520 This works better on 32-bit hosts configured --with-wide-int.
18521 (bidi_cache_ensure_space): Check for size-calculation overflow.
18522 Use % rather than repeated addition, for better worst-case speed.
18523 Don't set bidi_cache_size until after xrealloc returns, because it
18524 might not return.
18525 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
18526 (bidi_cache_ensure_space): Also check that the bidi cache size
18527 does not exceed that of the largest Lisp string or buffer. See Eli
18528 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
18529
18530 * alloc.c (__malloc_size_t): Remove.
18531 All uses replaced by size_t. See Andreas Schwab's note
18532 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18533
18534 * image.c: Improve checking for integer overflow.
18535 (check_image_size): Assume that f is nonnull, since
18536 it is always nonnull in practice. This is one less thing to
18537 worry about when checking for integer overflow later.
18538 (x_check_image_size): New function, which checks for integer
18539 overflow issues inside X.
18540 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18541 This removes the need for a memory_full check.
18542 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18543 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18544 (xbm_read_bitmap_data): Change locals back to 'int', since
18545 their values must fit in 'int'.
18546 (xpm_load_image, png_load, tiff_load):
18547 Invoke x_create_x_image_and_pixmap earlier,
18548 to avoid much needless work if the image is too large.
18549 (tiff_load): Treat overly large images as if
18550 x_create_x_image_and_pixmap failed, not as malloc failures.
18551 (gs_load): Use x_check_image_size.
18552
18553 * gtkutil.c: Omit integer casts.
18554 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18555 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18556
18557 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18558
18559 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18560 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18561 would wrongly return t on a 64-bit host.
18562
18563 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18564 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18565 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18566 and therefore cause GCC to emit a bogus diagnostic in some cases.
18567
18568 * image.c: Integer signedness and overflow and related fixes.
18569 This is not an exhaustive set of fixes, but it's time to
18570 record what I've got.
18571 (lookup_pixel_color, check_image_size): Remove redundant decls.
18572 (check_image_size): Don't assume that arbitrary EMACS_INT values
18573 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18574 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18575 (tiff_load, imagemagick_load_image):
18576 Check for overflow in size calculations.
18577 (x_create_x_image_and_pixmap): Remove unnecessary test for
18578 xmalloc returning NULL; that can't happen.
18579 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18580 (xpm_color_bucket): Use better integer hashing function.
18581 (xpm_cache_color): Don't possibly over-allocate memory.
18582 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18583 (gif_memory_source):
18584 Use ptrdiff_t, not int or size_t, to record sizes.
18585 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18586 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18587 either works, as we prefer signed integers.
18588 (tiff_read_from_memory, tiff_write_from_memory):
18589 Return tsize_t, not size_t, since that's what the TIFF API wants.
18590 (tiff_read_from_memory): Don't fail simply because the read would
18591 go past EOF; instead, return a short read.
18592 (tiff_load): Omit no-longer-needed casts.
18593 (Fimagemagick_types): Don't assume size fits into 'int'.
18594
18595 Improve hashing quality when configured --with-wide-int.
18596 * fns.c (hash_string): New function, taken from sxhash_string.
18597 Do not discard information about ASCII character case; this
18598 discarding is no longer needed.
18599 (sxhash-string): Use it. Change sig to match it. Caller changed.
18600 * lisp.h: Declare it.
18601 * lread.c (hash_string): Remove, since we now use fns.c's version.
18602 The fns.c version returns a wider integer if --with-wide-int is
18603 specified, so this should help the quality of the hashing a bit.
18604
18605 * emacs.c: Integer overflow minor fix.
18606 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18607 Define only if GNU_LINUX.
18608 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18609
18610 * dispnew.c: Integer signedness and overflow fixes.
18611 Remove unnecessary forward decls, that were a maintenance hassle.
18612 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18613 All uses changed.
18614 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18615 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18616 (prepare_desired_row, line_draw_cost):
18617 Use int, not unsigned, where either works.
18618 (save_current_matrix, restore_current_matrix):
18619 Use ptrdiff_t, not size_t, where either works.
18620 (init_display): Check for overflow more accurately, and without
18621 relying on undefined behavior.
18622
18623 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18624 Remove, replacing with the new symbols in lisp.h. All uses changed.
18625 * fileio.c (make_temp_name):
18626 * filelock.c (lock_file_1, lock_file):
18627 * xdisp.c (message_dolog):
18628 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18629 Use pMd etc. instead.
18630 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18631 replacing the pWIDE etc. symbols removed from editfns.c.
18632
18633 * keyboard.h (num_input_events): Now uintmax_t.
18634 This is (very slightly) less likely to mess up due to wraparound.
18635 All uses changed.
18636
18637 * buffer.c: Integer signedness fixes.
18638 (alloc_buffer_text, enlarge_buffer_text):
18639 Use ptrdiff_t rather than size_t when either will do, as we prefer
18640 signed integers.
18641
18642 * alloc.c: Integer signedness and overflow fixes.
18643 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18644 (__malloc_size_t): Default to size_t, not to int.
18645 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18646 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18647 Prefer ptrdiff_t to size_t when either would do, as we prefer
18648 signed integers.
18649 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18650 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18651 Now const. Initialize with values that are in range even if char
18652 is signed.
18653 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18654 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18655 These functions do the right thing with sizes > 2**32.
18656 (check_depth): Now ptrdiff_t, not int.
18657 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18658 Adjust to new way of storing sizes. Check for size overflow bugs
18659 in rest of code.
18660 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18661 slightly wrong anyway, as it missed one instance of
18662 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18663 (refill_memory_reserve): Omit needless cast to size_t.
18664 (mark_object_loop_halt): Mark as externally visible.
18665
18666 * xselect.c: Integer signedness and overflow fixes.
18667 (Fx_register_dnd_atom, x_handle_dnd_message):
18668 Use ptrdiff_t, not size_t, since we prefer signed.
18669 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18670 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18671 x_dnd_atoms_size and x_dnd_atoms_length.
18672
18673 * doprnt.c: Prefer signed to unsigned when either works.
18674 * eval.c (verror):
18675 * doprnt.c (doprnt):
18676 * lisp.h (doprnt):
18677 * xdisp.c (vmessage):
18678 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18679 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18680 prefer signed arithmetic to avoid comparison confusion.
18681 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18682 but is a bit tricky.
18683
18684 Assume freestanding C89 headers, string.h, stdlib.h.
18685 * data.c, doprnt.c, floatfns.c, print.c:
18686 Include float.h unconditionally.
18687 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18688 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18689 * regex.c: Likewise for stddef.h, string.h.
18690 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18691 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18692 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18693 (STDC_HEADERS): Remove obsolete defines.
18694 * sysdep.c: Include limits.h unconditionally.
18695
18696 Assume support for memcmp, memcpy, memmove, memset.
18697 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18698 * regex.c (memcmp, memcpy):
18699 Remove; we assume C89 now.
18700
18701 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18702 (__malloc_safe_bcopy): Remove; no longer needed.
18703
18704 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18705 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18706 well either way, and we prefer signed to unsigned.
18707
187082011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18709
18710 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18711 closes the connection while we're reading (bug#9182).
18712
187132011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18714
18715 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18716 are specified (Bug#9168).
18717
187182011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18719
18720 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18721 Found by GCC static checking and --with-wide-int on a 32-bit host.
18722
187232011-07-25 Eli Zaretskii <eliz@gnu.org>
18724
18725 * xdisp.c (compute_display_string_pos): Fix logic of caching
18726 previous display string position. Initialize cached_prev_pos to
18727 -1. Fixes slow-down at the beginning of a buffer.
18728
187292011-07-24 Eli Zaretskii <eliz@gnu.org>
18730
18731 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18732 for attrs[LFACE_FONTSET_INDEX].
18733
187342011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18735
18736 * xml.c (parse_region): Remove unused local
18737 that was recently introduced.
18738
187392011-07-23 Eli Zaretskii <eliz@gnu.org>
18740
18741 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18742 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18743
18744 * xdisp.c (move_it_in_display_line_to): Record the best matching
18745 position for TO_CHARPOS while scanning the line, and restore it on
18746 exit if none of the characters scanned was an exact match.
18747 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18748 when exact match is impossible due to invisible text, and the
18749 lines are truncated.
18750
187512011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18752
18753 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18754 for OSX >= 10.7.
18755
187562011-07-22 Eli Zaretskii <eliz@gnu.org>
18757
18758 Fix a significant slow-down of cursor motion with C-n, C-p,
18759 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18760 auto-repeat under bidi redisplay in fontified buffers.
18761 * xdisp.c (compute_stop_pos_backwards): New function.
18762 (next_element_from_buffer): Call compute_stop_pos_backwards to
18763 find a suitable prev_stop when we find ourselves before
18764 base_level_stop.
18765 (reseat): Don't look for prev_stop, as that could mean a very long
18766 run.
18767 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18768 <cached_disp_overlay_modiff>: Cache for last found display string
18769 position.
18770 (compute_display_string_pos): Return the cached position if asked
18771 about the same buffer in the same area of character positions, and
18772 the buffer wasn't changed since the time the display string
18773 position was cached.
18774
187752011-07-22 Eli Zaretskii <eliz@gnu.org>
18776
18777 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18778 is an integer, which is important for empty lines. (Bug#9149)
18779
187802011-07-22 Chong Yidong <cyd@stupidchicken.com>
18781
18782 * frame.c (Fmodify_frame_parameters): In tty case, update the
18783 default face if necessary (Bug#4238).
18784
187852011-07-21 Chong Yidong <cyd@stupidchicken.com>
18786
18787 * editfns.c (Fstring_to_char): No need to explain what a character
18788 is in the docstring (Bug#6576).
18789
187902011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18791
18792 * xml.c (parse_region): Make sure we always return a tree.
18793
187942011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18795
18796 * xml.c (parse_region): If a document contains only comments,
18797 return that, too.
18798
187992011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18800
18801 * xml.c (make_dom): Return comments, too.
18802
188032011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18804
18805 Port to OpenBSD.
18806 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18807 and the surrounding thread.
18808 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18809 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18810 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18811 timer goes off.
18812 * s/openbsd.h (BROKEN_SIGIO): Define.
18813 * unexelf.c (unexec) [__OpenBSD__]:
18814 Don't update the .mdebug section of the Alpha COFF symbol table.
18815
188162011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18817
18818 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18819 (bug#8460).
18820
188212011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18822
18823 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18824 This fixes some race conditions on the permissions of any newly
18825 created file.
18826
18827 * alloc.c (valid_pointer_p): Use pipe, not open.
18828 This fixes some permissions issues when debugging.
18829
18830 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18831 If fchown fails to set both uid and gid, try to set just gid,
18832 as that is sometimes allowed. Adjust the file's mode to eliminate
18833 setuid or setgid bits that are inappropriate if fchown fails.
18834
188352011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18836
18837 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18838 to compare Lisp_Objects.
18839 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18840 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18841 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18842
188432011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18844
18845 * lread.c (read_integer): Unread even EOF character.
18846 (read1): Likewise. Properly record start position of symbol.
18847
18848 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18849 symbol character follows.
18850
188512011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18852
18853 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18854 This works around a problem with the previous change to Fcopy_file.
18855 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18856 and without this change, GCC might complain about discarding
18857 fchown's return value.
18858
188592011-07-16 Juanma Barranquero <lekktu@gmail.com>
18860
18861 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18862
188632011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18864
18865 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18866
188672011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18868
18869 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18870 it's used from the C level.
18871
18872 * process.c: Use the same condition for POLL_FOR_INPUT in both
18873 keyboard.c and process.c (bug#1858).
18874
188752011-07-09 Lawrence Mitchell <wence@gmx.li>
18876
18877 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18878 (Fgnutls_boot): Use it.
18879
188802011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18881
18882 * doc.c (Fsubstitute_command_keys): Revert last change.
18883
188842011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18885
18886 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18887 quotes the next character, and doesn't affect other longer
18888 sequences (bug#8935).
18889
18890 * lread.c (syms_of_lread): Clarify that is isn't only
18891 `eval-buffer' and `eval-defun' that's affected by
18892 `lexical-binding' (bug#8460).
18893
188942011-07-15 Eli Zaretskii <eliz@gnu.org>
18895
18896 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18897 bidi redisplay when a line includes both an image and is truncated.
18898
188992011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18900
18901 Fix minor problems found by static checking.
18902 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18903 (elsz): Now a signed constant, not a size_t var. We prefer signed
18904 types to unsigned, to avoid integer comparison confusion. Without
18905 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18906 "cannot optimize loop, the loop counter may overflow", a symptom
18907 of the confusion.
18908 * indent.c (Fvertical_motion): Mark locals as initialized.
18909 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18910
189112011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18912
18913 * search.c (Fre_search_backward): Mention `case-fold-search' in
18914 all the re_search_* functions (bug#8138).
18915
18916 * keyboard.c (Fopen_dribble_file): Document when the file is
18917 closed (bug#8056).
18918
189192011-07-14 Eli Zaretskii <eliz@gnu.org>
18920
18921 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18922 bidi_cache_idx.
18923
18924 Support bidi reordering of display and overlay strings.
18925 * xdisp.c (compute_display_string_pos)
18926 (compute_display_string_end): Accept additional argument STRING.
18927 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18928 (reseat_to_string): Initialize bidi_it->string.s and
18929 bidi_it->string.schars.
18930 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18931 NULL (avoids a crash in bidi_paragraph_init).
18932 Initialize itb.string.lstring.
18933 (init_iterator): Call bidi_init_it only of a valid
18934 buffer position was specified. Initialize paragraph_embedding to
18935 L2R.
18936 (reseat_to_string): Initialize the bidi iterator.
18937 (display_string): If we need to ignore text properties of
18938 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18939 original value of -1 will not work with bidi.)
18940 (compute_display_string_pos): First arg is now struct
18941 `text_pos *'; all callers changed. Support display properties on
18942 Lisp strings.
18943 (compute_display_string_end): Support display properties on Lisp
18944 strings.
18945 (init_iterator, reseat_1, reseat_to_string): Initialize the
18946 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18947 when iterating on a string not from display properties).
18948 (compute_display_string_pos, compute_display_string_end):
18949 Fix calculation of the object to scan. Fixes an error when using
18950 arrow keys.
18951 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18952 base_level_stop; instead, set base_level_stop to BEGV.
18953 Fixes crashes in vertical-motion.
18954 (next_element_from_buffer): Improve commentary for when
18955 the iterator is before prev_stop.
18956 (init_iterator): Initialize bidi_p from the default value of
18957 bidi-display-reordering, not from buffer-local value. Use the
18958 buffer-local value only if initializing for buffer iteration.
18959 (handle_invisible_prop): Support invisible properties on strings
18960 that are being bidi-reordered.
18961 (set_iterator_to_next): Support bidi reordering of C strings and
18962 Lisp strings.
18963 (next_element_from_string): Support bidi reordering of Lisp
18964 strings.
18965 (handle_stop_backwards): Support Lisp strings as well.
18966 (display_string): Support display of R2L glyph rows.
18967 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18968 (init_iterator): Don't initialize it->bidi_p for strings
18969 here.
18970 (reseat_to_string): Initialize it->bidi_p for strings here.
18971 (next_element_from_string, next_element_from_c_string)
18972 (next_element_from_buffer): Add xassert's for correspondence
18973 between IT's object being iterated and it->bidi_it.string
18974 structure.
18975 (face_before_or_after_it_pos): Support bidi iteration.
18976 (next_element_from_c_string): Handle the case of the first string
18977 character that is not the first one in the visual order.
18978 (get_visually_first_element): New function, refactored from common
18979 parts of next_element_from_buffer, next_element_from_string, and
18980 next_element_from_c_string.
18981 (tool_bar_lines_needed, redisplay_tool_bar)
18982 (display_menu_bar): Force left-to-right direction. Add a FIXME
18983 comment for making that be controlled by a user option.
18984 (push_it, pop_it): Save and restore the state of the
18985 bidi iterator. Save and restore the bidi_p flag.
18986 (pop_it): Iterate out of display property for string iteration as
18987 well.
18988 (iterate_out_of_display_property): Support iteration over strings.
18989 (handle_single_display_spec): Set up it->bidi_it for iteration
18990 over a display string, and call bidi_init_it.
18991 (handle_single_display_spec, next_overlay_string)
18992 (get_overlay_strings_1, push_display_prop): Set up the bidi
18993 iterator for displaying display or overlay strings.
18994 (forward_to_next_line_start): Don't use the shortcut if
18995 bidi-iterating.
18996 (back_to_previous_visible_line_start): If handle_display_prop
18997 pushed the iterator stack, restore the internal state of the bidi
18998 iterator by calling bidi_pop_it same number of times.
18999 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
19000 and we are bidi-iterating, don't decrement the iterator position;
19001 instead, set the first_elt flag in the bidi iterator, to produce
19002 the same effect.
19003 (reseat_1): Remove redundant setting of string_from_display_prop_p.
19004 (push_display_prop): xassert that we are iterating a buffer.
19005 (push_it, pop_it): Save and restore paragraph_embedding member.
19006 (handle_single_display_spec, next_overlay_string)
19007 (get_overlay_strings_1, reseat_1, reseat_to_string)
19008 (push_display_prop): Set up the `unibyte' member of bidi_it.string
19009 correctly. Don't assume unibyte strings are not bidi-reordered.
19010 (compute_display_string_pos)
19011 (compute_display_string_end): Fix handling the case of C string.
19012 (push_it, pop_it): Save and restore from_disp_prop_p.
19013 (handle_single_display_spec, push_display_prop): Set the
19014 from_disp_prop_p flag.
19015 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
19016 (pop_it): Call iterate_out_of_display_property only if we are
19017 popping after iteration over a string that came from a display
19018 property. Fix a typo in popping stretch info. Add an assertion
19019 for verifying that the iterator position is in sync with the bidi
19020 iterator.
19021 (handle_single_display_spec, get_overlay_strings_1)
19022 (push_display_prop): Fix initialization of paragraph direction for
19023 string when that of the parent object is not yet determined.
19024 (reseat_1): Call bidi_init_it to resync the bidi
19025 iterator with IT's position. (Bug#7616)
19026 (find_row_edges): If ROW->start.pos gives position
19027 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
19028 (handle_stop, back_to_previous_visible_line_start, reseat_1):
19029 Reset the from_disp_prop_p flag.
19030 (SAVE_IT, RESTORE_IT): New macros.
19031 (pos_visible_p, face_before_or_after_it_pos)
19032 (back_to_previous_visible_line_start)
19033 (move_it_in_display_line_to, move_it_in_display_line)
19034 (move_it_to, move_it_vertically_backward, move_it_by_lines)
19035 (try_scrolling, redisplay_window, display_line): Use them when
19036 saving a temporary copy of the iterator and restoring it back.
19037 (back_to_previous_visible_line_start, reseat_1)
19038 (init_iterator): Empty the bidi cache "stack".
19039 (move_it_in_display_line_to): If iterator ended up at
19040 EOL, but we never saw any buffer positions smaller than
19041 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
19042 motion in bidi-reordered lines.
19043 (move_it_in_display_line_to): Record prev_method and prev_pos
19044 immediately before the call to set_iterator_to_next. Fixes cursor
19045 motion in bidi-reordered lines with stretch glyphs and strings
19046 displayed in margins. (Bug#8133) (Bug#8867)
19047 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
19048 TO_CHARPOS.
19049 (pos_visible_p): Support positions in bidi-reordered lines.
19050 Save and restore bidi cache.
19051
19052 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
19053 (bidi_paragraph_info): Delete unused struct.
19054 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
19055 (bidi_cache_start): New variable.
19056 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
19057 to zero.
19058 (bidi_cache_fetch_state, bidi_cache_search)
19059 (bidi_cache_find_level_change, bidi_cache_iterator_state)
19060 (bidi_cache_find, bidi_peek_at_next_level)
19061 (bidi_level_of_next_char, bidi_find_other_level_edge)
19062 (bidi_move_to_visually_next): Compare cache index with
19063 bidi_cache_start rather than with zero.
19064 (bidi_fetch_char): Accept new argument STRING; all callers
19065 changed. Support iteration over a string. Support strings with
19066 display properties. Support unibyte strings. Fix the type of
19067 `len' according to what STRING_CHAR_AND_LENGTH expects.
19068 (bidi_paragraph_init, bidi_resolve_explicit_1)
19069 (bidi_resolve_explicit, bidi_resolve_weak)
19070 (bidi_level_of_next_char, bidi_move_to_visually_next):
19071 Support iteration over a string.
19072 (bidi_set_sor_type, bidi_resolve_explicit_1)
19073 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
19074 can now be zero (for strings); special values 0 and -1 were
19075 changed to -1 and -2, respectively.
19076 (bidi_char_at_pos): New function.
19077 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
19078 Call it instead of FETCH_MULTIBYTE_CHAR.
19079 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
19080 initialized to valid values.
19081 (bidi_init_it): Don't initialize charpos and bytepos with invalid
19082 values.
19083 (bidi_level_of_next_char): Allow the sentinel "position" to pass
19084 the test for valid cached positions. Fix the logic for looking up
19085 the sentinel state in the cache. GCPRO the Lisp string we are
19086 iterating.
19087 (bidi_push_it, bidi_pop_it): New functions.
19088 (bidi_initialize): Initialize the bidi cache start stack pointer.
19089 (bidi_cache_ensure_space): New function, refactored from part of
19090 bidi_cache_iterator_state. Don't assume the required size is just
19091 one BIDI_CACHE_CHUNK away.
19092 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
19093 (bidi_count_bytes, bidi_char_at_pos): New functions.
19094 (bidi_cache_search): Don't assume bidi_cache_last_idx is
19095 always valid if bidi_cache_idx is valid.
19096 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
19097 is valid if it's going to be used.
19098 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
19099 (bidi_cache_fetch_state, bidi_cache_search)
19100 (bidi_cache_find_level_change, bidi_cache_ensure_space)
19101 (bidi_cache_iterator_state, bidi_cache_find)
19102 (bidi_find_other_level_edge, bidi_cache_start_stack):
19103 All variables related to cache indices are now EMACS_INT.
19104
19105 * dispextern.h (struct bidi_string_data): New structure.
19106 (struct bidi_it): New member `string'. Make flag members be 1-bit
19107 fields, and put them last in the struct.
19108 (compute_display_string_pos, compute_display_string_end):
19109 Update prototypes.
19110 (bidi_push_it, bidi_pop_it): Add prototypes.
19111 (struct iterator_stack_entry): New members bidi_p,
19112 paragraph_embedding, and from_disp_prop_p.
19113 (struct it): Member bidi_p is now a bit field 1 bit wide.
19114 (bidi_shelve_cache, bidi_unshelve_cache):
19115 Declare prototypes.
19116
19117 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
19118 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
19119 and vector-like objects.
19120
19121 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
19122 cache around display iteration.
19123
19124 * window.c (Fwindow_end, window_scroll_pixel_based)
19125 (displayed_window_lines, Frecenter): Save and restore the bidi
19126 cache around display iteration.
19127
191282011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
19129
19130 * editfns.c (Fdelete_region): Clarify the use of the named
19131 parameters (bug#6788).
19132
191332011-07-14 Martin Rudalics <rudalics@gmx.at>
19134
19135 * indent.c (Fvertical_motion): Set and restore w->pointm when
19136 saving and restoring the window's buffer (Bug#9006).
19137
191382011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
19139
19140 * editfns.c (Fstring_to_char): Clarify just what is returned
19141 (bug#6576). Text by Eli Zaretskii.
19142
191432011-07-13 Juanma Barranquero <lekktu@gmail.com>
19144
19145 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
19146
191472011-07-13 Eli Zaretskii <eliz@gnu.org>
19148
19149 * buffer.c (mmap_find): Fix a typo.
19150
191512011-07-13 Johan Bockgård <bojohan@gnu.org>
19152
19153 Fix execution of x selection hooks.
19154 * xselect.c (Qx_lost_selection_functions)
19155 (Qx_sent_selection_functions): New vars.
19156 (syms_of_xselect): DEFSYM them.
19157 (x_handle_selection_request): Pass Qx_sent_selection_functions
19158 rather than Vx_sent_selection_functions to Frun_hook_with_args.
19159 (x_handle_selection_clear,x_clear_frame_selections):
19160 Pass Qx_lost_selection_functions rather than
19161 Vx_lost_selection_functions to Frun_hook_with_args.
19162
191632011-07-13 Paul Eggert <eggert@cs.ucla.edu>
19164
19165 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
19166 The old code sometimes used this field without initializing it.
19167
19168 * alloc.c (gc_sweep): Don't read past end of array.
19169 In theory, the old code could also have corrupted Emacs internals,
19170 though it'd be very unlikely.
19171
191722011-07-12 Andreas Schwab <schwab@linux-m68k.org>
19173
19174 * character.c (Fcharacterp): Don't advertise optional ignored
19175 argument. (Bug#4026)
19176
191772011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
19178
19179 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
19180 key" (bug#4257).
19181
19182 * window.c (Fset_window_start): Doc fix (bug#4199).
19183 (Fset_window_hscroll): Ditto.
19184
191852011-07-12 Paul Eggert <eggert@cs.ucla.edu>
19186
19187 Fix minor new problems caught by GCC 4.6.1.
19188 * term.c (init_tty): Remove unused local.
19189 * xsettings.c (store_monospaced_changed): Define this function only
19190 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
19191 not used otherwise.
19192
191932011-07-12 Chong Yidong <cyd@stupidchicken.com>
19194
19195 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
19196
191972011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
19198
19199 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
19200 are the mini-buffer and the echo area (bug#3320).
19201
19202 * term.c (init_tty): Remove support for supdup, c10 and perq
19203 terminals, which are no longer supported (bug#1482).
19204
192052011-07-10 Johan Bockgård <bojohan@gnu.org>
19206
19207 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
19208
192092011-07-10 Jan Djärv <jan.h.d@swipnet.se>
19210
19211 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
19212 for non-popups (Bug#3642).
19213
192142011-07-10 Andreas Schwab <schwab@linux-m68k.org>
19215
19216 * alloc.c (reset_malloc_hooks): Protoize.
19217 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
19218 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
19219 * cm.c (losecursor): Likewise.
19220 * data.c (fmod): Likewise.
19221 * dispnew.c (swap_glyphs_in_rows): Likewise.
19222 * emacs.c (memory_warning_signal): Likewise.
19223 * floatfns.c (float_error): Likewise.
19224 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
19225 (otf_open, font_otf_capability, generate_otf_features)
19226 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
19227 Likewise.
19228 * image.c (pbm_read_file): Likewise.
19229 * indent.c (string_display_width): Likewise.
19230 * intervals.c (check_for_interval, search_for_interval)
19231 (inc_interval_count, count_intervals, root_interval)
19232 (adjust_intervals_for_insertion, make_new_interval): Likewise.
19233 * lread.c (defalias): Likewise.
19234 * ralloc.c (r_alloc_check): Likewise.
19235 * regex.c (set_image_of_range_1, set_image_of_range)
19236 (regex_grow_registers): Likewise.
19237 * sysdep.c (strerror): Likewise.
19238 * termcap.c (valid_filename_p, tprint, main): Likewise.
19239 * tparam.c (main): Likewise.
19240 * unexhp9k800.c (run_time_remap, save_data_space)
19241 (update_file_ptrs, read_header, write_header, calculate_checksum)
19242 (copy_file, copy_rest, display_header): Likewise.
19243 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
19244 Likewise.
19245 * xdisp.c (check_it): Likewise.
19246 * xfaces.c (register_color, unregister_color, unregister_colors):
19247 Likewise.
19248 * xfns.c (print_fontset_result): Likewise.
19249 * xrdb.c (member, fatal, main): Likewise.
19250
192512011-07-10 Paul Eggert <eggert@cs.ucla.edu>
19252
19253 Fix minor problems found by static checking (Bug#9031).
19254 * chartab.c (char_table_set_range, map_sub_char_table):
19255 Remove unused locals.
19256 (uniprop_table): Now static.
19257 * composite.c (_work_char): Remove unused static var.
19258
192592011-07-09 Juanma Barranquero <lekktu@gmail.com>
19260
19261 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
19262
192632011-07-09 Jan Djärv <jan.h.d@swipnet.se>
19264
19265 * gtkutil.c (qttip_cb): Remove code without function.
19266
192672011-07-09 Eli Zaretskii <eliz@gnu.org>
19268
19269 * w32.c (pthread_sigmask): New stub.
19270
192712011-07-08 Paul Eggert <eggert@cs.ucla.edu>
19272
19273 Use pthread_sigmask, not sigprocmask (Bug#9010).
19274 sigprocmask is portable only for single-threaded applications, and
19275 Emacs can be multi-threaded when it uses GTK.
19276 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
19277 (LIBES): Use it.
19278 * callproc.c (Fcall_process):
19279 * process.c (create_process):
19280 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
19281 Use pthread_sigmask, not sigprocmask.
19282
192832011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19284
19285 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
19286 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
19287 wrong (Bug#8591).
19288
192892011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19290
19291 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
19292 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
19293 (xg_hide_tooltip): Fix comment.
19294
19295 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
19296 in registerServicesMenuSendTypes.
19297 (validRequestorForSendType): Don't check ns_return_types.
19298
19299 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
19300 ns_return_type.
19301
193022011-07-08 Jason Rumney <jasonr@gnu.org>
19303
19304 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
19305 SH_SHOW for hidden windows (Bug#5482).
19306
19307 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
19308 frame struct members of non-existent frames (Bug#6284).
19309
193102011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19311
19312 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
19313 variable firstTime not needed on OSX >= 10.6.
19314 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
19315 >= 10.5. Use setKnobProportion, setDoubleValue.
19316
19317 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
19318 (MAC_OS_X_VERSION_10_5): Define if not defined.
19319 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
19320 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
19321 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
19322
19323 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
19324 cString and lossyCString on OSX >= 10.4.
19325
19326 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
19327 sizeToFit on OSX >= 10.2.
19328
19329 * nsimage.m (allocInitFromFile): Don't use deprecated method
19330 bestRepresentationForDevice on OSX >= 10.6.
19331
19332 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
19333 to avoid warning.
19334
19335 * emacs.c: Declare unexec_init_emacs_zone.
19336
19337 * nsgui.h: Fix compiler warning about gnulib redefining verify.
19338
19339 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
19340
19341 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
19342 on svcsMenu (Bug#8842).
19343
19344 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
19345 ns_return_types.
19346 (Fns_list_services): Just return Qnil on 10.6, code not working there.
19347
19348 * nsterm.m (QUTF8_STRING): Declare.
19349 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
19350 (validRequestorForSendType): Return type is (id).
19351 Change indexOfObjectIdenticalTo to indexOfObject.
19352 Check if we have local selection before returning self (Bug#8842).
19353 (writeSelectionToPasteboard): Put local selection into paste board
19354 if we have a local selection (Bug#8842).
19355 (syms_of_nsterm): DEFSYM QUTF8_STRING.
19356
19357 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
19358 (ns_get_local_selection): Declare.
19359
193602011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
19361
19362 * keymap.c (describe_map_tree): Don't insert a double newline at
19363 the end of the buffer (bug#1169) and return whether we inserted
19364 something.
19365
19366 * callint.c (Fcall_interactively): Change "reading args" to
19367 "providing args" to try to clarify what it does (bug#1010).
19368
193692011-07-07 Kenichi Handa <handa@m17n.org>
19370
19371 * composite.c (composition_compute_stop_pos): Ignore a static
19372 composition starting before CHARPOS (Bug#8915).
19373
19374 * xdisp.c (handle_composition_prop): Likewise.
19375
193762011-07-07 Eli Zaretskii <eliz@gnu.org>
19377
19378 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19379 (Bug#9015)
19380
193812011-07-07 Kenichi Handa <handa@m17n.org>
19382
19383 * character.h (unicode_category_t): New enum type.
19384
19385 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19386 (Qchar_code_property_table): New variable.
19387 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19388 (UNIPROP_COMPRESSED_FORM_P): New macros.
19389 (char_table_ascii): Uncompress the compressed values.
19390 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19391 Uncompress the compressed values.
19392 (sub_char_table_ref_and_range): Likewise.
19393 (char_table_ref_and_range): Uncompress the compressed values.
19394 (sub_char_table_set): New arg is_uniprop. Callers changed.
19395 Uncompress the compressed values.
19396 (sub_char_table_set_range): Args changed. Callers changed.
19397 (char_table_set_range): Adjuted for the above change.
19398 (map_sub_char_table): Delete args default_val and parent. Add arg
19399 top. Give decoded values to a Lisp function.
19400 (map_char_table): Adjust for the above change. Give decoded
19401 values to a Lisp function. Gcpro more variables.
19402 (uniprop_table_uncompress)
19403 (uniprop_decode_value_run_length): New functions.
19404 (uniprop_decoder, uniprop_decoder_count): New variables.
19405 (uniprop_get_decoder, uniprop_encode_value_character)
19406 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19407 New functions.
19408 (uniprop_encoder, uniprop_encoder_count): New variables.
19409 (uniprop_get_encoder, uniprop_table)
19410 (Funicode_property_table_internal, Fget_unicode_property_internal)
19411 (Fput_unicode_property_internal): New functions.
19412 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19413 Sunicode_property_table_internal, Sget_unicode_property_internal,
19414 and Sput_unicode_property_internal. Defvar_lisp
19415 char-code-property-alist.
19416
19417 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
19418 Vunicode_category_table.
19419
19420 * font.c (font_range): Adjust for the change of
19421 Vunicode_category_table.
19422
194232011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19424
19425 * m/iris4d.h: Remove file, move contents ...
19426 * s/irix6-5.h: ... here.
19427
194282011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19429
19430 Remove unportable assumption about struct layout (Bug#8884).
19431 * alloc.c (mark_buffer):
19432 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19433 (clone_per_buffer_values): Don't assume that
19434 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19435 This isn't true in general, and it's particularly not true
19436 if Emacs is configured with --with-wide-int.
19437 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19438 New macros, used in the buffer.c change.
19439
194402011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19441
19442 * xsettings.c: Use both GConf and GSettings if both are available.
19443 (store_config_changed_event): Add comment.
19444 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19445 (store_tool_bar_style_changed): New functions.
19446 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
19447 (struct xsettings): Move font inside HAVE_XFT.
19448 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
19449 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
19450 Move inside HAVE_XFT.
19451 (something_changed_gsettingsCB): Rename from something_changedCB.
19452 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19453 also.
19454 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
19455 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
19456 (something_changed_gconfCB): Rename from something_changedCB.
19457 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19458 (parse_settings): Move check for font inside HAVE_XFT.
19459 (read_settings, apply_xft_settings): Add comment.
19460 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19461 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19462 call store_font_name_changed.
19463 (xft_settings_event): Add comment.
19464 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19465 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19466 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19467 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19468 (xsettings_initialize): Call init_gsettings last.
19469 (xsettings_get_system_font, xsettings_get_system_normal_font):
19470 Add comment.
19471
194722011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19473
19474 Random fixes. E.g., (random) never returned negative values.
19475 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19476 subseconds part to the entropy, as that's a bit more random.
19477 Prefer signed to unsigned, since the signedness doesn't matter and
19478 in general we prefer signed. When given a limit, use a
19479 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19480 latter isn't right if USE_2_TAGS_FOR_INTS.
19481 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19482 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19483
194842011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19485
19486 * textprop.c (text_property_stickiness):
19487 Obey Vtext_property_default_nonsticky.
19488 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19489 * w32fns.c (syms_of_w32fns):
19490 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19491
194922011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19493
19494 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19495 This is more efficient than Ffile_directory_p and avoids a minor race.
19496
194972011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19498
19499 * buffer.c (Foverlay_put): Say what the return value is
19500 (bug#7835).
19501
19502 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19503 is a directory before asking whether to use the file name
19504 (bug#7564).
19505 (barf_or_query_if_file_exists): Make the "File is a directory"
19506 error be more correct.
19507
19508 * fns.c (Frequire): Remove the mention of the .gz files, since
19509 that's installation-specific, but keep the mention of
19510 `get-load-suffixes'.
19511
195122011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19513
19514 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19515 Report string overflow if the output is too long.
19516
195172011-07-04 Juanma Barranquero <lekktu@gmail.com>
19518
19519 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19520 (syms_of_gnutls): Remove duplicate DEFSYM for
19521 Qgnutls_bootprop_verify_hostname_error, an error for
19522 Qgnutls_bootprop_verify_error (which is no longer used).
19523
19524 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19525 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19526 Also (re)move comments that are misplaced or no longer relevant.
19527
195282011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19529
19530 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19531
195322011-07-03 Chong Yidong <cyd@stupidchicken.com>
19533
19534 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19535 and background color parameters if they have been changed.
19536
195372011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19538
19539 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19540
195412011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19542
19543 * xsettings.c (SYSTEM_FONT): Define only when used.
19544 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19545
19546 * keymap.c (access_keymap_1): Now static.
19547
195482011-07-02 Chong Yidong <cyd@stupidchicken.com>
19549
19550 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19551 leave any prefix arg for the up event (Bug#1586).
19552
195532011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19554
19555 * lread.c (syms_of_lread): Mention single symbols defined by
19556 `defvar' or `defconst' (bug#7154).
19557
19558 * fns.c (Frequire): Mention .el.gz files (bug#7314).
19559 (Frequire): Mention get-load-suffixes.
19560
195612011-07-02 Martin Rudalics <rudalics@gmx.at>
19562
19563 * window.h (window): Remove clone_number slot.
19564 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19565 Remove.
19566 (make_parent_window, make_window, saved_window)
19567 (Fset_window_configuration, save_window_save): Don't deal with
19568 clone numbers.
19569 * buffer.c (Qclone_number): Remove declaration.
19570 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19571
195722011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19573
19574 Add multiple inheritance to keymaps.
19575 * keymap.c (Fmake_composed_keymap): New function.
19576 (Fset_keymap_parent): Simplify.
19577 (fix_submap_inheritance): Remove.
19578 (access_keymap_1): New function extracted from access_keymap to handle
19579 embedded parents and handle lists of maps.
19580 (access_keymap): Use it.
19581 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19582 (Fcopy_keymap): Handle embedded parents.
19583 (Fcommand_remapping, define_as_prefix): Simplify.
19584 (Fkey_binding): Simplify.
19585 (syms_of_keymap): Move minibuffer-local-completion-map,
19586 minibuffer-local-filename-completion-map,
19587 minibuffer-local-must-match-map, and
19588 minibuffer-local-filename-must-match-map to Elisp.
19589 (syms_of_keymap): Defsubr make-composed-keymap.
19590 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19591 (parse_menu_item): Trivial simplification.
19592
195932011-07-01 Glenn Morris <rgm@gnu.org>
19594
19595 * Makefile.in (SETTINGS_LIBS): Fix typo.
19596
195972011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19598
19599 * coding.c (Fencode_coding_string): Record the last coding system
19600 used, as the function doc string says (bug#8738).
19601
196022011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19603
19604 * xsettings.c (store_monospaced_changed): Take new font as arg and
19605 check for change against current_mono_font.
19606 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19607 (emacs_settings_constructor, emacs_settings_get_property)
19608 (emacs_settings_set_property, emacs_settings_class_init)
19609 (emacs_settings_init, gsettings_obj): Remove.
19610 (something_changedCB): New function for HAVE_GSETTINGS.
19611 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19612 with value as argument.
19613 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19614 g_settings_new (Bug#8967). Do not create gsettings_obj.
19615 Remove calls to g_settings_bind. Connect something_changedCB to
19616 "changed".
19617
19618 * xgselect.c: Add defined (HAVE_GSETTINGS).
19619 (xgselect_initialize): Ditto.
19620
19621 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19622 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19623 xg_select.
19624
196252011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19626
19627 * eval.c (struct backtrace): Simplify and port the data structure.
19628 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19629 signed bit field, as this assumption is not portable and it makes
19630 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19631 "char debug_on_exit : 1" as this is not portable either; instead,
19632 use the portable "unsigned int debug_on_exit : 1". Remove unused
19633 member evalargs. Remove obsolete comments about cc bombing out.
19634
196352011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19636
19637 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19638 Let HAVE_GSETTINGS override HAVE_GCONF.
19639 (store_monospaced_changed): New function.
19640 (EMACS_SETTINGS): A new type derived from GObject to handle
19641 GSettings notifications.
19642 (emacs_settings_constructor, emacs_settings_get_property)
19643 (emacs_settings_set_property, emacs_settings_class_init):
19644 New functions.
19645 (gsettings_client, gsettings_obj): New variables.
19646 (GSETTINGS_SCHEMA): New define.
19647 (something_changedCB): Call store_monospaced_changed.
19648 (init_gsettings): New function.
19649 (xsettings_initialize): Call init_gsettings.
19650 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19651 to NULL.
19652
19653 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19654 GCONF_CFLAGS/LIBS.
19655
196562011-06-29 Martin Rudalics <rudalics@gmx.at>
19657
19658 * window.c (resize_root_window, grow_mini_window)
19659 (shrink_mini_window): Rename Qresize_root_window to
19660 Qwindow_resize_root_window and Qresize_root_window_vertically to
19661 Qwindow_resize_root_window_vertically.
19662
196632011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19664
19665 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19666
196672011-06-27 Juanma Barranquero <lekktu@gmail.com>
19668
19669 * makefile.w32-in: Redesign dependencies so they reflect more
19670 clearly which files are directly included by each source file,
19671 and not through other includes.
19672
196732011-06-27 Martin Rudalics <rudalics@gmx.at>
19674
19675 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19676 (sort_overlays, overlay_strings): When an overlay's clone number
19677 matches the window's clone number process the overlay even if
19678 the overlay's window property doesn't match the current window.
19679
19680 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19681 (Fwindow_hchild): Rename to Fwindow_left_child.
19682 (Fwindow_next): Rename to Fwindow_next_sibling.
19683 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19684 (resize_window_check): Rename to window_resize_check.
19685 (resize_window_apply): Rename to window_resize_apply.
19686 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19687 (Fdelete_other_windows_internal, resize_frame_windows)
19688 (Fsplit_window_internal, Fdelete_window_internal)
19689 (grow_mini_window, shrink_mini_window)
19690 (Fresize_mini_window_internal): Fix callers accordingly.
19691
196922011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19693
19694 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19695 (emacs_fixed_set_min_size): Remove.
19696 (emacs_fixed_new): Take frame as argument.
19697
19698 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19699 (_EmacsFixedPrivate): Remove minwidth/height.
19700 Add struct frame *f.
19701 (emacs_fixed_init): Initialize priv->f.
19702 (get_parent_class, emacs_fixed_set_min_size): Remove.
19703 (emacs_fixed_new): Set priv->f to argument.
19704 (emacs_fixed_get_preferred_width)
19705 (emacs_fixed_get_preferred_height): Use min_width/height from
19706 frames size_hint to set minimum and natural (Bug#8919).
19707 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19708 and use min_width/height from frames size_hint to set
19709 min_width/height (Bug#8919).
19710
19711 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19712 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19713 Fix indentation.
19714
197152011-06-26 Eli Zaretskii <eliz@gnu.org>
19716
19717 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19718 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19719 called at ZV.
19720
197212011-06-26 Chong Yidong <cyd@stupidchicken.com>
19722
19723 * process.c (wait_reading_process_output): Bypass select if
19724 waiting for a cell while ignoring keyboard input, and input is
19725 pending. Suggested by Jan Djärv (Bug#8869).
19726
197272011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19728
19729 Use gnulib's dup2 module instead of rolling our own.
19730 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19731
197322011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19733
19734 * dispnew.c (scrolling_window): Before scrolling, turn off a
19735 mouse-highlight in the window being scrolled.
19736
197372011-06-24 Juanma Barranquero <lekktu@gmail.com>
19738
19739 Move DEFSYM to lisp.h and use everywhere.
19740
19741 * character.h (DEFSYM): Move declaration...
19742 * lisp.h (DEFSYM): ...here.
19743
19744 * gnutls.c:
19745 * minibuf.c:
19746 * w32menu.c:
19747 * w32proc.c:
19748 * w32select.c: Don't include character.h.
19749
19750 * alloc.c (syms_of_alloc):
19751 * buffer.c (syms_of_buffer):
19752 * bytecode.c (syms_of_bytecode):
19753 * callint.c (syms_of_callint):
19754 * casefiddle.c (syms_of_casefiddle):
19755 * casetab.c (init_casetab_once):
19756 * category.c (init_category_once, syms_of_category):
19757 * ccl.c (syms_of_ccl):
19758 * cmds.c (syms_of_cmds):
19759 * composite.c (syms_of_composite):
19760 * dbusbind.c (syms_of_dbusbind):
19761 * dired.c (syms_of_dired):
19762 * dispnew.c (syms_of_display):
19763 * doc.c (syms_of_doc):
19764 * editfns.c (syms_of_editfns):
19765 * emacs.c (syms_of_emacs):
19766 * eval.c (syms_of_eval):
19767 * fileio.c (syms_of_fileio):
19768 * fns.c (syms_of_fns):
19769 * frame.c (syms_of_frame):
19770 * fringe.c (syms_of_fringe):
19771 * insdel.c (syms_of_insdel):
19772 * keymap.c (syms_of_keymap):
19773 * lread.c (init_obarray, syms_of_lread):
19774 * macros.c (syms_of_macros):
19775 * msdos.c (syms_of_msdos):
19776 * print.c (syms_of_print):
19777 * process.c (syms_of_process):
19778 * search.c (syms_of_search):
19779 * sound.c (syms_of_sound):
19780 * syntax.c (init_syntax_once, syms_of_syntax):
19781 * terminal.c (syms_of_terminal):
19782 * textprop.c (syms_of_textprop):
19783 * undo.c (syms_of_undo):
19784 * w32.c (globals_of_w32):
19785 * window.c (syms_of_window):
19786 * xdisp.c (syms_of_xdisp):
19787 * xfaces.c (syms_of_xfaces):
19788 * xfns.c (syms_of_xfns):
19789 * xmenu.c (syms_of_xmenu):
19790 * xsettings.c (syms_of_xsettings):
19791 * xterm.c (syms_of_xterm): Use DEFSYM.
19792
197932011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19794
19795 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19796
197972011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19798
19799 Integer and buffer overflow fixes (Bug#8873).
19800
19801 * print.c (printchar, strout): Check for string overflow.
19802 (PRINTPREPARE, printchar, strout):
19803 Don't set size unless allocation succeeds.
19804
19805 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19806 for sizes. Check for string overflow more accurately.
19807 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19808
19809 * macros.c: Integer and buffer overflow fixes.
19810 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19811 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19812 Use ptrdiff_t, not int, for sizes.
19813 Don't increment bufsize until after realloc succeeds.
19814 Check for size-calculation overflow.
19815 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19816
19817 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19818
19819 * lread.c: Integer overflow fixes.
19820 (read_integer): Radix is now EMACS_INT, not int,
19821 to improve quality of diagnostics for out-of-range radices.
19822 Calculate buffer size correctly for out-of-range radices.
19823 (read1): Check for integer overflow in radices, and in
19824 read-circle numbers.
19825 (read_escape): Avoid int overflow.
19826 (Fload, openp, read_buffer_size, read1)
19827 (substitute_object_recurse, read_vector, read_list, map_obarray):
19828 Use ptrdiff_t, not int, for sizes.
19829 (read1): Use EMACS_INT, not int, for sizes.
19830 Check for size overflow.
19831
19832 * image.c (cache_image): Check for size arithmetic overflow.
19833
19834 * lread.c: Integer overflow issues.
19835 (saved_doc_string_size, saved_doc_string_length)
19836 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19837 Now ptrdiff_t, not int.
19838 (read1): Don't assume doc string length fits in int. Check for
19839 out-of-range doc string lengths.
19840 (read_list): Don't assume file position fits in int.
19841 (read_escape): Check for hex character overflow.
19842
198432011-06-22 Leo Liu <sdl.web@gmail.com>
19844
19845 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19846 Move to minibuffer.el.
19847
198482011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19849
19850 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19851 The following patches are for when GLYPH_DEBUG && !XASSERT.
19852 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19853 * dispnew.c (flush_stdout):
19854 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19855 Mark as externally visible.
19856 * dispnew.c (check_window_matrix_pointers): Now static.
19857 * dispnew.c (window_to_frame_vpos):
19858 * xfns.c (unwind_create_frame):
19859 * xterm.c (x_check_font): Remove unused local.
19860 * scroll.c (CHECK_BOUNDS):
19861 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19862 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19863 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19864 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19865 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19866 Now static.
19867 (debug_method_add): Use va_list and vsprintf rather than relying
19868 on undefined behavior with wrong number of arguments.
19869 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19870 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19871 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19872 since we're not interested in debugging glyphs with old libraries.
19873 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19874 GCC 4.6.0's static checking.
19875
198762011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19877
19878 Integer overflow and signedness fixes (Bug#8873).
19879 A few related buffer overrun fixes, too.
19880
19881 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19882
19883 * dispextern.h (struct face.stipple):
19884 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19885 (x_bitmap_mask, x_allocate_bitmap_record)
19886 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19887 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19888 (x_create_bitmap_from_xpm_data):
19889 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19890 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19891 (.bitmaps_last):
19892 * xfaces.c (load_pixmap):
19893 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19894 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19895 (.bitmaps_last, struct x_output.icon_bitmap):
19896 Use ptrdiff_t, not int, for bitmap indexes.
19897 (x_allocate_bitmap_record): Check for size overflow.
19898 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19899
19900 Use ptrdiff_t, not int, for overlay counts.
19901 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19902 * editfns.c (overlays_around, get_pos_property):
19903 * textprop.c (get_char_property_and_overlay):
19904 * xdisp.c (next_overlay_change, note_mouse_highlight):
19905 * xfaces.c (face_at_buffer_position):
19906 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19907 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19908 (Fnext_overlay_change, Fprevious_overlay_change)
19909 (mouse_face_overlay_overlaps, Foverlays_in):
19910 Use ptrdiff_t, not int, for sizes.
19911 (overlays_at, overlays_in): Check for size-calculation overflow.
19912
19913 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19914
19915 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19916 (x_session_initialize): Do not assume string length fits in int.
19917
19918 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19919 This is unlikely, but can occur if DPI is outlandish.
19920
19921 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19922 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19923
19924 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19925 * xrdb.c (magic_file_p, search_magic_path):
19926 Omit last arg SUFFIX; it was always 0. All callers changed.
19927 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19928
19929 * xfont.c (xfont_match): Avoid need for strlen.
19930
19931 * xfns.c: Don't assume strlen fits in int.
19932 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19933
19934 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19935 not unsigned long, as we prefer signed integers. All callers changed.
19936 Detect integer overflow in repeat count.
19937 (message_dolog): Don't assume print length fits in 39 bytes.
19938 (display_mode_element): Don't assume strlen fits in int.
19939
19940 * termcap.c: Don't assume sizes fit in int and never overflow.
19941 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19942 (gobble_line): Check for size-calculation overflow.
19943
19944 * minibuf.c (Fread_buffer):
19945 * lread.c (intern, intern_c_string):
19946 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19947 Don't assume string length fits in int.
19948
19949 * keyboard.c (parse_tool_bar_item):
19950 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19951
19952 * font.c: Don't assume string length fits in int.
19953 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19954 Use ptrdiff_t, not int.
19955 (font_intern_prop): Don't assume string length fits in int.
19956 Don't assume integer property fits in fixnum.
19957 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19958
19959 * filelock.c: Fix some buffer overrun and integer overflow issues.
19960 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19961 Reformulate so as not to need the command string.
19962 Invoke gzip -cd rather than gunzip, as it's more portable.
19963 (lock_info_type, lock_file_1, lock_file):
19964 Don't assume pid_t and time_t fit in unsigned long.
19965 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19966 (current_lock_owner): Prefer signed type for sizes.
19967 Use memcpy, not strncpy, where memcpy is what is really wanted.
19968 Don't assume (via atoi) that time_t and pid_t fit in int.
19969 Check for time_t and/or pid_t out of range, e.g., via a network share.
19970 Don't alloca where an auto var works fine.
19971
19972 * fileio.c: Fix some integer overflow issues.
19973 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19974 Don't assume string length fits in int.
19975 (directory_file_name): Don't assume string length fits in long.
19976 (make_temp_name): Don't assume pid fits in int, or that its print
19977 length is less than 20.
19978
19979 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19980
19981 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19982
19983 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19984
19985 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19986 We prefer signed integers, even for size calculations.
19987
19988 * emacs.c: Don't assume string length fits in 'int'.
19989 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19990 (main): Don't invoke strlen when not needed.
19991
19992 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19993 (XD_DEBUG_MESSAGE): Don't waste a byte.
19994
19995 * callproc.c (getenv_internal_1, getenv_internal)
19996 (Fgetenv_internal):
19997 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19998
19999 * lread.c (invalid_syntax): Omit length argument.
20000 All uses changed. This doesn't fix a bug, but it simplifies the
20001 code away from its former Hollerith-constant appearance, and it's
20002 one less 'int' to worry about when looking at integer-overflow issues.
20003 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
20004
20005 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
20006 This didn't break anything, but it didn't help either.
20007 It's confusing to put a bogus integer in a place where the actual
20008 value does not matter.
20009 (LIST_END_P): Remove unused macro and its bogus comment.
20010 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
20011
20012 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
20013 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
20014 implementation.
20015 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
20016 We prefer signed types, and the value cannot exceed the EMACS_INT
20017 range anyway (because otherwise the length would not be representable).
20018 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
20019 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
20020 This avoids a GCC warning when WIDE_EMACS_INT.
20021
20022 * indent.c (sane_tab_width): New function.
20023 (current_column, scan_for_column, Findent_to, position_indentation)
20024 (compute_motion): Use it. This is just for clarity.
20025 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
20026
20027 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
20028
20029 * lisp.h (lint_assume): New macro.
20030 * composite.c (composition_gstring_put_cache):
20031 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
20032
20033 * editfns.c, insdel.c:
20034 Omit unnecessary forward decls, to simplify future changes.
20035
20036 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
20037
20038 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
20039
20040 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
20041 Use much-faster test for byte-length change.
20042 Don't assume string byte-length fits in 'int'.
20043 Check that character arg fits in 'int'.
20044 (mapcar1): Declare byte as byte, for clarity.
20045
20046 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
20047
20048 * fns.c (concat): Catch string overflow earlier.
20049 Do not rely on integer wraparound.
20050
20051 * dispextern.h (struct it.overlay_strings_charpos)
20052 (struct it.selective): Now EMACS_INT, not int.
20053 * xdisp.c (forward_to_next_line_start)
20054 (back_to_previous_visible_line_start)
20055 (reseat_at_next_visible_line_start, next_element_from_buffer):
20056 Don't arbitrarily truncate the value of 'selective' to int.
20057
20058 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
20059
20060 * composite.c: Don't truncate sizes to 'int'.
20061 (composition_gstring_p, composition_reseat_it)
20062 (composition_adjust_point): Use EMACS_INT, not int.
20063 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
20064 not EMACS_UINT, for indexes.
20065
20066 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
20067
20068 * buffer.c: Include <verify.h>.
20069 (struct sortvec.priority, struct sortstr.priority):
20070 Now EMACS_INT, not int.
20071 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
20072 (struct sortstr.size, record_overlay_string)
20073 (struct sortstrlist.size, struct sortlist.used):
20074 Don't truncate size to int.
20075 (record_overlay_string): Check for size-calculation overflow.
20076 (init_buffer_once): Check at compile-time, not run-time.
20077
200782011-06-22 Jim Meyering <meyering@redhat.com>
20079
20080 Don't leak an XBM-image-sized buffer
20081 * image.c (xbm_load): Free the image buffer after using it.
20082
200832011-06-21 Paul Eggert <eggert@cs.ucla.edu>
20084
20085 Port to Sun C.
20086 * composite.c (find_automatic_composition): Omit needless 'return 0;'
20087 that Sun C diagnosed.
20088 * fns.c (secure_hash): Fix pointer signedness issue.
20089 * intervals.c (static_offset_intervals): New function.
20090 (offset_intervals): Use it.
20091
200922011-06-21 Leo Liu <sdl.web@gmail.com>
20093
20094 * deps.mk (fns.o):
20095 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
20096 sha512.h.
20097
20098 * fns.c (secure_hash): Rename from crypto_hash_function and change
20099 the first arg to accept symbols.
20100 (Fsecure_hash): New primitive.
20101 (syms_of_fns): New symbols.
20102
201032011-06-20 Deniz Dogan <deniz@dogan.se>
20104
20105 * process.c (Fset_process_buffer): Clarify return value in
20106 docstring.
20107
201082011-06-18 Chong Yidong <cyd@stupidchicken.com>
20109
20110 * dispnew.c (add_window_display_history): Use BVAR.
20111
20112 * xdisp.c (debug_method_add): Use BVAR.
20113 (check_window_end, dump_glyph_matrix, dump_glyph)
20114 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
20115
20116 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
20117 Likewise.
20118
20119 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
20120 check till after the cache is created in init_frame_faces.
20121
201222011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
20123
20124 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
20125
201262011-06-16 Paul Eggert <eggert@cs.ucla.edu>
20127
20128 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
20129 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
20130 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
20131
20132 Improve buffer-overflow checking (Bug#8873).
20133 * fileio.c (Finsert_file_contents):
20134 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
20135 Remove the old (too-loose) buffer overflow checks.
20136 They weren't needed, since make_gap checks for buffer overflow.
20137 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
20138 The old code merely checked for Emacs fixnum overflow, and relied
20139 on undefined (wraparound) behavior. The new code avoids undefined
20140 behavior, and also checks for ptrdiff_t and/or size_t overflow.
20141
20142 * editfns.c (Finsert_char): Don't dump core with very negative counts.
20143 Tune. Don't use wider integers than needed. Don't use alloca.
20144 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
20145
20146 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
20147
20148 * insdel.c, lisp.h (buffer_overflow): New function.
20149 (insert_from_buffer_1, replace_range, replace_range_2):
20150 * insdel.c (make_gap_larger):
20151 * editfns.c (Finsert_char):
20152 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
20153
20154 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
20155
201562011-06-15 Paul Eggert <eggert@cs.ucla.edu>
20157
20158 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
20159
20160 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
20161 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
20162
20163 * fileio.c: Don't assume EMACS_INT fits in off_t.
20164 (emacs_lseek): New static function.
20165 (Finsert_file_contents, Fwrite_region): Use it.
20166 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
20167
20168 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
20169
20170 * fns.c: Don't overflow int when computing a list length.
20171 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
20172 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
20173 truncation on 64-bit hosts. Check for QUIT every
20174 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
20175 faster and is responsive enough.
20176 (Flength): Report an error instead of overflowing an integer.
20177 (Fsafe_length): Return a float if the value is not representable
20178 as a fixnum. This shouldn't happen except in contrived situations.
20179 (Fnthcdr, Fsort): Don't assume list length fits in int.
20180 (Fcopy_sequence): Don't assume vector length fits in int.
20181
20182 * alloc.c: Check that resized vectors' lengths fit in fixnums.
20183 (header_size, word_size): New constants.
20184 (allocate_vectorlike): Don't check size overflow here.
20185 (allocate_vector): Check it here instead, since this is the only
20186 caller of allocate_vectorlike that could cause overflow.
20187 Check that the new vector's length is representable as a fixnum.
20188
20189 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
20190 The previous code was bogus. For example, next_almost_prime (32)
20191 returned 39, which is undesirable as it is a multiple of 3; and
20192 next_almost_prime (24) returned 25, which is a multiple of 5 so
20193 why was the code bothering to check for multiples of 7?
20194
20195 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
20196
20197 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
20198
20199 Variadic C functions now count arguments with ptrdiff_t.
20200 This partly undoes my 2011-03-30 change, which replaced int with size_t.
20201 Back then I didn't know that the Emacs coding style prefers signed int.
20202 Also, in the meantime I found a few more instances where arguments
20203 were being counted with int, which may truncate counts on 64-bit
20204 machines, or EMACS_INT, which may be unnecessarily wide.
20205 * lisp.h (struct Lisp_Subr.function.aMANY)
20206 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
20207 Arg counts are now ptrdiff_t, not size_t.
20208 All variadic functions and their callers changed accordingly.
20209 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
20210 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
20211 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
20212 * callint.c (Fcall_interactively): Check arg count for overflow,
20213 to avoid potential buffer overrun. Use signed char, not 'int',
20214 for 'varies' array, so that we needn't bother to check its size
20215 calculation for overflow.
20216 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
20217 * eval.c (apply_lambda):
20218 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
20219 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
20220 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
20221
20222 * callint.c (Fcall_interactively): Don't use index var as event count.
20223
20224 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
20225 * mem-limits.h (SIZE): Remove; no longer used.
20226
20227 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
20228
20229 Remove unnecessary casts.
20230 * xterm.c (x_term_init):
20231 * xfns.c (x_set_border_pixel):
20232 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
20233 These aren't needed now that we assume ANSI C.
20234
20235 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
20236 It's more likely to cause problems (due to unsigned overflow)
20237 than to cure them.
20238
20239 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
20240
20241 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
20242
20243 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
20244
20245 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
20246
20247 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
20248
20249 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
20250
20251 GLYPH_CODE_FACE returns EMACS_INT, not int.
20252 * dispextern.h (merge_faces):
20253 * xfaces.c (merge_faces):
20254 * xdisp.c (get_next_display_element, next_element_from_display_vector):
20255 Don't assume EMACS_INT fits in int.
20256
20257 * character.h (CHAR_VALID_P): Remove unused parameter.
20258 * fontset.c, lisp.h, xdisp.c: All uses changed.
20259
20260 * editfns.c (Ftranslate_region_internal): Omit redundant test.
20261
20262 * fns.c (concat): Minor tuning based on overflow analysis.
20263 This doesn't fix any bugs. Use int to hold character, instead
20264 of constantly refetching from Emacs object. Use XFASTINT, not
20265 XINT, for value known to be a character. Don't bother comparing
20266 a single byte to 0400, as it's always less.
20267
20268 * floatfns.c (Fexpt):
20269 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
20270
20271 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
20272 for characters.
20273
20274 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
20275
20276 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
20277 Without this fix, on a 64-bit host (aset S 0 4294967386) would
20278 incorrectly succeed when S was a string, because 4294967386 was
20279 truncated before it was used.
20280
20281 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
20282 Otherwise, an out-of-range integer could cause undefined behavior
20283 on a 64-bit host.
20284
20285 * composite.c: Use int, not EMACS_INT, for characters.
20286 (fill_gstring_body, composition_compute_stop_pos): Use int, not
20287 EMACS_INT, for values that are known to be in character range.
20288 This doesn't fix any bugs but is the usual style inside Emacs and
20289 may generate better code on 32-bit machines.
20290
20291 Make sure a 64-bit char is never passed to ENCODE_CHAR.
20292 This is for reasons similar to the recent CHAR_STRING fix.
20293 * charset.c (Fencode_char): Check that character arg is actually
20294 a character. Pass an int to ENCODE_CHAR.
20295 * charset.h (ENCODE_CHAR): Verify that the character argument is no
20296 wider than 'int', as a compile-time check to prevent future regressions
20297 in this area.
20298
20299 * character.c (char_string): Remove unnecessary casts.
20300
20301 Make sure a 64-bit char is never passed to CHAR_STRING.
20302 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
20303 by silently ignoring the top 32 bits, allowing some values
20304 that were far too large to be valid characters.
20305 * character.h: Include <verify.h>.
20306 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
20307 arguments are no wider than unsigned, as a compile-time check
20308 to prevent future regressions in this area.
20309 * data.c (Faset):
20310 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
20311 (Fsubst_char_in_region):
20312 * fns.c (concat):
20313 * xdisp.c (decode_mode_spec_coding):
20314 Adjust to CHAR_STRING's new requirement.
20315 * editfns.c (Finsert_char, Fsubst_char_in_region):
20316 * fns.c (concat): Check that character args are actually
20317 characters. Without this test, these functions did the wrong
20318 thing with wildly out-of-range values on 64-bit hosts.
20319
20320 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
20321 These casts should not be needed on 32-bit hosts, either.
20322 * keyboard.c (read_char):
20323 * lread.c (Fload): Remove casts to unsigned.
20324
20325 * lisp.h (UNSIGNED_CMP): New macro.
20326 This fixes comparison bugs on 64-bit hosts.
20327 (ASCII_CHAR_P): Use it.
20328 * casefiddle.c (casify_object):
20329 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
20330 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
20331 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
20332 * dispextern.h (FACE_FROM_ID):
20333 * keyboard.c (read_char): Use UNSIGNED_CMP.
20334
20335 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
20336 not to EMACS_INT, to avoid GCC warning.
20337
20338 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
20339
20340 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
20341 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
20342 isn't needed on 32-bit machines.
20343
20344 * buffer.c (Fgenerate_new_buffer_name):
20345 Use EMACS_INT for count, not int.
20346 (advance_to_char_boundary): Return EMACS_INT, not int.
20347
20348 * data.c (Qcompiled_function): Now static.
20349
20350 * window.c (window_body_lines): Now static.
20351
20352 * image.c (gif_load): Rename local to avoid shadowing.
20353
20354 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
20355 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
20356 * alloc.c (make_save_value): Integer argument is now of type
20357 ptrdiff_t, not int.
20358 (mark_object): Use ptrdiff_t, not int.
20359 * lisp.h (pD): New macro.
20360 * print.c (print_object): Use it.
20361
20362 * alloc.c: Use EMACS_INT, not int, to count objects.
20363 (total_conses, total_markers, total_symbols, total_vector_size)
20364 (total_free_conses, total_free_markers, total_free_symbols)
20365 (total_free_floats, total_floats, total_free_intervals)
20366 (total_intervals, total_strings, total_free_strings):
20367 Now EMACS_INT, not int. All uses changed.
20368 (Fgarbage_collect): Compute overall total using a double, so that
20369 integer overflow is less likely to be a problem. Check for overflow
20370 when converting back to an integer.
20371 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20372 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20373 These were 'int' variables that could overflow on 64-bit hosts;
20374 they were never used, so remove them instead of repairing them.
20375 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
20376 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20377 Previously, this ceilinged at INT_MAX, but that doesn't work on
20378 64-bit machines.
20379 (allocate_pseudovector): Don't use EMACS_INT when int would do.
20380
20381 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
20382 (allocate_vectorlike): Check for ptrdiff_t overflow.
20383 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20384 when a (possibly-narrower) signed value would do just as well.
20385 We prefer using signed arithmetic, to avoid comparison confusion.
20386
20387 * alloc.c: Catch some string size overflows that we were missing.
20388 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20389 for convenience in STRING_BYTES_MAX.
20390 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20391 The definition here is exact; the one in lisp.h was approximate.
20392 (allocate_string_data): Check for string overflow. This catches
20393 some instances we weren't catching before. Also, it catches
20394 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20395 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20396 and ptrdiff_t and EMACS_INT are both 64 bits.
20397
20398 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20399 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
20400 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
20401
20402 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20403
20404 * alloc.c (Fmake_string): Check for out-of-range init.
20405
204062011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20407
20408 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20409
204102011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20411
20412 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20413 xg_get_default_scrollbar_width.
20414
20415 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20416 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20417 (style_changed_cb): Call update_theme_scrollbar_width and call
20418 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20419 all frames (Bug#8505).
20420 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20421 Call gtk_window_set_resizable if HAVE_GTK3.
20422 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20423 and height if HAVE_GTK3 (Bug#8505).
20424 (scroll_bar_width_for_theme): New variable.
20425 (update_theme_scrollbar_width): New function.
20426 (xg_get_default_scrollbar_width): Move code to
20427 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20428 (xg_initialize): Call update_theme_scrollbar_width.
20429
20430 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20431
20432 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20433
204342011-06-12 Martin Rudalics <rudalics@gmx.at>
20435
20436 * frame.c (make_frame): Call other_buffer_safely instead of
20437 other_buffer.
20438
20439 * window.c (temp_output_buffer_show): Call display_buffer with
20440 second argument Vtemp_buffer_show_specifiers and reset latter
20441 immediately after the call.
20442 (Vtemp_buffer_show_specifiers): New variable.
20443 (auto_window_vscroll_p, next_screen_context_lines)
20444 (Vscroll_preserve_screen_position): Remove leading asterisks from
20445 doc-strings.
20446
204472011-06-12 Paul Eggert <eggert@cs.ucla.edu>
20448
20449 Fix minor problems found by GCC 4.6.0 static checking.
20450 * buffer.c (Qclone_number): Remove for now, as it's unused.
20451 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20452 (record_buffer): Remove unused local.
20453 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20454 (set_frame_buffer_list): Remove; unused.
20455 * frame.h (other_visible_frames): Remove decl.
20456 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20457 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20458 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20459 if HAVE_GPM.
20460 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20461 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20462 Define only if HAVE_GPM.
20463 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20464 (update_hints_inhibit): Remove; never set. All uses removed.
20465 * widgetprv.h (emacsFrameClassRec): Remove decl.
20466 * window.c (delete_deletable_window): Now returns void, since it
20467 wasn't returning anything.
20468 (compare_window_configurations): Remove unused locals.
20469 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20470 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
20471 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20472 the same widths as pointers. This follows up on the 2011-05-06 patch.
20473 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20474 * xterm.h: Likewise.
20475 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20476
204772011-06-12 Juanma Barranquero <lekktu@gmail.com>
20478
20479 * makefile.w32-in: Update dependencies.
20480 (LISP_H): Add lib/intprops.h.
20481
204822011-06-11 Chong Yidong <cyd@stupidchicken.com>
20483
20484 * image.c (gif_load): Add animation frame delay to the metadata.
20485 (syms_of_image): Use DEFSYM. New symbol `delay'.
20486
204872011-06-11 Martin Rudalics <rudalics@gmx.at>
20488
20489 * window.c (delete_deletable_window): Re-add.
20490 (Fset_window_configuration): Rewrite to handle dead buffers and
20491 consequently deletable windows.
20492 (window_tree, Fwindow_tree): Remove. Supply functionality in
20493 window.el.
20494 (compare_window_configurations): Simplify code.
20495
204962011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20497
20498 * image.c (imagemagick_load_image): Fix type mismatch.
20499 (Fimagemagick_types): Likewise.
20500
20501 * window.h (replace_buffer_in_windows): Declare.
20502
205032011-06-11 Martin Rudalics <rudalics@gmx.at>
20504
20505 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20506 Qclone_number. Remove external declaration of Qdelete_window.
20507 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20508 code.
20509 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20510 Run Qbuffer_list_update_hook if allowed.
20511 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20512 buffer list implementation.
20513 (other_buffer_safely): New function.
20514 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20515 calls to replace_buffer_in_windows and
20516 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20517 if allowed.
20518 (record_buffer): Inhibit quitting and rewrite using quittable
20519 functions. Run Qbuffer_list_update_hook if allowed.
20520 (Frecord_buffer, Funrecord_buffer): New functions.
20521 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20522 Move switch-to-buffer to window.el.
20523 (bury-buffer): Move to window.el.
20524 (Vbuffer_list_update_hook): New variable.
20525
20526 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20527 section.
20528
20529 * window.h (resize_frame_windows): Move up in code.
20530 (Fwindow_frame): Remove EXFUN.
20531 (replace_buffer_in_all_windows): Remove prototype.
20532 (replace_buffer_in_windows_safely): Add prototype.
20533
20534 * window.c: Declare Qdelete_window static again. Move down
20535 declaration of select_count.
20536 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20537 (Fother_window): Move to window.el.
20538 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20539 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20540 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20541 window.el.
20542 (replace_buffer_in_windows): Implement by calling
20543 Qreplace_buffer_in_windows.
20544 (replace_buffer_in_all_windows): Remove with some functionality
20545 moved into replace_buffer_in_windows_safely.
20546 (replace_buffer_in_windows_safely): New function.
20547 (select_window_norecord, select_frame_norecord): Move in front
20548 of run_window_configuration_change_hook. Remove now obsolete
20549 declarations.
20550 (Fset_window_buffer): Rewrite doc-string.
20551 Call Qrecord_window_buffer.
20552 (keys_of_window): Move binding for other-window to window.el.
20553
205542011-06-11 Chong Yidong <cyd@stupidchicken.com>
20555
20556 * dispextern.h (struct image): Replace data member, whose int_val
20557 and ptr_val fields were not used by anything, with a single
20558 lisp_val object.
20559
20560 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20561 (gif_clear_image, gif_load, imagemagick_load_image)
20562 (gs_clear_image, gs_load): Callers changed.
20563
205642011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20565
20566 * buffer.h: Include <time.h>, for time_t.
20567 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20568
20569 Fix minor problems found by static checking.
20570
20571 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20572
20573 Make identifiers static if they are not used in other modules.
20574 * data.c (Qcompiled_function, Qframe, Qvector):
20575 * image.c (QimageMagick, Qsvg):
20576 * minibuf.c (Qmetadata):
20577 * window.c (resize_window_check, resize_root_window): Now static.
20578 * window.h (resize_window_check, resize_root_window): Remove decls.
20579
20580 * window.c (window_deletion_count, delete_deletable_window):
20581 Remove; unused.
20582 (window_body_lines): Now static.
20583 (Fdelete_other_windows_internal): Mark vars as initialized.
20584 Make sure 'resize_failed' is initialized.
20585 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20586 (resize_window_apply): Remove unused local.
20587 * window.h (delete_deletable_window): Remove decl.
20588
20589 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20590 (imagemagick_load_image): Fix pointer signedness problem by changing
20591 last arg from unsigned char * to char *. All uses changed.
20592 Also, fix a local for similar reasons.
20593 Remove unused locals. Remove locals to avoid shadowing.
20594 (fn_rsvg_handle_free): Remove; unused.
20595 (svg_load, svg_load_image): Fix pointer signedness problem.
20596 (imagemagick_load_image): Don't use garbage pointer image_wand.
20597
20598 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20599
206002011-06-10 Chong Yidong <cyd@stupidchicken.com>
20601
20602 * image.c (gif_load): Fix omitted cast error introduced by
20603 2011-06-06 change.
20604
206052011-06-10 Martin Rudalics <rudalics@gmx.at>
20606
20607 * window.h (resize_proportionally, orig_total_lines)
20608 (orig_top_line): Remove from window structure.
20609 (set_window_height, set_window_width, change_window_heights)
20610 (Fdelete_window): Remove prototypes.
20611 (resize_frame_windows): Remove duplicate declaration.
20612
206132011-06-10 Eli Zaretskii <eliz@gnu.org>
20614
20615 * window.h (resize_frame_windows, resize_window_check)
20616 (delete_deletable_window, resize_root_window)
20617 (resize_frame_windows): Declare prototypes.
20618
20619 * window.c (resize_window_apply): Make definition be "static" to
20620 match the prototype.
20621
206222011-06-10 Martin Rudalics <rudalics@gmx.at>
20623
20624 * window.c: Remove declarations of Qwindow_size_fixed,
20625 window_min_size_1, window_min_size_2, window_min_size,
20626 size_window, window_fixed_size_p, enlarge_window, delete_window.
20627 Remove static from declaration of Qdelete_window, it's
20628 temporarily needed by Fbury_buffer.
20629 (replace_window): Don't assign orig_top_line and
20630 orig_total_lines.
20631 (Fdelete_window, delete_window): Remove. Window deletion is
20632 handled by window.el.
20633 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20634 Replace Fdelete_window calls with calls to Qdelete_window.
20635 (Fdelete_other_windows): Remove. Deleting other windows is
20636 handled by window.el.
20637 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20638 handled in window.el.
20639 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20640 Window minimum sizes are handled in window.el.
20641 (shrink_windows, size_window, set_window_height)
20642 (set_window_width, change_window_heights, window_height)
20643 (window_width, CURBEG, CURSIZE, enlarge_window)
20644 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20645 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20646 handled in window.el.
20647 (make_dummy_parent): Rename to make_parent_window and give it a
20648 second argument horflag.
20649 (make_window): Don't set resize_proportionally any more.
20650 (Fsplit_window): Remove. Windows are split in window.el.
20651 (save_restore_action, save_restore_orig_size)
20652 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20653 Resize mini windows in window.el.
20654 (grow_mini_window, shrink_mini_window): Implement by calling
20655 Qresize_root_window_vertically, resize_window_check and
20656 resize_window_apply.
20657 (saved_window, Fset_window_configuration, save_window_save):
20658 Do not handle orig_top_line, orig_total_lines, and
20659 resize_proportionally.
20660 (window_min_height, window_min_width): Move to window.el.
20661 (keys_of_window): Move bindings for delete-other-windows,
20662 split-window, delete-window and enlarge-window to window.el.
20663
20664 * buffer.c: Temporarily extern Qdelete_window.
20665 (Fbury_buffer): Temporarily call Qdelete_window instead of
20666 Fdelete_window (Fbury_buffer will move to window.el soon).
20667
20668 * frame.c (set_menu_bar_lines_1): Remove code handling
20669 orig_top_line and orig_total_lines.
20670
20671 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20672 set_window_height but set heights directly.
20673 (change_frame_size_1): Use resize_frame_windows.
20674
20675 * xdisp.c (init_xdisp): Don't use set_window_height but set
20676 heights directly.
20677
20678 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20679 Use resize_frame_windows instead of change_window_heights and run
20680 run_window_configuration_change_hook.
20681
20682 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20683 instead of change_window_heights and run
20684 run_window_configuration_change_hook.
20685
206862011-06-09 Martin Rudalics <rudalics@gmx.at>
20687
20688 * window.c (replace_window): Rename second argument REPLACEMENT to
20689 NEW. New third argument SETFLAG. Rewrite.
20690 (delete_window, make_dummy_parent): Call replace_window with
20691 third argument 1.
20692 (window_list_1): Move down in code.
20693 (run_window_configuration_change_hook): Move set_buffer part
20694 before select_frame_norecord part in order to unwind correctly.
20695 Rename count1 to count.
20696 (recombine_windows, delete_deletable_window, resize_root_window)
20697 (Fdelete_other_windows_internal)
20698 (Frun_window_configuration_change_hook, make_parent_window)
20699 (resize_window_check, resize_window_apply, Fresize_window_apply)
20700 (resize_frame_windows, Fsplit_window_internal)
20701 (Fdelete_window_internal, Fresize_mini_window_internal):
20702 New functions.
20703 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20704
207052011-06-08 Martin Rudalics <rudalics@gmx.at>
20706
20707 * window.h (window): Add some new members to window structure -
20708 normal_lines, normal_cols, new_total, new_normal, clone_number,
20709 splits, nest, prev_buffers, next_buffers.
20710 (WINDOW_TOTAL_SIZE): Move here from window.c.
20711 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20712
20713 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20714 Remove.
20715 (make_dummy_parent): Set new members of windows structure.
20716 (make_window): Move down in code. Handle new members of window
20717 structure.
20718 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20719 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20720 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20721 (Fset_window_prev_buffers, Fwindow_next_buffers)
20722 (Fset_window_next_buffers, Fset_window_clone_number):
20723 New functions.
20724 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20725 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20726 Doc-string fixes.
20727 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20728 Argument WINDOW can be now internal window too.
20729 (Fwindow_use_time): Move up in code.
20730 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20731 Rewrite doc-string.
20732 (Fset_window_configuration, saved_window)
20733 (Fcurrent_window_configuration, save_window_save): Handle new
20734 members of window structure.
20735 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20736 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20737 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20738 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20739 Qget_mru_window, Qresize_root_window,
20740 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20741 Qauto_buffer_name; staticpro them.
20742
207432011-06-07 Martin Rudalics <rudalics@gmx.at>
20744
20745 * window.c (Fwindow_total_size, Fwindow_left_column)
20746 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20747 (Fwindow_list_1): New functions.
20748 (window_box_text_cols): Replace with window_body_cols.
20749 (Fwindow_width, Fscroll_left, Fscroll_right):
20750 Use window_body_cols instead of window_box_text_cols.
20751 (delete_window, Fset_window_configuration):
20752 Call delete_all_subwindows with window as argument.
20753 (delete_all_subwindows): Take a window as argument and not a
20754 structure. Rewrite.
20755 (window_loop): Remove handling of GET_LRU_WINDOW and
20756 GET_LARGEST_WINDOW.
20757 (Fget_lru_window, Fget_largest_window): Move to window.el.
20758
20759 * window.h: Extern window_body_cols instead of
20760 window_box_text_cols. delete_all_subwindows now takes a
20761 Lisp_Object as argument.
20762
20763 * indent.c (compute_motion, Fcompute_motion):
20764 Use window_body_cols instead of window_box_text_cols.
20765
20766 * frame.c (delete_frame): Call delete_all_subwindows with root
20767 window as argument.
20768
207692011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20770
20771 * fns.c (Fputhash): Document return value.
20772
207732011-06-06 Chong Yidong <cyd@stupidchicken.com>
20774
20775 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20776
207772011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20778
20779 Cons<->int and similar integer overflow fixes (Bug#8794).
20780
20781 Check for overflow when converting integer to cons and back.
20782 * charset.c (Fdefine_charset_internal, Fdecode_char):
20783 Use cons_to_unsigned to catch overflow.
20784 (Fencode_char): Use INTEGER_TO_CONS.
20785 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20786 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20787 * data.c (long_to_cons, cons_to_long): Remove.
20788 (cons_to_unsigned, cons_to_signed): New functions.
20789 These signal an error for invalid or out-of-range values.
20790 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20791 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20792 * font.c (Ffont_variation_glyphs):
20793 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20794 * lisp.h: Include <intprops.h>.
20795 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20796 (cons_to_signed, cons_to_unsigned): New decls.
20797 (long_to_cons, cons_to_long): Remove decls.
20798 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20799 (Fprimitive_undo): Use CONS_TO_INTEGER.
20800 * xfns.c (Fx_window_property): Likewise.
20801 * xselect.c: Include <limits.h>.
20802 (x_own_selection, selection_data_to_lisp_data):
20803 Use INTEGER_TO_CONS.
20804 (x_handle_selection_request, x_handle_selection_clear)
20805 (x_get_foreign_selection, Fx_disown_selection_internal)
20806 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20807 (lisp_data_to_selection_data): Use cons_to_unsigned.
20808 (x_fill_property_data): Use cons_to_signed.
20809 Report values out of range.
20810
20811 Check for buffer and string overflow more precisely.
20812 * buffer.h (BUF_BYTES_MAX): New macro.
20813 * lisp.h (STRING_BYTES_MAX): New macro.
20814 * alloc.c (Fmake_string):
20815 * character.c (string_escape_byte8):
20816 * coding.c (coding_alloc_by_realloc):
20817 * doprnt.c (doprnt):
20818 * editfns.c (Fformat):
20819 * eval.c (verror):
20820 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20821 since they may not be the same number.
20822 * editfns.c (Finsert_char):
20823 * fileio.c (Finsert_file_contents):
20824 Likewise for BUF_BYTES_MAX.
20825
20826 * image.c: Use ptrdiff_t, not int, for sizes.
20827 (slurp_file): Switch from int to ptrdiff_t.
20828 All uses changed.
20829 (slurp_file): Check that file size fits in both size_t (for
20830 malloc) and ptrdiff_t (for sanity and safety).
20831
20832 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20833 if b->modtime has its maximal value.
20834
20835 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20836
20837 Don't assume time_t can fit into int.
20838 * buffer.h (struct buffer.modtime): Now time_t, not int.
20839 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20840 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20841
20842 Minor fixes for signed vs unsigned integers.
20843 * character.h (MAYBE_UNIFY_CHAR):
20844 * charset.c (maybe_unify_char):
20845 * keyboard.c (read_char, reorder_modifiers):
20846 XINT -> XFASTINT, since the integer must be nonnegative.
20847 * ftfont.c (ftfont_spec_pattern):
20848 * keymap.c (access_keymap, silly_event_symbol_error):
20849 XUINT -> XFASTINT, since the integer must be nonnegative.
20850 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20851 since it makes no difference and we prefer signed.
20852 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20853 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20854 nonnegative.
20855
208562011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20857
20858 * window.h (Fwindow_frame): Declare.
20859
208602011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20861
20862 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20863 (SPARE_MEMORY): Always define.
20864 (LARGE_REQUEST): Remove.
20865 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20866
208672011-06-06 Martin Rudalics <rudalics@gmx.at>
20868
20869 * lisp.h: Move EXFUNS for Fframe_root_window,
20870 Fframe_first_window and Fset_frame_selected_window to window.h.
20871
20872 * window.h: Move EXFUNS for Fframe_root_window,
20873 Fframe_first_window and Fset_frame_selected_window here from
20874 lisp.h.
20875
20876 * frame.c (Fwindow_frame, Fframe_first_window)
20877 (Fframe_root_window, Fframe_selected_window)
20878 (Fset_frame_selected_window): Move to window.c.
20879 (Factive_minibuffer_window): Move to minibuf.c.
20880 (Fother_visible_frames_p): New function.
20881
20882 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20883
20884 * window.c (decode_window, decode_any_window): Move up in code.
20885 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20886 (inhibit_frame_unsplittable): Remove unused variable.
20887 (Fwindow_buffer): Move up and rewrite doc-string.
20888 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20889 (Fwindow_prev): New functions.
20890 (Fwindow_frame): Move here from frame.c. Accept any window as
20891 argument.
20892 (Fframe_root_window, Fframe_first_window)
20893 (Fframe_selected_window): Move here from frame.c. Accept frame
20894 or arbitrary window as argument. Update doc-strings.
20895 (Fminibuffer_window): Move up in code.
20896 (Fwindow_minibuffer_p): Move up in code and simplify.
20897 (Fset_frame_selected_window): Move here from frame.c.
20898 Marginal rewrite.
20899 (Fselected_window, select_window, Fselect_window): Move up in
20900 code. Minor doc-string fixes.
20901
209022011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20903
20904 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20905 Do not assume that spare memory exists; that assumption is valid
20906 only if SYSTEM_MALLOC.
20907 (LARGE_REQUEST): New macro, so that the issue of large requests
20908 is separated from the issue of spare memory.
20909
209102011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20911
20912 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20913 format. (Bug#8806)
20914
20915 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20916
20917 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20918 before statements.
20919
209202011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20921
20922 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20923
20924 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20925
20926 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20927 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20928
209292011-06-05 Juanma Barranquero <lekktu@gmail.com>
20930
20931 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20932
209332011-06-04 Chong Yidong <cyd@stupidchicken.com>
20934
20935 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20936 (x_clipboard_manager_save): Add return value.
20937 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20938 New error handlers.
20939 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20940 Obey Vx_select_enable_clipboard_manager. Catch errors in
20941 x_clipboard_manager_save (Bug#8779).
20942 (Vx_select_enable_clipboard_manager): New variable.
20943 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20944
209452011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20946
20947 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20948
209492011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20950
20951 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20952 in the current matrix if keep_current_p is non-zero.
20953
209542011-06-04 Eli Zaretskii <eliz@gnu.org>
20955
20956 * bidi.c (bidi_level_of_next_char): Fix last change.
20957
209582011-06-03 Eli Zaretskii <eliz@gnu.org>
20959
20960 Support bidi reordering of text covered by display properties.
20961
20962 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20963 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20964 (bidi_cache_search, bidi_cache_iterator_state)
20965 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20966 (bidi_level_of_next_char, bidi_move_to_visually_next):
20967 Support character positions inside a run of characters covered by a
20968 display string.
20969 (bidi_paragraph_init, bidi_resolve_explicit_1)
20970 (bidi_level_of_next_char): Call bidi_fetch_char and
20971 bidi_fetch_char_advance instead of FETCH_CHAR and
20972 FETCH_CHAR_ADVANCE.
20973 (bidi_init_it): Initialize new members.
20974 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20975 definitions.
20976 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20977 instead of using explicit *_CHAR codes.
20978 (bidi_resolve_explicit, bidi_resolve_weak):
20979 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20980 bidirectional text is supported only in multibyte buffers.
20981 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20982 it to initialize the frame_window_p member of struct bidi_it.
20983 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20984 (bidi_resolve_explicit, bidi_resolve_weak)
20985 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20986 bidi_it->nchars is non-positive.
20987 (bidi_level_of_next_char): Don't try to lookup the cache for the
20988 next/previous character if nothing is cached there yet, or if we
20989 were just reseat()'ed to a new position.
20990
20991 * xdisp.c (set_cursor_from_row): Set start and stop points
20992 according to the row's direction when priming the loop that looks
20993 for the glyph on which to display cursor.
20994 (single_display_spec_intangible_p): Function deleted.
20995 (display_prop_intangible_p): Reimplement to call
20996 handle_display_spec instead of single_display_spec_intangible_p.
20997 Accept 3 additional arguments needed by handle_display_spec.
20998 This fixes incorrect cursor motion across display property with complex
20999 values: lists, `(when COND...)' forms, etc.
21000 (single_display_spec_string_p): Support property values that are
21001 lists with the argument STRING its top-level element.
21002 (display_prop_string_p): Fix the condition for processing a
21003 property that is a list to be consistent with handle_display_spec.
21004 (handle_display_spec): New function, refactored from the
21005 last portion of handle_display_prop.
21006 (compute_display_string_pos): Accept additional argument
21007 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
21008 value of a `display' property is a "replacing spec".
21009 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
21010 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
21011 the display property, but just return a value indicating whether
21012 the display property will replace the characters it covers.
21013 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
21014 frame_window_p members of struct bidi_it.
21015 (compute_display_string_pos, compute_display_string_end):
21016 New functions.
21017 (push_it): Accept second argument POSITION, where pop_it should
21018 jump to continue iteration.
21019 (reseat_1): Initialize bidi_it.disp_pos.
21020
21021 * keyboard.c (adjust_point_for_property): Adjust the call to
21022 display_prop_intangible_p to its new signature.
21023
21024 * dispextern.h (struct bidi_it): New member frame_window_p.
21025 (bidi_init_it): Update prototypes.
21026 (display_prop_intangible_p): Update prototype.
21027 (compute_display_string_pos, compute_display_string_end):
21028 Declare prototypes.
21029 (struct bidi_it): New members nchars and disp_pos. ch_len is now
21030 EMACS_INT.
21031
210322011-06-02 Paul Eggert <eggert@cs.ucla.edu>
21033
21034 Malloc failure behavior now depends on size of allocation.
21035 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
21036 * lisp.h: Change signatures accordingly.
21037 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
21038 All callers changed. (Bug#8762)
21039
21040 * gnutls.c: Use Emacs's memory allocators.
21041 Without this change, the gnutls library would invoke malloc etc.
21042 directly, which causes problems on non-SYNC_INPUT hosts, and which
21043 runs afoul of improving memory_full behavior. (Bug#8761)
21044 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
21045 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
21046 xfree instead of the default malloc, realloc, free.
21047 (Fgnutls_boot): No need to check for memory allocation failure,
21048 since xmalloc does that for us.
21049
21050 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
21051 * category.c (hash_get_category_set):
21052 * ccl.c (ccl_driver):
21053 * charset.c (Fdefine_charset_internal):
21054 * charset.h (struct charset.hash_index):
21055 * composite.c (get_composition_id, gstring_lookup_cache)
21056 (composition_gstring_put_cache):
21057 * composite.h (struct composition.hash_index):
21058 * dispextern.h (struct image.hash):
21059 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
21060 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
21061 (hashfn_equal, hashfn_user_defined, make_hash_table)
21062 (maybe_resize_hash_table, hash_lookup, hash_put)
21063 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
21064 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
21065 (Fsxhash, Fgethash, Fputhash, Fmaphash):
21066 * image.c (make_image, search_image_cache, lookup_image)
21067 (xpm_put_color_table_h):
21068 * lisp.h (struct Lisp_Hash_Table):
21069 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
21070 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
21071 for hashes and hash indexes, instead of 'unsigned' and 'int'.
21072 * alloc.c (allocate_vectorlike):
21073 Check for overflow in vector size calculations.
21074 * ccl.c (ccl_driver):
21075 Check for overflow when converting EMACS_INT to int.
21076 * fns.c, image.c: Remove unnecessary static decls that would otherwise
21077 need to be updated by these changes.
21078 * fns.c (make_hash_table, maybe_resize_hash_table):
21079 Check for integer overflow with large hash tables.
21080 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
21081 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
21082 (SXHASH_REDUCE): New macro.
21083 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
21084 Use it instead of discarding useful hash info with large hash values.
21085 (sxhash_float): New function.
21086 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
21087 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
21088 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
21089 Rewrite to use FIXNUM_BITS, as this simplifies things.
21090 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
21091 Adjust signatures to match updated version of code.
21092 (consing_since_gc): Now EMACS_INT, since a single hash table can
21093 use more than INT_MAX bytes.
21094
210952011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
21096
21097 Make it possible to build with GCC-4.6+ -O2 -flto.
21098
21099 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
21100
211012011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
21102
21103 * minibuf.c (get_minibuffer, read_minibuf_unwind):
21104 Call minibuffer-inactive-mode.
21105
211062011-05-31 Juanma Barranquero <lekktu@gmail.com>
21107
21108 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
21109 Update dependencies.
21110
211112011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
21112
21113 * data.c (init_data): Remove code for UTS, this system is not
21114 supported anymore.
21115
211162011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
21117
21118 Don't force ./temacs to start in terminal mode.
21119
21120 * frame.c (make_initial_frame): Initialize faces in all cases, not
21121 only when CANNOT_DUMP is defined.
21122 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
21123
211242011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
21125
21126 * dispnew.c (add_window_display_history): Use const for the string
21127 pointer. Remove declaration, not needed.
21128
211292011-05-31 Paul Eggert <eggert@cs.ucla.edu>
21130
21131 Use 'inline', not 'INLINE'.
21132 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
21133 * alloc.c, fontset.c (INLINE): Remove.
21134 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
21135 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
21136 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
21137 * gmalloc.c (register_heapinfo): Use inline unconditionally.
21138 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
21139
211402011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
21141
21142 Make it possible to run ./temacs.
21143
21144 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
21145 syms_of_callproc does the same thing. Remove test for
21146 "initialized", do it in the caller.
21147 * emacs.c (main): Avoid calling set_initial_environment when dumping.
21148
211492011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
21150
21151 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
21152 (read_minibuf): Use get_minibuffer.
21153 (syms_of_minibuf): Use DEFSYM.
21154 (Qmetadata): New var.
21155 * data.c (Qbuffer): Don't make it static.
21156 (syms_of_data): Use DEFSYM.
21157
211582011-05-31 Paul Eggert <eggert@cs.ucla.edu>
21159
21160 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
21161 (CCL_CODE_MIN): New macro.
21162
211632011-05-30 Paul Eggert <eggert@cs.ucla.edu>
21164
21165 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
21166
21167 * eval.c (Qdebug): Now static.
21168 * lisp.h (Qdebug): Remove decl. This reverts a part of the
21169 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
21170 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
21171
211722011-05-29 Chong Yidong <cyd@stupidchicken.com>
21173
21174 * image.c: Various fixes to ImageMagick code comments.
21175 (Fimagemagick_types): Doc fix.
21176
211772011-05-29 Paul Eggert <eggert@cs.ucla.edu>
21178
21179 Minor fixes prompted by GCC 4.6.0 warnings.
21180
21181 * xselect.c (converted_selections, conversion_fail_tag): Now static.
21182
21183 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
21184 (x_clipboard_manager_save_all): Move extern decl to ...
21185 * xterm.h: ... here, so that it can be checked for consistency.
21186
211872011-05-29 Chong Yidong <cyd@stupidchicken.com>
21188
21189 * xselect.c (x_clipboard_manager_save_frame)
21190 (x_clipboard_manager_save_all): New functions.
21191 (Fx_clipboard_manager_save): Lisp function deleted.
21192
21193 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
21194 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
21195
21196 * xterm.h: Update prototype.
21197
211982011-05-28 William Xu <william.xwl@gmail.com>
21199
21200 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
21201 exiting (Bug#8239).
21202
212032011-05-28 Jim Meyering <meyering@redhat.com>
21204
21205 Avoid a sign-extension bug in crypto_hash_function.
21206 * fns.c (to_uchar): Define.
21207 (crypto_hash_function): Use it to convert some newly-signed
21208 variables to unsigned, to avoid sign-extension bugs. For example,
21209 without this change, (md5 "truc") would evaluate to
21210 45723a2aff78ff4fff7fff1114760e62 rather than the expected
21211 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
21212 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
21213
212142011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21215
21216 Integer overflow fixes.
21217
21218 * dbusbind.c: Serial number integer overflow fixes.
21219 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
21220 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
21221 to hold a serial number that is too large for a fixnum.
21222 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21223 Check for serial numbers out of range. Decode any serial number
21224 that was so large that it became a float. (Bug#8722)
21225
21226 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
21227 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21228 Use XFASTINT rather than XUINT when numbers are nonnegative.
21229 (xd_append_arg, Fdbus_method_return_internal):
21230 (Fdbus_method_error_internal): Likewise. Also, for unsigned
21231 arguments, check that Lisp number is nonnegative, rather than
21232 silently wrapping negative numbers around. (Bug#8722)
21233 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
21234 (Bug#8722)
21235
21236 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
21237
21238 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
21239
21240 ccl: Add integer overflow checks.
21241 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
21242 (IN_INT_RANGE): New macros.
21243 (ccl_driver): Use them to check for integer overflow when
21244 decoding a CCL program. Many of the new checks are whether XINT (x)
21245 fits in int; it doesn't always, on 64-bit hosts. The new version
21246 doesn't catch all possible integer overflows, but it's an
21247 improvement. (Bug#8719)
21248
21249 * alloc.c (make_event_array): Use XINT, not XUINT.
21250 There's no need for unsigned here.
21251
21252 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
21253 This follows up to the 2011-05-06 change that substituted uintptr_t
21254 for EMACS_INT. This case wasn't caught back then.
21255
21256 Rework Fformat to avoid integer overflow issues.
21257 * editfns.c: Include <float.h> unconditionally, as it's everywhere
21258 now (part of C89). Include <verify.h>.
21259 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
21260 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
21261 (Fformat): Avoid the prepass trying to compute sizes; it was only
21262 approximate and thus did not catch overflow reliably. Instead, walk
21263 through the format just once, formatting and computing sizes as we go,
21264 checking for integer overflow at every step, and allocating a larger
21265 buffer as needed. Keep track separately whether the format is
21266 multibyte. Keep only the most-recently calculated precision, rather
21267 than them all. Record whether each argument has been converted to
21268 string. Use EMACS_INT, not int, for byte and char and arg counts.
21269 Support field widths and precisions larger than INT_MAX. Avoid
21270 sprintf's undefined behavior with conversion specifications such as %#d
21271 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
21272 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
21273 formatting out-of-range floating point numbers with int
21274 formats. (Bug#8668)
21275
21276 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
21277
21278 * data.c: Avoid integer truncation in expressions involving floats.
21279 * data.c: Include <intprops.h>.
21280 (arith_driver): When there's an integer overflow in an expression
21281 involving floating point, convert the integers to floating point
21282 so that the resulting value does not suffer from catastrophic
21283 integer truncation. For example, on a 64-bit host (* 4
21284 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
21285 Do not rely on undefined behavior after integer overflow.
21286
21287 merge count_size_as_multibyte, parse_str_to_multibyte
21288 * character.c, character.h (count_size_as_multibyte):
21289 Rename from parse_str_to_multibyte; all uses changed.
21290 Check for integer overflow.
21291 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
21292 since it's now a duplicate of the other. This is more of
21293 a character than a buffer op, so better that it's in character.c.
21294 * fns.c, print.c: Adjust to above changes.
21295
212962011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
21297
21298 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
21299
213002011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21301
21302 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21303 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
21304 (x_clipboard_manager_save): Now static.
21305 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
21306
21307 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21308 (crypto_hash_function): Now static.
21309 Fix pointer signedness problems. Avoid unnecessary initializations.
21310
213112011-05-27 Chong Yidong <cyd@stupidchicken.com>
21312
21313 * termhooks.h (Vselection_alist): Make it terminal-local.
21314
21315 * terminal.c (create_terminal): Initialize it.
21316
21317 * xselect.c: Support for clipboard managers.
21318 (Vselection_alist): Move to termhooks.h as terminal-local var.
21319 (LOCAL_SELECTION): New macro.
21320 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
21321 (symbol_to_x_atom): Remove gratuitous arg.
21322 (x_handle_selection_request, lisp_data_to_selection_data)
21323 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
21324 (x_own_selection, x_get_local_selection, x_convert_selection):
21325 New arg, specifying work frame. Use terminal-local Vselection_alist.
21326 (some_frame_on_display): Delete unused function.
21327 (Fx_own_selection_internal, Fx_get_selection_internal)
21328 (Fx_disown_selection_internal, Fx_selection_owner_p)
21329 (Fx_selection_exists_p): New optional frame arg.
21330 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
21331 (x_handle_selection_clear): Don't treat other terminals with the
21332 same keyboard specially. Use the terminal-local Vselection_alist.
21333 (x_clear_frame_selections): Use Frun_hook_with_args.
21334
21335 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
21336
21337 * xterm.h: Add support for those atoms.
21338
213392011-05-26 Chong Yidong <cyd@stupidchicken.com>
21340
21341 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
21342 (converted_selections, conversion_fail_tag): New global variables.
21343 (x_selection_request_lisp_error): Free the above.
21344 (x_get_local_selection): Remove unnecessary code.
21345 (x_reply_selection_request): Args changed; handle arbitrary array
21346 of converted selections stored in converted_selections.
21347 Separate the XChangeProperty and SelectionNotify steps.
21348 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
21349 (x_convert_selection): New function.
21350 (x_handle_selection_event): Simplify.
21351 (x_get_foreign_selection): Don't ignore incoming requests while
21352 waiting for an answer; this will fail when we implement
21353 SAVE_TARGETS, and seems unnecessary anyway.
21354 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
21355 (Vx_sent_selection_functions): Doc fix.
21356
213572011-05-26 Leo Liu <sdl.web@gmail.com>
21358
21359 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
21360
213612011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21362
21363 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21364
21365 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21366 for fringe update if it has periodic bitmap.
21367 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
21368 and fringe_bitmap_periodic_p.
21369
21370 * fringe.c (get_fringe_bitmap_data): New function.
21371 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21372 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21373 row. Mark glyph row for fringe update if periodicity changed.
21374
21375 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21376 for fringe update unless it has periodic bitmap.
21377
213782011-05-25 Kenichi Handa <handa@m17n.org>
21379
21380 * xdisp.c (get_next_display_element): Set correct it->face_id for
21381 a static composition.
21382
213832011-05-24 Leo Liu <sdl.web@gmail.com>
21384
21385 * deps.mk (fns.o):
21386 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21387
21388 * fns.c (crypto_hash_function, Fsha1): New function.
21389 (Fmd5): Use crypto_hash_function.
21390 (syms_of_fns): Add Ssha1.
21391
213922011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21393
21394 * gnutls.c: Remove unused macros.
21395 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21396 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21397 Remove macros that are defined and never used.
21398 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21399
214002011-05-22 Chong Yidong <cyd@stupidchicken.com>
21401
21402 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21403 (Fx_get_selection_internal): Minor cleanup.
21404 (Fx_own_selection_internal): Rename arguments for consistency with
21405 select.el.
21406
214072011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21408
21409 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21410
214112011-05-22 Chong Yidong <cyd@stupidchicken.com>
21412
21413 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21414
214152011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21416
21417 * dispnew.c (scrolling_window): Don't exclude the case that the
21418 last enabled row in the desired matrix touches the bottom boundary.
21419
214202011-05-21 Glenn Morris <rgm@gnu.org>
21421
21422 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
21423 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21424 and add some more files.
21425
214262011-05-20 Eli Zaretskii <eliz@gnu.org>
21427
21428 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21429 report_file_error introduced by the change from 2011-05-07.
21430
214312011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21432
21433 * systime.h (Time): Define only if emacs is defined.
21434 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21435 where the include path doesn't have X11/X.h by default. See
21436 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21437
214382011-05-20 Kenichi Handa <handa@m17n.org>
21439
21440 * composite.c (find_automatic_composition): Fix previous change.
21441
214422011-05-20 Glenn Morris <rgm@gnu.org>
21443
21444 * lisp.mk: New file, split from Makefile.in.
21445 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21446 (shortlisp): Remove.
21447 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21448
214492011-05-19 Glenn Morris <rgm@gnu.org>
21450
21451 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21452 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21453 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21454 (lisp): Set the order to that of loadup.el.
21455 (shortlisp): Make it a copy of $lisp.
21456 (SOME_MACHINE_LISP): Remove.
21457 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21458 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21459
214602011-05-18 Kenichi Handa <handa@m17n.org>
21461
21462 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21463 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21464 (find_automatic_composition): Mostly rewrite for efficiency.
21465
214662011-05-18 Juanma Barranquero <lekktu@gmail.com>
21467
21468 * makefile.w32-in: Update dependencies.
21469
214702011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21471
21472 * menu.c: Include limits.h (fixes the MS-Windows build broken by
21473 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
21474
214752011-05-18 Paul Eggert <eggert@cs.ucla.edu>
21476
21477 Fix some integer overflow issues, such as string length overflow.
21478
21479 * insdel.c (count_size_as_multibyte): Check for string overflow.
21480
21481 * character.c (lisp_string_width): Check for string overflow.
21482 Use EMACS_INT, not int, for string indexes and lengths; in
21483 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21484 the resulting string length overflows an EMACS_INT; instead,
21485 report a string overflow if no precision given. When checking for
21486 precision exhaustion, use a check that cannot possibly have
21487 integer overflow. (Bug#8675)
21488 * character.h (lisp_string_width): Adjust to new signature.
21489
21490 * alloc.c (string_overflow): New function.
21491 (Fmake_string): Use it. This doesn't change behavior, but saves
21492 a few bytes and will simplify future changes.
21493 * character.c (string_escape_byte8): Likewise.
21494 * lisp.h (string_overflow): New decl.
21495
21496 Fixups, following up to the user-interface timestamp change.
21497 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21498 for UI timestamps, instead of unsigned long.
21499 * msdos.c (mouse_get_pos): Likewise.
21500 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
21501 * w32gui.h (Time): Define by including "systime.h" rather than by
21502 declaring it ourselves. (Bug#8664)
21503
21504 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21505 * image.c (clear_image_cache): Likewise.
21506
21507 * term.c (term_mouse_position): Don't assume time_t wraparound.
21508
21509 Be more systematic about user-interface timestamps.
21510 Before, the code sometimes used 'Time', sometimes 'unsigned long',
21511 and sometimes 'EMACS_UINT', to represent these timestamps.
21512 This change causes it to use 'Time' uniformly, as that's what X uses.
21513 This makes the code easier to follow, and makes it easier to catch
21514 integer overflow bugs such as Bug#8664.
21515 * frame.c (Fmouse_position, Fmouse_pixel_position):
21516 Use Time, not unsigned long, for user-interface timestamps.
21517 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21518 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21519 * keyboard.h (last_event_timestamp): Likewise.
21520 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21521 * menu.h (xmenu_show): Likewise.
21522 * term.c (term_mouse_position): Likewise.
21523 * termhooks.h (struct input_event.timestamp): Likewise.
21524 (struct terminal.mouse_position_hook): Likewise.
21525 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21526 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21527 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21528 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21529 what it was before.
21530 * menu.h, termhooks.h: Include "systime.h", for Time.
21531
21532 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21533 Don't assume that the difference between two unsigned long values
21534 can fit into an integer. At this point, we know button_down_time
21535 <= event->timestamp, so the difference must be nonnegative, so
21536 there's no need to cast the result if double-click-time is
21537 nonnegative, as it should be; check that it's nonnegative, just in
21538 case. This bug is triggered when events are more than 2**31 ms
21539 apart (about 25 days). (Bug#8664)
21540
21541 * xselect.c (last_event_timestamp): Remove duplicate decl.
21542 (x_own_selection): Remove needless cast to unsigned long.
21543
21544 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21545 that always fit in int. Use a sentinel instead of a counter, to
21546 avoid a temp and to allay GCC's concerns about possible int overflow.
21547 * frame.h (struct frame): Use int for menu_bar_items_used
21548 instead of EMACS_INT, since it always fits in int.
21549
21550 * menu.c (grow_menu_items): Check for int overflow.
21551
21552 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21553
21554 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21555 Before, the code was not consistent. These values cannot exceed
21556 2**31 - 1 so there's no need to make them unsigned.
21557 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21558 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21559 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21560 as modifiers.
21561 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21562
21563 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21564 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21565 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21566 presumably because the widths might not match.
21567
21568 * window.c (size_window): Avoid needless test at loop start.
21569
215702011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21571
21572 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21573
215742011-05-12 Drew Adams <drew.adams@oracle.com>
21575
21576 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21577
215782011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21579
21580 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21581 `width' to `bar_area_x' and `bar_area_width', respectively.
21582 (x_scroll_run): Take account of fringe background extension.
21583
21584 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21585 Rename local vars `left' and `width' to `bar_area_x' and
21586 `bar_area_width', respectively.
21587 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21588 background extension.
21589
215902011-05-10 Jim Meyering <meyering@redhat.com>
21591
21592 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21593
215942011-05-10 Juanma Barranquero <lekktu@gmail.com>
21595
21596 * image.c (Finit_image_library): Return t for built-in image types,
21597 like pbm and xbm. (Bug#8640)
21598
215992011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21600
21601 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21602
216032011-05-07 Eli Zaretskii <eliz@gnu.org>
21604
21605 * w32console.c (Fset_screen_color): Doc fix.
21606 (Fget_screen_color): New function.
21607 (syms_of_ntterm): Defsubr it.
21608
21609 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21610 unlink the temporary file if Fcall_process didn't create it in the
21611 first place.
21612 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21613 child process will be redirected to a file specified with `:file'.
21614 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21615 cue to call_process_cleanup not to close that handle.
21616
216172011-05-07 Ben Key <bkey76@gmail.com>
21618
21619 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21620 one of two shell specific rules, either bootstrap-temacs-CMD or
21621 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21622 to the previous implementation of the bootstrap-temacs rule.
21623 The bootstrap-temacs-CMD rule is similar to the previous
21624 implementation of the bootstrap-temacs rule except that it
21625 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21626 variable.
21627
21628 These changes, along with some changes to nt/configure.bat,
21629 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21630 earlier fix to add support for --cflags and --ldflags options
21631 that include quotes so that it works whether make uses cmd or
21632 sh as the shell.
21633
216342011-05-06 Michael Albinus <michael.albinus@gmx.de>
21635
21636 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21637 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21638 is a constant.
21639 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21640 a string. Handle both cases.
21641 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21642 (Fdbus_register_method): Use Qinvalid_function.
21643
216442011-05-06 Juanma Barranquero <lekktu@gmail.com>
21645
21646 * makefile.w32-in: Update dependencies.
21647 (LISP_H): Add inttypes.h and stdin.h.
21648 (PROCESS_H): Add unistd.h.
21649
216502011-05-06 Eli Zaretskii <eliz@gnu.org>
21651
21652 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21653 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21654
216552011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21656
21657 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21658
21659 * term.c (vfatal): Remove stray call to va_end.
21660 It's not needed and the C Standard doesn't allow it here anyway.
21661
21662 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21663 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21664
21665 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21666 bytes.
21667
21668 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21669
21670 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21671
21672 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21673
21674 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21675
21676 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21677
21678 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21679 * charset.c (Fdefine_charset_internal): Don't initialize
21680 charset.code_space[15]. The value was garbage, on hosts with
21681 32-bit int (Bug#8600).
21682
21683 * lread.c (read_integer): Be more consistent with string-to-number.
21684 Use string_to_number to do the actual conversion; this avoids
21685 rounding errors and fixes some other screwups. Without this fix,
21686 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21687 (digit_to_number): Move earlier, for benefit of read_integer.
21688 Return -1 if the digit is out of range for the base, -2 if it is
21689 not a digit in any supported base. (Bug#8602)
21690
21691 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21692
21693 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21694 to match comment at start of function. This also removes a
21695 GCC warning about overflow in a 32+64-bit port.
21696
21697 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21698
21699 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21700 Reported by Stefan Monnier in
21701 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21702 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21703 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21704
21705 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21706 (EMACS_UINTPTR): Likewise, with uintptr_t.
21707
21708 * lisp.h: Prefer 64-bit EMACS_INT if available.
21709 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21710 on 32-bit hosts that have 64-bit int, so that they can access
21711 large files.
21712 However, temporarily disable this change unless the temporary
21713 symbol WIDE_EMACS_INT is defined.
21714
21715 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21716
21717 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21718 This removes an assumption that EMACS_INT and long are the same
21719 width as pointers. The assumption is true for Emacs porting targets
21720 now, but we want to make other targets possible.
21721 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21722 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21723 In the rest of the code, change types of integers that hold casted
21724 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21725 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21726 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21727 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21728 No need to cast type when ORing.
21729 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21730 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21731 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21732 assume EMACS_INT is the same width as char *.
21733 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21734 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21735 Remove no-longer-needed casts.
21736 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21737 (xg_tool_bar_help_callback, xg_make_tool_item):
21738 Use EMACS_INTPTR to hold an integer
21739 that will be cast to void *; this can avoid a GCC warning
21740 if EMACS_INT is not the same width as void *.
21741 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21742 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21743 (current_message_1, set_message_1):
21744 Use a local to convert to proper width without a cast.
21745 * xmenu.c (dialog_selection_callback): Likewise.
21746
21747 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21748 Also, don't assume VALBITS / RAND_BITS is less than 5,
21749 and don't rely on undefined behavior when shifting a 1 left into
21750 the sign bit.
21751 * lisp.h (get_random): Change signature to match.
21752
21753 * lread.c (hash_string): Use size_t, not int, for hash computation.
21754 Normally we prefer signed values; but hashing is special, because
21755 it's better to use unsigned division on hash table sizes so that
21756 the remainder is nonnegative. Also, size_t is the natural width
21757 for hashing into memory. The previous code used 'int', which doesn't
21758 retain enough info to hash well into very large tables.
21759 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21760
21761 * dbusbind.c: Don't possibly lose pointer info when converting.
21762 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21763 Use XPNTR rather than XHASH, so that the high-order bits of
21764 the pointer aren't lost when converting through void *.
21765
21766 * eval.c (Fautoload): Don't double-shift a pointer.
21767
21768 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21769
217702011-05-06 Juanma Barranquero <lekktu@gmail.com>
21771
21772 * gnutls.c (DEF_GNUTLS_FN):
21773 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21774
217752011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21776
21777 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21778 marker. (Bug#8610)
21779
217802011-05-05 Eli Zaretskii <eliz@gnu.org>
21781
21782 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21783 New version that can reserve upto 2GB of heap space.
21784
217852011-05-05 Chong Yidong <cyd@stupidchicken.com>
21786
21787 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21788
217892011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21790
21791 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21792 `gnutls_certificate_set_x509_key_file'.
21793
217942011-05-05 Juanma Barranquero <lekktu@gmail.com>
21795
21796 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21797 Update dependencies.
21798
217992011-05-04 Juanma Barranquero <lekktu@gmail.com>
21800
21801 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21802 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21803 Remove unused parameter `fildes'.
21804 * process.c (read_process_output, send_process): Don't pass it.
21805
218062011-05-04 Juanma Barranquero <lekktu@gmail.com>
21807
21808 Fix previous change: the library cache is defined in w32.c.
21809 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21810 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21811
218122011-05-04 Juanma Barranquero <lekktu@gmail.com>
21813
21814 Implement dynamic loading of GnuTLS on Windows.
21815
21816 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21817 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21818 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21819 Declare.
21820
21821 * gnutls.c (Qgnutls_dll): Define.
21822 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21823 (gnutls_*): Declare function pointers.
21824 (init_gnutls_functions): New function to initialize function pointers.
21825 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21826 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21827 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21828 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21829 (emacs_gnutls_write, emacs_gnutls_read)
21830 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21831 (Fgnutls_available_p): New function.
21832 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21833 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21834 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21835
21836 * image.c: Include w32.h.
21837 (Vimage_type_cache): Delete.
21838 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21839 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21840 (w32_delayed_load): Move to w32.c.
21841
21842 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21843
21844 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21845 (w32_delayed_load): Move from image.c. When loading a library, record
21846 its filename in the :loaded-from property of the library id.
21847 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21848 Initialize and staticpro them.
21849 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21850
21851 * process.c: Include lisp.h before w32.h, not after.
21852 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21853 instead of gnutls_record_check_pending.
21854
21855 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21856
218572011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21858
21859 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21860 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21861 as passed in.
21862
218632011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21864
21865 * xterm.c (x_set_frame_alpha): Do not set property on anything
21866 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21867
218682011-05-02 Juanma Barranquero <lekktu@gmail.com>
21869
21870 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21871
218722011-05-02 Juanma Barranquero <lekktu@gmail.com>
21873
21874 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21875 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21876 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21877 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21878 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21879 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21880 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21881 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21882 (Qgnutls_bootprop_callbacks_verify): Make static.
21883
218842011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21885
21886 * callproc.c: Indentation fixup.
21887
21888 * sysdep.c (wait_for_termination_1): Make static.
21889 (wait_for_termination, interruptible_wait_for_termination):
21890 Move after wait_for_termination_1.
21891
218922011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21893
21894 * sysdep.c (interruptible_wait_for_termination): New function
21895 which is like wait_for_termination, but allows keyboard
21896 interruptions.
21897
21898 * callproc.c (Fcall_process): Add (:file "file") as an option for
21899 the STDOUT buffer.
21900 (Fcall_process_region): Ditto.
21901
219022011-04-30 Eli Zaretskii <eliz@gnu.org>
21903
21904 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21905 rather than `XVECTOR (FOO)->size'.
21906
21907 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21908 inttypes.h, as a gnulib replacement is used if it not available in
21909 system headers.
21910
219112011-04-21 Eli Zaretskii <eliz@gnu.org>
21912
21913 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21914 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21915 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21916
21917 * coding.c (coding_alloc_by_realloc): Error out if destination
21918 will grow beyond MOST_POSITIVE_FIXNUM.
21919 (decode_coding_emacs_mule): Abort if there isn't enough place in
21920 charbuf for the composition carryover bytes. Reserve an extra
21921 space for up to 2 characters produced in a loop.
21922 (decode_coding_iso_2022): Abort if there isn't enough place in
21923 charbuf for the composition carryover bytes.
21924
219252011-04-21 Eli Zaretskii <eliz@gnu.org>
21926
21927 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21928 aborting when %lld or %lll format is passed.
21929 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21930 %llo or %llx format is passed. (Bug#8545)
21931
21932 * window.c (window_scroll_line_based): Use a marker instead of
21933 simple variables to record original value of point. (Bug#7952)
21934
21935 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21936 produced by %s or %c overflows available buffer space. (Bug#8545)
21937
219382011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21939
21940 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21941 (SIZE_MAX): Move defn after all includes, as they might #define it.
21942
219432011-04-28 Juanma Barranquero <lekktu@gmail.com>
21944
21945 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21946
219472011-04-28 Juanma Barranquero <lekktu@gmail.com>
21948
21949 * keyboard.c (Qdelayed_warnings_hook): Define.
21950 (command_loop_1): Run `delayed-warnings-hook'
21951 if Vdelayed_warnings_list is non-nil.
21952 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21953 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21954
219552011-04-28 Eli Zaretskii <eliz@gnu.org>
21956
21957 * doprnt.c (doprnt): Don't return value smaller than the buffer
21958 size if the message was truncated. (Bug#8545).
21959
219602011-04-28 Juanma Barranquero <lekktu@gmail.com>
21961
21962 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21963 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21964
219652011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21966
21967 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21968
219692011-04-27 Juanma Barranquero <lekktu@gmail.com>
21970
21971 * makefile.w32-in: Update dependencies.
21972
219732011-04-27 Eli Zaretskii <eliz@gnu.org>
21974
21975 Improve `doprnt' and its usage. (Bug#8545)
21976 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21977 `format_end'. Remove support for %l as a conversion specifier.
21978 Don't use xrealloc. Improve diagnostics when the %l size modifier
21979 is used. Update the commentary.
21980
21981 * eval.c (verror): Simplify calculation of size_t.
21982
21983 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21984 messages.
21985
219862011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21987
21988 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21989 change.
21990
219912011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21992
21993 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21994 This makes this file independent of the recent pseudovector change.
21995
219962011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21997
21998 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21999
22000 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
22001 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
22002 Remove unused local.
22003 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
22004
22005 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
22006 GCC 4.6.0 optimizes based on type-based alias analysis.
22007 For example, if b is of type struct buffer * and v of type struct
22008 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
22009 != &v->size, and therefore "v->size = 1; b->size = 2; return
22010 v->size;" must therefore return 1. This assumption is incorrect
22011 for Emacs, since it type-puns struct Lisp_Vector * with many other
22012 types. To fix this problem, this patch adds a new type struct
22013 vectorlike_header that documents the constraints on layout of vectors
22014 and pseudovectors, and helps optimizing compilers not get fooled
22015 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
22016 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
22017 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
22018 the size member.
22019 (XSETPVECTYPE): Rewrite in terms of new macro.
22020 (XSETPVECTYPESIZE): New macro, specifying both type and size.
22021 This is a bit clearer, and further avoids the possibility of
22022 undesirable aliasing.
22023 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
22024 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
22025 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
22026 since Lisp_Subr is a special case (no "next" field).
22027 (ASIZE): Now uses header.size rather than size.
22028 All previous uses of XVECTOR (foo)->size replaced to use this macro,
22029 to avoid the hassle of writing XVECTOR (foo)->header.size.
22030 (struct vectorlike_header): New type.
22031 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
22032 object, to help avoid aliasing.
22033 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
22034 (SUBRP): Likewise, since Lisp_Subr is a special case.
22035 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
22036 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
22037 (struct Lisp_Hash_Table): Combine first two members into a single
22038 struct vectorlike_header member. All uses of "size" and "next" members
22039 changed to be "header.size" and "header.next".
22040 * buffer.h (struct buffer): Likewise.
22041 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
22042 * frame.h (struct frame): Likewise.
22043 * process.h (struct Lisp_Process): Likewise.
22044 * termhooks.h (struct terminal): Likewise.
22045 * window.c (struct save_window_data, struct saved_window): Likewise.
22046 * window.h (struct window): Likewise.
22047 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
22048 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
22049 * buffer.c (init_buffer_once): Likewise.
22050 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
22051 special case.
22052 * process.c (Fformat_network_address): Use local var for size,
22053 for brevity.
22054
22055 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
22056
22057 Make the Lisp reader and string-to-float more consistent (Bug#8525)
22058 * data.c (atof): Remove decl; no longer used or needed.
22059 (digit_to_number): Move to lread.c.
22060 (Fstring_to_number): Use new string_to_number function, to be
22061 consistent with how the Lisp reader treats infinities and NaNs.
22062 Do not assume that floating-point numbers represent EMACS_INT
22063 without losing information; this is not true on most 64-bit hosts.
22064 Avoid double-rounding errors, by insisting on integers when
22065 parsing non-base-10 numbers, as the documentation specifies.
22066 * lisp.h (string_to_number): New decl, replacing ...
22067 (isfloat_string): Remove.
22068 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
22069 (read1): Do not accept +. and -. as integers; this
22070 appears to have been a coding error. Similarly, do not accept
22071 strings like +-1e0 as floating point numbers. Do not report
22072 overflow for integer overflows unless the base is not 10 which
22073 means we have no simple and reliable way to continue.
22074 Break out the floating-point parsing into a new
22075 function string_to_number, so that Fstring_to_number parses
22076 floating point numbers consistently with the Lisp reader.
22077 (digit_to_number): Move here from data.c. Make it static inline.
22078 (E_CHAR, EXP_INT): Remove, replacing with ...
22079 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
22080 (string_to_number): New function, replacing isfloat_string.
22081 This function checks for valid syntax and produces the resulting
22082 Lisp float number too. Rework it so that string-to-number
22083 no longer mishandles examples like "1.0e+". Use strtoumax,
22084 so that overflow for non-base-10 numbers is reported only when
22085 there's no portable and simple way to convert to floating point.
22086
22087 * textprop.c (set_text_properties_1): Rewrite for clarity,
22088 and to avoid GCC warning about integer overflow.
22089
22090 * intervals.h (struct interval): Use EMACS_INT for members
22091 where EMACS_UINT might cause problems. See
22092 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
22093 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
22094 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
22095 All uses changed.
22096 (offset_intervals): Tell GCC not to worry about length overflow
22097 when negating a negative length.
22098
22099 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
22100 (overrun_check_free): Likewise.
22101
22102 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
22103 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
22104 word size.
22105
22106 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
22107 (gnutls_make_error): Rename local to avoid shadowing.
22108 (gnutls_emacs_global_deinit): ifdef out; not used.
22109 (Fgnutls_boot): Use const for pointer to readonly storage.
22110 Comment out unused local. Fix pointer signedness problems.
22111
22112 * lread.c (openp): Don't stuff size_t into an 'int'.
22113 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
22114 about possible signed overflow.
22115
22116 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
22117 (GDK_KEY_g): Don't define if already defined.
22118 (xg_prepare_tooltip): Avoid pointer signedness problem.
22119 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
22120
22121 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
22122 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
22123
22124 * xfns.c (Fx_window_property): Simplify a bit,
22125 to make a bit faster and to avoid GCC 4.6.0 warning.
22126 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
22127
22128 * fns.c (internal_equal): Don't assume size_t fits in int.
22129
22130 * alloc.c (compact_small_strings): Tighten assertion a little.
22131
22132 Replace pEd with more-general pI, and fix some printf arg casts.
22133 * lisp.h (pI): New macro, generalizing old pEd macro to other
22134 conversion specifiers. For example, use "...%"pI"d..." rather
22135 than "...%"pEd"...".
22136 (pEd): Remove. All uses replaced with similar uses of pI.
22137 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
22138 * alloc.c (check_pure_size): Don't overflow by converting size to int.
22139 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
22140 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
22141 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
22142 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
22143 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
22144 64-bit hosts.
22145 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
22146 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
22147 * print.c (safe_debug_print, print_object): Likewise.
22148 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
22149 to int.
22150 Use pI instead of if-then-else-abort. Use %p to avoid casts,
22151 avoiding the 0 flag, which is not portable.
22152 * process.c (Fmake_network_process): Use pI to avoid cast.
22153 * region-cache.c (pp_cache): Likewise.
22154 * xdisp.c (decode_mode_spec): Likewise.
22155 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
22156 behavior on 64-bit hosts with printf arg.
22157 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
22158 (x_stop_queuing_selection_requests): Likewise.
22159 (x_get_window_property): Don't truncate byte count to an 'int'
22160 when tracing.
22161
22162 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
22163 here, since it parses constructs like leading '-' and spaces,
22164 which are not wanted; and it overflows with large numbers.
22165 Instead, simply match F[0-9]+, which is what is wanted anyway.
22166
22167 * alloc.c: Remove unportable assumptions about struct layout.
22168 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
22169 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
22170 (allocate_vectorlike, make_pure_vector): Use the new macros,
22171 plus offsetof, to remove unportable assumptions about struct layout.
22172 These assumptions hold on all porting targets that I know of, but
22173 they are not guaranteed, they're easy to remove, and removing them
22174 makes further changes easier.
22175
22176 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
22177 This doesn't fix a bug but makes the code clearer.
22178 (string_overrun_cookie): Now const. Use initializers that
22179 don't formally overflow signed char, to avoid warnings.
22180 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
22181 can cause Emacs to crash when string overrun checking is enabled.
22182 (allocate_buffer): Don't assume sizeof (struct buffer) is a
22183 multiple of sizeof (EMACS_INT); it need not be, if
22184 alignof(EMACS_INT) < sizeof (EMACS_INT).
22185 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
22186
221872011-04-26 Juanma Barranquero <lekktu@gmail.com>
22188
22189 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
22190
221912011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
22192
22193 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
22194 supposed to be handshaking. (Bug#8556)
22195 Reported by Paul Eggert <eggert@cs.ucla.edu>.
22196
221972011-04-26 Daniel Colascione <dan.colascione@gmail.com>
22198
22199 * lisp.h (Qdebug): List symbol.
22200 * eval.c (Qdebug): Restore global linkage.
22201 * keyboard.c (debug-on-event): New variable.
22202 (handle_user_signal): Break into debugger when debug-on-event
22203 matches the current signal symbol.
22204
222052011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
22206
22207 * alloc.c (check_sblock, check_string_bytes)
22208 (check_string_free_list): Convert to standard C.
22209
222102011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
22211
22212 * w32.c (emacs_gnutls_push): Fix typo.
22213
222142011-04-25 Eli Zaretskii <eliz@gnu.org>
22215
22216 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
22217 "cast to pointer from integer of different size".
22218
22219 Improve doprnt and its use in verror. (Bug#8545)
22220 * doprnt.c (doprnt): Document the set of format control sequences
22221 supported by the function. Use SAFE_ALLOCA instead of always
22222 using `alloca'.
22223
22224 * eval.c (verror): Don't limit the buffer size at size_max-1, that
22225 is one byte too soon. Don't use xrealloc; instead xfree and
22226 xmalloc anew.
22227
222282011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
22229
22230 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
22231 callbacks stage.
22232
22233 * gnutls.c: Renamed global_initialized to
22234 gnutls_global_initialized. Added internals for the
22235 :verify-hostname-error, :verify-error, and :verify-flags
22236 parameters of `gnutls-boot' and documented those parameters in the
22237 docstring. Start callback support.
22238 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
22239 unless a fatal error occurred. Call gnutls_alert_send_appropriate
22240 on error. Return error code.
22241 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
22242 (emacs_gnutls_read): Likewise.
22243 (Fgnutls_boot): Return handshake error code.
22244 (emacs_gnutls_handle_error): New function.
22245 (wsaerror_to_errno): Likewise.
22246
22247 * w32.h (emacs_gnutls_pull): Add prototype.
22248 (emacs_gnutls_push): Likewise.
22249
22250 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
22251 (emacs_gnutls_push): Likewise.
22252
222532011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
22254
22255 * process.c (wait_reading_process_output): Check if GnuTLS
22256 buffered some data internally if no FDs are set for TLS
22257 connections.
22258
22259 * makefile.w32-in (OBJ2): Add gnutls.$(O).
22260 (LIBS): Link to USER_LIBS.
22261 ($(BLD)/gnutls.$(0)): New target.
22262
222632011-04-24 Eli Zaretskii <eliz@gnu.org>
22264
22265 * xdisp.c (handle_single_display_spec): Rename the
22266 display_replaced_before_p argument into display_replaced_p, to
22267 make it consistent with the commentary. Fix typos in the
22268 commentary.
22269
22270 * textprop.c (syms_of_textprop): Remove dead code.
22271 (copy_text_properties): Delete obsolete commentary about an
22272 interface that was deleted long ago. Fix typos in the description
22273 of arguments.
22274
22275 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
22276 to changes in oldXMenu/XMenu.h from 2011-04-16.
22277 <menu_help_message, prev_menu_help_message>: Constify.
22278 (IT_menu_make_room): menu->help_text is now `const char **';
22279 adjust.
22280
22281 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
22282 to changes in oldXMenu/XMenu.h from 2011-04-16.
22283 (struct XMenu): Declare `help_text' `const char **'.
22284
22285 * xfaces.c <Qunspecified>: Make extern again.
22286
22287 * syntax.c: Include sys/types.h before including regex.h, as
22288 required by POSIX.
22289
22290 * doc.c (get_doc_string): Improve the format passed to `error'.
22291
22292 * doprnt.c (doprnt): Improve commentary.
22293
22294 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
22295
22296 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
22297 them with etags.
22298
22299 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
22300 changes in globals.h immediately force recompilation.
22301 (TAGS): Depend on $(CURDIR)/m/intel386.h and
22302 $(CURDIR)/s/ms-w32.h.
22303 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
22304
22305 * character.c (Fchar_direction): Function deleted.
22306 (syms_of_character): Don't defsubr it.
22307 <char-direction-table>: Deleted.
22308
223092011-04-23 Eli Zaretskii <eliz@gnu.org>
22310
22311 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
22312 * doprnt.c: Include limits.h.
22313 (SIZE_MAX): New macro.
22314 (doprnt): Return a size_t value. 2nd arg is now size_t.
22315 Many local variables are now size_t instead of int or unsigned.
22316 Improve overflow protection. Support `l' modifier for integer
22317 conversions. Support %l conversion. Don't assume an EMACS_INT
22318 argument for integer conversions and for %c.
22319
22320 * lisp.h (doprnt): Restore prototype.
22321
22322 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
22323 $(SRC)/character.h.
22324
22325 * Makefile.in (base_obj): Add back doprnt.o.
22326
22327 * deps.mk (doprnt.o): Add back prerequisites.
22328 (callint.o): Depend on character.h.
22329
22330 * eval.c (internal_lisp_condition_case): Include the handler
22331 representation in the error message.
22332 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
22333 when breaking from the loop.
22334
22335 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
22336
22337 * callint.c (Fcall_interactively): When displaying error message
22338 about invalid control letter, pass the character's codepoint, not
22339 a pointer to its multibyte form. Improve display of the character
22340 in octal and display also its hex code.
22341
22342 * character.c (char_string): Use %x to display the (unsigned)
22343 codepoint of an invalid character, to avoid displaying a bogus
22344 negative value.
22345
22346 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
22347 `error', not SYMBOL_NAME itself.
22348
22349 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
22350 character arguments to `error'.
22351
22352 * charset.c (check_iso_charset_parameter): Fix incorrect argument
22353 to `error' in error message about FINAL_CHAR argument. Make sure
22354 FINAL_CHAR is a character, and use %c when it is passed as
22355 argument to `error'.
22356
223572011-04-23 Eli Zaretskii <eliz@gnu.org>
22358
22359 * s/ms-w32.h (localtime): Redirect to sys_localtime.
22360
22361 * w32.c: Include <time.h>.
22362 (sys_localtime): New function.
22363
223642011-04-23 Chong Yidong <cyd@stupidchicken.com>
22365
22366 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22367
22368 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
22369
223702011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
22371
22372 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22373 zombies (Bug#8467).
22374
223752011-04-19 Eli Zaretskii <eliz@gnu.org>
22376
22377 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22378 gl_state.e_property when gl_state.object is Qt.
22379
22380 * insdel.c (make_gap_larger): Remove limitation of buffer size
22381 to <= INT_MAX.
22382
223832011-04-18 Chong Yidong <cyd@stupidchicken.com>
22384
22385 * xdisp.c (lookup_glyphless_char_display)
22386 (produce_glyphless_glyph): Handle cons cell entry in
22387 glyphless-char-display.
22388 (Vglyphless_char_display): Document it.
22389
22390 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22391 glyphless-char-display.
22392
223932011-04-17 Chong Yidong <cyd@stupidchicken.com>
22394
22395 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22396
22397 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22398
22399 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22400 definition for no-X builds.
22401
224022011-04-16 Paul Eggert <eggert@cs.ucla.edu>
22403
22404 Static checks with GCC 4.6.0 and non-default toolkits.
22405
22406 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22407
22408 * process.c (keyboard_bit_set): Define only if SIGIO.
22409 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22410 (send_process): Repair possible setjmp clobbering.
22411
22412 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22413
22414 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22415
22416 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22417
22418 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22419 Define only if needed.
22420
22421 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22422 by pacifying GCC about it. Maybe it's time to retire it?
22423 * xfaces.c (USG, __TIMEVAL__): Likewise.
22424
22425 * dispextern.h (struct redisplay_interface): Rename param
22426 to avoid shadowing.
22427 * termhooks.h (struct terminal): Likewise.
22428 * xterm.c (xembed_send_message): Likewise.
22429
22430 * insdel.c (make_gap_smaller): Define only if
22431 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22432
22433 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22434 it.
22435
22436 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22437 so that we aren't warned about unused symbols.
22438
22439 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22440
22441 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
22442
22443 * xfns.c (x_real_positions): Mark locals as initialized.
22444
22445 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22446
22447 * xterm.c: Fix problems found by static analysis with other toolkits.
22448 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
22449 (x_dispatch_event): Declare static if USE_GTK, and
22450 define if USE_GTK || USE_X_TOOLKIT.
22451 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
22452 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
22453 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22454 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
22455
22456 * xmenu.c (menu_help_callback): Pointer type fixes.
22457 Use const pointers when pointing at readonly data. Avoid pointer
22458 signedness clashes.
22459 (FALSE): Remove unused macro.
22460 (update_frame_menubar): Remove unused decl.
22461
22462 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22463
22464 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22465 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22466 (single_menu_item): Rename local to avoid shadowing.
22467
22468 * keyboard.c (make_lispy_event): Remove unused local var.
22469
22470 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22471 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22472
22473 * bitmaps: Change bitmaps from unsigned char back to the X11
22474 compatible char. Avoid the old compiler warnings about
22475 out-of-range initializers by using, for example, '\xab' rather
22476 than 0xab.
22477
22478 * xgselect.c (xgselect_initialize): Check vs interface
22479 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22480
22481 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22482
22483 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22484 to read-only memory.
22485
22486 * fns.c (vector): Remove; this old hack is no longer needed.
22487
22488 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
22489 Remove unused var.
22490 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
22491
22492 * xrdb.c (x_load_resources): Omit unused local.
22493
22494 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
22495 (x_window): Rename locals to avoid shadowing.
22496 (USG): Use the kludged USG macro, to pacify gcc.
22497
22498 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
22499 (x_term_init): Remove local to avoid shadowing.
22500
22501 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
22502
22503 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22504 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22505
225062011-04-16 Eli Zaretskii <eliz@gnu.org>
22507
22508 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22509
22510 Fix regex.c, syntax.c and friends for buffers > 2GB.
22511 * syntax.h (struct gl_state_s): Declare character position members
22512 EMACS_INT.
22513
22514 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22515
22516 * textprop.c (verify_interval_modification, interval_of):
22517 Declare arguments EMACS_INT.
22518
22519 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22520 EMACS_INT.
22521
22522 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22523
22524 * indent.c (Fvertical_motion): Local variable it_start is now
22525 EMACS_INT.
22526
22527 * regex.c (re_match, re_match_2, re_match_2_internal)
22528 (bcmp_translate, regcomp, regexec, print_double_string)
22529 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22530 (re_compile_pattern, re_exec): Declare arguments and local
22531 variables `size_t' and `ssize_t' and return values `regoff_t', as
22532 appropriate.
22533 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22534 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22535 <compile_stack_type>: `size' and `avail' are now `size_t'.
22536
22537 * regex.h <regoff_t>: Use ssize_t, not int.
22538 (re_search, re_search_2, re_match, re_match_2): Arguments that
22539 specify buffer/string position and length are now ssize_t and
22540 size_t. Return type is regoff_t.
22541
225422011-04-16 Ben Key <bkey76@gmail.com>
22543
22544 * nsfont.m: Fixed bugs in ns_get_family and
22545 ns_descriptor_to_entity that were caused by using free to
22546 deallocate memory blocks that were allocated by xmalloc (via
22547 xstrdup). This caused Emacs to crash when compiled with
22548 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22549 --enable-checking=xmallocoverrun). xfree is now used to
22550 deallocate these memory blocks.
22551
225522011-04-15 Paul Eggert <eggert@cs.ucla.edu>
22553
22554 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22555
22556 emacs_write: Accept and return EMACS_INT for sizes.
22557 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22558 et seq.
22559 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22560 Accept and return EMACS_INT.
22561 (emacs_gnutls_write): Return the number of bytes written on
22562 partial writes.
22563 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
22564 (emacs_read, emacs_write): Remove check for negative size, as the
22565 Emacs source code has been audited now.
22566 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22567 (emacs_read, emacs_write): Use it.
22568 * process.c (send_process): Adjust to the new signatures of
22569 emacs_write and emacs_gnutls_write. Do not attempt to store
22570 a byte offset into an 'int'; it might overflow.
22571 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
22572
22573 * sound.c: Don't assume sizes fit in 'int'.
22574 (struct sound_device.period_size, alsa_period_size):
22575 Return EMACS_INT, not int.
22576 (struct sound_device.write, vox_write, alsa_write):
22577 Accept EMACS_INT, not int.
22578 (wav_play, au_play): Use EMACS_INT to store sizes and to
22579 record read return values.
22580
225812011-04-15 Ben Key <bkey76@gmail.com>
22582
22583 * keyboard.c (Qundefined): Don't declare static since it is used
22584 in nsfns.m.
22585 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22586 static since they are used in nsfont.m.
22587
225882011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22589
22590 * process.c (Qprocessp): Don't declare static.
22591 * lisp.h (Qprocessp): Declare again.
22592
225932011-04-15 Juanma Barranquero <lekktu@gmail.com>
22594
22595 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22596
225972011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22598
22599 Improve C-level modularity by making more things 'static'.
22600
22601 Don't publish debugger-only interfaces to other modules.
22602 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22603 (verify_bytepos, count_markers): Move decls to the only modules
22604 that need them.
22605 * region-cache.h (pp_cache): Likewise.
22606 * window.h (check_all_windows): Likewise.
22607 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22608
22609 * sysdep.c (croak): Now static, if
22610 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22611 * syssignal.h (croak): Declare only if not static.
22612
22613 * alloc.c (refill_memory_reserve): Now static if
22614 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22615 * lisp.h (refill_memory_reserve): Declare only if not static.
22616
22617 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22618 Define only if USE_LUCID.
22619
22620 * xrdb.c (x_customization_string, x_rm_string): Now static.
22621
22622 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22623 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22624
22625 * xdisp.c (draw_row_with_mouse_face): Now static.
22626 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22627
22628 * window.h (check_all_windows): Mark externally visible.
22629
22630 * window.c (window_deletion_count): Now static.
22631
22632 * undo.c: Make symbols static if they're not exported.
22633 (last_undo_buffer, last_boundary_position, pending_boundary):
22634 Now static.
22635
22636 * textprop.c (interval_insert_behind_hooks): Now static.
22637 (interval_insert_in_front_hooks): Likewise.
22638
22639 * term.c: Make symbols static if they're not exported.
22640 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22641 (max_frame_lines, tty_set_terminal_modes):
22642 (tty_reset_terminal_modes, tty_turn_off_highlight):
22643 (get_tty_terminal): Now static.
22644 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22645 * termhooks.h (term_mouse_moveto): Do not declare if
22646 HAVE_WINDOW_SYSTEM.
22647 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22648 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22649
22650 * sysdep.c: Make symbols static if they're not exported.
22651 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22652 Now static.
22653 (sigprocmask_set, full_mask): Remove; unused.
22654 (wait_debugging): Mark as visible.
22655 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22656 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22657
22658 * syntax.c (syntax_temp): Define only if !__GNUC__.
22659
22660 * sound.c (current_sound_device, current_sound): Now static.
22661
22662 * search.c (searchbufs, searchbuf_head): Now static.
22663
22664 * scroll.c (scroll_cost): Remove; unused.
22665 * dispextern.h (scroll_cost): Remove decl.
22666
22667 * region-cache.h (pp_cache): Mark as externally visible.
22668
22669 * process.c: Make symbols static if they're not exported.
22670 (process_tick, update_tick, create_process, chan_process):
22671 (Vprocess_alist, proc_buffered_char, datagram_access):
22672 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22673 (deactivate_process): Mark defn as static, as well as decl.
22674 * lisp.h (create_process): Remove decl.
22675 * process.h (chan_process, Vprocess_alist): Remove decls.
22676
22677 * print.c: Make symbols static if they're not exported.
22678 (print_depth, new_backquote_output, being_printed, print_buffer):
22679 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22680 (print_interval, print_number_index, initial_stderr_stream):
22681 Now static.
22682 * lisp.h (Fprinc): Remove decl.
22683 (debug_output_compilation_hack): Mark as externally visible.
22684
22685 * sysdep.c (croak): Move decl from here to syssignal.h.
22686 * syssignal.h (croak): Put it here, so the API can be checked when
22687 'croak' is called from dissociate_if_controlling_tty.
22688
22689 * minibuf.c: Make symbols static if they're not exported.
22690 (minibuf_save_list, choose_minibuf_frame): Now static.
22691 * lisp.h (choose_minibuf_frame): Remove decl.
22692
22693 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22694
22695 * lread.c: Make symbols static if they're not exported.
22696 (read_objects, initial_obarray, oblookup_last_bucket_number):
22697 Now static.
22698 (make_symbol): Remove; unused.
22699 * lisp.h (initial_obarray, make_symbol): Remove decls.
22700
22701 * keyboard.c: Make symbols static if they're not exported.
22702 (single_kboard, recent_keys_index, total_keys, recent_keys):
22703 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22704 (this_single_command_key_start, echoing, last_auto_save):
22705 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22706 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22707 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22708 (Vlispy_mouse_stem, double_click_count):
22709 Now static.
22710 (force_auto_save_soon): Define only if SIGDANGER.
22711 (ignore_mouse_drag_p): Now static if
22712 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22713 (print_help): Remove; unused.
22714 (stop_character, last_timer_event): Mark as externally visible.
22715 * keyboard.h (ignore_mouse_drag_p): Declare only if
22716 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22717 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22718 * lisp.h (echoing): Remove decl.
22719 (force_auto_save_soon): Declare only if SIGDANGER.
22720 * xdisp.c (redisplay_window): Simplify code, to make it more
22721 obvious that ignore_mouse_drag_p is not accessed if !defined
22722 USE_GTK && !defined HAVE_NS.
22723
22724 * intervals.c: Make symbols static if they're not exported.
22725 (merge_properties_sticky, merge_interval_right, delete_interval):
22726 Now static.
22727 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22728
22729 * insdel.c: Make symbols static if they're not exported.
22730 However, leave prepare_to_modify_buffer alone. It's never
22731 called from outside this function, but that appears to be a bug.
22732 (combine_after_change_list, combine_after_change_buffer):
22733 (adjust_after_replace, signal_before_change): Now static.
22734 (adjust_after_replace_noundo): Remove; unused.
22735 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22736 (signal_before_change): Remove decls.
22737
22738 * indent.c (val_compute_motion, val_vmotion): Now static.
22739
22740 * image.c: Make symbols static if they're not exported.
22741 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22742 if USE_GTK.
22743 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22744 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22745
22746 * fringe.c (standard_bitmaps): Now static.
22747 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22748
22749 * frame.c: Make symbols static if they're not exported.
22750 (x_report_frame_params, make_terminal_frame): Now static.
22751 (get_frame_param): Now static, unless HAVE_NS.
22752 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22753 (x_get_resource_string): Remove; not used.
22754 * frame.h (make_terminal_frame, x_report_frame_params):
22755 (x_get_resource_string); Remove decls.
22756 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22757 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22758
22759 * font.c, fontset.c: Make symbols static if they're not exported.
22760 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22761 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22762 * font.c (font_close_object): Now static.
22763 * font.h (font_close_object): Remove.
22764 * fontset.c (FONTSET_OBJLIST): Remove.
22765 (free_realized_fontset) #if-0 the body, which does nothing.
22766 (face_suitable_for_char_p): #if-0, as it's never called.
22767 * fontset.h (face_suitable_for_char_p): Remove decl.
22768 * xfaces.c (face_at_string_position):
22769 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22770 since 0 is always ASCII.
22771
22772 * fns.c (weak_hash_tables): Now static.
22773
22774 * fileio.c: Make symbols static if they're not exported.
22775 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22776 (Vwrite_region_annotation_buffers): Now static.
22777
22778 * eval.c: Make symbols static if they're not exported.
22779 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22780 * lisp.h (backtrace_list): Remove decl.
22781
22782 * emacs.c: Make symbols static if they're not exported.
22783 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22784 (fatal_error_code, fatal_error_signal_hook, standard_args):
22785 Now static.
22786 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22787 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22788 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22789 * lisp.h (fatal_error_signal_hook): Remove decl.
22790 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22791
22792 * editfns.c: Move a (normally-unused) function to its only use.
22793 * editfns.c, lisp.h (get_operating_system_release): Remove.
22794 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22795 worth the hassle of breaking this out.
22796
22797 * xterm.c: Make symbols static if they're not exported.
22798 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22799 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22800 (x_destroy_window, x_delete_display):
22801 Now static.
22802 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22803 (x_mouse_leave): Remove; unused.
22804 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22805 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22806 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22807 Remove decls.
22808 (x_mouse_leave): Declare only if WINDOWSNT.
22809 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22810 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22811 USE_X_TOOLKIT.
22812
22813 * ftxfont.c: Make symbols static if they're not exported.
22814 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22815 HAVE_FREETYPE.
22816 * font.h (ftxfont_driver): Likewise.
22817
22818 * xfns.c: Make symbols static if they're not exported.
22819 (x_last_font_name, x_display_info_for_name):
22820 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22821 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22822 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22823 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22824 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22825 (last_show_tip_args): Now static.
22826 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22827 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22828 (x_screen_planes): Remove; unused.
22829 * dispextern.h (x_screen_planes): Remove decl.
22830
22831 * dispnew.c: Make symbols static if they're not exported.
22832 * dispextern.h (redraw_garbaged_frames, scrolling):
22833 (increment_row_positions): Remove.
22834 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22835 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22836 Now static.
22837 (redraw_garbaged_frames): Remove; unused.
22838
22839 * xfaces.c: Make symbols static if they're not exported.
22840 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22841 Remove decls.
22842 * xterm.h (defined_color): Remove decls.
22843 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22844 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22845 (menu_face_changed_default, defined_color, free_realized_face):
22846 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22847 (ascii_face_of_lisp_face): Remove; unused.
22848
22849 * xdisp.c: Make symbols static if they're not exported.
22850 * dispextern.h (scratch_glyph_row, window_box_edges):
22851 (glyph_to_pixel_coords, set_cursor_from_row):
22852 (get_next_display_element, set_iterator_to_next):
22853 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22854 (show_mouse_face): Remove decls
22855 * frame.h (message_buf_print): Likewise.
22856 * lisp.h (pop_message, set_message, check_point_in_composition):
22857 Likewise.
22858 * xterm.h (set_vertical_scroll_bar): Likewise.
22859 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22860 (message_buf_print, scratch_glyph_row, displayed_buffer):
22861 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22862 (get_next_display_element, show_mouse_face, window_box_edges):
22863 (frame_to_window_pixel_xy, check_point_in_composition):
22864 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22865 (glyph_to_pixel_coords): Remove; unused.
22866
22867 * dired.c (file_name_completion): Now static.
22868
22869 * dbusbind.c (xd_in_read_queued_messages): Now static.
22870
22871 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22872 * data.c (circular_list_error): Remove.
22873
22874 * commands.h (last_point_position, last_point_position_buffer):
22875 (last_point_position_window): Remove decls.
22876 * keyboard.c: Make these variables static.
22877
22878 * coding.h (coding, code_convert_region, encode_coding_gap):
22879 Remove decls.
22880 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22881 (iso_code_class, detect_coding, code_convert_region): Now static.
22882 (encode_coding_gap): Remove; unused.
22883
22884 * chartab.c (chartab_chars, chartab_bits): Now static.
22885
22886 * charset.h (charset_iso_8859_1): Remove decl.
22887 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22888 Now static.
22889
22890 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22891 * ccl.c (Vccl_program_table): Now static.
22892 (check_ccl_update): Remove; unused.
22893
22894 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22895 * category.h: ... from here.
22896 * category.c (check_category_table, set_category_set): Now static.
22897
22898 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22899 * lisp.h: Remove these decls.
22900
22901 * buffer.c (buffer_count): Remove unused var.
22902
22903 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22904 so that it's not optimized away.
22905 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22906 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22907 exported only to the debugger.
22908
22909 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22910 * atimer.h (run_all_atimers): Remove; not exported.
22911
22912 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22913 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22914 was inaccessible from Lisp.
22915 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22916 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22917
22918 alloc.c: Import and export fewer symbols, and remove unused items.
22919 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22920 is defined.
22921 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22922 it's not optimized away by whole-program optimization.
22923 (message_enable_multibyte, free_misc): Remove.
22924 (catchlist, handlerlist, mark_backtrace):
22925 Declare only if BYTE_MARK_STACK.
22926 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22927 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22928 (message_enable_multibyte): Remove decl.
22929 (free_misc, interval_free_list, float_block, float_block_index):
22930 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22931 (cons_free_list, last_marked_index):
22932 Now static.
22933 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22934 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22935 (mark_backtrace): Define only if BYTE_MARK_STACK.
22936 * xdisp.c (message_enable_multibyte): Now static.
22937
22938 Declare Lisp_Object Q* variables to be 'static' if not exported.
22939 This makes it easier for human readers (and static analyzers)
22940 to see whether these variables are used from other modules.
22941 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22942 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22943 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22944 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22945 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22946 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22947 * xmenu.c, xselect.c:
22948 Declare Q* vars static if they are not used in other modules.
22949 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22950 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22951 Remove decls of unexported vars.
22952 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22953
22954 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22955
22956 Make Emacs functions such as Fatom 'static' by default.
22957 This makes it easier for human readers (and static analyzers)
22958 to see whether these functions can be called from other modules.
22959 DEFUN now defines a static function. To make the function external
22960 so that it can be used in other C modules, use the new macro DEFUE.
22961 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22962 (Finit_image_library):
22963 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22964 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22965 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22966 Remove decls, since these functions are now static.
22967 (Funintern, Fget_internal_run_time): New decls, since these functions
22968 were already external.
22969
22970 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22971 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22972 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22973 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22974 * keyboard.c, keymap.c, lread.c:
22975 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22976 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22977 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22978 Mark functions with DEFUE instead of DEFUN,
22979 if they are used in other modules.
22980 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22981 decls for now-static functions.
22982 * buffer.h (Fdelete_overlay): Remove decl.
22983 * callproc.c (Fgetenv_internal): Mark as internal.
22984 * composite.c (Fremove_list_of_text_properties): Remove decl.
22985 (Fcomposition_get_gstring): New forward static decl.
22986 * composite.h (Fcomposite_get_gstring): Remove decl.
22987 * dired.c (Ffile_attributes): New forward static decl.
22988 * doc.c (Fdocumntation_property): New forward static decl.
22989 * eval.c (Ffetch_bytecode): New forward static decl.
22990 (Funintern): Remove extern decl; now in .h file where it belongs.
22991 * fileio.c (Fmake_symbolic_link): New forward static decl.
22992 * image.c (Finit_image_library): New forward static decl.
22993 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22994 * intervals.h (Fprevious_property_change):
22995 (Fremove_list_of_text_properties): Remove decls.
22996 * keyboard.c (Fthis_command_keys): Remove decl.
22997 (Fcommand_execute): New forward static decl.
22998 * keymap.c (Flookup_key): New forward static decl.
22999 (Fcopy_keymap): Now static.
23000 * keymap.h (Flookup_key): Remove decl.
23001 * process.c (Fget_process): New forward static decl.
23002 (Fprocess_datagram_address): Mark as internal.
23003 * syntax.c (Fsyntax_table_p): New forward static decl.
23004 (skip_chars): Remove duplicate decl.
23005 * textprop.c (Fprevious_property_change): New forward static decl.
23006 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
23007 Now internal.
23008 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
23009 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
23010
23011 * editfns.c (Fformat): Remove unreachable code.
23012
230132011-04-14 Andreas Schwab <schwab@linux-m68k.org>
23014
23015 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
23016 change. (Bug#8496)
23017
230182011-04-13 Eli Zaretskii <eliz@gnu.org>
23019
23020 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
23021 when at ZV. (Bug#8487)
23022
230232011-04-12 Andreas Schwab <schwab@linux-m68k.org>
23024
23025 * charset.c (Fclear_charset_maps): Use xfree instead of free.
23026 (Bug#8437)
23027 * keyboard.c (parse_tool_bar_item): Likewise.
23028 * sound.c (sound_cleanup, alsa_close): Likewise.
23029 * termcap.c (tgetent): Likewise.
23030 * xfns.c (x_default_font_parameter): Likewise.
23031 * xsettings.c (read_and_apply_settings): Likewise.
23032
23033 * alloc.c (overrun_check_malloc, overrun_check_realloc)
23034 (overrun_check_free): Protoize.
23035
230362011-04-12 Paul Eggert <eggert@cs.ucla.edu>
23037
23038 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
23039 since callers should never pass a negative size.
23040 Change the signature to match that of plain 'read' and 'write'; see
23041 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
23042 * lisp.h: Update prototypes of emacs_write and emacs_read.
23043
230442011-04-11 Eli Zaretskii <eliz@gnu.org>
23045
23046 * xdisp.c (redisplay_window): Don't try to determine the character
23047 position of the scroll margin if the window start point w->startp
23048 is outside the buffer's accessible region. (Bug#8468)
23049
230502011-04-10 Eli Zaretskii <eliz@gnu.org>
23051
23052 Fix write-region and its subroutines for buffers > 2GB.
23053 * fileio.c (a_write, e_write): Modify declaration of arguments and
23054 local variables to support buffers larger than 2GB.
23055 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
23056
23057 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
23058 argument, local variables, and return value.
23059
23060 * lisp.h: Update prototypes of emacs_write and emacs_read.
23061
23062 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
23063
230642011-04-10 Paul Eggert <eggert@cs.ucla.edu>
23065
23066 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
23067
23068 Fix more problems found by GCC 4.6.0's static checks.
23069
23070 * xdisp.c (vmessage): Use a better test for character truncation.
23071
23072 * charset.c (load_charset_map): <, not <=, for optimization,
23073 and to avoid potential problems with integer overflow.
23074 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
23075 * casetab.c (set_identity, shuffle): Likewise.
23076 * editfns.c (Fformat): Likewise.
23077 * syntax.c (skip_chars): Likewise.
23078
23079 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
23080 This also lets GCC 4.6.0 generate slightly better loop code.
23081
23082 * callint.c (Fcall_interactively): <, not <=, for optimization.
23083 (Fcall_interactively): Count the number of arguments produced,
23084 not the number of arguments given. This is simpler and lets GCC
23085 4.6.0 generate slightly better code.
23086
23087 * ftfont.c: Distingish more carefully between FcChar8 and char.
23088 The previous code passed unsigned char * to a functions like
23089 strlen and xstrcasecmp that expect char *, which does not
23090 conform to the C standard.
23091 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
23092 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
23093 char * when the C standard requires it.
23094
23095 * keyboard.c (read_char): Remove unused var.
23096
23097 * eval.c: Port to Windows vsnprintf (Bug#8435).
23098 Include <limits.h>.
23099 (SIZE_MAX): Define if the headers do not.
23100 (verror): Do not give up if vsnprintf returns a negative count.
23101 Instead, grow the buffer. This ports to Windows vsnprintf, which
23102 does not conform to C99. Problem reported by Eli Zaretskii.
23103 Also, simplify the allocation scheme, by avoiding the need for
23104 calling realloc, and removing the ALLOCATED variable.
23105
23106 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
23107
23108 Remove invocations of doprnt, as Emacs now uses vsnprintf.
23109 But keep the doprint source code for now, as we might revamp it
23110 and use it again (Bug#8435).
23111 * lisp.h (doprnt): Remove.
23112 * Makefile.in (base_obj): Remove doprnt.o.
23113 * deps.mk (doprnt.o): Remove.
23114
23115 error: Print 32- and 64-bit integers portably (Bug#8435).
23116 Without this change, on typical 64-bit hosts error ("...%d...", N)
23117 was used to print both 32- and 64-bit integers N, which relied on
23118 undefined behavior.
23119 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
23120 * lisp.h (error, verror): Mark as printf-like functions.
23121 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
23122 Report overflow in size calculations when allocating printf buffer.
23123 Do not truncate output string at its first null byte.
23124 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
23125 Truncate the output at a character boundary, since vsnprintf does not
23126 do that.
23127 * charset.c (check_iso_charset_parameter): Convert internal
23128 character to string before calling 'error', since %c now has the
23129 printf meaning.
23130 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
23131 overflow when computing char to be passed to 'error'. Do not
23132 pass Lisp_Object to 'error'; pass the integer instead.
23133 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
23134 formatted with plain %d.
23135
23136 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
23137
23138 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
23139
23140 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
23141
23142 * xterm.c (x_catch_errors): Remove duplicate declaration.
23143
23144 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
23145
23146 * xdisp.c, lisp.h (message_nolog): Remove; unused.
23147
231482011-04-10 Jim Meyering <meyering@redhat.com>
23149
23150 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
23151 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
23152 return ssize_t not "int", and use size_t as the buffer length.
23153 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
23154 * gnutls.h: Update declarations.
23155 * process.c (read_process_output): Use ssize_t, to match.
23156 (send_process): Likewise.
23157
231582011-04-09 Chong Yidong <cyd@stupidchicken.com>
23159
23160 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
23161
231622011-04-09 Chong Yidong <cyd@stupidchicken.com>
23163
23164 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
23165 Use unsigned char, to match FcChar8 type definition.
23166
23167 * xterm.c (handle_one_xevent):
23168 * xmenu.c (create_and_show_popup_menu):
23169 * xselect.c (x_decline_selection_request)
23170 (x_reply_selection_request): Avoid type-punned deref of X events.
23171
231722011-04-09 Eli Zaretskii <eliz@gnu.org>
23173
23174 Fix some uses of `int' instead of EMACS_INT.
23175 * search.c (string_match_1, fast_string_match)
23176 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
23177 (scan_buffer, find_next_newline_no_quit)
23178 (find_before_next_newline, search_command, Freplace_match)
23179 (Fmatch_data): Make some `int' variables be EMACS_INT.
23180
23181 * xdisp.c (display_count_lines): 3rd argument and return value now
23182 EMACS_INT. All callers changed.
23183 (pint2hrstr): Last argument is now EMACS_INT.
23184
23185 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
23186 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
23187 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
23188 (decode_coding_utf_16, decode_coding_emacs_mule)
23189 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
23190 (decode_coding_ccl, decode_coding_charset)
23191 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
23192 (decode_coding_iso_2022, decode_coding_emacs_mule)
23193 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
23194 <char_offset, last_offset>: Declare EMACS_INT.
23195 (encode_coding_utf_8, encode_coding_utf_16)
23196 (encode_coding_emacs_mule, encode_invocation_designation)
23197 (encode_designation_at_bol, encode_coding_iso_2022)
23198 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
23199 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
23200 Declare EMACS_INT.
23201 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
23202 (encode_invocation_designation): Last argument P_NCHARS is now
23203 EMACS_INT.
23204 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
23205 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
23206
23207 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
23208 All users changed.
23209
23210 * ccl.c (Fccl_execute_on_string): Declare some variables
23211 EMACS_INT.
23212
232132011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
23214
23215 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
23216
232172011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
23218
23219 * process.c (Fformat_network_address): Doc fix.
23220
232212011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
23222
23223 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
23224
232252011-04-08 Chong Yidong <cyd@stupidchicken.com>
23226
23227 * keyboard.c (read_char): Call Lisp function help-form-show,
23228 instead of using internal_with_output_to_temp_buffer.
23229 (Qhelp_form_show): New var.
23230 (syms_of_keyboard): Use DEFSYM macro.
23231
23232 * print.c (internal_with_output_to_temp_buffer): Function deleted.
23233
23234 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
23235
232362011-04-06 Chong Yidong <cyd@stupidchicken.com>
23237
23238 * process.c (Flist_processes): Remove to Lisp.
23239 (list_processes_1): Delete.
23240
232412011-04-06 Eli Zaretskii <eliz@gnu.org>
23242
23243 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
23244
23245 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
23246
232472011-04-06 Paul Eggert <eggert@cs.ucla.edu>
23248
23249 Fix more problems found by GCC 4.6.0's static checks.
23250
23251 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
23252
23253 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
23254
23255 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
23256
23257 * xdisp.c (vmessage): Mark as a printf-like function.
23258
23259 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
23260
23261 * sound.c (sound_warning): Don't crash if arg contains a printf format.
23262
23263 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
23264 printf-like functions.
23265 (tiff_load): Add casts to remove these marks before passing them
23266 to system-supplied API.
23267
23268 * eval.c (Fsignal): Remove excess argument to 'fatal'.
23269
23270 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
23271 This avoids several warnings with gcc -Wstrict-overflow.
23272 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
23273 directly, rather than having caller test rule sign. This avoids
23274 some unnecessary tests.
23275 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
23276 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
23277 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
23278
23279 * xfont.c (xfont_text_extents): Remove var that was set but not used.
23280 (xfont_open): Avoid unnecessary tests.
23281
23282 * composite.c (composition_gstring_put_cache): Use unsigned integer.
23283
23284 * composite.h, composite.c (composition_gstring_put_cache):
23285 Use EMACS_INT, not int, for length.
23286
23287 * composite.h (COMPOSITION_DECODE_REFS): New macro,
23288 breaking out part of COMPOSITION_DECODE_RULE.
23289 (COMPOSITION_DECODE_RULE): Use it.
23290 * composite.c (get_composition_id): Remove unused local vars,
23291 by using the new macro.
23292
23293 * textprop.c (set_text_properties_1): Change while to do-while,
23294 since the condition is always true at first.
23295
23296 * intervals.c (graft_intervals_into_buffer): Mark var as used.
23297 (interval_deletion_adjustment): Return unsigned value.
23298 All uses changed.
23299
23300 * process.c (list_processes_1, create_pty, read_process_output):
23301 (exec_sentinel): Remove vars that were set but not used.
23302 (create_pty): Remove unnecessary "volatile"s.
23303 (Fnetwork_interface_info): Avoid possibility of int overflow.
23304 (read_process_output): Do adaptive read buffering even if carryover.
23305 (read_process_output): Simplify nbytes computation if buffered.
23306
23307 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
23308
23309 * syntax.c (scan_words): Remove var that was set but not used.
23310 (update_syntax_table): Use unsigned instead of int.
23311
23312 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
23313 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
23314 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
23315
23316 * print.c (print_error_message): Avoid int overflow.
23317
23318 * font.c (font_list_entities): Redo for clarity,
23319 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
23320
23321 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
23322 (font_score): Avoid potential overflow in diff calculation.
23323
23324 * fns.c (substring_both): Remove var that is set but not used.
23325 (sxhash): Redo loop for clarity and to avoid wraparound warning.
23326
23327 * eval.c (funcall_lambda): Rename local to avoid shadowing.
23328
23329 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
23330 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
23331 can always succeed if overflow has undefined behavior.
23332
23333 * search.c (boyer_moore, wordify): Remove vars set but not used.
23334 (wordify): Omit three unnecessary tests.
23335
23336 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
23337 All callers changed. This avoids the need for an unused var.
23338
23339 * casefiddle.c (casify_region): Remove var that is set but not used.
23340
23341 * dired.c (file_name_completion): Remove var that is set but not used.
23342
23343 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
23344
23345 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
23346 (Finsert_file_contents): Remove unnecessary code checking fd.
23347
23348 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
23349 Check for integer overflow on size calculations.
23350
23351 * buffer.c (Fprevious_overlay_change): Remove var that is set
23352 but not used.
23353
23354 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
23355 Remove vars that are set but not used.
23356 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
23357 (timer_check_2): Mark vars as initialized.
23358
23359 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
23360
23361 * image.c (lookup_image): Remove var that is set but not used.
23362 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
23363
23364 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23365 that are set but not used.
23366
23367 * xfns.c (make_invisible_cursor): Don't return garbage
23368 if XCreateBitmapFromData fails (Bug#8410).
23369
23370 * xselect.c (x_get_local_selection, x_handle_property_notify):
23371 Remove vars that are set but not used.
23372
23373 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
23374 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
23375
23376 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23377 Remove var that is set but not used.
23378 (scroll_bar_windows_size): Now size_t, not int.
23379 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23380 Check for overflow.
23381
23382 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23383 (map_tty_color) [!defined MSDOS]: Likewise.
23384
23385 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23386
23387 * coding.c: Remove vars that are set but not used.
23388 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23389 All callers changed.
23390 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23391 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23392 (decode_coding_charset): Remove vars that are set but not used.
23393
23394 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23395 that is set but not used.
23396
23397 * print.c (print_object): Remove var that is set but not used.
23398
23399 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
23400 The gnulib version avoids calling malloc in the usual case,
23401 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23402 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23403 * filelock.c (current_lock_owner): Likewise.
23404 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23405 * sysdep.c: Include allocator.h, careadlinkat.h.
23406 (emacs_no_realloc_allocator): New static constant.
23407 (emacs_readlink): New function.
23408 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23409 ../lib/careadlinkat.h.
23410
234112011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23412
23413 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23414 first non-nil return value).
23415
234162011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23417
23418 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23419 if not defined (Bug#8403).
23420
234212011-04-02 Juanma Barranquero <lekktu@gmail.com>
23422
23423 * xdisp.c (display_count_lines): Remove parameter `start',
23424 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23425 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23426 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23427 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23428 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23429 and thereabouts. All callers changed.
23430 (get_per_char_metric): Remove parameter `f', unused since
23431 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23432
234332011-04-02 Jim Meyering <meyering@redhat.com>
23434
23435 do not dereference NULL upon failed strdup
23436 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23437 (ns_get_family): Likewise.
23438
234392011-04-02 Juanma Barranquero <lekktu@gmail.com>
23440
23441 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23442
234432011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23444
23445 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23446 later (Bug#8403).
23447
234482011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23449
23450 Add lexical binding.
23451
23452 * window.c (Ftemp_output_buffer_show): New fun.
23453 (Fsave_window_excursion):
23454 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23455
23456 * lread.c (lisp_file_lexically_bound_p): New function.
23457 (Fload): Bind Qlexical_binding.
23458 (readevalloop): Remove `evalfun' arg.
23459 Bind Qinternal_interpreter_environment.
23460 (Feval_buffer): Bind Qlexical_binding.
23461 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23462 Mark as dynamic.
23463 (syms_of_lread): Declare `lexical-binding'.
23464
23465 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23466
23467 * keyboard.c (eval_dyn): New fun.
23468 (menu_item_eval_property): Use it.
23469
23470 * image.c (parse_image_spec): Use Ffunctionp.
23471
23472 * fns.c (concat, mapcar1): Accept byte-code-functions.
23473
23474 * eval.c (Fsetq): Handle lexical vars.
23475 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23476 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23477 (FletX, Flet): Obey lexical binding.
23478 (Fcommandp): Handle closures.
23479 (Feval): New `lexical' arg.
23480 (eval_sub): New function extracted from Feval. Use it almost
23481 everywhere where Feval was used. Look up vars in lexical env.
23482 Handle closures.
23483 (Ffunctionp): Move from subr.el.
23484 (Ffuncall): Handle closures.
23485 (apply_lambda): Remove `eval_flags'.
23486 (funcall_lambda): Handle closures and new byte-code-functions.
23487 (Fspecial_variable_p): New function.
23488 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23489 but without exporting it to Lisp.
23490
23491 * doc.c (Fdocumentation, store_function_docstring):
23492 * data.c (Finteractive_form): Handle closures.
23493
23494 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23495 interactive spec.
23496
23497 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23498 New byte-codes.
23499 (exec_byte_code): New function extracted from Fbyte_code to handle new
23500 calling convention for byte-code-functions. Add new byte-codes.
23501
23502 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
23503
23504 * alloc.c (Fmake_symbol): Init new `declared_special' field.
23505
235062011-03-31 Juanma Barranquero <lekktu@gmail.com>
23507
23508 * xdisp.c (redisplay_internal): Fix prototype.
23509
235102011-03-31 Eli Zaretskii <eliz@gnu.org>
23511
23512 * xdisp.c (SCROLL_LIMIT): New macro.
23513 (try_scrolling): Use it when setting scroll_limit.
23514 Limit scrolling to 100 screen lines.
23515 (redisplay_window): Even when falling back on "recentering",
23516 position point in the window according to scroll-conservatively,
23517 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23518
23519 (try_scrolling): When point is above the window, allow searching
23520 as far as scroll_max, or one screenful, to compute vertical
23521 distance from PT to the scroll margin position. This prevents
23522 try_scrolling from unnecessarily failing when
23523 scroll-conservatively is set to a value slightly larger than the
23524 window height. Clean up the case of PT below the margin at bottom
23525 of window: scroll_max can no longer be INT_MAX. When aggressive
23526 scrolling is in use, don't let point enter the opposite scroll
23527 margin as result of the scroll.
23528 (syms_of_xdisp) <scroll-conservatively>: Document the
23529 threshold of 100 lines for never-recentering scrolling.
23530
235312011-03-31 Juanma Barranquero <lekktu@gmail.com>
23532
23533 * dispextern.h (move_it_by_lines):
23534 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23535 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23536 (message_log_check_duplicate): Remove parameters `prev_bol' and
23537 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23538 (redisplay_internal): Remove parameter `preserve_echo_area',
23539 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23540
23541 * indent.c (Fvertical_motion):
23542 * window.c (window_scroll_pixel_based, Frecenter):
23543 Don't pass `need_y_p' to `move_it_by_lines'.
23544
235452011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23546
23547 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23548 steal a few bits to be more compact.
23549 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23550 Remove unneeded casts.
23551
23552 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23553
235542011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23555
23556 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23557 binding" message (bug#7967).
23558
235592011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23560
23561 Fix more problems found by GCC 4.6.0's static checks.
23562
23563 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23564 Remove unused local var.
23565
23566 * editfns.c (Fmessage_box): Remove unused local var.
23567
23568 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23569 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23570 Omit unused local vars.
23571 * window.c (shrink_windows): Omit unused local var.
23572 * menu.c (digest_single_submenu): Omit unused local var.
23573 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23574 Omit unused local var.
23575
23576 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23577 Don't assume string length fits in int.
23578 (keyremap_step, read_key_sequence): Use size_t for sizes.
23579 (read_key_sequence): Don't check last_real_key_start redundantly.
23580
23581 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23582 instead of alloca (Bug#8344).
23583
23584 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23585 (Fbacktrace_frame): Don't assume nframes fits in int.
23586
23587 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23588
23589 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23590 concerns.
23591
23592 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23593
23594 * cm.c (calccost): Turn while-do into do-while, for clarity.
23595
23596 * keyboard.c (syms_of_keyboard): Use the same style as later
23597 in this function when indexing through an array. This also
23598 works around GCC bug 48267.
23599
23600 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23601
23602 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23603
23604 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23605 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23606
23607 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23608 This avoids undefined behavior on integer overflow, and is a bit
23609 more convenient anyway since it is compared to a size_t variable.
23610
23611 Variadic C functions now count arguments with size_t, not int.
23612 This avoids an unnecessary limitation on 64-bit machines, which
23613 caused (substring ...) to crash on large vectors (Bug#8344).
23614 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23615 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23616 All variadic functions and their callers changed accordingly.
23617 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23618 * data.c (arith_driver, float_arith_driver): Likewise.
23619 * editfns.c (general_insert_function): Likewise.
23620 * eval.c (struct backtrace.nargs, interactive_p)
23621 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23622 (funcall_lambda, mark_backtrace): Likewise.
23623 * fns.c (concat): Likewise.
23624 * frame.c (x_set_frame_parameters): Likewise.
23625 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23626 0 if not found, not -1. All callers changed.
23627
23628 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23629 (stack_copy_size): Now size_t, not int.
23630 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23631
236322011-03-28 Juanma Barranquero <lekktu@gmail.com>
23633
23634 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23635 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23636 All callers changed.
23637
23638 * lisp.h (multibyte_char_to_unibyte):
23639 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23640 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23641 * character.h (CHAR_TO_BYTE8):
23642 * cmds.c (internal_self_insert):
23643 * editfns.c (general_insert_function):
23644 * keymap.c (push_key_description):
23645 * search.c (Freplace_match):
23646 * xdisp.c (message_dolog, set_message_1): All callers changed.
23647
236482011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23649
23650 * keyboard.c (safe_run_hook_funcall): New function.
23651 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23652 don't set the hook to nil, but remove the offending function instead.
23653 (Qcommand_hook_internal): Remove, unused.
23654 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23655 Vcommand_hook_internal.
23656
23657 * eval.c (enum run_hooks_condition): Remove.
23658 (funcall_nil, funcall_not): New functions.
23659 (run_hook_with_args): Call each function through a `funcall' argument.
23660 Remove `cond' argument, now redundant.
23661 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23662 (Frun_hook_with_args_until_failure): Adjust accordingly.
23663 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23664
236652011-03-28 Juanma Barranquero <lekktu@gmail.com>
23666
23667 * dispextern.h (string_buffer_position): Remove declaration.
23668
23669 * print.c (strout): Remove parameter `multibyte', unused since
23670 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23671
23672 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23673 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23674 All callers changed.
23675
23676 * w32.c (_wsa_errlist): Use braces for struct initializers.
23677
23678 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23679 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23680 All callers changed.
23681 (string_buffer_position): Likewise. Also, make static (it's never
23682 used outside xdisp.c).
23683 (cursor_row_p): Remove parameter `w', unused since
23684 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23685 (decode_mode_spec): Remove parameter `precision', introduced during
23686 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23687 All callers changed.
23688
236892011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23690
23691 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23692
236932011-03-27 Anders Lindgren <andlind@gmail.com>
23694
23695 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23696 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23697 (ns_update_auto_hide_menu_bar): New functions.
23698 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23699 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23700 ns_constrain_all_frames.
23701 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23702 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23703
237042011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23705
23706 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23707
237082011-03-27 Glenn Morris <rgm@gnu.org>
23709
23710 * syssignal.h: Replace RETSIGTYPE with void.
23711 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23712 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23713 Replace SIGTYPE with void everywhere.
23714 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23715 * s/template.h (SIGTYPE): Remove commented out definition.
23716
237172011-03-26 Eli Zaretskii <eliz@gnu.org>
23718
23719 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23720 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23721
237222011-03-26 Juanma Barranquero <lekktu@gmail.com>
23723
23724 * w32.c (read_unc_volume): Use parameter `henum', instead of
23725 global variable `wget_enum_handle'.
23726
23727 * keymap.c (describe_vector): Remove parameters `indices' and
23728 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23729 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23730
23731 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23732
23733 * keyboard.c (timer_check): Remove parameter `do_it_now',
23734 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23735 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23736 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23737
23738 * keyboard.c (read_char):
23739 * w32menu.c (w32_menu_display_help):
23740 * xmenu.c (show_help_event, menu_help_callback):
23741 Adjust calls to `show_help_echo'.
23742
23743 * gtkutil.c (xg_maybe_add_timer):
23744 * keyboard.c (readable_events):
23745 * process.c (wait_reading_process_output):
23746 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23747
23748 * insdel.c (adjust_markers_gap_motion):
23749 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23750 (gap_left, gap_right): Don't call it.
23751
237522011-03-25 Chong Yidong <cyd@stupidchicken.com>
23753
23754 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23755 incurred during fontification.
23756
237572011-03-25 Juanma Barranquero <lekktu@gmail.com>
23758
23759 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23760 (DEFVAR_PER_BUFFER): Don't pass it.
23761
23762 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23763 (scrolling_window): Don't pass it.
23764
237652011-03-25 Juanma Barranquero <lekktu@gmail.com>
23766
23767 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23768
23769 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23770 and `suffix'.
23771 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23772 of variables specific to SELinux and computation of `encoded_absname'.
23773
23774 * image.c (XPutPixel): Remove unused variable `height'.
23775
23776 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23777
23778 * unexw32.c (get_section_info): Remove unused variable `section'.
23779
23780 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23781 (system_process_attributes): Remove unused variable `sess'.
23782 (sys_read): Remove unused variable `err'.
23783
23784 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23785 (w32_wnd_proc): Remove unused variable `isdead'.
23786 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23787 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23788 (x_create_tip_frame): Remove unused variable `tem'.
23789
23790 * w32inevt.c (w32_console_read_socket):
23791 Remove unused variable `no_events'.
23792
23793 * w32term.c (x_draw_composite_glyph_string_foreground):
23794 Remove unused variable `width'.
23795
237962011-03-24 Juanma Barranquero <lekktu@gmail.com>
23797
23798 * w32term.c (x_set_glyph_string_clipping):
23799 Don't pass uninitialized region to CombineRgn.
23800
238012011-03-23 Juanma Barranquero <lekktu@gmail.com>
23802
23803 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23804 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23805 (Fx_close_connection): Remove unused variable `i'.
23806
23807 * w32font.c (w32font_draw): Return number of glyphs.
23808 (w32font_open_internal): Remove unused variable `i'.
23809 (w32font_driver): Add missing initializer.
23810
23811 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23812 (fill_in_menu): Remove unused variable `items_added'.
23813
23814 * w32term.c (last_mouse_press_frame): Remove static global variable.
23815 (w32_clip_to_row): Remove unused variable `f'.
23816 (x_delete_terminal): Remove unused variable `i'.
23817
23818 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23819 (NOTHING): Remove unused static global variable.
23820 (uniscribe_check_otf): Remove unused variable `table'.
23821 (uniscribe_font_driver): Add missing initializers.
23822
238232011-03-23 Julien Danjou <julien@danjou.info>
23824
23825 * term.c (Fsuspend_tty, Fresume_tty):
23826 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23827 * window.c (temp_output_buffer_show):
23828 * insdel.c (signal_before_change):
23829 * frame.c (Fhandle_switch_frame):
23830 * fileio.c (Fdo_auto_save):
23831 * emacs.c (Fkill_emacs):
23832 * editfns.c (save_excursion_restore):
23833 * cmds.c (internal_self_insert):
23834 * callint.c (Fcall_interactively):
23835 * buffer.c (Fkill_all_local_variables):
23836 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23837 Use Frun_hooks.
23838 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23839 unconditionally since it does the check itself.
23840
238412011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23842
23843 Fix more problems found by GCC 4.5.2's static checks.
23844
23845 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23846 the first time through the loop, since we know p0 < p1 then.
23847 This also avoids a gcc -Wstrict-overflow warning.
23848
23849 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23850 leading to a memory leak, possible in functions like
23851 load_charset_map_from_file that can allocate an unbounded number
23852 of objects (Bug#8318).
23853
23854 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23855 that could (at least in theory) be that large.
23856
23857 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23858 This is less likely to overflow, and avoids undefined behavior if
23859 overflow does occur. All callers changed. Use strtoul to scan
23860 for the unsigned long integer.
23861 (pint2hrstr): Simplify and tune code slightly.
23862 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23863
23864 * scroll.c (do_scrolling): Work around GCC bug 48228.
23865 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23866
23867 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23868 This also avoids a warning with gcc -Wstrict-overflow.
23869 (validate_x_resource_name): Simplify count usage.
23870 This also avoids a warning with gcc -Wstrict-overflow.
23871
23872 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23873 fail (Bug#8306).
23874
23875 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23876
23877 * process.c (Fmake_network_process): Use socklen_t, not int,
23878 where POSIX says socklen_t is required in portable programs.
23879 This fixes a porting bug on hosts like 64-bit HP-UX, where
23880 socklen_t is wider than int (Bug#8277).
23881 (Fmake_network_process, server_accept_connection):
23882 (wait_reading_process_output, read_process_output):
23883 Likewise.
23884
23885 * process.c: Rename or move locals to avoid shadowing.
23886 (list_processes_1, Fmake_network_process):
23887 (read_process_output_error_handler, exec_sentinel_error_handler):
23888 Rename or move locals.
23889 (Fmake_network_process): Define label "retry_connect" only if needed.
23890 (Fnetwork_interface_info): Fix pointer signedness.
23891 (process_send_signal): Add cast to avoid pointer signedness problem.
23892 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23893 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23894
23895 Make tparam.h and terminfo.c consistent.
23896 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23897 Include tparam.h instead, since it declares them.
23898 * cm.h (PC): Remove extern decl; tparam.h now does this.
23899 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23900 * terminfo.c: Include tparam.h, to check interfaces.
23901 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23902 (tparam): Adjust signature to match interface in tparam.h;
23903 this removes some undefined behavior. Check that outstring and len
23904 are zero, which they always are with Emacs.
23905 * tparam.h (PC, BC, UP): New extern decls.
23906
23907 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23908 (xftfont_open): Rename locals to avoid shadowing.
23909
23910 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23911 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23912 (OTF_TAG_SYM): Omit macro if not needed.
23913 (ftfont_list): Remove unused local.
23914 (get_adstyle_property, ftfont_pattern_entity):
23915 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23916 Rename locals to avoid shadowing.
23917
23918 * xfont.c (xfont_list_family): Mark var as initialized.
23919
23920 * xml.c (make_dom): Now static.
23921
23922 * composite.c (composition_compute_stop_pos): Rename local to
23923 avoid shadowing.
23924 (composition_reseat_it): Remove unused locals.
23925 (find_automatic_composition, composition_adjust_point): Likewise.
23926 (composition_update_it): Mark var as initialized.
23927 (find_automatic_composition): Mark vars as initialized,
23928 with a FIXME (Bug#8290).
23929
23930 character.h: Rename locals to avoid shadowing.
23931 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23932 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23933 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23934 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23935 to avoid shadowing.
23936
23937 * textprop.c (property_change_between_p): Remove; unused.
23938
23939 * intervals.c (interval_start_pos): Now static.
23940
23941 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23942
23943 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23944 Rename locals to avoid shadowing.
23945
23946 * sound.c (wav_play, au_play, Fplay_sound_internal):
23947 Fix pointer signedness.
23948 (alsa_choose_format): Remove unused local var.
23949 (wav_play): Initialize a variable to 0, to prevent undefined
23950 behavior (Bug#8278).
23951
23952 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23953
23954 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23955
23956 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23957 clobbering (Bug#8298).
23958 * sysdep.c (sys_subshell): Likewise.
23959 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23960
23961 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23962 This should get cleaned up, so that child_setup has the
23963 same signature on all platforms.
23964
23965 * callproc.c (call_process_cleanup): Now static.
23966 (relocate_fd): Rename locals to avoid shadowing.
23967
239682011-03-22 Chong Yidong <cyd@stupidchicken.com>
23969
23970 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23971 not to be necessary, and produces flickering.
23972
239732011-03-20 Glenn Morris <rgm@gnu.org>
23974
23975 * config.in: Remove file.
23976
239772011-03-20 Juanma Barranquero <lekktu@gmail.com>
23978
23979 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23980 are now in src/globals.h.
23981 (syms_of_minibuf): Remove spurious & from previous change.
23982
239832011-03-20 Leo Liu <sdl.web@gmail.com>
23984
23985 * minibuf.c (completing-read-function): New variable.
23986 (completing-read-default): Rename from completing-read.
23987 (completing-read): Call completing-read-function.
23988
239892011-03-19 Juanma Barranquero <lekktu@gmail.com>
23990
23991 * xfaces.c (Fx_load_color_file):
23992 Read color file from absolute filename (bug#8250).
23993
239942011-03-19 Juanma Barranquero <lekktu@gmail.com>
23995
23996 * makefile.w32-in: Update dependencies.
23997
239982011-03-17 Eli Zaretskii <eliz@gnu.org>
23999
24000 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
24001
240022011-03-17 Paul Eggert <eggert@cs.ucla.edu>
24003
24004 Fix more problems found by GCC 4.5.2's static checks.
24005
24006 * process.c (make_serial_process_unwind, send_process_trap):
24007 (sigchld_handler): Now static.
24008
24009 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
24010 That way, the code declares only the vars that it needs.
24011 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
24012 * s/cygwin.h (PTY_ITERATION): Likewise.
24013 * s/darwin.h (PTY_ITERATION): Likewise.
24014 * s/gnu-linux.h (PTY_ITERATION): Likewise.
24015
24016 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
24017 * process.c (allocate_pty): Don't declare stb unless it's needed.
24018
24019 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
24020 (CONSTANTLIM): Remove; unused.
24021 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
24022 Define only if needed.
24023
24024 * unexelf.c (unexec): Name an expression,
24025 to avoid gcc -Wbad-function-cast warning.
24026 Use a different way to cause a compilation error if anyone uses
24027 n rather than nn, a way that does not involve shadowing.
24028 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
24029
24030 * deps.mk (unexalpha.o): Remove; unused.
24031
24032 New file unexec.h, the (simple) interface for unexec (Bug#8267).
24033 * unexec.h: New file.
24034 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
24035 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
24036 Depend on unexec.h.
24037 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
24038 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
24039 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
24040 Change as necessary to match prototype in unexec.h.
24041
24042 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
24043 shadowing.
24044 (back_comment, skip_chars): Mark vars as initialized.
24045
24046 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
24047 Rename locals to avoid shadowing.
24048
24049 * lread.c (read1): Rewrite so as not to use empty "else".
24050 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
24051
24052 * print.c (Fredirect_debugging_output): Fix pointer signedess.
24053
24054 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
24055 warning when compiling print.c.
24056
24057 * font.c (font_unparse_fcname): Abort in an "impossible" situation
24058 instead of using an uninitialized var.
24059 (font_sort_entities): Mark var as initialized.
24060
24061 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
24062
24063 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
24064 pointers to constants.
24065 (font_parse_fcname): Remove unused vars.
24066 (font_delete_unmatched): Now static.
24067 (font_get_spec): Remove; unused.
24068 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
24069 (font_update_drivers, Ffont_get_glyphs, font_add_log):
24070 Rename or move locals to avoid shadowing.
24071
24072 * fns.c (require_nesting_list, require_unwind): Now static.
24073 (Ffillarray): Rename locals to avoid shadowing.
24074
24075 * floatfns.c (domain_error2): Define only if needed.
24076 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
24077
24078 * alloc.c (mark_backtrace): Move decl from here ...
24079 * lisp.h: ... to here, so that it can be checked.
24080
24081 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
24082 (Fdefvar): Rewrite so as not to use empty "else".
24083 (lisp_indirect_variable): Name an expression,
24084 to avoid gcc -Wbad-function-cast warning.
24085 (Fdefvar): Rename locals to avoid shadowing.
24086
24087 * callint.c (quotify_arg, quotify_args): Now static.
24088 (Fcall_interactively): Rename locals to avoid shadowing.
24089 Use const pointer when appropriate.
24090
24091 * lisp.h (get_system_name, get_operating_system_release):
24092 Move decls here, to check interfaces.
24093 * process.c (get_operating_system_release): Move decl to lisp.h.
24094 * xrdb.c (get_system_name): Likewise.
24095 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
24096 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
24097 some of which prompt warnings from gcc -Wbad-function-cast.
24098 (Fformat_time_string, Fencode_time, Finsert_char):
24099 (Ftranslate_region_internal, Fformat):
24100 Rename or remove local vars to avoid shadowing.
24101 (Ftranslate_region_internal): Mark var as initialized.
24102
24103 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
24104 avoid shadowing.
24105
24106 * lisp.h (eassert): Check that the argument compiles, even if
24107 ENABLE_CHECKING is not defined.
24108
24109 * data.c (Findirect_variable): Name an expression, to avoid
24110 gcc -Wbad-function-cast warning.
24111 (default_value, arithcompare, arith_driver, arith_error): Now static.
24112 (store_symval_forwarding): Rename local to avoid shadowing.
24113 (Fmake_variable_buffer_local, Fmake_local_variable):
24114 Mark variables as initialized.
24115 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
24116
24117 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
24118 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
24119 Rename locals to avoid shadowing.
24120 (mark_stack): Move local variables into the #ifdef region where
24121 they're used.
24122 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
24123 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
24124 needed otherwise.
24125 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
24126 (GC_STRING_CHARS): Remove; not used.
24127 (Fmemory_limit): Cast sbrk's returned value to char *.
24128
24129 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
24130 avoids undefined behavior in theory.
24131
24132 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
24133
24134 Use functions, not macros, for up- and down-casing (Bug#8254).
24135 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
24136 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
24137 to use the following functions instead of these macros.
24138 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
24139 EMACS_INT, since callers assume the returned value fits in int.
24140 (upcase1): Likewise, for UPCASE_TABLE.
24141 (uppercasep, lowercasep, upcase): New static inline functions.
24142 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
24143 the race-condition problem in the old DOWNCASE.
24144
24145 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
24146 Rename locals to avoid shadowing.
24147 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
24148 (regex_compile, re_search_2, re_match_2_internal):
24149 Remove unused local vars.
24150 (FREE_VAR): Rewrite so as not to use empty "else",
24151 which gcc can warn about.
24152 (regex_compile, re_match_2_internal): Mark locals as initialized.
24153 (RETALLOC_IF): Define only if needed.
24154 (WORDCHAR_P): Likewise. This one is never needed, but is used
24155 only in a comment talking about a compiler bug, so put inside
24156 the #if 0 of that comment.
24157 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
24158 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
24159 Remove; unused.
24160
24161 * search.c (boyer_moore): Rename locals to avoid shadowing.
24162 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
24163 (PREV_CHAR_BOUNDARY): Likewise.
24164
24165 * search.c (simple_search): Remove unused var.
24166
24167 * dired.c (compile_pattern): Move decl from here ...
24168 * lisp.h: ... to here, so that it can be checked.
24169 (struct re_registers): New forward decl.
24170
24171 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
24172
24173 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
24174 All uses changed.
24175 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
24176 Rename locals to avoid shadowing.
24177 (Fvertical_motion): Mark locals as initialized.
24178
24179 * casefiddle.c (casify_object, casify_region): Now static.
24180 (casify_region): Mark local as initialized.
24181
24182 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
24183
24184 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
24185 New macros, so that the caller can use some names other than
24186 gcpro1, gcpro2, etc.
24187 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
24188 of the new macros.
24189 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
24190 argument, for consistency with GCPRO2_VAR, etc: it is now the
24191 prefix of the variable, not the variable itself. All uses
24192 changed.
24193 * dired.c (directory_files_internal, file_name_completion):
24194 Rename locals to avoid shadowing.
24195
24196 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
24197 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
24198 dired.c's scmp function, had undefined behavior.
24199 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
24200 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
24201 * buffer.h: ... to here, because these macros use current_buffer,
24202 and the new implementation with inline functions needs to have
24203 current_buffer in scope now, rather than later when the macros
24204 are used.
24205 (downcase, upcase1): New static inline functions.
24206 (DOWNCASE, UPCASE1): Reimplement using these functions.
24207 This avoids undefined behavior in expressions like
24208 DOWNCASE (x) == DOWNCASE (y), which previously suffered
24209 from race conditions in accessing the global variables
24210 case_temp1 and case_temp2.
24211 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
24212 * lisp.h (case_temp1, case_temp2): Remove their decls.
24213 * character.h (ASCII_CHAR_P): Move from here ...
24214 * lisp.h: ... to here, so that the inline functions mentioned
24215 above can use them.
24216
24217 * dired.c (directory_files_internal_unwind): Now static.
24218
24219 * fileio.c (file_name_as_directory, directory_file_name):
24220 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
24221 Now static.
24222 (file_name_as_directory): Use const pointers when appropriate.
24223 (Fexpand_file_name): Likewise. In particular, newdir might
24224 point at constant storage, so make it a const pointer.
24225 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
24226 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
24227 signedness issues.
24228 (Fset_file_times, Finsert_file_contents, auto_save_error):
24229 Rename locals to avoid shadowing.
24230
24231 * minibuf.c (choose_minibuf_frame_1): Now static.
24232 (Ftry_completion, Fall_completions): Rename or remove locals
24233 to avoid shadowing.
24234
24235 * marker.c (bytepos_to_charpos): Remove; unused.
24236
24237 * lisp.h (verify_bytepos, count_markers): New decls,
24238 so that gcc does not warn that these functions aren't declared.
24239
24240 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
24241 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
24242 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
24243 (copy_text): Remove unused local var.
24244
24245 * filelock.c (within_one_second): Now static.
24246 (lock_file_1): Rename local to avoid shadowing.
24247
24248 * buffer.c (fix_overlays_before): Mark locals as initialized.
24249 (fix_start_end_in_overlays): Likewise. This function should be
24250 simplified by using pointers-to-pointers, but that's a different
24251 matter.
24252 (switch_to_buffer_1): Now static.
24253 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
24254 (report_overlay_modification): Rename locals to avoid shadowing.
24255
24256 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
24257 Fix pointer signedness issue.
24258 (sys_subshell): Mark local as volatile if checking for lint,
24259 to suppress a gcc -Wclobbered warning that does not seem to be right.
24260 (MAXPATHLEN): Define only if needed.
24261
24262 * process.c (serial_open, serial_configure): Move decls from here ...
24263 * systty.h: ... to here, so that they can be checked.
24264
24265 * fns.c (get_random, seed_random): Move extern decls from here ...
24266 * lisp.h: ... to here, so that they can be checked.
24267
24268 * sysdep.c (reset_io): Now static.
24269 (wait_for_termination_signal): Remove; unused.
24270
24271 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
24272 (copy_keymap_item, append_key, push_text_char_description):
24273 Now static.
24274 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
24275 (DENSE_TABLE_SIZE): Remove; unused.
24276 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
24277 (describe_map_tree):
24278 Rename locals to avoid shadowing.
24279
24280 * keyboard.c: Declare functions static if they are not used elsewhere.
24281 (echo_char, echo_dash, cmd_error, top_level_2):
24282 (poll_for_input, handle_async_input): Now static.
24283 (read_char, kbd_buffer_get_event, make_lispy_position):
24284 (make_lispy_event, make_lispy_movement, apply_modifiers):
24285 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
24286 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
24287 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
24288 (read_key_sequence, read_char): Mark locals as initialized.
24289 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
24290
24291 * keyboard.h (make_ctrl_char): New decl.
24292 (mark_kboards): Move decl here ...
24293 * alloc.c (mark_kboards): ... from here.
24294
24295 * lisp.h (force_auto_save_soon): New decl.
24296
24297 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
24298 (DEFINE_DUMMY_FUNCTION): New macro.
24299 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
24300 Use it.
24301 (main): Add casts to avoid warnings
24302 if GCC considers string literals to be constants.
24303
24304 * lisp.h (fatal_error_signal): Add decl, since it's exported.
24305
24306 * dbusbind.c: Pointer signedness fixes.
24307 (xd_signature, xd_append_arg, xd_initialize):
24308 (Fdbus_call_method, Fdbus_call_method_asynchronously):
24309 (Fdbus_method_return_internal, Fdbus_method_error_internal):
24310 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
24311 (Fdbus_register_signal): Use SSDATA when the context wants char *.
24312
24313 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
24314 if GCC considers string literals to be constants.
24315 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
24316
243172011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
24318
24319 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
24320 (print_preprocess, print_object): New macro to fix last change.
24321
24322 * print.c (print_preprocess): Don't forget font objects.
24323
243242011-03-16 Juanma Barranquero <lekktu@gmail.com>
24325
24326 * emacs.c (USAGE3): Doc fixes.
24327
243282011-03-15 Andreas Schwab <schwab@linux-m68k.org>
24329
24330 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
24331 structure.
24332
243332011-03-14 Juanma Barranquero <lekktu@gmail.com>
24334
24335 * lisp.h (VWindow_system, Qfile_name_history):
24336 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
24337 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
24338 (w32_system_caret_x, w32_system_caret_y): Declare extern.
24339
24340 * w32select.c: Don't #include "keyboard.h".
24341 (run_protected): Add extern declaration for waiting_for_input.
24342
24343 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
24344 * w32console.c (detect_input_pending, read_input_pending)
24345 (encode_terminal_code):
24346 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
24347 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
24348 (w32_system_caret_y, Qfile_name_history):
24349 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
24350 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
24351 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
24352 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
24353 * w32proc.c (Qlocal, report_file_error):
24354 * w32term.c (Vwindow_system, updating_frame):
24355 * w32uniscribe.c (initialized, uniscribe_font_driver):
24356 Remove unneeded extern declarations.
24357
243582011-03-14 Chong Yidong <cyd@stupidchicken.com>
24359
24360 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
24361
243622011-03-13 Chong Yidong <cyd@stupidchicken.com>
24363
24364 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24365 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24366 These macros can no longer be used for assignment.
24367
24368 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24369 Assign struct members directly, instead of using BUF_BEGV etc.
24370 (record_buffer_markers, fetch_buffer_markers): New functions for
24371 recording and fetching special buffer markers.
24372 (set_buffer_internal_1, set_buffer_temp): Use them.
24373
24374 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24375
24376 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24377
24378 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24379 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24380
24381 * xdisp.c (hscroll_window_tree):
24382 (reconsider_clip_changes): Use PT instead of BUF_PT.
24383
243842011-03-13 Eli Zaretskii <eliz@gnu.org>
24385
24386 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24387 $(EMACS_ROOT)/lib/intprops.h.
24388
243892011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24390
24391 Fix more problems found by GCC 4.5.2's static checks.
24392
24393 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24394 to unsigned char * to avoid compiler diagnostic.
24395 (xg_free_frame_widgets): Make it clear that a local variable is
24396 needed only if USE_GTK_TOOLTIP.
24397 (gdk_window_get_screen): Make it clear that this macro is needed
24398 only if USE_GTK_TOOLTIP.
24399 (int_gtk_range_get_value): New function, which avoids a diagnostic
24400 from gcc -Wbad-function-cast.
24401 (xg_set_toolkit_scroll_bar_thumb): Use it.
24402 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24403 diagnostic from gcc -Wbad-function-cast.
24404 (get_utf8_string, xg_get_file_with_chooser):
24405 Rename locals to avoid shadowing.
24406 (create_dialog): Move locals to avoid shadowing.
24407
24408 * xgselect.c (xg_select): Remove unused var.
24409
24410 * image.c (four_corners_best): Mark locals as initialized.
24411 (gif_load): Initialize transparent_p to zero (Bug#8238).
24412 Mark another local as initialized.
24413 (my_png_error, my_error_exit): Mark with NO_RETURN.
24414
24415 * image.c (clear_image_cache): Now static.
24416 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
24417 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
24418 (x_edge_detection): Remove unnecessary cast that
24419 gcc -Wbad-function-cast diagnoses.
24420 (gif_load): Fix pointer signedness.
24421 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24422 (jpeg_load, gif_load): Rename locals to avoid shadowing.
24423
244242011-03-12 Paul Eggert <eggert@cs.ucla.edu>
24425
24426 Improve quality of tests for time stamp overflow.
24427 For example, without this patch (encode-time 0 0 0 1 1
24428 1152921504606846976) returns the obviously-bogus value (-948597
24429 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24430 reports time overflow. See
24431 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
24432 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24433 * editfns.c: Include limits.h and intprops.h.
24434 (TIME_T_MIN, TIME_T_MAX): New macros.
24435 (time_overflow): Move earlier, to before first use.
24436 (hi_time, lo_time): New functions, for an accurate test for
24437 out-of-range times.
24438 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24439 (Fget_internal_run_time): Don't assume time_t fits in int.
24440 (make_time): Use list2 instead of Fcons twice.
24441 (Fdecode_time): More accurate test for out-of-range times.
24442 (check_tm_member): New function.
24443 (Fencode_time): Use it, to test for out-of-range times.
24444 (lisp_time_argument): Don't rely on undefined left-shift and
24445 right-shift behavior when checking for time stamp overflow.
24446
24447 * editfns.c (time_overflow): New function, refactoring common code.
24448 (Fformat_time_string, Fdecode_time, Fencode_time):
24449 (Fcurrent_time_string): Use it.
24450
24451 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24452 * dired.c (make_time): Move to ...
24453 * editfns.c (make_time): ... here.
24454 * systime.h: Note the move.
24455
244562011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24457
24458 * fringe.c (update_window_fringes): Remove unused variables.
24459
24460 * unexmacosx.c (copy_data_segment): Also copy __got section.
24461 (Bug#8223)
24462
244632011-03-12 Eli Zaretskii <eliz@gnu.org>
24464
24465 * termcap.c [MSDOS]: Include "msdos.h".
24466 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24467 Constify `char *' arguments and their references according to
24468 prototypes in tparam.h.
24469
24470 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
24471
24472 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24473 Adapt all references accordingly.
24474
24475 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24476
244772011-03-11 Tom Tromey <tromey@redhat.com>
24478
24479 * buffer.c (syms_of_buffer): Remove obsolete comment.
24480
244812011-03-11 Eli Zaretskii <eliz@gnu.org>
24482
24483 * termhooks.h (encode_terminal_code): Declare prototype.
24484
24485 * msdos.c (encode_terminal_code): Don't declare prototype.
24486
24487 * term.c (encode_terminal_code): Now external again, used by
24488 w32console.c and msdos.c.
24489
24490 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24491 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
24492
244932011-03-11 Paul Eggert <eggert@cs.ucla.edu>
24494
24495 Fix some minor problems found by GCC 4.5.2's static checks.
24496
24497 * fringe.c (update_window_fringes): Mark locals as initialized
24498 (Bug#8227).
24499 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
24500
24501 * alloc.c (mark_fringe_data): Move decl from here ...
24502 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24503 to check its interface.
24504 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24505
24506 * fontset.c (free_realized_fontset): Now static.
24507 (Fset_fontset_font): Rename local to avoid shadowing.
24508 (fontset_font): Mark local as initialized.
24509 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
24510
24511 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24512
24513 * xselect.c (x_disown_buffer_selections): Remove; not used.
24514 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
24515 (x_own_selection, Fx_disown_selection_internal): Rename locals
24516 to avoid shadowing.
24517 (x_handle_dnd_message): Remove local to avoid shadowing.
24518
24519 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24520 so that the caller can use some name other than gcpro1.
24521 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
24522 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24523 (Fx_backspace_delete_keys_p):
24524 Use them to avoid shadowing, and rename vars to avoid shadowing.
24525 (x_decode_color, x_set_name, x_window): Now static.
24526 (Fx_create_frame): Add braces to silence GCC warning.
24527 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
24528 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24529 Remove unused locals.
24530 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24531 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24532 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24533 macros.
24534
24535 * xterm.h (x_mouse_leave): New decl.
24536
24537 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24538 Remove unused functions.
24539 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24540 (x_calc_absolute_position): Now static.
24541 (XTread_socket): Don't define label "out" unless it's used.
24542 Don't declare local "event" unless it's used.
24543 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24544 unless they are used.
24545 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24546 (x_fatal_error_signal): Remove; not used.
24547 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24548 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24549 (x_error_catcher, x_connection_closed, x_error_handler):
24550 (x_error_quitter, xembed_send_message, x_iconify_frame):
24551 (my_log_handler): Rename locals to avoid shadowing.
24552 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
24553 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
24554
24555 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24556 Rename or move locals to avoid shadowing.
24557 (tty_defined_color, merge_face_heights): Now static.
24558 (free_realized_faces_for_fontset): Remove; not used.
24559 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24560 does not deduce is never used uninitialized.
24561 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24562 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
24563
24564 * terminal.c (store_terminal_param): Now static.
24565
24566 * xmenu.c (menu_highlight_callback): Now static.
24567 (set_frame_menubar): Remove unused local.
24568 (xmenu_show): Rename parameter to avoid shadowing.
24569 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24570 since they might point to immutable storage.
24571 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24572 since it's unused otherwise.
24573
24574 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24575 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24576 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24577 avoids a gcc -Wuninitialized diagnostic.
24578 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24579 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24580 does not deduce are never used uninitialized.
24581
24582 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24583
24584 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24585 * window.c (window_loop, size_window):
24586 (run_window_configuration_change_hook, enlarge_window): Likewise.
24587
24588 * window.c (display_buffer): Now static.
24589 (size_window): Mark variables that gcc -Wuninitialized
24590 does not deduce are never used uninitialized.
24591 * window.h (check_all_windows): New decl, to forestall
24592 gcc -Wmissing-prototypes diagnostic.
24593 * dispextern.h (bidi_dump_cached_states): Likewise.
24594
24595 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24596 shadowing.
24597 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24598 Include <limits.h>.
24599 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24600 and to avoid gcc -Wuninitialized warning.
24601 (load_charset_map): Mark variables that gcc -Wuninitialized
24602 does not deduce are never used uninitialized.
24603 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24604
24605 * coding.c (coding_set_source, coding_set_destination):
24606 Use "else { /* comment */ }" rather than "else /* comment */;"
24607 for clarity, and to avoid gcc -Wempty-body warning.
24608 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24609 a block, when the outer 'i' will do.
24610 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24611 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24612 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24613 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24614 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24615 Rename locals to avoid shadowing.
24616 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24617 * coding.c (emacs_mule_char, encode_invocation_designation):
24618 Now static, since they're not used elsewhere.
24619 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24620 (decode_coding_object, encode_coding_object, detect_coding_system):
24621 (decode_coding_emacs_mule): Mark variables that gcc
24622 -Wuninitialized does not deduce are never used uninitialized.
24623 (detect_coding_iso_2022): Initialize a local variable that might
24624 be used uninitialized. Leave a FIXME because it's not clear that
24625 this initialization is needed. (Bug#8211)
24626 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24627 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24628 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24629 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24630 Remove unused macros.
24631
24632 * category.c (hash_get_category_set): Remove unused local var.
24633 (copy_category_table): Now static, since it's not used elsewhere.
24634 * character.c (string_count_byte8): Likewise.
24635
24636 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24637 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24638
24639 * chartab.c (copy_sub_char_table): Now static, since it's not used
24640 elsewhere.
24641 (sub_char_table_ref_and_range, char_table_ref_and_range):
24642 Rename locals to avoid shadowing.
24643 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24644
24645 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24646 (BIDI_BOB): Remove unused macro.
24647
24648 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24649 deduce are never used uninitialized.
24650 * term.c (encode_terminal_code): Likewise.
24651
24652 * term.c (encode_terminal_code): Now static. Remove unused local.
24653
24654 * tparam.h: New file.
24655 * term.c, tparam.h: Include it.
24656 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24657 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24658 Move these decls to tparam.h, and make them agree with what
24659 is actually in tparam.c. The previous trick of using incompatible
24660 decls in different modules does not conform to the C standard.
24661 All callers of tparam changed to use tparam's actual API.
24662 * tparam.c (tparam1, tparam, tgoto):
24663 Use const pointers where appropriate.
24664
24665 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24666 * cm.h (struct cm): Likewise.
24667 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24668 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24669 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24670 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24671 (turn_on_face, init_tty): Likewise.
24672 * termchar.h (struct tty_display_info): Likewise.
24673
24674 * term.c (term_mouse_position): Rename local to avoid shadowing.
24675
24676 * alloc.c (mark_ttys): Move decl from here ...
24677 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24678
246792011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24680
24681 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24682
246832011-03-09 Juanma Barranquero <lekktu@gmail.com>
24684
24685 * search.c (compile_pattern_1): Remove argument regp, unused since
24686 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24687 (compile_pattern): Don't pass it.
24688
246892011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24690
24691 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24692 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24693 for ! HAVE_GTK3.
24694 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24695
24696 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24697
24698 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24699 gdk_window_get_screen, gdk_window_get_geometry,
24700 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24701 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24702 (xg_get_pixbuf_from_pixmap): New function.
24703 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24704 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24705 Call xg_get_pixbuf_from_pixmap instead of
24706 gdk_pixbuf_get_from_drawable.
24707 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24708 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24709 (xg_check_special_colors): Use GtkStyleContext and its functions
24710 for HAVE_GTK3.
24711 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24712 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24713 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24714 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24715 Call gtk_widget_get_preferred_size.
24716 (xg_frame_resized): gdk_window_get_geometry only takes 5
24717 parameters.
24718 (xg_win_to_widget, xg_event_is_for_menubar):
24719 Call gdk_x11_window_lookup_for_display.
24720 (xg_set_widget_bg): New function.
24721 (delete_cb): New function.
24722 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24723 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24724 (xg_set_background_color): Call xg_set_widget_bg.
24725 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24726 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24727 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24728 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24729 if ! HAVE_GTK3.
24730 (update_frame_tool_bar): Call gtk_widget_hide.
24731 (xg_initialize): Use GDK_KEY_g.
24732
24733 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24734 if ! HAVE_GTK3
24735 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24736
24737 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24738 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24739 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24740
247412011-03-08 Juanma Barranquero <lekktu@gmail.com>
24742
24743 * w32xfns.c (select_palette): Check success of RealizePalette against
24744 GDI_ERROR, not zero.
24745
24746See ChangeLog.11 for earlier changes.
24747 1868
24748;; Local Variables: 1869;; Local Variables:
24749;; coding: utf-8 1870;; coding: utf-8