aboutsummaryrefslogtreecommitdiffstats
path: root/src/ChangeLog
diff options
context:
space:
mode:
authorJuanma Barranquero2013-06-18 13:17:50 +0200
committerJuanma Barranquero2013-06-18 13:17:50 +0200
commita020afb9892611eb57f6a0a31da26a4554a51f30 (patch)
tree267c488d3ed1430025f45e9d3514378fa2f0c59a /src/ChangeLog
parent58aa805b97182b8cd94928d88520ae0aa4edbbb7 (diff)
downloademacs-a020afb9892611eb57f6a0a31da26a4554a51f30.tar.gz
emacs-a020afb9892611eb57f6a0a31da26a4554a51f30.zip
lisp/ChangeLog, src/ChangeLog: Rotate changelogs.
Diffstat (limited to 'src/ChangeLog')
-rw-r--r--src/ChangeLog22925
1 files changed, 1 insertions, 22924 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e1609356403..ff9f771b779 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1860,22930 +1860,7 @@
1860 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin 1860 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1861 and FreeBSD now. 1861 and FreeBSD now.
1862 1862
18632013-03-11 Paul Eggert <eggert@cs.ucla.edu> 1863See ChangeLog.12 for earlier changes.
1864
1865 * insdel.c (adjust_after_replace): Use bool for boolean.
1866
18672013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1868
1869 * keyboard.c: Move keyboard decoding to read_key_sequence.
1870 (decode_keyboard_code): Remove.
1871 (tty_read_avail_input): Don't try to decode input.
1872 (read_decoded_char): New function.
1873 (read_key_sequence): Use it.
1874
18752013-03-10 Daniel Colascione <dancol@dancol.org>
1876
1877 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1878 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1879 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1880 w32fns.c.
1881
1882 * w32term.c (construct_drag_n_drop): Use the above macros to make
1883 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1884
1885 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1886 properly display non-ASCII frame titles in cygw32 builds.
1887
1888 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1889 call ShellExecute in cygw32 builds.
1890
1891 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1892 common file dialog code.
1893
1894 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1895 can just use du like other systems.
1896
1897 * coding.c (from_unicode_buffer): Declare.
1898 * coding.c (from_unicode_buffer): Implement.
1899
19002013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1901
1902 * lread.c: Minor cleanup.
1903 (FROM_FILE_P): New macro.
1904 (skip_dyn_bytes, unreadchar, read1): Use it.
1905 (read_list): Consolidate duplicated code.
1906
1907 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1908
19092013-03-10 Eli Zaretskii <eliz@gnu.org>
1910
1911 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1912 (redisplay_internal, set_cursor_from_row, try_window)
1913 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1914 (display_line, notice_overwritten_cursor)
1915 (mouse_face_from_buffer_pos, note_mouse_highlight):
1916 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1917 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1918 (mouse_face_from_string_pos, fast_find_string_pos):
1919 Use MATRIX_ROW_VPOS.
1920
1921 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1922
1923 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1924
1925 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1926 MATRIX_MODE_LINE_ROW.
1927
1928 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1929
19302013-03-10 handa <handa@gnu.org>
1931
1932 * lisp.h (adjust_after_replace): Extern it.
1933
1934 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1935 case of detection for coding_category_utf_8_auto.
1936 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1937 Skip decoding if all bytes are ASCII.
1938
1939 * insdel.c (adjust_after_replace): Make it public. New arg
1940 text_at_gap_tail.
1941 (adjust_after_insert): Call adjust_after_replace with the new arg
1942 value 0.
1943
19442013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1945
1946 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1947 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1948 from Elisp via unread-command-events.
1949
1950 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1951 functions to mean "no change".
1952
19532013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1954
1955 region-cache.c, scroll.c, search.c: Use bool for booleans.
1956 * lisp.h (compile_pattern):
1957 * scroll.c (do_scrolling, do_direct_scrolling):
1958 * search.c (struct regexp_cache, compile_pattern_1)
1959 (compile_pattern, string_match_1, search_command)
1960 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1961 (search_regs_saved, Fregexp_quote):
1962 Use bool for boolean.
1963 * region-cache.c (region_cache_forward, region_cache_backward):
1964 Fix comments to match code: these functions return int, not boolean.
1965
19662013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1967
1968 * search.c (find_newline): Accept start and end byte positions
1969 as arguments and allow -1 if not known.
1970 (find_newline_no_quit): Likewise for start position.
1971 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1972 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1973 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1974 * editfns.c (Fconstrain_to_field): Break long line.
1975 Adjust call to find_newline.
1976 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1977 Use DEC_BOTH to start next search from the previous buffer
1978 position, where appropriate.
1979 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1980 (get_visually_first_element, move_it_vertically_backward): Likewise.
1981 Obtain byte position from the display iterator, where appropriate.
1982
19832013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1984
1985 print.c, process.c: Use bool for booleans.
1986 * lisp.h (wait_reading_process_output):
1987 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1988 (strout, debug_output_compilation_hack, float_to_string, print)
1989 (print_object):
1990 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1991 (decode_status, status_message, create_process, create_pty)
1992 (Fmake_network_process, Fnetwork_interface_info)
1993 (wait_reading_process_output, read_process_output)
1994 (write_queue_push, write_queue_pop, process_send_signal)
1995 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1996 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1997 Use bool for booleans.
1998 * process.c (Fnetwork_interface_list): Remove unused local.
1999 (connect_counter): Now EMACS_INT, not int.
2000
20012013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
2002
2003 * bidi.c (bidi_fetch_char): Swap first and second arguments
2004 to match other functions accepting character and byte positions.
2005 Adjust comment.
2006 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
2007 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
2008 when you need just to move to the previous buffer position.
2009 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
2010
20112013-03-07 Eli Zaretskii <eliz@gnu.org>
2012
2013 * .gdbinit (prowlims): Display the enabled_p flag of the row.
2014
20152013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
2016
2017 Avoid character to byte conversions in motion subroutines.
2018 * indent.h (compute_motion, vmotion): Add byte position argument.
2019 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
2020 Add eassert.
2021 (Fcompute_motion): Break long line. Adjust call to compute_motion.
2022 Use list5 for return value.
2023 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
2024 Adjust comments, style and calls to compute_motion.
2025 (Fvertical_motion): Adjust call to vmotion.
2026 * window.c (Fdelete_other_windows_internal): Record window start
2027 byte position and adjust call to vmotion.
2028 (window_scroll_line_based): Likewise with call to compute_motion.
2029 Use SET_PT_BOTH.
2030 (Frecenter): Adjust calls to vmotion.
2031
20322013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
2033
2034 * lisp.h (list2i, list3i): New functions.
2035 (list4i): Move from window.c and make LISP_INLINE.
2036 * editfns.c (make_lisp_time):
2037 * fns.c (Flocale_info):
2038 * keyboard.c (parse_modifiers):
2039 * xterm.c (x_ewmh_activate_frame): Use list2i.
2040 * instel.c (signal_after_change):
2041 * nsfns.m (Fx_server_version, Fxw_color_values):
2042 * w32fns.c (Fxw_color_values, Fx_server_version):
2043 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
2044 * fileio.c (Fvisited_file_modtime):
2045 * nsfns.m (Fns_display_usable_bounds):
2046 * w32.c (ltime): Use list4i.
2047
20482013-03-06 Eli Zaretskii <eliz@gnu.org>
2049
2050 * search.c (find_newline_no_quit): Rename from find_next_newline.
2051 Add commentary.
2052
2053 * lisp.h (find_newline_no_quit): Rename prototype.
2054
2055 * xdisp.c (back_to_previous_line_start)
2056 (forward_to_next_line_start, get_visually_first_element)
2057 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
2058 * indent.c (vmotion): Callers of find_newline_no_quit changed.
2059 * bidi.c (bidi_find_paragraph_start): Callers of
2060 find_newline_no_quit changed.
2061
2062 * msdos.c: Change encoding to cp850. (Bug#13879)
2063 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
2064
20652013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
2066
2067 Coding system support cleanup and minor refactoring.
2068 * coding.h (enum coding_result_code): Remove
2069 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
2070 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
2071 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
2072 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
2073 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
2074 (decode_coding_region, encode_coding_region, decode_coding_string):
2075 Remove unused compatibility macros.
2076 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
2077 (record_conversion_result): Adjust user.
2078 (syms_of_coding): Likewise.
2079 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
2080 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
2081 (decode_coding_object): Simplify since xrealloc never returns NULL.
2082 Add eassert.
2083
20842013-03-06 Paul Eggert <eggert@cs.ucla.edu>
2085
2086 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
2087 * sysdep.c (list_system_processes)
2088 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
2089 Make it a stub in this case; otherwise the build might fail,
2090 and this code hasn't been tested on such hosts anyway.
2091 Problem reported by Nelson H. F. Beebe in
2092 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
2093 and analyzed by Jérémie Courrèges-Anglas in
2094 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
2095
20962013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
2097
2098 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
2099 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
2100 (get_visually_first_element, move_it_vertically_backward): Ajust users.
2101 * bidi.c (bidi_find_paragraph_start): Likewise.
2102 * indent.c (vmotion): Likewise.
2103
21042013-03-05 Paul Eggert <eggert@cs.ucla.edu>
2105
2106 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
2107 * filelock.c: Include <c-ctype.h>.
2108 (MAX_LFINFO): New top-level constant.
2109 (lock_info_type): Remove members pid, boot_time. Add members at,
2110 dot, colon. Change user member to be the entire buffer, not a
2111 pointer. This allows us to handle the case where a foreign
2112 pid or boot time exceeds the local range. All uses changed.
2113 (LINKS_MIGHT_NOT_WORK): New constant.
2114 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
2115 (defined_WINDOWSNT): Remove.
2116 (MAKE_LOCK_NAME, file_in_lock_file_name):
2117 Always use .#FILE (not .#-FILE) for the file lock,
2118 even if it is a regular file.
2119 (rename_lock_file): New function.
2120 (create_lock_file): Use it.
2121 (create_lock_file, read_lock_data):
2122 Prefer a symbolic link for the lock file, falling back on a
2123 regular file if symlinks don't work. Do not try to create
2124 symlinks on MS-Windows, due to security hassles. Stick with
2125 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
2126 link, rename, unlink, mkstemp) when creating locks, as a GNUish
2127 host may be using a Windowsish file system, and cannot use
2128 MS-Windows-only system calls. Fall back on mktemp if mkstemp
2129 doesn't work. Don't fail merely because of a symlink-contents
2130 length limit in the current file system; fall back on regular
2131 files. Increase the symlink contents length limit to 8 KiB, this
2132 should be big enough for any real use and doesn't crunch the
2133 stack.
2134 (create_lock_file, lock_file_1, read_lock_data):
2135 Simplify allocation of lock file buffers now that they fit in 8 KiB.
2136 (lock_file_1): Return error number, not bool. All callers changed.
2137 (ELOOP): New macro, if not already defined.
2138 (read_lock_data): Return size of lock file contents, not Lisp object.
2139 All callers changed. Handle a race condition if some other process
2140 replaces a regular-file lock with a symlink lock or vice versa,
2141 while we're trying to read the lock.
2142 (current_lock_owner): Parse contents more carefully, to help avoid
2143 confusing a regular-file lock with some other application's use
2144 of the file. Check for lock file contents being too long, or
2145 not parsing correctly.
2146 (current_lock_owner, lock_file):
2147 Allow foreign pid and boot times that exceed the local range.
2148 (current_lock_owner, lock_if_free, lock_file):
2149 Simplify allocation of lock file contents.
2150 * w32.c (sys_rename_replace): New function, containing most of
2151 the contents of the old sys_rename.
2152 (sys_rename): Use it.
2153 (fchmod): New dummy function.
2154 * w32.h (sys_rename_replace, fchmod): New decls.
2155
21562013-03-05 Eli Zaretskii <eliz@gnu.org>
2157
2158 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
2159 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
2160 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
2161 <dmantipov@yandex.ru>.
2162
21632013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
2164
2165 * composite.c (get_composition_id, fill_gstring_header):
2166 Use make_uninit_vector where appropriate.
2167 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
2168 * xselect.c (clean_local_selection_data): Likewise.
2169
21702013-03-04 Paul Eggert <eggert@cs.ucla.edu>
2171
2172 Fix misuse of ImageMagick that caused core dump (Bug#13846).
2173 * image.c (imagemagick_load_image): Calculate height and width
2174 after flattening the image, not before.
2175
21762013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
2177
2178 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
2179 * ftfont.c (ftfont_shape_by_flt): Likewise.
2180 * w32uniscribe.c (uniscribe_shape): Likewise.
2181
21822013-03-02 Paul Eggert <eggert@cs.ucla.edu>
2183
2184 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
2185 The old approach, which fell back on DIR/.#FILE.0 through
2186 DIR/.#FILE.9, had race conditions that could not be easily fixed.
2187 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
2188 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
2189 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
2190 because the locking mechanism was never reliable in that case).
2191 This patch fixes this and other bugs discovered by a code
2192 inspection that was prompted by
2193 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
2194 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
2195 to avoid interoperability problems between the MS-Windows and
2196 non-MS-Windows implementations. MS-Windows and non-MS-Windows
2197 instances of Emacs now ignore each others' locks.
2198 * filelock.c (defined_WINDOWSNT): New constant.
2199 (MAKE_LOCK_NAME, fill_in_lock_file_name):
2200 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
2201 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
2202 regular files on MS-Windows hosts.
2203 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
2204 Use SAFE_ALLOCA to avoid problems with long file names.
2205 (MAX_LFINFO): Now a local constant, not a global macro.
2206 (IS_LOCK_FILE): Remove.
2207 (lock_file_1): Don't inspect errno if symlink call succeeds;
2208 that's not portable.
2209 (lock_file): Document that this function can return if lock
2210 creation fails.
2211 (lock_file): Don't access freed storage.
2212
22132013-03-02 Andreas Schwab <schwab@linux-m68k.org>
2214
2215 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
2216
22172013-03-02 Paul Eggert <eggert@cs.ucla.edu>
2218
2219 * textprop.c: Use bool for booleans.
2220 (validate_interval_range, Fadd_text_properties)
2221 (Fremove_text_properties): Prefer bool to int when either works.
2222
22232013-03-02 Eli Zaretskii <eliz@gnu.org>
2224
2225 * textprop.c (Fadd_text_properties, Fremove_text_properties):
2226 If the interval tree changes as a side effect of calling
2227 modify_region, re-do processing starting from the call to
2228 validate_interval_range. (Bug#13743)
2229
22302013-02-28 Eli Zaretskii <eliz@gnu.org>
2231
2232 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
2233 (Bug#13546).
2234
22352013-02-27 Eli Zaretskii <eliz@gnu.org>
2236
2237 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
2238 _SH_DENYRW flag, instead of emacs_open, to deny any other process
2239 access to the lock file until it is written and closed.
2240 (Bug#13807)
2241
22422013-02-27 Paul Eggert <eggert@cs.ucla.edu>
2243
2244 * callint.c (Qcall_interactively):
2245 * macros.c (Qexecute_kbd_macro):
2246 Now static.
2247
22482013-02-26 Bastien Guerry <bzg@gnu.org>
2249
2250 * window.c (Frecenter): Tiny docstring enhancement.
2251
22522013-02-26 Paul Eggert <eggert@cs.ucla.edu>
2253
2254 Minor textprop integer cleanup.
2255 * intervals.h, textprop.c (add_text_properties_from_list):
2256 Return void, not int, since nobody uses the return value.
2257 * textprop.c (validate_plist, add_properties, remove_properties)
2258 (Fadd_text_properties):
2259 Don't assume list length fits in int.
2260 (interval_has_all_properties, interval_has_some_properties)
2261 (interval_has_some_properties_list, add_properties, remove_properties)
2262 (Fadd_text_properties, Fremove_text_properties)
2263 (Fremove_list_of_text_properties, text_property_stickiness):
2264 Use bool for booleans.
2265 (Fadd_text_properties, Fremove_text_properties):
2266 (Fremove_list_of_text_properties):
2267 Reindent do-while as per GNU style.
2268
22692013-02-25 Eli Zaretskii <eliz@gnu.org>
2270
2271 Implement CLASH_DETECTION for MS-Windows.
2272
2273 * filelock.c [WINDOWSNT]: Include w32.h.
2274 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
2275 function of that name. Up-case the macro arguments.
2276 (IS_LOCK_FILE): New macro.
2277 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
2278 (create_lock_file): New function, with body extracted from
2279 lock_file_1.
2280 [WINDOWSNT]: Implement lock files by writing a regular file with
2281 the lock information as its contents.
2282 (read_lock_data): New function, on Posix platforms just calls
2283 emacs_readlinkat.
2284 [WINDOWSNT]: Read the lock info from the file.
2285 (current_lock_owner): Call read_lock_data instead of calling
2286 emacs_readlinkat directly.
2287 (lock_file) [WINDOWSNT]: Run the file name through
2288 dostounix_filename.
2289
2290 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
2291 just check if the process by that PID exists.
2292
2293 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
2294 also present, as doing so will fail to error out if the file
2295 already exists.
2296
2297 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
2298
2299 * textprop.c (Fadd_text_properties, Fremove_text_properties)
2300 (Fremove_list_of_text_properties): Skip all of the intervals in
2301 the region between START and END that already have resp. don't
2302 have the requested properties, not just the first one.
2303 Add assertions that the loop afterwards always modifies the
2304 properties. (Bug#13743)
2305
23062013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
2307
2308 * callint.c (Fcall_interactively): Use the right lexical environment
2309 for `interactive' specs (bug#13811).
2310 * eval.c (Feval): Accept a lexical environment.
2311
23122013-02-25 Paul Eggert <eggert@cs.ucla.edu>
2313
2314 Simplify data_start configuration (Bug#13783).
2315 This is a followon simplification to the fix for Bug#13650.
2316 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
2317 (START_FILES): Remove. All uses removed.
2318 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
2319 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
2320 (buildobj.h): Use it.
2321 ($(ALLOBJS)): Depend on globals.h.
2322 (temacs$(EXEEXT)): Use $(ALLOBJS).
2323 * autodeps.mk (ALLOBJS): Move to Makefile.in.
2324 * deps.mk (vm-limit.o):
2325 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
2326 Do not depend on mem-limits.h.
2327 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
2328 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
2329 [__GNUC__ && !ORDINARY_LINK]: Remove.
2330 * mem-limits.h, pre-crt0.c: Remove.
2331 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
2332 * unexcoff.c (etext): New decl.
2333 (make_hdr): Use DATA_START instead of start_of_data.
2334 * vm-limit.c: Move most of mem-limits.h's contents here.
2335 (data_start): New decl. It's OK if this is approximate,
2336 so simplify-away some unnecessary exactness.
2337 (POINTER): Remove; all uses removed.
2338 (data_space_start): Now char *, to avoid casts.
2339 (exceeds_lisp_ptr): New function, replacing the old
2340 EXCEEDS_LISP_PTR macro. All uses changed.
2341 (check_memory_limits): Simplify and remove casts.
2342 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
2343 (memory_warnings): Use data_start instead of start_of_data.
2344
23452013-02-24 Andreas Schwab <schwab@linux-m68k.org>
2346
2347 * xdisp.c (set_message): Only check for debug-on-message if STRING
2348 is a string. (Bug#13797)
2349
23502013-02-24 Paul Eggert <eggert@cs.ucla.edu>
2351
2352 Fix regression introduced by July 10 filelock.c patch.
2353 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
2354 2012-07-10 patch to this file. Reported by Eli Zaretskii in
2355 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
2356 and diagnosed by Andreas Schwab in
2357 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
2358
23592013-02-22 Paul Eggert <eggert@cs.ucla.edu>
2360
2361 Assume C89 or better.
2362 * ralloc.c (SIZE, POINTER, NIL):
2363 * vm-limit.c (POINTER):
2364 Remove, replacing all uses with C89 equivalents. These old
2365 symbols were present only for porting to pre-C89 platforms.
2366
23672013-02-22 Claudio Bley <claudio.bley@gmail.com>
2368
2369 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
2370 This avoids warning messages reported as part of Bug#13546.
2371
23722013-02-21 Ken Brown <kbrown@cornell.edu>
2373
2374 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
2375
23762013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2377
2378 * sheap.c (report_sheap_usage): Prefer message1_nolog.
2379
2380 * keyboard.c (Qcommand_execute): New var.
2381 (command_loop_1, read_char): Use it.
2382 (Fcommand_execute): Remove, replace by an Elisp implementation.
2383 (syms_of_keyboard): Adjust accordingly.
2384
23852013-02-19 Daniel Colascione <dancol@dancol.org>
2386
2387 * sheap.c (report_sheap_usage): Use message, not message1, so
2388 that we don't try to create a buffer while we're in the middle
2389 of dumping Emacs. Explain why.
2390
23912013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
2392
2393 * search.c (find_newline): Return byte position in bytepos.
2394 Adjust comment.
2395 (find_next_newline_no_quit, find_before_next_newline):
2396 Add bytepos argument.
2397 * lisp.h (find_newline, find_next_newline_no_quit)
2398 (find_before_next_newline): Adjust prototypes.
2399 * bidi.c (bidi_find_paragraph_start):
2400 * editfns.c (Fconstrain_to_field, Fline_end_position):
2401 * indent.c (compute_motion, vmotion):
2402 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2403 (get_visually_first_element, move_it_vertically_backward):
2404 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2405
24062013-02-19 Eli Zaretskii <eliz@gnu.org>
2407
2408 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2409 resources were not orderly released.
2410
24112013-02-17 Eli Zaretskii <eliz@gnu.org>
2412
2413 * xdisp.c (x_draw_vertical_border): For a window that is neither
2414 the leftmost nor the rightmost, redraw both the left and the right
2415 vertical borders. (Bug#13723)
2416
24172013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2418
2419 * xml.c (init_libxml2_functions):
2420 * sound.c (sound_warning):
2421 * sheap.c (report_sheap_usage):
2422 * process.c (wait_reading_process_output):
2423 * msdos.c (XMenuActivate):
2424 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2425 * keyboard.c (top_level_1):
2426 * editfns.c (Fmessage, Fmessage_box):
2427 * callint.c (Fcall_interactively):
2428 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2429
24302013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2431
2432 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
2433 * frame.c (syms_of_frame): ... to here.
2434
24352013-02-16 Eli Zaretskii <eliz@gnu.org>
2436
2437 * w32.c (sys_chown): Remove unused function.
2438
2439 * w32term.c <input_signal_count>: Declare 'volatile'
2440 unconditionally. (Bug#9066)
2441
2442 * w32.c (set_errno): Reset h_errno and don't set it to any other
2443 value. Set errno instead.
2444 (check_errno): Reset h_errno.
2445 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2446 (sys_gethostname, sys_getservbyname, sys_getpeername)
2447 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2448 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2449 h_errno.
2450 (sys_gethostbyname): Set h_errno only errors detected.
2451
24522013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2453
2454 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2455
24562013-02-15 Eli Zaretskii <eliz@gnu.org>
2457
2458 * keyboard.c (read_char): Fix calculation of auto-save time out
2459 when auto-save-timeout is less than 4. (Bug#13720)
2460
2461 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
2462 time. Improve diagnostics in DebPrint. (Bug#13546)
2463
2464 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2465 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2466 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2467 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2468 make sure errno is set to an appropriate value. (Bug#13546)
2469 (socket_to_fd): Add assertion against indexing fd_info[] with a
2470 value that is out of bounds.
2471 (sys_accept): If fd is negative, do not set up the child_process
2472 structure for reading.
2473
24742013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2475
2476 * composite.c (fill_gstring_header): Remove useless prototype.
2477 Break long line.
2478 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2479 * print.c (PRINTDECLARE, print_object):
2480 * search.c (compile_pattern, fast_looking_at, search_buffer):
2481 (simple_search, boyer_moore, Freplace_match):
2482 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2483 (get_overlay_arrow_glyph_row, display_mode_element):
2484 (decode_mode_spec_coding, message3):
2485 * xfaces.c (face_at_string_position): Use bool for booleans.
2486 Adjust comments.
2487
24882013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2489
2490 Fix AIX port (Bug#13650).
2491 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2492 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2493 was #undeffed earlier, so it cannot be used as a macro here.
2494 Use the constant and not the macro.
2495
24962013-02-15 Eli Zaretskii <eliz@gnu.org>
2497
2498 * w32proc.c (new_child): If no vacant slots are found in
2499 child_procs[], make another pass looking for slots whose process
2500 has exited or died. (Bug#13546)
2501
2502 * w32.c (sys_pipe): When failing due to file descriptors above
2503 MAXDESC, set errno to EMFILE.
2504 (_sys_read_ahead): Update cp->status when failing to read serial
2505 communications input, so that the status doesn't stay at
2506 STATUS_READ_IN_PROGRESS. (Bug#13546)
2507
25082013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2509
2510 * gtkutil.c (tb_size_cb): New function.
2511 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2512
25132013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2514
2515 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2516 an event.
2517
25182013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2519
2520 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2521
25222013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2523
2524 * font.c (font_range): Add pos_byte argument. Adjust comment
2525 and break long line.
2526 * font.h (font_range): Adjust prototype.
2527 * composite.c (autocmp_chars): Pass byte position to font_range.
2528 Break long line. Remove useless prototype and format comment.
2529
25302013-02-13 Glenn Morris <rgm@gnu.org>
2531
2532 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2533
25342013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2535
2536 Improve AIX port some more (Bug#13650).
2537 With this, it should be as good as it was in 23.3, though it's
2538 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2539 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2540 * unexaix.c (start_of_text): Remove.
2541 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2542 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2543 (orig_load_scnptr, orig_data_scnptr):
2544 Now off_t, not long, since they are file offsets.
2545 (make_hdr): Use _data, not start_of_data ().
2546 This is the key part of the fix.
2547 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2548 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2549
2550 * pre-crt0.c (data_start): Initialize to 1.
2551 This ports to compilers that optimize the external declaration
2552 'int x = 0;' as if it were 'int x;' to shrink the executable.
2553
2554 Improve AIX port (Bug#13650).
2555 This doesn't fix the bug, but it makes progress: Emacs builds now.
2556 * unexaix.c: Include inttypes.h, stdarg.h.
2557 (report_error, report_error_1): Mark as _Noreturn.
2558 (report_error): Don't report the wrong errno.
2559 (report_error_1): Now varargs. All callers changed.
2560 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2561 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2562 (write_ptr): Use %p to print address rather than %lx and a cast
2563 to unsigned long. Grow buffer a bit, to be safer.
2564
25652013-02-13 Eli Zaretskii <eliz@gnu.org>
2566
2567 * bidi.c (bidi_resolve_neutral): After finding the next
2568 non-neutral character, accept NEUTRAL_ON type as well, because
2569 directional control characters, such as LRE and RLE, have their
2570 type converted to that by bidi_resolve_weak. This avoids aborts
2571 when LRE/RLE follows a run of neutrals.
2572 (bidi_move_to_visually_next): Assert that return value of
2573 bidi_peek_at_next_level is non-negative. Negative values will
2574 cause an infloop.
2575
25762013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2577
2578 Minor getenv-related fixes.
2579 * callproc.c (Fcall_process_region) [!DOS_NT]:
2580 Avoid unnecessary duplicate call to getenv.
2581 * callproc.c (init_callproc):
2582 * dispnew.c (init_display):
2583 * sysdep.c (sys_subshell):
2584 Omit unnecessary cast of getenv or egetenv.
2585
25862013-02-13 Juanma Barranquero <lekktu@gmail.com>
2587
2588 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2589 Update dependencies.
2590
25912013-02-12 Eli Zaretskii <eliz@gnu.org>
2592
2593 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2594 marker's position.
2595 (display_line): Set w->region_showing to the value of
2596 it->region_beg_charpos, not to -1. This fixes redisplay
2597 optimization when cursor is moved up after M->. (Bug#13623)
2598 (Bug#13626)
2599 (try_scrolling): Scroll text up more if point is too close to ZV
2600 and inside the scroll margin. This makes sure point is moved
2601 outside the scroll margin in these cases.
2602
2603 * window.h (struct window): region_showing can no longer be
2604 negative.
2605
26062013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2607
2608 Tune by using memchr and memrchr.
2609 * doc.c (Fsnarf_documentation):
2610 * fileio.c (Fsubstitute_in_file_name):
2611 * search.c (find_newline, scan_newline):
2612 * xdisp.c (pos_visible_p, display_count_lines):
2613 Use memchr and memrchr rather than scanning byte-by-byte.
2614 * search.c (find_newline): Rename from scan_buffer.
2615 Omit first arg TARGET, as it's always '\n'. All callers changed.
2616
2617 Clean up read_key_sequence a tiny bit more.
2618 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2619 (read_key_sequence): Remove unused locals.
2620
26212013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2622
2623 Clean up read_key_sequence a bit; reread active keymaps after first event.
2624 * keyboard.c (read_char, read_char_x_menu_prompt)
2625 (read_char_minibuf_menu_prompt):
2626 Replace nmaps+maps with a single `map' arg.
2627 (follow_key): Operate on a single map.
2628 (active_maps): New function.
2629 (test_undefined): Also return true for nil bindings.
2630 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2631 a single (composed) keymap. Remember `first_event' to choose the right
2632 set of active keymaps. Recompute the set of keymaps after receiving
2633 the first event. Remove GOBBLE_FIRST_EVENT.
2634 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2635 * keyboard.h (read_char): Update declaration.
2636 * lread.c (read_filtered_event): Adjust call to read_char.
2637
26382013-02-11 Eli Zaretskii <eliz@gnu.org>
2639
2640 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2641 Don't use the limitation on backwards movement when lines are truncated
2642 in the window. (Bug#13675)
2643
26442013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2645
2646 * marker.c (set_marker_internal): If desired position is passed
2647 as a marker, avoid call to buf_charpos_to_bytepos.
2648 * window.c (Fset_window_point): Omit redundant type checking.
2649 (Fset_window_start): Likewise. Format comment.
2650 (window_scroll_pixel_based): Use set_marker_restricted_both
2651 with character and byte positions obtained from an iterator.
2652 (Fset_window_configuration): Use set_marker_restricted_both.
2653 * xdisp.c (message_dolog): Likewise.
2654
26552013-02-10 Eli Zaretskii <eliz@gnu.org>
2656
2657 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2658 When text lines are longer than window's screen lines, don't move back
2659 too far. This speeds up some redisplay operations. (Bug#13675)
2660
26612013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2662
2663 * syntax.c (scan_sexps_forward): Fix byte position calculation
2664 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2665
26662013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2667
2668 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2669 that was not needed.
2670
26712013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 Minor hashing refactoring.
2674 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2675 (sxhash_float): Return EMACS_UINT, for consistency with the other
2676 hash functions.
2677 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2678 non-static inline function and therefore can't use static vars.
2679 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2680 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2681 with the other hash functions.
2682
26832013-02-09 Eli Zaretskii <eliz@gnu.org>
2684
2685 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2686 XXXXXX part of the temporary file pattern is not downcased even
2687 when w32-downcase-file-names is non-nil. (Bug#13661)
2688
2689 * xdisp.c (decode_mode_spec): Remove handling of %t.
2690
2691 * msdos.c (careadlinkatcwd): Remove.
2692
26932013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2694
2695 * lread.c (skip_dyn_bytes): New function (bug#12598).
2696 (read1): Use it. Use getc instead of READCHAR to read bytes.
2697 (load_each_byte): Remove. Update users.
2698
26992013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2700
2701 * search.c (scan_buffer): Calculate end byte position just once.
2702 (scan_newline): Do not recalculate start_byte.
2703 (search_command): Use eassert.
2704 * syntax.c (struct lisp_parse_state): New member location_byte.
2705 (scan_sexps_forward): Record from_byte and avoid redundant
2706 character to byte position calculation ...
2707 (Fparse_partial_sexp): ... here. Break too long line.
2708
27092013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2710
2711 * lisp.h (make_uninit_vector): New function.
2712 * alloc.c (Fvector, Fmake_byte_code):
2713 * ccl.c (Fregister_ccl_program):
2714 * charset.c (Fdefine_charset_internal, define_charset_internal):
2715 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2716 * composite.c (syms_of_composite):
2717 * font.c (Fquery_font, Ffont_info, syms_of_font):
2718 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2719 * ftfont.c (ftfont_shape_by_flt):
2720 * indent.c (recompute_width_table):
2721 * nsselect.m (clean_local_selection_data):
2722 * syntax.c (init_syntax_once):
2723 * w32unsubscribe.c (uniscribe_shape):
2724 * window.c (Fcurrent_window_configuration):
2725 * xfaces.c (Fx_family_fonts):
2726 * xselect.c (selection_data_to_lisp_data): Use it.
2727
27282013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2729
2730 * coding.c (Fdefine_coding_system_internal): Use AREF where
2731 argument is known to be a vector.
2732 * fns.c (Flocale_info): Likewise for ASET.
2733 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2734 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2735
27362013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2737
2738 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2739 height.
2740
2741 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2742 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2743 updateCollectionBehaviour.
2744
2745 * nsterm.m (NEW_STYLE_FS): Remove.
2746 (ns_last_use_native_fullscreen): New variable.
2747 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2748 (x_set_window_size): Do not take title bar and tool bar into account
2749 if isFullscreen returns YES.
2750 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2751 (check_native_fs): New function.
2752 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2753 (ns_term_init): Remove NEW_STYLE_FS.
2754 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2755 and tool bar if isFullscreen returns NO.
2756 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2757 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2758 with HAVE_NATIVE_FS.
2759 (window:willUseFullScreenPresentationOptions:): New method.
2760 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2761 Hide toolbar if not enabled (Bug#13444).
2762 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2763 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2764 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2765 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2766 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2767 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2768 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2769 (syms_of_nsterm): Add ns-use-native-fullscreen.
2770
27712013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2772
2773 * fileio.c (Qchoose_write_coding_system): Now static.
2774
27752013-02-04 Eli Zaretskii <eliz@gnu.org>
2776
2777 * xdisp.c (window_buffer_changed): region_showing can be negative,
2778 which still means region is being displayed.
2779 (redisplay_internal): Resurrect code that forced redisplay of the
2780 whole window when showing region and the mark has changed.
2781 Record the new mark position to allow redisplay optimizations.
2782 (display_line): If it->region_beg_charpos is non-zero, set the
2783 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2784
2785 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2786 not bitfield of 1 bit.
2787
27882013-02-03 Daniel Colascione <dancol@dancol.org>
2789
2790 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2791 daemon mode works on cygw32 when Emacs is installed and not just
2792 during development.
2793
27942013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2795
2796 Avoid file time stamp bug on MS-Windows (Bug#13149).
2797 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2798 as FAT32 doesn't update time stamps when truncating them.
2799 Also, check that a file time stamp is not a multiple of 100 ns;
2800 this should catch all instances of the problem on MS-Windows,
2801 as its native file system resolution is 100 ns or worse, and
2802 checking for a non-multiple of 100 ns should impose only a small
2803 overhead on systems with ns resolution.
2804
28052013-02-02 Eli Zaretskii <eliz@gnu.org>
2806
2807 Avoid encoding file names on MS-Windows when they need to be run
2808 through dostounix_filename.
2809 * w32.c (normalize_filename): Accept an additional argument
2810 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2811 downcase it even if w32-downcase-file-names is non-nil.
2812 (dostounix_filename): Accept an additional argument MULTIBYTE and
2813 pass it to normalize_filename.
2814 (emacs_root_dir): Adjust.
2815
2816 * msdos.h (dostounix_filename): Adjust prototype.
2817
2818 * w32.h (dostounix_filename): Adjust prototype.
2819
2820 * msdos.c (dostounix_filename): Accept an additional argument and
2821 ignore it.
2822 (init_environment): Adjust callers of dostounix_filename.
2823
2824 * fileio.c (Ffile_name_directory, file_name_as_directory)
2825 (directory_file_name, Fexpand_file_name)
2826 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2827 dostounix_filename.
2828 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2829 non-nil.
2830 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2831 variables, as egetenv is case-insensitive for DOS_NT.
2832
2833 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2834 with an encoded file name.
2835
2836 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2837 Adjust calls to dostounix_filename.
2838
2839 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2840
2841 * unexw32.c (unexec): Adjust call to dostounix_filename.
2842
2843 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2844
2845 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2846 dostounix_filename.
2847
2848 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2849 dostounix_filename.
2850
2851 * callproc.c (Fcall_process): Make sure program name in PATH and
2852 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2853 is passed to exec/spawnve, which fails unless the file-name
2854 encoding is UTF-8.
2855
2856 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2857 even if w32-quote-process-args is nil.
2858
28592013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2860
2861 Fix timestamp bug when write-region appends nothing (Bug#13149).
2862 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2863 the file's time stamp doesn't change if Emacs happens to write nothing
2864 to the file, and on a buggy file system this could cause Emacs to
2865 incorrectly infer that the file system doesn't have the bug.
2866 Avoid this problem by inhibiting the inference in this case.
2867
28682013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2869
2870 * window.h (struct window): Convert base_line_number, base_line_pos
2871 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2872 Convert region_showing member from Lisp_Object to bitfield.
2873 Remove sequence_number member. Adjust comments.
2874 * window.c (sequence_number): Remove.
2875 (make_window): Initialize column_number_displayed.
2876 * print.c (print_object): Follow the printed representation of
2877 frames and print window pointer to distinguish between windows.
2878 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2879 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2880 (wset_column_number_displayed, wset_region_showing): Remove.
2881 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2882 (try_scrolling, try_cursor_movement, redisplay_window)
2883 (try_window_reusing_current_matrix, try_window_id, display_line)
2884 (display_mode_lines, decode_mode_spec): Adjust users.
2885 * .gdbinit (pwinx): Do not print sequence_number.
2886
28872013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2888
2889 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2890 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2891 * dired.c: Include <fcntl.h>.
2892 (open_directory): New function, which uses open and fdopendir
2893 rather than opendir. DOS_NT platforms still use opendir, though.
2894 (directory_files_internal, file_name_completion): Use it.
2895 (file_attributes): New function, with most of the old Ffile_attributes.
2896 (directory_files_internal, Ffile_attributes): Use it.
2897 (file_attributes, file_name_completion_stat): First arg is now fd,
2898 not dir name. All uses changed. Use fstatat rather than lstat +
2899 stat.
2900 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2901 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2902 (emacs_readlinkat): New function, with much of the old
2903 Ffile_symlink_p, but with an fd argument for speed.
2904 It uses readlinkat rather than careadlinkatcwd, so that it
2905 need not assume the working directory.
2906 (Ffile_symlink_p): Use it.
2907 * filelock.c (current_lock_owner): Use emacs_readlinkat
2908 rather than emacs_readlink.
2909 * lisp.h (emacs_readlinkat): New decl.
2910 (READLINK_BUFSIZE, emacs_readlink): Remove.
2911 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2912 (emacs_norealloc_allocator, emacs_readlink): Remove.
2913 This stuff is moved to fileio.c.
2914 * w32.c (fstatat, readlinkat): New functions.
2915 (careadlinkat): Don't check that fd == AT_FDCWD.
2916 (careadlinkatcwd): Remove; no longer needed.
2917
29182013-01-31 Glenn Morris <rgm@gnu.org>
2919
2920 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2921 (Fwrite_region): Update for new choose_write_coding_system args.
2922 Move the last piece of choose_write_coding_system here. (Bug#13522)
2923 (syms_of_fileio): Add choose-write-coding-system.
2924
29252013-01-30 Eli Zaretskii <eliz@gnu.org>
2926
2927 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2928 (sys_close): Zero out the flags for the file descriptor before
2929 closing it. (Bug#13546)
2930
2931 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2932 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2933 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2934 DBCS. (Bug#13553)
2935
2936 * w32.c (w32_get_long_filename, init_environment, readlink):
2937 Support file names encoded in DBCS codepages.
2938 (readlink): Use the current file-name-coding-system, not the ANSI
2939 codepage, to decode and handle targets of symlinks.
2940
29412013-01-28 Eli Zaretskii <eliz@gnu.org>
2942
2943 * w32.c (opendir): Now accepts a 'const char *'.
2944
29452013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2946
2947 Remove obsolete redisplay code. See the discussion at
2948 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2949 * dispnew.c (preemption_period, preemption_next_check): Remove.
2950 (Vredisplay_preemption_period): Likewise.
2951 (update_frame, update_single_window, update_window, update_frame_1):
2952 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2953 used, following the 2012-06-22 change.
2954
29552013-01-25 Eli Zaretskii <eliz@gnu.org>
2956
2957 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2958
29592013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2960
2961 * font.c (num_fonts): Remove the leftover from old
2962 debugging code. Adjust comment style here and there.
2963 * insdel.c (insert_1): Remove.
2964 * lisp.h (insert_1): Remove prototype.
2965 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2966
29672013-01-25 Eli Zaretskii <eliz@gnu.org>
2968
2969 * w32.c (max_filename_mbslen): New function.
2970 (normalize_filename, readdir): Use it to detect locales where ANSI
2971 encoding of file names uses a double-byte character set (DBCS).
2972 If a DBCS encoding is used, advance by characters using
2973 CharNextExA, instead of incrementing a 'char *' pointer.
2974 Use _mbslwr instead of _strlwr. (Bug#13515)
2975
2976 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2977 request of memory reservation to 1.7GB. (Bug#13065)
2978
29792013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2980
2981 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2982 at check_extra_latin label. (Bug#13505)
2983
29842013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2985
2986 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2987 Avoid redundant calls to strlen.
2988
29892013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2990
2991 Drop async_visible and async_iconified fields of struct frame.
2992 This is possible because async input is gone; for details, see
2993 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2994 * frame.h (struct frame): Remove async_visible and async_iconified
2995 members, convert garbaged to unsigned bitfield. Adjust comments.
2996 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2997 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2998 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2999 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
3000 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
3001 * w32term.c: Ditto.
3002 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
3003 properly. Likewise for obscured.
3004 * xterm.c: Ditto.
3005 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
3006 properly.
3007 * nsterm.m: Ditto.
3008 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
3009
30102013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
3011
3012 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
3013 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
3014
30152013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
3016
3017 * xdisp.c (message2, message2_nolog): Remove functions.
3018 (message3, message3_nolog): Extract nbytes and multibyteness directly
3019 from the string. Change all callers.
3020 (message3_nolog): Don't set message_enable_multibyte since set_message
3021 will reset it anyway.
3022 (message1, message1_nolog): Use message3.
3023 (vmessage): Use a stack allocated buffer rather than f->message_buf.
3024 (with_echo_area_buffer): Remove last two arguments. Update all callers.
3025 (set_message): Drop all but the second arg, which has to be a string.
3026 (set_message_1): Simplify now that we know that a1 is NULL and the
3027 second arg is a string.
3028 * frame.h (struct frame): Remove `message_buf' field.
3029 Use glyphs_initialized_p instead.
3030 (FRAME_MESSAGE_BUF): Remove macro.
3031 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
3032 * lisp.h (message2, message2_nolog): Remove declarations.
3033 (message3, message3_nolog): Update declarations.
3034 * keyboard.c (read_char_minibuf_menu_text)
3035 (read_char_minibuf_menu_width): Remove vars.
3036 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
3037 to correctly handle multibyte strings.
3038 * frame.c (delete_frame): Don't free message_buf any more.
3039 * editfns.c (message_text, message_length): Remove vars.
3040 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
3041 * fileio.c (auto_save_error): Use message3 instead of message2.
3042 * dispnew.c (adjust_frame_message_buffer): Remove function.
3043
30442013-01-23 Eli Zaretskii <eliz@gnu.org>
3045
3046 * w32term.c (w32fullscreen_hook): Account correctly for the screen
3047 real estate used for the tool bar and the menu bar.
3048
30492013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
3050
3051 * insdel.c (prepare_to_modify_buffer): Force redisplay if
3052 hidden buffer is prepared to modification (Bug#13164).
3053
30542013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
3055
3056 * window.h (struct window): Change window_end_valid member from
3057 Lisp_Object to a bitfield. Adjust comments.
3058 (wset_window_end_valid): Remove.
3059 * window.c (adjust_window_count): Clear window_end_valid.
3060 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
3061 (Fwindow_line_height, set_window_buffer, Frecenter)
3062 (Fsplit_window_internal, Fdelete_other_windows_internal)
3063 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
3064 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
3065 * xdisp.c (check_window_end, reconsider_clip_changes)
3066 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
3067 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
3068 (find_first_unchanged_at_end_row, try_window_id): Likewise.
3069
30702013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
3071
3072 * xdisp.c (mark_window_display_accurate): Simplify the loop
3073 assuming that the only one of vchild, hchild or buffer window
3074 slots is non-nil. Call mark_window_display_accurate_1 for
3075 the leaf windows only.
3076 (mark_window_display_accurate_1): Always assume leaf window.
3077 Adjust comment.
3078
30792013-01-22 Paul Eggert <eggert@cs.ucla.edu>
3080
3081 * emacs.c (Qkill_emacs_hook): Now static.
3082
3083 * fileio.c (Finsert_file_contents): Simplify.
3084 Remove unnecessary assignments and tests.
3085
30862013-01-21 Eli Zaretskii <eliz@gnu.org>
3087
3088 * w32.c (acl_set_file): Don't test for errors unless
3089 set_file_security returns FALSE. Avoids spurious errors when
3090 saving files.
3091
30922013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
3093
3094 * fileio.c (Finsert_file_contents): Revert code introduced at
3095 2013-01-18 in favor of the simpler and generally better fix.
3096 Save stack space by removing 'buffer' and reusing 'read_buf'
3097 where appropriate.
3098
30992013-01-19 Paul Eggert <eggert@cs.ucla.edu>
3100
3101 * lisp.h (eabs): Define unconditionally (Bug#13419).
3102 The old "#if !defined (eabs)" was an unnecessary revenant of back
3103 when this macro was called "abs". Document 'eabs' better.
3104
31052013-01-19 Glenn Morris <rgm@gnu.org>
3106
3107 * fns.c (Frandom): Doc fix.
3108
31092013-01-19 Eli Zaretskii <eliz@gnu.org>
3110
3111 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
3112 segfault when there are lots of overlays.
3113
3114 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
3115 when there are lots of overlays.
3116 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
3117 for the details and a way to reproduce.
3118
31192013-01-19 Paul Eggert <eggert@cs.ucla.edu>
3120
3121 * fileio.c: Use O_APPEND to append.
3122 This corresponds better to the natural interpretation of "append",
3123 and avoids the need to open the output file twice, or to invoke
3124 lseek when APPEND is neither nil nor a number.
3125 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
3126 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
3127 file possibly twice, and lseeking to its end; this avoids the
3128 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
3129 at the same time: the combination is never needed and apparently
3130 it doesn't work with DOS_NT.
3131
3132 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
3133 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
3134
3135 Allow floating-point file offsets.
3136 Problem reported by Vitalie Spinu in
3137 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
3138 * fileio.c (emacs_lseek): Remove.
3139 (file_offset): New function.
3140 (Finsert_file_contents, Fwrite_region): Use it.
3141
31422013-01-19 Chong Yidong <cyd@gnu.org>
3143
3144 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
3145 aborting on Fsignal (Bug#13289).
3146
31472013-01-19 Eli Zaretskii <eliz@gnu.org>
3148
3149 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
3150 set_file_security as failure due to insufficient privileges.
3151 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3152 (fstat): Return owner and group like 'stat' and 'lstat' do.
3153
31542013-01-19 Paul Eggert <eggert@cs.ucla.edu>
3155
3156 Work around bug in CIFS and vboxsf file systems (Bug#13149).
3157 The bug was observed on Ubuntu operating inside a virtual machine,
3158 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
3159 The workaround introduces a race condition on non-buggy hosts,
3160 but it's an unlikely race and anyway there's a nearly identical
3161 nearby race that can't be fixed.
3162 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
3163 New static vars.
3164 (Fwrite_region): Test for file system time stamp bug.
3165 (init_fileio): New function.
3166 * lisp.h (init_fileio): Declare it.
3167 * emacs.c (main): Call it.
3168
3169 * fileio.c (Finsert_file_contents): Simplify new diagnostic
3170 and make it more consistent with other stat-failure diagnostics.
3171
31722013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
3173
3174 Fix crash when inserting data from non-regular files.
3175 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
3176 for the error description produced by valgrind.
3177 * fileio.c (read_non_regular): Rename to read_contents.
3178 Free Lisp_Save_Value object used to pass parameters.
3179 (read_non_regular_quit): Rename to read_contents_quit.
3180 (Finsert_file_contents): Redesign internal file reading loop to adjust
3181 gap and end positions after each read and so help make_gap to work
3182 properly. Do not signal an I/O error too early and so do not leave
3183 not yet decoded characters in a buffer, which was the reason of
3184 redisplay crash. Use list2 to build return value. Adjust comments.
3185
31862013-01-17 Paul Eggert <eggert@cs.ucla.edu>
3187
3188 Close a race when statting and reading files (Bug#13149).
3189 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
3190 This avoids a race if the file is renamed between stat and open.
3191 This race is not the problem originally noted in Bug#13149;
3192 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
3193
31942013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
3195
3196 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
3197 objects, related functions and macros.
3198 (make_save_value): Adjust prototype.
3199 (make_save_pointer): New prototype.
3200 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
3201 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
3202 * alloc.c (format_save_value): Rename to make_save_value.
3203 (make_save_pointer): New function.
3204 (record_xmalloc): Use make_save_pointer.
3205 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
3206 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
3207 Change users of make_save_value to make_save_pointer.
3208 Likewise for format_save_value and make_save_value.
3209
32102013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
3211
3212 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
3213 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
3214 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
3215 debugging stubs.
3216
32172013-01-15 Paul Eggert <eggert@cs.ucla.edu>
3218
3219 * alloc.c (free_save_value): Now static.
3220
32212013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3222
3223 * keymap.c (map_keymap_internal): Use format_save_value.
3224 (map_keymap_char_table_item): Adjust accordingly.
3225 * fileio.c (non_regular_fd, non_regular_inserted)
3226 (non_regular_nbytes): Remove.
3227 (Finsert_file_contents): Convert trytry to ptrdiff_t.
3228 Use format_save_value to pass parameters to read_non_regular.
3229 (read_non_regular): Use XSAVE_ macros to extract parameters.
3230 Adjust comment.
3231 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
3232 format_save_value.
3233 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
3234
32352013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3236
3237 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
3238 extraction from any Lisp_Save_Value slot. Add type checking.
3239 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
3240 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
3241 * xselect.c: All users changed.
3242
32432013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
3244
3245 Some convenient bits to deal with Lisp_Save_Values.
3246 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
3247 (allocate_misc): Remove prototype.
3248 (format_save_value): New prototype.
3249 * alloc.c (allocate_misc): Revert back to static.
3250 (format_save_value): New function to build Lisp_Save_Value
3251 object with the specified internal structure.
3252 (make_save_value): Reimplement using format_save_value.
3253 * editfns.c (save_excursion_save): Use format_save_value.
3254 (save_excursion_restore): Use XSAVE_OBJECT.
3255
32562013-01-14 Paul Eggert <eggert@cs.ucla.edu>
3257
3258 Avoid needless casts with XSAVE_POINTER.
3259 * alloc.c (mark_object) [GC_MARK_STACK]:
3260 * dired.c (directory_files_internal_unwind):
3261 * fileio.c (do_auto_save_unwind):
3262 * gtkutil.c (pop_down_dialog):
3263 * keymap.c (map_keymap_char_table_item):
3264 * lread.c (load_unwind):
3265 * nsmenu.m (pop_down_menu):
3266 * print.c (print_object) [GC_MARK_STACK]:
3267 * xfns.c (clean_up_file_dialog):
3268 * xmenu.c (cleanup_widget_value_tree):
3269 Omit casts between XSAVE_POINTER and a pointer type.
3270
32712013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3272
3273 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
3274 * eval.c (eval_sub): Protect `form' from being GCed before its
3275 car and cdr becomes protected with the backtrace entry.
3276
32772013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
3278
3279 Make Lisp_Save_Value more versatile storage for up to four objects.
3280 * lisp.h (toplevel): Enumeration to describe types of saved objects.
3281 (struct Lisp_Save_Value): New layout. Adjust comments.
3282 (XSAVE_POINTER): New macro.
3283 (XSAVE_INTEGER): Likewise.
3284 (allocate_misc): Add prototype.
3285 (free_misc): Likewise.
3286 * alloc.c (allocate_misc): Now global.
3287 (free_misc): Likewise. Adjust comment.
3288 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
3289 (free_save_value): Likewise.
3290 (mark_object): Likewise.
3291 * editfns.c (save_excursion_save): Pack everything within
3292 Lisp_Save_Value and so avoid xmalloc.
3293 (save_excursion_restore): Adjust to match new layout. Use free_misc
3294 because we do not allocate extra memory any more. Add eassert.
3295 * print.c (print_object): New code to print Lisp_Save_Value. Do not
3296 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
3297 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
3298 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
3299 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
3300
33012013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3302
3303 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
3304 (nsfont_draw): Remove disabling of LCD smoothing.
3305 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
3306 Bug#11484 with LCD smoothing on.
3307
33082013-01-13 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 Fix SIGDANGER handlers, for AIX (Bug#13408).
3311 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
3312 Move handlers here from emacs.c; they were out of place.
3313
33142013-01-11 Jan Djärv <jan.h.d@swipnet.se>
3315
3316 * xterm.c (syms_of_xterm): Adjust documentation for
3317 scroll-bar-adjust-thumb-portion.
3318
33192012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
3320
3321 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
3322 determine whether scroll bar thumb size should be adjusted or not.
3323 Use variable for MOTIF.
3324
3325 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for GTK.
3326
33272013-01-13 Jan Djärv <jan.h.d@swipnet.se>
3328
3329 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
3330 event is generated.
3331 (doCommandBySelector:): Set processingCompose to NO.
3332
3333 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
3334 Remove check for fkeys count > zero, block/unblock fixes the real bug.
3335 (nsfont_list_family): Add block/unblock_input calls.
3336 (nsfont_open): Move block_input earlier. Add unblock_input before early
3337 return.
3338 (nsfont_draw): Add block/unblock_input calls.
3339
33402013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
3341
3342 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
3343 for old_charpos and old_bytepos.
3344
33452013-01-12 Paul Eggert <eggert@cs.ucla.edu>
3346
3347 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
3348 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
3349 Clear tzvalbuf_in_environ if this workaround is in effect.
3350 Problem and fix reported by Kazuhiro Ito.
3351
33522013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
3353
3354 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
3355 Fix ambiguous doc string cross-reference(s).
3356
3357 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
3358 doc string cross-reference(s).
3359
3360 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
3361 string cross-reference(s).
3362
33632013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
3364
3365 Avoid unnecessary byte position calculation for the gap movement.
3366 Since all users of move_gap do CHAR_TO_BYTE for other purposes
3367 anyway, all of them should use move_gap_both instead.
3368 * lisp.h (move_gap): Remove prototype.
3369 * insdel.c (move_gap): Remove.
3370 (move_gap_both): Add eassert.
3371 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
3372 * xml.c (parse_region): Likewise.
3373
33742013-01-11 Paul Eggert <eggert@cs.ucla.edu>
3375
3376 emacsclient -t should not suspend Emacs server (Bug#13387)
3377 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
3378 New functions.
3379 * term.c (init_tty): Use them instead of rolling our own code.
3380 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
3381 switches from 'signal' to 'pthread_sigmask', which is safer in
3382 multithreaded applications.
3383 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
3384 which has already arranged for that.
3385 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
3386 This is the main part of the bug fix.
3387
33882013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
3389
3390 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
3391 x_last_font_name (Bug#13403).
3392
33932013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
3394
3395 Omit buffer_slot_type_mismatch and use generic predicates to enforce
3396 the type of per-buffer values where appropriate.
3397 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
3398 predicate, which is how it's really used now. Adjust comment.
3399 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
3400 * buffer.c (buffer_slot_type_mismatch): Remove.
3401 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3402 predicate. Adjust comment.
3403 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3404 fill-column, left-margin, tab-width, buffer-saved-size,
3405 left-margin-width, right-margin-width, left-fringe-width,
3406 right-fringe-width, scroll-bar-width and buffer-display-count.
3407 Use Qstringp for default-directory, buffer-file-name,
3408 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3409 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3410 line-spacing.
3411 * data.c (store_symval_forwarding): Adjust to call the predicate.
3412
34132013-01-09 Juanma Barranquero <lekktu@gmail.com>
3414
3415 * w32.c (get_name_and_id, acl_set_file):
3416 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3417
34182013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3419
3420 * lisp.h (make_gap_1): New prototype.
3421 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3422 gap size values.
3423 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3424 naming convention.
3425 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
3426 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
3427 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3428 (make_gap_1): New function to adjust the gap of any buffer.
3429 * coding.c (coding_alloc_by_making_gap): Use it.
3430 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3431 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3432
34332013-01-08 Juri Linkov <juri@jurta.org>
3434
3435 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3436 of (supports :underline (:style wave)). (Bug#13000)
3437
34382013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3439
3440 * undo.c (Fprimitive_undo): Move to simple.el.
3441 (syms_of_undo): Remove declarations for Sprimitive_undo.
3442
34432013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3444
3445 * keyboard.c (echo_add_key): Rename from echo_add_char.
3446
34472013-01-06 Chong Yidong <cyd@gnu.org>
3448
3449 * keyboard.c (echo_add_char): New function, factored out from
3450 echo_char. Don't add a space if the previous echo string was
3451 empty (Bug#13255).
3452 (echo_char): Use it.
3453 (read_key_sequence): When echoing mock input, ensure that the
3454 trailing dash is properly added.
3455
34562013-01-05 Eli Zaretskii <eliz@gnu.org>
3457
3458 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3459 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
3460 digits for buffer positions, before misalignment starts.
3461 Display "0" for integer "object" field.
3462 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3463 Display the newline glyph more unambiguously.
3464
34652013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3466
3467 * nsterm.m (ns_draw_underwave):
3468 * w32term.c (w32_draw_underwave):
3469 * xterm.c (x_draw_underwave): Make underwave look more triangular
3470 and also degrade gracefully for small fonts. (Bug#13000)
3471
3472 * nsterm.m (ns_draw_text_decoration):
3473 * w32term.c (x_draw_glyph_string):
3474 * xterm.c (x_draw_glyph_string): Don't use previous underline
3475 thickness and position if previous underline type is underwave.
3476
34772013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3478
3479 * fileio.c (Ffile_acl): Undocument return format.
3480
34812013-01-02 Glenn Morris <rgm@gnu.org>
3482
3483 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3484
34852013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3486
3487 Simplify via eabs.
3488 * dired.c (file_name_completion):
3489 * doc.c (get_doc_string):
3490 * floatfns.c (round2):
3491 * font.c (font_score, font_delete_unmatched):
3492 * fringe.c (compute_fringe_widths):
3493 * lread.c (read_list):
3494 * minibuf.c (Ftry_completion):
3495 * term.c (tty_ins_del_lines):
3496 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3497 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3498
34992012-12-31 Eli Zaretskii <eliz@gnu.org>
3500
3501 * w32.c (unsetenv): Set up the string passed to _putenv
3502 correctly.
3503 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
3504 for the bug this caused.
3505
35062012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3507
3508 * coding.c (Qmac): Now static.
3509
35102012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3511
3512 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3513 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3514 handlebox_widget. Set toolbar_in_hbox to false/true, set
3515 toolbar_is_packed to true.
3516 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3517 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3518 Show all on TOOLBAR_TOP_WIDGET.
3519 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3520 by TOOLBAR_TOP_WIDGET.
3521 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3522 Check toolbar_is_packed.
3523 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3524 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3525 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3526 false.
3527 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3528 (xg_update_menubar): Update title only if
3529 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3530 (xg_update_submenu): Skip tearoff only if
3531 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3532 (xg_initialize): Initialize xg_detached_menus only if
3533 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3534
3535 * xterm.h (struct x_output): Surround handlebox_widget with
3536 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3537 toolbar_in_hbox is bool.
3538
35392012-12-30 Andreas Schwab <schwab@linux-m68k.org>
3540
3541 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3542 (LIBS_GNUSTEP): Define.
3543 (LIBES): Add $(LIBS_GNUSTEP).
3544 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3545
35462012-12-30 Eli Zaretskii <eliz@gnu.org>
3547
3548 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3549 continuation glyph on a TTY with an indication of an empty line.
3550 (Bug#13277)
3551
35522012-12-29 Eli Zaretskii <eliz@gnu.org>
3553
3554 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3555 file's SELinux context or ACLs successfully set, nil otherwise.
3556 (Bug#13298)
3557 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
3558
3559 * w32proc.c (reader_thread): Avoid passing NULL handles to
3560 SetEvent and WaitForSingleObject.
3561
35622012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3563
3564 Port EXTERNALLY_VISIBLE to Clang 3.2.
3565 * conf_post.h (__has_attribute): New macro.
3566 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3567
35682012-12-27 Glenn Morris <rgm@gnu.org>
3569
3570 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3571 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3572
35732012-12-27 Eli Zaretskii <eliz@gnu.org>
3574
3575 * fileio.c (file_name_as_directory, directory_file_name):
3576 Accept an additional argument MULTIBYTE to indicate whether the input C
3577 came from a multibyte or a unibyte Lisp string; all callers
3578 adjusted. Don't assume the input string is always multibyte.
3579 (Bug#13262)
3580 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3581 don't ENCODE_FILE them, and return a unibyte string if the input
3582 was unibyte.
3583 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3584 don't assume the input strings will always be multibyte. If the
3585 input strings are multibyte, decode strings obtained from C
3586 library functions.
3587
35882012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3589
3590 * lisp.h (toplevel): Add two notices to the comment about
3591 defining a new Lisp data type.
3592 * print.c (print_object): If Lisp_Save_Value object's pointer
3593 is the address of a memory area containing Lisp_Objects, try
3594 to print them.
3595 * alloc.c (valid_lisp_object_p): Adjust comment.
3596
35972012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3598
3599 * keyboard.c (record_asynch_buffer_change): Initialize an event
3600 only if it's really needed.
3601 * frame.h (enum output_method): Remove output_mac member since
3602 it's a leftover from the deleted code.
3603 * frame.c (Fframep): Adjust user here ...
3604 * terminal.c (Fterminal_live_p): ... and here.
3605 * coding.c (Qmac): Now here because it's only used to denote
3606 end-of-line encoding type.
3607 (syms_of_coding): DEFSYM it.
3608 * frame.h (Qmac): Remove duplicated declaration.
3609
36102012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3611
3612 * window.c (select_window_1): Now static, since it's used only here.
3613
36142012-12-25 Eli Zaretskii <eliz@gnu.org>
3615
3616 * window.c (window_body_cols): Subtract display margins from the
3617 window body width on TTYs as well. See
3618 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3619 for the original report.
3620
36212012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3622
3623 * xdisp.c (redisplay_window): Remove inner local variable
3624 because the outer shadowed one has the same meaning.
3625 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3626 set but never used.
3627 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3628 (xg_create_tool_bar): Adjust users.
3629
36302012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3631
3632 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3633 * buffer.c (Fget_buffer_create): Use it to set compact field of
3634 struct buffer_text to avoid accessing an uninitialized value
3635 when compact_buffer is called for the first time.
3636 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3637 (Fset_buffer_modified_p): Use buffer_window_count to check
3638 whether the buffer is displayed in some window.
3639 * xdisp.c (message_dolog): Likewise.
3640
36412012-12-23 Eli Zaretskii <eliz@gnu.org>
3642
3643 * w32.c (acl_set_file): If setting the file security descriptor
3644 fails, and the new DACL is identical to the existing one, silently
3645 return success. This fixes problems for users backing up their
3646 own files without having the necessary privileges for setting
3647 security descriptors.
3648
3649 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3650 values.
3651 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3652 after WaitForSingleObject returns normally. This expedites reader
3653 thread shutdown when delete_child triggers it.
3654 (reap_subprocess): More accurate commentary for why we call
3655 delete_child only when cp->fd is negative.
3656
3657 * w32.c (sys_close): Do not call delete_child on a subprocess
3658 whose handle is not yet closed. Instead, set its file descriptor
3659 to a negative value, so that reap_subprocess will call
3660 delete_child on that subprocess when its SIGCHLD arrives.
3661 This avoids closing handles used for communications between sys_select
3662 and reader_thread, which doesn't give sys_select a chance to
3663 notice that the process exited and invoke the SIGCHLD handler for
3664 it.
3665
36662012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3667
3668 * nsfns.m (Fns_do_applescript): Run event loop until script has
3669 been executed (Bug#12969).
3670 (ns_run_ascript): Chech as_script for nil, set to nil after
3671 executing script.
3672
36732012-12-22 Martin Rudalics <rudalics@gmx.at>
3674
3675 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3676
36772012-12-22 Eli Zaretskii <eliz@gnu.org>
3678
3679 * w32term.c (w32fullscreen_hook): New function.
3680 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3681
36822012-12-21 Eli Zaretskii <eliz@gnu.org>
3683
3684 * fileio.c (Finsert_file_contents): Doc fix.
3685
3686 * w32proc.c (new_child, delete_child, find_child_pid): For a
3687 subprocess, consider its slot being in use as long as its process
3688 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3689 slot when a new process is started immediately after killing
3690 another one, without waiting enough time for the first process to
3691 be reaped and resources allocated for it be orderly freed.
3692 (Bug#13086)
3693 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3694
36952012-12-21 Chong Yidong <cyd@gnu.org>
3696
3697 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3698
3699 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3700
37012012-12-21 Eli Zaretskii <eliz@gnu.org>
3702
3703 * w32.c (get_name_and_id): Always pass NULL as the first argument
3704 of lookup_account_sid. Avoids crashes with UNC file names that
3705 refer to DFS domains, not to specific machine names. (Bug#12621)
3706 Remove now unused argument FNAME; all callers changed.
3707 (get_file_owner_and_group): Remove now unused argument FNAME; all
3708 callers changed.
3709
37102012-12-21 Chong Yidong <cyd@gnu.org>
3711
3712 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3713 error for invalid chars, don't check for a nil return value.
3714
37152012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3716
3717 Avoid calls to CHAR_TO_BYTE if byte position is known.
3718 * editfns.c (make_buffer_string_both): Use move_gap_both.
3719 (Fbuffer_string): Use make_buffer_string_both.
3720 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3721 Adjust comment.
3722 (buf_bytepos_to_charpos): Likewise.
3723 (charpos_to_bytepos): Remove.
3724 * fileio.c (Finsert_file_contents): Use move_gap_both.
3725 * search.c (Freplace_match): Likewise.
3726 * process.c (process_send_region): Likewise. Use convenient
3727 names for byte positions.
3728 * lisp.h (charpos_to_bytepos): Remove prototype.
3729 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3730 * insdel.c (move_gap): Likewise.
3731
37322012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3733
3734 * xdisp.c (redisplay_internal): Remove now-unused local.
3735
37362012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3737
3738 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3739 (redisplay_internal): Don't bother selecting the frame to get the
3740 proper value of frame-local variables (bug#13225).
3741
37422012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3743
3744 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3745 Rename 4th argument since it may be buffer or string. Adjust comment.
3746 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3747
37482012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3749
3750 * coding.c (Fdetect_coding_region): Do not check start and end with
3751 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3752 (code_convert_region): Likewise.
3753
37542012-12-18 Eli Zaretskii <eliz@gnu.org>
3755
3756 * w32.c (acl_get_file, acl_set_file): Run the file name through
3757 map_w32_filename, and resolve any symlinks in the file name, like
3758 Posix platforms do.
3759 (acl_set_file): Call revert_to_self, if any privileges were
3760 enabled.
3761
37622012-12-17 Juanma Barranquero <lekktu@gmail.com>
3763
3764 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3765 ($(BLD)/w32.$(O)): Update dependencies.
3766
37672012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3768
3769 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3770 propagate redisplay's scrolling (if any) to the right window.
3771 (redisplay_internal): Use ensure_selected_frame.
3772 (display_mode_lines): Complete last fix.
3773 * window.c (select_window_1): New func, extracted from select_window.
3774 (select_window): Use it.
3775 * window.h (select_window_1): Declare.
3776
37772012-12-17 Eli Zaretskii <eliz@gnu.org>
3778
3779 Emulate Posix ACL APIs on MS-Windows.
3780 * w32.c: Include sddl.h and sys/acl.h.
3781 (SDDL_REVISION_1): Define if not already defined.
3782 (g_b_init_get_security_descriptor_dacl)
3783 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3784 (g_b_init_is_valid_security_descriptor)
3785 (g_b_init_set_file_security): New static flags.
3786 (globals_of_w32): Initialize them to zero.
3787 (SetFileSecurity_Name): New string constant.
3788 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3789 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3790 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3791 (IsValidSecurityDescriptor_Proc): New typedefs.
3792 (get_file_security, get_security_descriptor_owner)
3793 (get_security_descriptor_group): Set errno to ENOTSUP.
3794 (set_file_security, get_security_descriptor_dacl)
3795 (is_valid_security_descriptor, convert_sd_to_sddl)
3796 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3797 (acl_free, acl_get_file, acl_set_file): New functions.
3798
3799 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3800
38012012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3802
3803 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3804 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3805 for some of that bug's symptoms can now cause Emacs to abort.
3806 Remove the workaround.
3807 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3808 The bug that caused SIGCHLD to get lost has been fixed, and the
3809 workaround for it can now cause Emacs to abort.
3810
38112012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3812
3813 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3814 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3815 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3816
38172012-12-16 Romain Francoise <romain@orebokech.com>
3818
3819 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3820 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3821 and copy ACL entries of file in addition to SELinux context if set.
3822 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3823
3824 * Makefile.in (LIBACL_LIBS): New macro.
3825 (LIBES): Use it.
3826
38272012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3828
3829 * fileio.c (internal_delete_file): Use bool for boolean.
3830
38312012-12-15 Eli Zaretskii <eliz@gnu.org>
3832
3833 Fix bug #13079 on MS-Windows with temp files not being deleted.
3834 * w32.h (_child_process): New members input_file and
3835 pending_deletion.
3836 (register_child): First argument is now pid_t.
3837 (record_infile, record_pending_deletion): New prototypes.
3838
3839 * w32proc.c (new_child): Initialize input_file and
3840 pending_deletion members of the child.
3841 (delete_child): Delete the child's temporary input file, if any,
3842 that is pending deletion.
3843 (register_child): First argument is now pid_t.
3844 (record_infile, record_pending_deletion): New functions.
3845 (reap_subprocess): Fix a typo in DebPrint string.
3846 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3847
3848 * fileio.c (internal_delete_file): Return an int again: non-zero
3849 if delete-file succeeds, zero otherwise.
3850
3851 * lisp.h (internal_delete_file): Adjust prototype.
3852
3853 * callproc.c (Fcall_process): Don't overwrite infile with result
3854 of DECODE_FILE.
3855 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3856 asynchronous subprocess, record the name of the input file name,
3857 if any.
3858 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3859 delete the file, record it as pending deletion when the subprocess
3860 exits.
3861
38622012-12-14 Eli Zaretskii <eliz@gnu.org>
3863
3864 * editfns.c [HAVE_PWD_H]: Include grp.h.
3865
3866 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3867
38682012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3869
3870 Fix permissions bugs with setgid directories etc. (Bug#13125)
3871 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3872 to mark it as a placeholder. The old value was often wrong.
3873 The only user of this attribute has been changed to use
3874 file-ownership-preserved-p instead, with its new group arg.
3875 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3876
38772012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3878
3879 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3880 Keep selected_window and selected_frame in sync.
3881
38822012-12-14 Eli Zaretskii <eliz@gnu.org>
3883
3884 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3885 try to get accurate owner and group information from NT file
3886 security APIs. This is to make most callers of 'stat' and
3887 'lstat', which don't need that information, much faster.
3888
3889 * dired.c (Ffile_attributes) [WINDOWSNT]:
3890 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3891 owner and group information from 'lstat'.
3892
38932012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3894
3895 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3896 as that confuses set-auto-coding, so insist on the head-read
3897 returning the full 1024 bytes. Let lseek compute the tail offset;
3898 less work for us. Do not ignore I/O errors when reading the tail.
3899
3900 * xdisp.c: Minor style fixes.
3901 (init_iterator): Hoist assignment out of if-expression.
3902 (markpos_of_region): Callers now test for sign, not for -1.
3903
39042012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3905
3906 Minor redisplay optimization when the region length is zero.
3907 * xdisp.c (markpos_of_region): New function.
3908 (init_iterator): Do not highlight the region of zero length.
3909 (redisplay_window): Check whether the region is of non-zero length.
3910 (try_cursor_movement): Allow if the region length is zero.
3911 (try_window_reusing_current_matrix, try_window_id): Likewise.
3912
39132012-12-13 Eli Zaretskii <eliz@gnu.org>
3914
3915 * search.c (search_buffer): Check the inverse translations of each
3916 character in pattern when the buffer being searched is unibyte.
3917 (Bug#13084)
3918
39192012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3920
3921 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3922 files, fixing a regression from 24.2.
3923 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3924
39252012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3926
3927 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3928 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3929 Remove unnecessary S_ISLNK test, as (contra the comments) this
3930 function can't copy symlinks. Improve quality of error message
3931 when attempting to copy files that are neither regular files nor
3932 directories.
3933
39342012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3935
3936 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3937 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3938 * window.c (Frecenter):
3939 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3940 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3941
39422012-12-12 Daniel Colascione <dancol@dancol.org>
3943
3944 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3945 the dumped Emacs is not a sparse file, greatly improving Cygwin
3946 "make bootstrap" performance.
3947
39482012-12-11 Michael Albinus <michael.albinus@gmx.de>
3949
3950 * inotify.c (inotify_callback): Generate an Emacs event for every
3951 incoming inotify event.
3952
39532012-12-11 Eli Zaretskii <eliz@gnu.org>
3954
3955 * xdisp.c (handle_face_prop): Fix logic of computing
3956 it->start_of_box_run_p.
3957 (append_space_for_newline): If the glyph row is R2L, reset the
3958 iterator's end_of_box_run_p flag before prepending the space glyph.
3959 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3960 iterator's start_of_box_run_p flag before prepending the stretch.
3961 (append_glyph, produce_image_glyph, append_composite_glyph)
3962 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3963 left_box_line_p and right_box_line_p flags of the glyph for R2L
3964 glyph rows. (Bug#13011)
3965
39662012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3967
3968 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3969 if changed buffer is not shown in a window.
3970 * insdel.c (prepare_to_modify_buffer): Likewise.
3971 * window.c (replace_buffer_in_windows_safely): Do nothing
3972 if buffer is not shown in a window.
3973 (Fforce_window_update): Likewise if string or buffer argument
3974 is passed.
3975
39762012-12-11 Eli Zaretskii <eliz@gnu.org>
3977
3978 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3979 encoded_file_name, which is what it is.
3980
39812012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3982
3983 Consistently use marker_position and marker_byte_position.
3984 * fringe.c (Ffringe_bitmaps_at_pos):
3985 * indent.c (Fvertical_motion):
3986 * insdel.c (prepare_to_modify_buffer):
3987 * keyboard.c (make_lispy_position):
3988 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3989 (window_scroll_pixel_based, displayed_window_lines)
3990 (Fset_window_configuration):
3991 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3992 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3993 Replace direct access to marker fields with calls
3994 to marker_position and/or marker_byte_position.
3995
39962012-12-11 Juanma Barranquero <lekktu@gmail.com>
3997
3998 * makefile.w32-in (SIG2STR_H): New macro.
3999 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
4000 ($(BLD)/w32notify.$(O)): Update dependencies.
4001
40022012-12-10 Daniel Colascione <dancol@dancol.org>
4003
4004 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
4005 Windows file notification functionality unless WINDOWSNT.
4006
4007 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
4008 declarations.
4009
4010 * w32fns.c (cache_system_info): Initialize the global hinst
4011 variable here so various initialization calls DTRT.
4012
4013 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
4014 (hinst): Remove unneeded extern declaration.
4015 (_start): Remove initialization of above variables; remove
4016 initialization of hinst, as cache_system_info now does that.
4017
4018 * emacs.c (main): Call cache_system_info early in startup; we
4019 previously weren't calling it in Cygwin builds.
4020
4021 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
4022 Teach the autoconf build system how to compile a Windows resource file
4023 and link it to Emacs.
4024
40252012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
4026
4027 Per-buffer window counters.
4028 * buffer.h (struct buffer): New member window_count.
4029 (buffer_window_count): New function.
4030 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
4031 Initialize window_count.
4032 (Fkill_buffer): Verify window_count for the buffer being killed.
4033 (modify_overlay): Do not force redisplay if buffer is not shown
4034 in any window.
4035 (init_buffer_once): Initialize window_count for buffer_defaults
4036 and buffer_local_symbols.
4037 * window.h (buffer_shared): Remove declaration.
4038 (wset_buffer): Convert from inline ...
4039 * window.c (wset_buffer): ... to an ordinary function.
4040 (adjust_window_count): New function.
4041 (make_parent_window): Use it.
4042 * xdisp.c (buffer_shared): Remove.
4043 (redisplay_internal, redisplay_window): Adjust users.
4044 (buffer_shared_and_changed): Use per-buffer window counter.
4045
40462012-12-10 Eli Zaretskii <eliz@gnu.org>
4047
4048 Support for filesystem notifications on MS-Windows.
4049 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
4050 and this is a TTY frame, signal the caller that keyboard input is
4051 available.
4052
4053 * w32xfns.c (drain_message_queue): Now returns an int: an
4054 indication whether any WM_EMACS_FILENOTIFY messages were found in
4055 the queue.
4056
4057 * w32inevt.c (handle_file_notifications): New function.
4058 (w32_console_read_socket): Call it to process file notifications.
4059
4060 * w32console.c (initialize_w32_display): Record the main thread ID
4061 in dwMainThreadId.
4062
4063 * deps.mk (inotify.o): New dependency list.
4064
4065 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
4066
4067 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
4068 (WM_EMACS_END): Bump value by 1.
4069 (notification_buffer_in_use, file_notifications)
4070 (notifications_size, notifications_desc): Declare.
4071 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
4072 Add prototypes.
4073
4074 * w32term.c (lispy_file_action, queue_notifications): New functions.
4075 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
4076 <Qrenamed_to>: New symbols.
4077 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
4078
4079 * w32notify.c: New file, implements file event notifications for
4080 MS-Windows.
4081
4082 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
4083 by posting it to the w32_read_socket queue.
4084
4085 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
4086
4087 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
4088 (GLOBAL_SOURCES): Add w32notify.c
4089 ($(BLD)/w32notify.$(O)): New set of dependencies.
4090
4091 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
4092
4093 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
4094 Handle FILE_NOTIFY_EVENT.
4095 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
4096 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
4097 w32notify-handle-event by default.
4098
4099 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
4100 syms_of_w32notify.
4101
41022012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
4103
4104 Support for filesystem notifications on GNU/Linux via inotify.
4105 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
4106
4107 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
4108
4109 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
4110 (syms_of_keyboard): DEFSYM it.
4111 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
4112 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
4113 Qfile_inotify events.
4114 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
4115 special-event-map to inotify-handle-event.
4116
4117 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
4118
4119 * Makefile.in (base_obj): Add inotify.o.
4120
4121 * inotify.c: New file.
4122
41232012-12-10 Jan Djärv <jan.h.d@swipnet.se>
4124
4125 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
4126
41272012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
4128
4129 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
4130 DWORD_PTR, for compatibility with 64-bit builds.
4131
4132 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
4133 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
4134 (system_process_attributes): Use SIZE_T rather than DWORD, for
4135 compatibility with 64-bit builds.
4136
41372012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
4138
4139 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
4140
41412012-12-10 Eli Zaretskii <eliz@gnu.org>
4142
4143 * indent.c (Fvertical_motion): If a display string will be
4144 displayed on the left or the right margin, don't consider it as a
4145 factor in cursor positioning. (Bug#13108)
4146
41472012-12-10 Martin Rudalics <rudalics@gmx.at>
4148
4149 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
4150
41512012-12-10 Paul Eggert <eggert@cs.ucla.edu>
4152
4153 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
4154 for string length.
4155
41562012-12-08 Eli Zaretskii <eliz@gnu.org>
4157
4158 * w32.c (unsetenv): Return 0 if the input string is too long.
4159
41602012-12-08 Paul Eggert <eggert@cs.ucla.edu>
4161
4162 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
4163 * alloc.c (xputenv): New function.
4164 * dbusbind.c (Fdbus_init_bus):
4165 * emacs.c (main):
4166 * xterm.c (x_term_init):
4167 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
4168 * editfns.c (initial_tz): Move static var decl up.
4169 (tzvalbuf_in_environ): New static var.
4170 (init_editfns): Initialize these two static vars.
4171 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
4172 Save old TZ value on stack, if it's small.
4173 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
4174 instead, use xputenv+unsetenv to set and restore TZ.
4175 (environbuf): Remove static var. All uses removed.
4176 (Fset_time_zone_rule): Do not save TZ and environ;
4177 no longer needed here.
4178 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
4179 Move to inside set_time_zone_rule; they don't need file scope any more.
4180 (set_time_zone_rule): Maintain the TZ=value string separately.
4181 (syms_of_editfns): Don't initialize initial_tz;
4182 init_editfns now does it.
4183 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
4184 * lisp.h (xputenv): New decl.
4185
41862012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
4187
4188 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
4189
41902012-12-08 Eli Zaretskii <eliz@gnu.org>
4191
4192 * w32.c (unsetenv, sys_putenv): New functions.
4193
41942012-12-08 Chong Yidong <cyd@gnu.org>
4195
4196 * editfns.c (Finsert_char): Make the error message more
4197 informative (Bug#12992).
4198
41992012-12-08 Paul Eggert <eggert@cs.ucla.edu>
4200
4201 Simplify get_lim_data.
4202 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
4203 Remove USG and vlimit methods; no longer used these days.
4204 Add #error catchall just in case.
4205
4206 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
4207 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
4208 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
4209 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
4210 (deleted_pid_list, Fdelete_process, create_process)
4211 (record_child_status_change, handle_child_signal, deliver_child_signal)
4212 (init_process_emacs, syms_of_process):
4213 Assume SIGCHLD is defined.
4214 (parse_signal): Remove. All uses removed.
4215 (abbr_to_signal): New static function.
4216 (Fsignal_process): Use it to convert signal names to ints.
4217 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
4218 kill (getpgrp (), ...).
4219 (emacs_sigaction_init): Assume SIGCHLD is defined.
4220 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
4221 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
4222 * syssignal.h (EMACS_KILLPG): Remove.
4223 All uses replaced by 'kill' with a negative pid.
4224 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
4225 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
4226
42272012-12-07 Paul Eggert <eggert@cs.ucla.edu>
4228
4229 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
4230 This will cause a production Emacs to dump core instead of
4231 infinite-looping.
4232
42332012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4234
4235 * frame.c (make_frame): Do not set window's buffer to t.
4236 * window.c (Fsplit_window_internal): Likewise. Previously it was
4237 used to indicate that the window is being set up. Now we use
4238 set_window_buffer for all new windows, so the condition in ...
4239 (Fset_window_buffer): ... is always true and can be removed.
4240
42412012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
4242
4243 Convenient macro to check whether the buffer is hidden.
4244 * buffer.h (BUFFER_HIDDEN_P): New macro.
4245 * frame.c (make_frame): Use it. Adjust comment.
4246 * buffer.c (candidate_buffer): New function.
4247 (Fother_buffer, other_buffer_safely): Use it.
4248
42492012-12-06 Eli Zaretskii <eliz@gnu.org>
4250
4251 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
4252 if the child process is still running. Instead, exit the wait
4253 loop and return zero. (Bug#13086)
4254
42552012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4256
4257 * frame.h (x_char_width, x_char_height): Remove prototypes.
4258 * w32term.h (x_char_width, x_char_height): Likewise.
4259 * xfns.c (x_char_width, x_char_height): Remove.
4260 * w32fns.c (x_char_width, x_char_height): Likewise.
4261 * nsfns.c (x_char_width, x_char_height): Likewise.
4262 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
4263 all window frames.
4264 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
4265 * keyboard.c (command_loop_1): Remove prototype.
4266 (command_loop_2, top_level_1): Add static to match prototype.
4267
42682012-12-06 Paul Eggert <eggert@cs.ucla.edu>
4269
4270 Fix a recently-introduced delete-process race condition.
4271 * callproc.c, process.h (record_kill_process):
4272 New function, containing part of the old call_process_kill.
4273 (call_process_kill): Use it.
4274 This does not change call_process_kill's behavior.
4275 * process.c (Fdelete_process): Use record_kill_process to fix a
4276 race condition that could cause Emacs to lose track of a child.
4277
42782012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
4279
4280 Avoid code duplication between prev_frame and next_frame.
4281 * frame.c (candidate_frame): New function. Add comment.
4282 (prev_frame, next_frame): Use it. Adjust comment.
4283
42842012-12-06 Eli Zaretskii <eliz@gnu.org>
4285
4286 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
4287 fails, signal an error instead of continuing with an empty
4288 string. (Bug#13079)
4289 Encode expanded temp file pattern before passing it to mkstemp or
4290 mktemp.
4291
4292 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
4293 Encode the file name before passing it to dostounix_filename, in
4294 case it will downcase it (under w32-downcase-file-names).
4295 (Bug#12933)
4296
42972012-12-05 Paul Eggert <eggert@cs.ucla.edu>
4298
4299 Minor call-process cleanups.
4300 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
4301 at the same time as other platforms, to simplify analysis.
4302 No need for fd0_volatile since we have synch_process_fd.
4303 Avoid needless emacs_close; arg is always negative.
4304
43052012-12-04 Andreas Schwab <schwab@linux-m68k.org>
4306
4307 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
4308 processes.
4309
43102012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
4311
4312 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
4313 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
4314 and mouse_face_hidden members to a bitfields.
4315 * frame.h (struct frame): Remove set-but-not-used space_width member.
4316 (FRAME_SPACE_WIDTH): Remove.
4317 * nsterm.m, w32term.c, xterm.c: Adjust users.
4318 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
4319 member. Adjust users. Convert term_initted, delete_in_insert_mode,
4320 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
4321 members to a bitfields.
4322
43232012-12-03 Paul Eggert <eggert@cs.ucla.edu>
4324
4325 Don't let call-process be a zombie factory (Bug#12980).
4326 Fixing this bug required some cleanup of the signal-handling code.
4327 As a side effect, this change also fixes a longstanding rare race
4328 condition whereby Emacs could mistakenly kill unrelated processes,
4329 and it fixes a bug where a second C-g does not kill a recalcitrant
4330 synchronous process in GNU/Linux and similar platforms.
4331 The patch should also fix the last vestiges of Bug#9488,
4332 a bug which has mostly been fixed on the trunk by other changes.
4333 * callproc.c, process.h (synch_process_alive, synch_process_death)
4334 (synch_process_termsig, sync_process_retcode):
4335 Remove. All uses removed, to simplify analysis and so that
4336 less consing is done inside critical sections.
4337 * callproc.c (call_process_exited): Remove. All uses replaced
4338 with !synch_process_pid.
4339 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
4340 These take the role of what used to be in unwind-protect arg.
4341 All uses changed.
4342 (block_child_signal, unblock_child_signal):
4343 New functions, to avoid races that could kill innocent-victim processes.
4344 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
4345 (call_process_kill): Record killed processes as deleted, so that
4346 zombies do not clutter up the system. Do this inside a critical
4347 section, to avoid a race that would allow the clutter.
4348 (call_process_cleanup): Fix code so that the second C-g works again
4349 on common platforms such as GNU/Linux.
4350 (Fcall_process): Create the child process in a critical section,
4351 to fix a race condition. If creating an asynchronous process,
4352 record it as deleted so that zombies do not clutter up the system.
4353 Do unwind-protect for WINDOWSNT too, as that's simpler in the
4354 light of these changes. Omit unnecessary call to emacs_close
4355 before failure, as the unwind-protect code does that.
4356 * callproc.c (call_process_cleanup):
4357 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
4358 * process.c (record_deleted_pid): New function, containing
4359 code refactored out of Fdelete_process.
4360 (Fdelete_process): Use it.
4361 (process_status_retrieved): Remove. All callers changed to use
4362 child_status_change.
4363 (record_child_status_change): Remove, folding its contents into ...
4364 (handle_child_signal): ... this signal handler. Now, this
4365 function is purely a handler for SIGCHLD, and is not called after
4366 a synchronous waitpid returns; the synchronous code is moved to
4367 wait_for_termination. There is no need to worry about reaping
4368 more than one child now.
4369 * sysdep.c (get_child_status, child_status_changed): New functions.
4370 (wait_for_termination): Now takes int * status and bool
4371 interruptible arguments, too. Do not record child status change;
4372 that's now the caller's responsibility. All callers changed.
4373 Reimplement in terms of get_child_status.
4374 (wait_for_termination_1, interruptible_wait_for_termination):
4375 Remove. All callers changed to use wait_for_termination.
4376 * syswait.h: Include <stdbool.h>, for bool.
4377 (record_child_status_change, interruptible_wait_for_termination):
4378 Remove decls.
4379 (record_deleted_pid, child_status_changed): New decls.
4380 (wait_for_termination): Adjust to API changes noted above.
4381
4382 * bytecode.c, lisp.h (Qbytecode): Remove.
4383 No longer needed after 2012-11-20 interactive-p changes.
4384
43852012-12-03 Eli Zaretskii <eliz@gnu.org>
4386
4387 * xdisp.c (redisplay_window): If the cursor is visible, but inside
4388 the scroll margin, move point outside the margin. (Bug#13055)
4389
43902012-12-03 Jan Djärv <jan.h.d@swipnet.se>
4391
4392 * gtkutil.c (my_log_handler): New function.
4393 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
4394
43952012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4396
4397 * lisp.h (modify_region): Rename to...
4398 (modify_region_1): ...new prototype.
4399 * textprop.c (modify_region): Now static. Adjust users.
4400 * insdel.c (modify_region): Rename to...
4401 (modify_region_1): ...new function to work with current buffer.
4402 Adjust comment and users. Use true and false for booleans.
4403
44042012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4405
4406 * alloc.c (free_save_value): New function.
4407 (safe_alloca_unwind): Use it.
4408 * lisp.h (free_save_value): New prototype.
4409 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4410 Add comment.
4411 (save_excursion_restore): Adjust to match saved data structure.
4412 Use free_save_value to offload some work from GC. Drop obsolete
4413 #if 0 code.
4414
44152012-12-03 Chong Yidong <cyd@gnu.org>
4416
4417 * fileio.c (Vauto_save_list_file_name): Doc fix.
4418
44192012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
4420
4421 * w32fns.c: Remove prototype of atof.
4422 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
4423 builds.
4424 (file_dialog_callback): Make it UINT_PTR.
4425
4426 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4427 with 64-bit builds.
4428
4429 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4430 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4431 defined.
4432
44332012-12-03 Glenn Morris <rgm@gnu.org>
4434
4435 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
4436
44372012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4438
4439 Fix xpalloc confusion after memory is exhausted.
4440 * alloc.c (xpalloc): Comment fix.
4441 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4442 and signals an error, do not clear charset_table_size, as
4443 charset_table is still valid.
4444 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4445
4446 Use execve to avoid need to munge environ (Bug#13054).
4447 * callproc.c (Fcall_process):
4448 * process.c (create_process):
4449 Don't save and restore environ; no longer needed.
4450 * callproc.c (child_setup):
4451 Use execve, not execvp, to preserve environ.
4452
44532012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4454
4455 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4456
44572012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4458
4459 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4460 display for sliced images (Bug#10500).
4461
4462 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4463
44642012-11-30 Juanma Barranquero <lekktu@gmail.com>
4465
4466 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4467 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4468
44692012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4470
4471 * xdisp.c (window_outdated): Remove eassert since it hits
4472 some suspicious corner cases (see Bug#13007 and Bug#13012).
4473 (mode_line_update_needed): New function.
4474 (redisplay_internal, redisplay_window): Use it.
4475 (ensure_selected_frame): New function.
4476 (redisplay_internal, unwind_redisplay): Use it.
4477 (redisplay_internal): Move comment about buffer_shared...
4478 (buffer_shared_and_changed): ...near to its real use.
4479
44802012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4481
4482 * callproc.c (Fcall_process): Don't misreport vfork failure.
4483
44842012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4485
4486 * callproc.c (Fcall_process): Fix vfork portability problems.
4487 Do not assume that fd[0], count, filefd, and save_environ survive
4488 vfork. Fix bug whereby wrong errno value could be reported for
4489 pipe failure. Some minor cleanups, too, as follows. Move buf and
4490 bufsize to the context where they're needed. Change new_argv to
4491 be of type char **, as this is more convenient and avoids casts.
4492 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4493 Now local constants, not macros.
4494
44952012-11-18 Kenichi Handa <handa@gnu.org>
4496
4497 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4498 for the variable "f".
4499
45002012-11-13 Kenichi Handa <handa@gnu.org>
4501
4502 * font.c (font_unparse_xlfd): Exclude special characters from the
4503 generating XLFD name.
4504
45052012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4506
4507 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4508 * dired.c (stat_uname, stat_gname):
4509 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4510
4511 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4512 * dired.c (directory_files_internal, file_name_completion):
4513 Assume EAGAIN and EINTR are defined.
4514
4515 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4516 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4517 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4518 * lread.c (readbyte_from_file): Assume EINTR is defined.
4519 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4520 Assume EIO and EAGAIN are defined.
4521 * unexcoff.c (write_segment): Assume EFAULT is defined.
4522
45232012-11-27 Eli Zaretskii <eliz@gnu.org>
4524
4525 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4526 (Bug#11964)
4527
4528 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4529 highlighting on the frame was cleared. Prevents assertion
4530 violations when repeatedly clicking on the "Top" link of the
4531 "bread-crumbs" in Info buffers.
4532
45332012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4534
4535 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4536
45372012-11-24 Ken Brown <kbrown@cornell.edu>
4538
4539 * keyboard.c (HAVE_MOUSE):
4540 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4541 were always defined.
4542
45432012-11-24 Eli Zaretskii <eliz@gnu.org>
4544
4545 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4546 between bpos_covered and bpos_max. This fixes cursor display when
4547 several display strings follow each other.
4548
4549 * .gdbinit (pgx): If the glyph's object is a string, display the
4550 pointer to string data, rather than the value of the string object
4551 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4552
4553 * indent.c (Fvertical_motion): If the starting position is covered
4554 by a display string, return to one position before that, to avoid
4555 overshooting it inside move_it_to. (Bug#12930)
4556
45572012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4558
4559 * frame.h (struct frame): Remove display_preempted member
4560 since all users are dead long ago.
4561 * nsterm.h (struct x_output): Use the only dummy member.
4562 * w32menu.c (pending_menu_activation): Remove since not
4563 really used.
4564 (set_frame_menubar): Adjust user.
4565 * w32term.h (struct x_output): Drop outdated #if 0 code.
4566 (struct w32_output): Use bitfields for explicit_parent,
4567 asked_for_visible and menubar_active members.
4568 Drop unused pending_menu_activation member.
4569 * xterm.h (struct x_output): Drop outdated #if 0 code.
4570 Use bitfields for explicit_parent, asked_for_visible,
4571 has_been_visible and net_wm_state_hidden_seen members.
4572
45732012-11-23 Eli Zaretskii <eliz@gnu.org>
4574
4575 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4576 of a literal "/". (Bug#12955)
4577 (gl-stamp): Invoke fc.exe directly, not through cmd.
4578
45792012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4580
4581 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4582 * dired.c: Assume HAVE_DIRENT_H.
4583 (NAMLEN): Remove, replacing with ...
4584 (dirent_namelen): New function. All uses changed. Use the GNU macro
4585 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4586 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4587 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4588 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4589 $(NT_INC)/dirent.h.
4590 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4591 * ndir.h: Rename to ../nt/inc/dirent.h.
4592 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4593 Do not include <dirent.h>; no longer needed.
4594 * w32.c: Include <dirent.h> rather than "ndir.h".
4595
45962012-11-23 Chong Yidong <cyd@gnu.org>
4597
4598 * xftfont.c (xftfont_open): Remove duplicate assignment.
4599
46002012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4601
4602 * alloc.c (Fgarbage_collect): Unblock input after clearing
4603 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4604 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4605 * msdos.c (IT_frame_up_to_date): Use it here...
4606 * w32term.c (w32_frame_up_to_date): ...here...
4607 * xterm.c (XTframe_up_to_date): ...and here...
4608 * nsterm.m (ns_frame_up_to_date): ...but not here.
4609 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4610 Adjust users.
4611 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4612 Do not check whether GC is in progress.
4613
46142012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4615
4616 * xdisp.c (window_buffer_changed): New function.
4617 (update_menu_bar, update_tool_bar): Use it to
4618 simplify large 'if' statements.
4619 (redisplay_internal): Generalize commonly used
4620 'tail' and 'frame' local variables.
4621
46222012-11-22 Eli Zaretskii <eliz@gnu.org>
4623
4624 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4625 with Windows system header.
4626
46272012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4628
4629 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4630 * alloc.c: Assume unistd.h exists.
4631 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4632 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4633 (getwd) [USG]: Remove; no longer needed.
4634 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4635 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4636 * w32.h (getcwd): Remove decl.
4637
46382012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4639
4640 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4641 Make it set selected_window as well.
4642 (update_tool_bar): Use it.
4643
46442012-11-21 Ken Brown <kbrown@cornell.edu>
4645
4646 * emacs.c (main): Set the G_SLICE environment variable for all
4647 Cygwin builds, not just GTK builds. See
4648 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4649
46502012-11-21 Eli Zaretskii <eliz@gnu.org>
4651
4652 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4653 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4654 Define for the MSVC compiler.
4655
4656 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4657
4658 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4659 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4660 dostounix_filename. Prevents crashes down the road, because
4661 dostounix_filename assumes it gets a unibyte string.
4662 Reported by Michel de Ruiter <michel@sentient.nl>, see
4663 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4664
46652012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4666
4667 Conflate Qnil and Qunbound for `symbol-function'.
4668 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4669 * lread.c (init_obarray): Set `function' fields to Qnil.
4670 * eval.c (Fcommandp): Ignore Qunbound.
4671 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4672 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4673 Test NILP rather than Qunbound.
4674 (Ffmakunbound): Set to Qnil.
4675 (Fsymbol_function): Never signal an error.
4676 (Finteractive_form): Ignore Qunbound.
4677
46782012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4679
4680 * eval.c (interactive_p): Remove no-longer-used decl.
4681
46822012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4683
4684 * xdisp.c (buffer_shared): Adjust comment.
4685 (buffer_shared_and_changed): New function.
4686 (prepare_menu_bars, redisplay_internal): Use it to
4687 decide whether all windows or frames should be updated.
4688 (window_outdated): New function.
4689 (text_outside_line_unchanged_p, redisplay_window): Use it.
4690 (redisplay_internal): Likewise. Fix indentation.
4691
46922012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4693
4694 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4695 (syms_of_eval): Remove corresponding defsubr.
4696 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4697
46982012-11-19 Daniel Colascione <dancol@dancol.org>
4699
4700 * w32fns.c (Fx_file_dialog):
4701 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4702 cygwin_convert_file_name*.
4703
4704 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4705 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4706
47072012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4708
4709 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4710
47112012-11-18 Eli Zaretskii <eliz@gnu.org>
4712
4713 * w32select.c: Include w32common.h before w32term.h, so that
4714 windows.h gets included before w32term.h uses some of its
4715 features, see below.
4716
4717 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4718 New typedefs.
4719 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4720 New prototypes.
4721 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4722
47232012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4724
4725 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4726 (ns_select): Return at once if events are held (Bug#12834).
4727
47282012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4729
4730 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4731 Needed following 2012-10-20 change. (Bug#12902)
4732
47332012-11-18 Juanma Barranquero <lekktu@gmail.com>
4734
4735 * w32proc.c (waitpid): Remove unused label get_result.
4736
47372012-11-17 Juanma Barranquero <lekktu@gmail.com>
4738
4739 * makefile.w32-in (SYSWAIT_H): New macro.
4740 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4741 ($(BLD)/sysdep.$(O)): Update dependencies.
4742
47432012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4744
4745 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4746 * callproc.c (relocate_fd): Assume F_DUPFD.
4747 * emacs.c, term.c (O_RDWR): Remove.
4748 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4749 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4750 * nsterm.m: Assume <fcntl.h> exists.
4751 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4752 (create_pty, Fmake_network_process, server_accept_connection)
4753 (wait_reading_process_output, init_process_emacs):
4754 Assume O_NONBLOCK.
4755 (wait_reading_process_output): Put in a special case for WINDOWSNT
4756 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4757 It's not clear this is needed, but it's a more-conservative change.
4758 (create_process): Assume FD_CLOEXEC.
4759 (create_process, create_pty): Assume O_NOCTTY.
4760 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4761 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4762 Omit if not DOS_NT, since F_GETFL is not defined there.
4763 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4764 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4765 (O_NOCTTY): Remove.
4766 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4767 lack it, since gnulib guarantees this.
4768 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4769
47702012-11-17 Eli Zaretskii <eliz@gnu.org>
4771
4772 * w32.c (faccessat): Pretend that directories have the execute bit
4773 set. Emacs expects that, e.g., in files.el:cd-absolute.
4774
4775 * w32proc.c (create_child): Don't clip the PID of the child
4776 process to fit into an Emacs integer, as this is no longer a
4777 restriction.
4778 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4779 reaping only the process specified by PID argument, if that is
4780 positive. Use PID instead of dead_child to know which process to
4781 reap. Wait for the child to die only if WNOHANG is not in
4782 OPTIONS.
4783 (sys_select): Don't set dead_child.
4784
4785 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4786 as it is no longer needed.
4787
4788 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4789 no longer needed.
4790 (record_child_status_change): Remove the setting of
4791 record_at_most_one_child for the !WNOHANG case.
4792
47932012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4794
4795 Fix problems in ns port found by static checking.
4796 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4797 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4798 not to process group.
4799 (ns_select): Use emacs_write, not write, as that's more robust
4800 in the presence of signals.
4801 (fd_handler:): Check for read errors.
4802
48032012-11-16 Glenn Morris <rgm@gnu.org>
4804
4805 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4806
48072012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4808
4809 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4810
48112012-11-16 Eli Zaretskii <eliz@gnu.org>
4812
4813 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4814 use the same value of thread handle.
4815 (start_timer_thread): If the timer thread exited (due to error),
4816 clean up by closing the two handles it used. Duplicate the caller
4817 thread's handle here, so it gets duplicated only once, when
4818 launching the timer thread. Set priority of the timer thread, not
4819 the caller thread.
4820 (getitimer): Don't duplicate the caller thread's handle here.
4821 (Bug#12832)
4822
48232012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4824
4825 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4826 called (Bug#12834).
4827
48282012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4829
4830 Remove no-longer-used pty_max_bytes variable.
4831 * process.c (pty_max_bytes): Remove; unused.
4832 (send_process): Do not set it.
4833
48342012-11-15 Juanma Barranquero <lekktu@gmail.com>
4835
4836 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4837 Update dependencies.
4838
48392012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4842 This follows up on the 2012-09-29 patch that removed indirection
4843 for the 'function' field. Reported by Sergey Vinokurov in
4844 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4845
48462012-11-14 Eli Zaretskii <eliz@gnu.org>
4847
4848 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4849 different name, as the MS runtime does not have such a function,
4850 and probably never will.) All callers changed. Ignore DIRFD
4851 value if PATH is an absolute file name, to match Posix spec
4852 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4853 symlinks.
4854
48552012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4856
4857 * xdisp.c (echo_area_display, redisplay_internal):
4858 Omit redundant check whether frame_garbaged is set.
4859
48602012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4861
4862 Use faccessat, not access, when checking file permissions (Bug#12632).
4863 This fixes a bug that has been present in Emacs since its creation.
4864 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4865 which must set some sort of record. (Torek's bug report was against
4866 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4867 same common flaw.) See Torek's Usenet posting
4868 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4869 Posted: Fri Apr 8 14:18:56 1983.
4870 * Makefile.in (LIB_EACCESS): New macro.
4871 (LIBES): Use it.
4872 * callproc.c (init_callproc):
4873 * charset.c (init_charset):
4874 * fileio.c (check_existing, check_executable, check_writable)
4875 (Ffile_readable_p):
4876 * lread.c (openp, load_path_check):
4877 * process.c (allocate_pty):
4878 * xrdb.c (file_p):
4879 Use effective UID when checking permissions, not real UID.
4880 * callproc.c (init_callproc):
4881 * charset.c (init_charset):
4882 * lread.c (load_path_check, init_lread):
4883 Test whether directories are accessible, not merely whether they exist.
4884 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4885 * fileio.c (check_existing, check_executable, check_writable)
4886 (Ffile_readable_p):
4887 Use symbolic names instead of integers for the flags, as they're
4888 portable now.
4889 (check_writable): New arg AMODE. All uses changed.
4890 Set errno on failure.
4891 (Ffile_readable_p): Use faccessat, not stat + open + close.
4892 (Ffile_writable_p): No need to call check_existing + check_writable.
4893 Just call check_writable and then look at errno. This saves a syscall.
4894 dir should never be nil; replace an unnecessary runtime check
4895 with an eassert. When checking the parent directory of a nonexistent
4896 file, check that the directory is searchable as well as writable, as
4897 we can't create files in unsearchable directories.
4898 (file_directory_p): New function, which uses 'stat' on most platforms
4899 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4900 (Ffile_directory_p, Fset_file_times): Use it.
4901 (file_accessible_directory_p): New function, which uses a single
4902 syscall for efficiency.
4903 (Ffile_accessible_directory_p): Use it.
4904 * xrdb.c (file_p): Use file_directory_p.
4905 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4906 * lread.c (openp): When opening a file, use fstat rather than
4907 stat, as that avoids a permissions race. When not opening a file,
4908 use file_directory_p rather than stat.
4909 (dir_warning): First arg is now a usage string, not a format.
4910 Use errno. All uses changed.
4911 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4912 that merely introduced a race.
4913 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4914 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4915 and similarly for the other O_* flags.
4916 * w32.c (sys_faccessat): Rename from sys_access and switch to
4917 faccessat's API. All uses changed.
4918 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4919 (magic_db): Rename from magic_file_p.
4920 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4921 char *, so that we don't have to test for file existence
4922 separately from opening the file for reading. This removes a race
4923 fixes a permission-checking problem, and simplifies the code.
4924 All uses changed.
4925 (file_p): Remove; no longer needed.
4926
49272012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4928
4929 Omit glyphs initialization at startup.
4930 * dispnew.c (glyphs_initialized_initially_p): Remove.
4931 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4932 (Fredraw_frame): Move actual code from here...
4933 (redraw_frame): ...to here. Add eassert. Adjust comment.
4934 (Fredraw_display): Use redraw_frame.
4935 * xdisp.c (clear_garbaged_frames): Likewise.
4936
49372012-11-13 Eli Zaretskii <eliz@gnu.org>
4938
4939 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4940 passed to pint2str and pint2hrstr to be at most the size of the
4941 frame's decode_mode_spec_buffer. This avoids crashes with very
4942 large values of FIELD_WIDTH argument to decode_mode_spec.
4943 (Bug#12867)
4944
49452012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4946
4947 Fix a race with verify-visited-file-modtime (Bug#12863).
4948 Since at least 1991 Emacs has ignored an mtime difference of no
4949 more than one second, but my guess is that this was to work around
4950 file system bugs that were fixed long ago. Since the race is
4951 causing problems now, let's remove that code.
4952 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4953 whose time stamp is off by no more than a second. Insist that the
4954 file time stamps match exactly.
4955
49562012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4957
4958 * frame.h (struct frame): Convert external_tool_bar member to
4959 1-bit unsigned bitfield.
4960 * termhooks.h (struct terminal): Remove mouse_moved member since
4961 all users are long dead. Adjust comment on mouse_position_hook.
4962
49632012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4964
4965 Simplify by using FOR_EACH_FRAME here and there.
4966 * frame.c (next_frame, prev_frame, other_visible_frames)
4967 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4968 * w32term.c (x_window_to_scroll_bar): Likewise.
4969 * window.c (window_list): Likewise.
4970 * xdisp.c (x_consider_frame_title): Likewise.
4971 * xfaces.c (Fdisplay_supports_face_attributes_p): Likewise.
4972 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4973 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4974 * xmenu.c (menubar_id_to_frame): Likewise.
4975 * xselect.c (frame_for_x_selection): Likewise.
4976 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4977 (x_window_to_menu_bar): Likewise.
4978 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4979
49802012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4981
4982 * data.c (Qdefalias_fset_function): Now static.
4983
4984 Another tweak to vectorlike_header change.
4985 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4986 Remove, and replace all uses with ...
4987 (next_in_free_list, set_next_in_free_list):
4988 New functions, which respect C's aliasing rules better.
4989
49902012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4991
4992 * window.c (list4i): Rename from 'quad'. All uses changed.
4993 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4994
49952012-11-11 Juanma Barranquero <lekktu@gmail.com>
4996
4997 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4998 warning about mixing declarations and code in ISO C90.
4999
50002012-11-10 Martin Rudalics <rudalics@gmx.at>
5001
5002 * window.c (Fsplit_window_internal): Set combination limit of
5003 new parent window to t iff Vwindow_combination_limit is t;
5004 fixing a regression introduced with the change from 2012-09-22.
5005 (Fset_window_combination_limit): Fix doc-string.
5006
50072012-11-10 Eli Zaretskii <eliz@gnu.org>
5008
5009 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
5010 amount when the scroll margins are too large. When scrolling
5011 backwards in the buffer, give up if cannot reach point or the
5012 scroll margin within a reasonable number of screen lines.
5013 Fixes point position in window under scroll-up/down-aggressively when
5014 point is positioned many lines beyond the window top/bottom.
5015 (Bug#12811)
5016
5017 * ralloc.c (relinquish): If real_morecore fails to return memory
5018 to the system, don't crash; instead, leave the last heap
5019 unchanged and return. (Bug#12774)
5020
50212012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
5022
5023 * lisp.h (AUTOLOADP): New macro.
5024 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
5025 * data.c (Ffset): Remove special ad-advice-info handling.
5026 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
5027 (Fsubr_arity): CSE.
5028 (Finteractive_form): Simplify.
5029 (Fquo): Don't insist on having at least 2 arguments.
5030 (Qdefalias_fset_function): New var.
5031
50322012-11-09 Jan Djärv <jan.h.d@swipnet.se>
5033
5034 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
5035
5036 * nsfont.m (Qcondensed, Qexpanded): New variables.
5037 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
5038 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
5039
50402012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
5041
5042 Fix recently introduced crash on MS-Windows (Bug#12839).
5043 * w32term.h (struct scroll_bar): Use convenient header.
5044 (SCROLL_BAR_VEC_SIZE): Remove.
5045 * w32term.c (x_scroll_bar_create): Use VECSIZE.
5046
50472012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
5048
5049 Tweak last vectorlike_header change.
5050 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
5051 vectorlike object on the free list. This is introduced to avoid
5052 some (but not all) pointer casting and aliasing problems, see
5053 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
5054 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
5055 objects.
5056 (xvectype, xvecsize): Use them to examine Lisp_Object values.
5057
50582012-11-09 Jan Djärv <jan.h.d@swipnet.se>
5059
5060 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
5061 been removed, so remove them here also.
5062
50632012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
5064
5065 * doc.c (Fdocumentation): Handle new property
5066 dynamic-docstring-function to replace the old ad-advice-info.
5067
50682012-11-09 Paul Eggert <eggert@cs.ucla.edu>
5069
5070 * fns.c (Qeql, hashtest_eq): Now static.
5071
50722012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
5073
5074 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
5075 * fns.c (hashfn_eq, hashfn_eql, sxhash):
5076 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
5077 * buffer.c (compare_overlays): Use XLI rather than XHASH.
5078
50792012-11-08 Paul Eggert <eggert@cs.ucla.edu>
5080
5081 Use same hash function for hashfn_profiler as for hash_string etc.
5082 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
5083 * lisp.h (sxhash_combine): New inline function, with the contents
5084 of the old SXHASH_COMBINE.
5085 * profiler.c (hashfn_profiler): Use it, instead of having a
5086 special hash function containing a comparison that always yields 1.
5087
50882012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
5089
5090 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
5091 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
5092 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
5093 Remove unused vars.
5094
50952012-11-08 Jan Djärv <jan.h.d@swipnet.se>
5096
5097 * image.c (xpm_make_color_table_h): Fix compiler error because
5098 make_hash_table changed.
5099
51002012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
5101
5102 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
5103
51042012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
5105
5106 Use ad-hoc comparison function for the profiler's hash-tables.
5107 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
5108 (make_log): Use them.
5109 (handle_profiler_signal): Don't inhibit quit any longer since we don't
5110 call Fequal any more.
5111 (Ffunction_equal): New function.
5112 (cmpfn_profiler, hashfn_profiler): New functions.
5113 (syms_of_profiler): Initialize them.
5114 * lisp.h (struct hash_table_test): New struct.
5115 (struct Lisp_Hash_Table): Use it.
5116 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
5117 * fns.c (make_hash_table): Take a struct to describe the test.
5118 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
5119 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
5120 (hash_lookup, hash_remove_from_table): Move assertion checking of
5121 hashfn result here. Check hash-equality before calling cmpfn.
5122 (Fmake_hash_table): Adjust call to make_hash_table.
5123 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
5124 (syms_of_fns): Initialize them.
5125 * emacs.c (main): Move syms_of_fns earlier.
5126 * xterm.c (syms_of_xterm):
5127 * category.c (hash_get_category_set): Adjust call to make_hash_table.
5128 * print.c (print_object): Adjust to new hash-table struct.
5129 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
5130
51312012-11-08 Eli Zaretskii <eliz@gnu.org>
5132
5133 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
5134 value of w32-scroll-lock-modifier is neither nil nor one of the
5135 known key modifiers. (Bug#12806)
5136
51372012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
5138
5139 Shrink struct vectorlike_header to the only size field.
5140 * lisp.h (enum pvec_type): Avoid explicit enum member values.
5141 Adjust comment.
5142 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
5143 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
5144 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
5145 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
5146 information from the vector header. Adjust comment.
5147 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
5148 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
5149 layout.
5150 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
5151 (struct vectorlike_header): Remove next member. Adjust comment.
5152 (struct Lisp_Subr): Add convenient header. Adjust comment.
5153 (allocate_pseudovector): Adjust prototype.
5154 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
5155 (sweep_string, lisp_malloc): Remove useless prototypes.
5156 (enum mem_type): Adjust comment.
5157 (NEXT_IN_FREE_LIST): New macro.
5158 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
5159 (Fmake_bool_vector): Likewise.
5160 (struct large_vector): New type to represent allocation unit for
5161 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
5162 (large_vectors): Change type to struct large_vector.
5163 (allocate_vector_from_block): Simplify.
5164 (PSEUDOVECTOR_NBYTES): Replace with...
5165 (vector_nbytes): ...new function. Adjust users.
5166 (sweep_vectors): Adjust processing of large vectors.
5167 (allocate_vectorlike): Likewise.
5168 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
5169 Add easserts. Adjust XSETPVECTYPESIZE usage.
5170 (allocate_buffer): Use BUFFER_PVEC_INIT.
5171 (live_vector_p): Adjust to match large vector.
5172 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
5173 * buffer.h (struct buffer): Add next member.
5174 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
5175 New macros.
5176 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
5177 * fns.c (internal_equal): Adjust to match enum pvec_type change.
5178 (copy_hash_table): Adjust to match vector header change.
5179 * lread.c (defsubr): Use XSETPVECTYPE.
5180 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
5181 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
5182 (xvecsize): New command.
5183
51842012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
5185
5186 * keyboard.c (event_to_kboard): Do not dereference
5187 frame_or_window field of SELECTION_REQUEST_EVENT
5188 and SELECTION_CLEAR_EVENT events (Bug#12814).
5189 * xterm.h (struct selection_input_event): Adjust comment.
5190
51912012-11-07 Eli Zaretskii <eliz@gnu.org>
5192
5193 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
5194 such as Scroll Lock, if the respective keys are treated as
5195 function keys, not as modifiers. This avoids destroying non-ASCII
5196 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
5197
51982012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
5199
5200 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
5201
52022012-11-06 Paul Eggert <eggert@cs.ucla.edu>
5203
5204 Restore some duplicate definitions (Bug#12814).
5205 This undoes part of the 2012-11-03 changes. Some people build
5206 with plain -g rather than with -g3, and they need the duplicate
5207 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
5208 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
5209 Define as macros, as well as as enums or as constants.
5210
52112012-11-06 Jan Djärv <jan.h.d@swipnet.se>
5212
5213 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
5214 to keypad keys (Bug#12816).
5215
52162012-11-06 Paul Eggert <eggert@cs.ucla.edu>
5217
5218 Minor adjustments of recently-changed frame functions.
5219 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
5220 known to be a frame (we're in the FRAMEP branch).
5221 * lisp.h (Qframep): Remove decl. frame.h declares this.
5222 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
5223 since they're meant for Lisp fixnum values.
5224
52252012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5226
5227 * window.c (Fwindow_combination_limit): Revert to the only
5228 required argument and adjust docstring as suggested in
5229 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
5230 by Martin Rudalics <rudalics@gmx.at>.
5231
52322012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5233
5234 Widely used frame validity and checking functions.
5235 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
5236 * frame.c (decode_live_frame, decode_any_frame): New functions.
5237 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
5238 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
5239 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
5240 (Fframe_pointer_visible_p): Use decode_any_frame.
5241 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
5242 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
5243 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
5244 (Fframe_focus): Likewise. Allow zero number of arguments.
5245 Adjust docstring.
5246 (frame_buffer_list, frame_buffer_predicate): Remove.
5247 * lisp.h (frame_buffer_predicate): Remove prototype.
5248 * buffer.c (Fother_buffer): Use decode_any_frame.
5249 * xdisp.c (Ftool_bar_lines_needed): Likewise.
5250 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
5251 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
5252 (Fclose_font, Ffont_info): Use decode_live_frame.
5253 * fontset.c (check_fontset_name): Likewise.
5254 * terminal.c (Fframe_terminal): Likewise.
5255 * w32fns.c (check_x_frame): Likewise.
5256 * window.c (Fminibuffer_window, Fwindow_at)
5257 (Fcurrent_window_configuration): Likewise.
5258 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
5259 Likewise. Allow zero number of arguments. Adjust docstring.
5260 * dispnew.c (Fredraw_frame): Likewise.
5261 * xfaces.c (frame_or_selected_frame): Remove.
5262 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
5263 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
5264 (Fframe_face_alist): Use decode_live_frame.
5265 * xfns.c (check_x_frame): Likewise.
5266
52672012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
5268
5269 * window.c (quad): New function.
5270 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
5271 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
5272 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
5273 (Fwindow_line_height): Use it.
5274 (Fwindow_fringes): Use list3.
5275 (Fwindow_scroll_bars): Use list4.
5276 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
5277 (Fwindow_combination_limit): Allow zero number of arguments.
5278
52792012-11-05 Eli Zaretskii <eliz@gnu.org>
5280
5281 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
5282
5283 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
5284 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
5285 file descriptor 2 for standard error. (Bug#12805)
5286
52872012-11-05 Chong Yidong <cyd@gnu.org>
5288
5289 * process.c (wait_reading_process_output): Revert previous change.
5290
52912012-11-05 Paul Eggert <eggert@cs.ucla.edu>
5292
5293 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
5294 This removes code that has been obsolete since around 1990.
5295 * callproc.c (Fcall_process):
5296 * emacs.c (main):
5297 * process.c (create_process):
5298 * term.c (dissociate_if_controlling_tty):
5299 Assume setsid exists.
5300 * callproc.c (child_setup): Assume setpgid exists and behaves as
5301 per POSIX.1-1988 or later.
5302 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
5303 * emacs.c (shut_down_emacs):
5304 * sysdep.c (sys_suspend, init_foreground_group):
5305 Assume getpgrp behaves as per POSIX.1-1998 or later.
5306 * msdos.c (setpgrp): Remove.
5307 (tcgetpgrp, setpgid, setsid): New functions.
5308 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
5309 * term.c (no_controlling_tty): Remove; unused.
5310 * w32proc.c (setpgrp): Remove.
5311 (setsid, tcgetpgrp): New functions.
5312
5313 Simplify by assuming __fpending.
5314 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
5315 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
5316 Do not assume that __fpending's result fits in int.
5317
53182012-11-04 Paul Eggert <eggert@cs.ucla.edu>
5319
5320 Remove EMACS_OUTQSIZE+sleep hack.
5321 * dispnew.c (update_frame_1): Remove hack for terminals slower
5322 than 2400 bps, which throttled Emacs by having it sleep.
5323 This code hasn't worked since at least 2007, when the multi-tty stuff
5324 was added, and anyway those old terminals are long dead.
5325 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
5326 without the dispnew.c change, as dispnew.c doesn't include systty.h.
5327
5328 Fix data-loss with --version (Bug#9574).
5329 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
5330 as we can't assume that emacs_strerror is initialized, and strerror
5331 is good enough here.
5332 (main): Invoke atexit earlier, to catch earlier instances of
5333 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
5334
53352012-11-04 Michael Marchionna <tralfaz@pacbell.net>
5336
5337 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
5338 (keyDown): Remap keypad keys to X11 virtual key codes.
5339
53402012-11-03 Paul Eggert <eggert@cs.ucla.edu>
5341
5342 Fix data-loss with --batch (Bug#9574).
5343 * emacs.c: Include <close-stream.h>.
5344 (close_output_streams): New function.
5345 (main): Pass it to atexit, so that Emacs closes stdout and stderr
5346 and handles errors appropriately.
5347 (Fkill_emacs): Don't worry about flushing, as close_output_stream
5348 does that now.
5349
5350 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
5351 The symptom is a diagnostic "GLib-WARNING **: In call to
5352 g_spawn_sync(), exit status of a child process was requested but
5353 SIGCHLD action was set to SIG_IGN and ECHILD was received by
5354 waitpid(), so exit status can't be returned." The diagnostic
5355 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
5356 The real bug is a race condition between Emacs and glib: Emacs
5357 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
5358 so that glib can't find it. Work around the bug by invoking
5359 waitpid only on subprocesses that Emacs itself creates.
5360 * process.c (create_process, record_child_status_change):
5361 Don't use special value -1 in pid field, as the caller now must
5362 know the pid rather than having the callee infer it.
5363 The inference was sometimes incorrect anyway, due to another race.
5364 (create_process): Set new 'alive' member if child is created.
5365 (process_status_retrieved): New function.
5366 (record_child_status_change): Use it.
5367 Accept negative 1st argument, which means to wait for the
5368 processes that Emacs already knows about. Move special-case code
5369 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
5370 processes that have already been waited for, by testing and
5371 clearing new 'alive' member.
5372 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
5373 now does this internally.
5374 (handle_child_signal): Let record_child_status_change do all
5375 the work, since we do not want to reap all exited child processes,
5376 only the child processes that Emacs itself created.
5377 * process.h (Lisp_Process): New boolean member 'alive'.
5378
5379 Omit duplicate definitions no longer needed with gcc -g3.
5380 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
5381 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
5382 Define only as macros. There's no longer any need to also define
5383 these symbols as enums or as constants, since we now assume
5384 gcc -g3 when debugging.
5385
53862012-11-03 Eli Zaretskii <eliz@gnu.org>
5387
5388 * lisp.mk: Adjust comments to the fact that term/internal is now
5389 loaded from loadup.el.
5390
5391 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
5392 (msdos_fatal_signal): New function.
5393 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
5394 its argument list.
5395
5396 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
5397 for GCC versions before 4.
5398 (emacs_raise): Define to call msdos_fatal_signal.
5399
5400 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
5401 iterator when starting in the middle of a display or overlay
5402 string. (Bug#12745)
5403
54042012-11-03 Chong Yidong <cyd@gnu.org>
5405
5406 * process.c (wait_reading_process_output): Clean up the last
5407 change.
5408
54092012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5410
5411 * process.c (wait_reading_process_output): Avoid a race condition
5412 with SIGIO delivery (Bug#11536).
5413
54142012-11-03 Chong Yidong <cyd@gnu.org>
5415
5416 * buffer.c (cursor_type): Untabify docstring.
5417
54182012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5419
5420 * frame.h (struct frame): Drop can_have_scroll_bars member
5421 which is meaningless for a long time. Adjust comments.
5422 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5423 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5424
54252012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5426
5427 * window.c (decode_next_window_args): Update window arg after
5428 calling decode_live_window and so fix crash reported at
5429 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5430 by Juanma Barranquero <lekktu@gmail.com>.
5431 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5432 * font.c (Ffont_at): Likewise.
5433
54342012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5435
5436 * widget.c (resize_cb): New function.
5437 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5438 (EmacsFrameResize): Check if all is up to date before changing frame
5439 size.
5440
54412012-11-02 Eli Zaretskii <eliz@gnu.org>
5442
5443 Implement backtrace output for fatal errors on MS-Windows.
5444 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5445 (BACKTRACE_LIMIT_MAX): New macro.
5446 (w32_backtrace): New function.
5447 (emacs_abort): Use w32_backtrace when the user chooses not to
5448 attach a debugger. Update the text of the abort dialog.
5449
54502012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5451
5452 Window-related stuff cleanup here and there.
5453 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5454 Use decode_any_window.
5455 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5456 * xdisp.c (Fformat_mode_line): Likewise.
5457 * font.c (Ffont_at): Use decode_live_window.
5458 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5459 * window.c (decode_next_window_args): Likewise.
5460 (decode_any_window): Remove static.
5461 * window.h (decode_any_window): Add prototype.
5462 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5463 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5464 respectively.
5465
54662012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5467
5468 Remove pad from struct input_event.
5469 * termhooks.h (struct input_event): Remove padding field.
5470 Adjust comment.
5471 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5472 member is never cons for a long time. Adjust comment.
5473 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5474 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5475 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5476 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5477
54782012-11-01 Eli Zaretskii <eliz@gnu.org>
5479
5480 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5481
54822012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5483
5484 Fix crash when using Emacs as commit editor for git (Bug#12697).
5485 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5486 and it is configured in conf_post.h.
5487 (Fcall_process): Don't invoke both setsid and setpgid; the former
5488 is enough, if it exists.
5489 * callproc.c (Fcall_process, child_setup):
5490 * process.c (create_process): Use setpgid.
5491 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5492 for the real thing.
5493 * dispnew.c (init_display): Initialize the foreground group
5494 if we are running a tty display.
5495 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5496 * lisp.h (init_foreground_group): New decl.
5497 * sysdep.c (inherited_pgroup): New static var.
5498 (init_foreground_group, tcsetpgrp_without_stopping)
5499 (narrow_foreground_group, widen_foreground_group): New functions.
5500 (init_sys_modes): Narrow foreground group.
5501 (reset_sys_modes): Widen foreground group.
5502
55032012-10-31 Michael Albinus <michael.albinus@gmx.de>
5504
5505 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5506
55072012-10-31 Martin Rudalics <rudalics@gmx.at>
5508
5509 * minibuf.c (read_minibuf): Restore current buffer since
5510 choose_minibuf_frame calling Fset_frame_selected_window may
5511 change it (Bug#12766).
5512
55132012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5514
5515 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5516
55172012-10-30 Kenichi Handa <handa@gnu.org>
5518
5519 * font.c (Ffont_at): If WINDOW is specified and it is not
5520 displaying the current buffer, signal an error.
5521
55222012-10-29 Daniel Colascione <dancol@dancol.org>
5523
5524 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5525 In preparation for fixing bug#12739, move these functions from
5526 here...
5527
5528 * coding.h, coding.c: ... to here, and compile them only when
5529 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5530 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
5531
55322012-10-28 Eli Zaretskii <eliz@gnu.org>
5533
5534 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5535 (timer_loop, getitimer, setitimer): Use it instead of
5536 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5537 'clock'.
5538 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5539 literal 10000.
5540
55412012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5542
5543 * nsterm.m (NO_APPDEFINED_DATA): New define.
5544 (last_appdefined_event_data): New variable
5545 (last_appdefined_event): Remove.
5546 (ns_select): Initialize t from last_appdefined_event_data instead
5547 of [last_appdefined_event data1].
5548 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5549 remove last_appdefined_event (Bug#12698).
5550
55512012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5552
5553 * frame.c (x_set_font): Catch internal error.
5554
55552012-10-27 Eli Zaretskii <eliz@gnu.org>
5556
5557 Avoid overflow in w32 implementation of interval timers.
5558 When possible, for ITIMER_PROF count only times the main thread
5559 actually executes.
5560 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
5561 'volatile ULONGLONG' types. All the other data which was
5562 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
5563 (GetThreadTimes_Proc): New typedef.
5564 (w32_get_timer_time): New function, returns a suitable time value
5565 for the timer.
5566 (timer_loop): Enter critical section when accessing ULONGLONG
5567 values of the itimer_data struct, as these accesses are no longer
5568 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5569 Remove unused variable.
5570 (init_timers): Initialize s_pfn_Get_Thread_Times.
5571 (start_timer_thread): Don't assign itimer->caller_thread here.
5572 (getitimer): Assign itimer->caller_thread here.
5573 (setitimer): Always call getitimer to get the value of ticks_now.
5574 (sys_spawnve): Avoid compiler warning about format mismatch.
5575
55762012-10-26 Eli Zaretskii <eliz@gnu.org>
5577
5578 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5579 mouse movement events if the menu bar is active. This avoids
5580 producing a busy "hour-glass" cursor by Windows if the mouse
5581 pointer is positioned over a tooltip shown for some menu item.
5582
55832012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5584
5585 Don't assume process IDs fit in int.
5586 * emacs.c (shut_down_emacs) [!DOS_NT]:
5587 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5588 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5589 Use pid_t, not int, to store process IDs, as 'int'
5590 is not wide enough on a few platforms (e.g., AIX and IRIX).
5591
55922012-10-23 Kenichi Handa <handa@gnu.org>
5593
5594 The following change is to make face-font-rescale-alist work
5595 correctly for non-ASCII fonts.
5596
5597 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5598 (font_open_for_lface): Handle Vface_font_rescale_alist.
5599
56002012-10-23 Chong Yidong <cyd@gnu.org>
5601
5602 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5603
56042012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5605
5606 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5607 for screen font.
5608 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5609
5610 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5611 event (Bug#12681).
5612
56132012-10-21 Glenn Morris <rgm@gnu.org>
5614
5615 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5616
56172012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5618
5619 Port to OpenBSD 5.1.
5620 * frame.c (Fmouse_position, Fmouse_pixel_position):
5621 * xdisp.c (produce_stretch_glyph):
5622 Declare local vars only when they're needed.
5623 This is clearer and avoids a warning on OpenBSD about unused vars.
5624 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5625 This is safer, and avoids OpenBSD warnings about unused vars.
5626 * keyboard.c (record_menu_key): Remove unnecessary decl.
5627 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5628 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5629 as our definition clashes with OpenBSD's.
5630 * xfaces.c (load_face_colors, check_lface_attrs)
5631 (get_lface_attributes_no_remap, get_lface_attributes)
5632 (lface_fully_specified_p, x_supports_face_attributes_p)
5633 (tty_supports_face_attributes_p, face_fontset, realize_face)
5634 (realize_x_face, realize_tty_face):
5635 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5636 merely Lisp_Object *. This is more informative and avoids
5637 a warning on OpenBSD about accessing beyond an object's size.
5638
56392012-10-20 Chong Yidong <cyd@gnu.org>
5640
5641 * lread.c (Fload): Doc fix (Bug#12592).
5642
56432012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5644
5645 * font.c (Ffont_at): Fix previous change.
5646
56472012-10-19 Eli Zaretskii <eliz@gnu.org>
5648
5649 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5650 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5651 for the reasons.
5652
5653 * alloc.c (NSTATICS): Decrease to 0x800.
5654
56552012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5656
5657 * fns.c (Fnreverse): Include the problem element when signaling an
5658 error (bug#12677).
5659
56602012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5661
5662 * nsterm.m (ns_select): Check writefds before call to
5663 FD_ISSET (Bug#12668).
5664
56652012-10-18 Daniel Colascione <dancol@dancol.org>
5666
5667 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5668 (staticpro): If we run out of staticpro slots, die with an
5669 informative error instead of just calling emacs_abort.
5670
56712012-10-18 Martin Rudalics <rudalics@gmx.at>
5672
5673 Fix two flaws reported by Dmitry Antipov.
5674 * window.c (Ftemp_output_buffer_show): Remove.
5675 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5676 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5677
56782012-10-17 Eli Zaretskii <eliz@gnu.org>
5679
5680 * makefile.w32-in ($(BLD)/w32.$(O)):
5681 ($(BLD)/vm-limit.$(O)):
5682 ($(BLD)/term.$(O)):
5683 ($(BLD)/unexw32.$(O)):
5684 ($(BLD)/fileio.$(O)):
5685 ($(BLD)/dispnew.$(O)): Update dependencies.
5686
5687 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5688 Add prototypes.
5689
5690 * w32proc.c: Include ctype.h.
5691
5692 * w32.h (init_environment, check_windows_init_file)
5693 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5694 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5695 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5696 (sys_link): Add prototypes.
5697
5698 * w32.c: Include w32select.h.
5699 (sys_access, e_malloc, sys_select): Add prototypes.
5700 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5701
5702 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5703
5704 * unexw32.c: Include lisp.h and w32.h.
5705
5706 * term.c [WINDOWSNT]: Include w32term.h.
5707
5708 * process.c [WINDOWSNT]: Add prototype of sys_select.
5709
5710 * fileio.c [WINDOWSNT]: Include w32.h.
5711
5712 * dispnew.c [WINDOWSNT]: Include w32.h.
5713
5714 * cygw32.c (Fcygwin_convert_path_to_windows)
5715 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5716 Lisp_Object values. (Bug#12661)
5717
5718 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5719 to Lisp_Object. (Bug#12661)
5720
57212012-10-17 Kenichi Handa <handa@gnu.org>
5722
5723 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5724 invalidate.
5725
57262012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 * buffer.c (Fkill_buffer): When unchaining the marker,
5729 reset its buffer pointer to NULL (Bug#12652).
5730
57312012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5732
5733 Do not verify indirection counters of killed buffers (Bug#12579).
5734 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5735 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5736
57372012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5738
5739 * alloc.c (Fmake_byte_code): Fix typo in comment.
5740 * print.c (print_interval): Define as static to match prototype.
5741 * indent.c (disptab_matches_widthtab, recompute_width_table):
5742 Convert to eassert.
5743
57442012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5745
5746 * editfns.c (get_system_name): Remove.
5747 * lisp.h (get_system_name): Remove prototype.
5748 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5749 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5750
57512012-10-15 Daniel Colascione <dancol@dancol.org>
5752
5753 * dbusbind.c: Add comment explaining reason for previous change.
5754
57552012-10-15 Martin Rudalics <rudalics@gmx.at>
5756
5757 * window.c (Fwindow_end): Rewrite check whether cached position
5758 can be used (Bug#12600).
5759 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5760 Set windows_or_buffers_changed.
5761
57622012-10-15 Daniel Colascione <dancol@dancol.org>
5763
5764 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5765 enabled by undefining the symbol "interface", which the platform
5766 headers define to something incompatible.
5767
57682012-10-14 Daniel Colascione <dancol@dancol.org>
5769
5770 * image.c (init_tiff_functions, init_imagemagick_functions)
5771 (init_svg_functions): Fix cygw32 build break by using these
5772 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5773
57742012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5775
5776 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5777
57782012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5779
5780 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5781
57822012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5783
5784 * coding.c (detect_coding): Set coding->id before calling
5785 this->detector.
5786
57872012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5788
5789 * fileio.c: Formatting fixes.
5790
57912012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5792
5793 Fix some stat-related races.
5794 * fileio.c (Fwrite_region): Avoid race condition if a file is
5795 removed or renamed by some other process immediately after Emacs
5796 writes it but before Emacs stats it. Do not assume that stat (or
5797 fstat) succeeds.
5798 * image.c (slurp_file): Resolve the file name with fopen + fstat
5799 rather than stat + fopen.
5800 (pbm_read_file) [0]: Remove unused code with stat race.
5801 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5802 Remove ineffective code with stat race.
5803
58042012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5805
5806 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5807
58082012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5809
5810 * nsterm.m (hold_event_q): New static variable.
5811 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5812 ! q_event_ptr.
5813 (hold_event): New function.
5814 (ns_read_socket): If hold_event_q have events, store them and
5815 return (Bug#12384).
5816 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5817 is zero (Bug#12384).
5818
58192012-10-12 Juanma Barranquero <lekktu@gmail.com>
5820
5821 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5822
58232012-10-12 Eli Zaretskii <eliz@gnu.org>
5824
5825 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5826
5827 * fileio.c (check_existing): New function.
5828 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5829 instead of calling 'stat', when what's needed is to check whether
5830 a file exists. This avoids expensive system calls on MS-Windows.
5831 (Bug#12587)
5832
5833 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5834
5835 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5836 determine whether a file exists and is not a directory.
5837
5838 * lisp.h (check_existing): Add prototype.
5839
58402012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5841
5842 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5843
58442012-10-12 Glenn Morris <rgm@gnu.org>
5845
5846 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5847
58482012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5849
5850 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5851
5852 * eval.c (Fautoload): Remember previous autoload status in load-history.
5853
58542012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5855
5856 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5857 * lread.c (load_each_byte, new_backquote_flag, readchar)
5858 (read_filtered_event, lisp_file_lexically_bound_p)
5859 (safe_to_load_version, Fload, complete_filename_p, openp)
5860 (build_load_history, readevalloop, read_escape, read1)
5861 (string_to_number, read_vector, read_list):
5862 * macros.c (Fstart_kbd_macro):
5863 * marker.c (CONSIDER):
5864 * menu.c (parse_single_submenu, digest_single_submenu)
5865 (find_and_return_menu_selection, Fx_popup_menu):
5866 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5867 (Ftry_completion):
5868 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5869 (ns_menu_show):
5870 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5871 (xmenu_show, xdialog_show):
5872 Use bool for booleans.
5873 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5874 as it's not a predicate. All uses changed. Omit unnecessary
5875 buffer termination.
5876
58772012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5878
5879 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5880 (save_excursion_restore): Do not restore mark if it was not saved.
5881
58822012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5883
5884 * marker.c (cached_modiff): EMACS_INT, not int.
5885
5886 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5887 instead of having a wrong decl.
5888 * nsmenu.m (waiting_for_input): Remove wrong decl.
5889
58902012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5891
5892 keyboard.c, keymap.c: Use bool for booleans.
5893 * dispnew.c (sit_for): Distinguish between 3-way display_option
5894 and boolean do_display.
5895 * keyboard.c (single_kboard, this_command_key_count_reset)
5896 (waiting_for_input, echoing, immediate_quit, input_pending)
5897 (interrupt_input, interrupts_deferred, pop_kboard)
5898 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5899 (command_loop_1, adjust_point_for_property)
5900 (safe_run_hooks_error, input_polling_used, read_char):
5901 (help_char_p, readable_events, kbd_buffer_events_waiting)
5902 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5903 (lucid_event_type_list_p, get_input_pending):
5904 (gobble_input, menu_separator_name_p, menu_bar_item)
5905 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5906 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5907 (keyremap_step, test_undefined, read_key_sequence)
5908 (detect_input_pending, detect_input_pending_ignore_squeezables)
5909 (detect_input_pending_run_timers, requeued_events_pending_p)
5910 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5911 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5912 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5913 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5914 (accessible_keymaps_1, Fkey_description, push_key_description):
5915 (shadow_lookup, struct where_is_internal_data)
5916 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5917 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5918 (describe_map, describe_vector):
5919 * menu.c (single_menu_item):
5920 * nsmenu.m (ns_update_menubar):
5921 * process.c (wait_reading_process_output):
5922 * search.c (scan_buffer, scan_newline):
5923 Use bool for boolean.
5924 * keyboard.c (timers_run, swallow_events)
5925 (detect_input_pending_run_timers):
5926 * process.c (wait_reading_process_output):
5927 Use unsigned for counter where wraparound-on-overflow is desired,
5928 since unsigned is guaranteed to have that behavior and signed is not.
5929 (read_char): Use ptrdiff_t for string length.
5930 (get_input_pending): Remove first argument, since it was always
5931 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5932 and behave as if it had that value. Return new value of
5933 input_pending. All callers changed.
5934 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5935 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5936 a string length.
5937 * keymap.c (push_key_description): Omit last arg, which was always 1.
5938 All callers changed.
5939
5940 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5941
59422012-10-10 Juanma Barranquero <lekktu@gmail.com>
5943
5944 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5945 ($(BLD)/term.$(O)): Update dependencies.
5946
59472012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5948
5949 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5950 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5951 initializer for PVEC_NORMAL_VECTOR.
5952
59532012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 Clean out old termopts cruft.
5956 * termopts.h (flow_control, meta_key): Remove unused decls.
5957 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5958 Don't include termopts.h.
5959
59602012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5961
5962 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5963
59642012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5965
5966 * commands.h (immediate_quit): Remove duplicate decl.
5967
59682012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5969
5970 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5971 caching.
5972 (nsfont_open): Remove setting of Vfonts_in_cache.
5973 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5974
59752012-10-09 Eli Zaretskii <eliz@gnu.org>
5976
5977 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5978 match what GetLastError returns. Explain why the function is
5979 needed.
5980
5981 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5982 'is_tooltip_frame', to avoid confusion with its global namesake.
5983
59842012-10-08 Daniel Colascione <dancol@dancol.org>
5985
5986 * xdisp.c (start_hourglass): Call w32_note_current_window when
5987 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5988 build that caused Emacs to display the hourglass cursor forever.
5989
5990 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5991 which is broken under remote desktop, calculate the number of
5992 colors available for a display based on the display's number of
5993 planes and number of bits per pixel per plane. (bug#10397).
5994
59952012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5996
5997 * nsfont.m (Vfonts_in_cache): New variable.
5998 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5999 are used. Add cached fonts to Vfonts_in_cache.
6000 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
6001
60022012-10-08 Juanma Barranquero <lekktu@gmail.com>
6003
6004 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
6005 in nt/config.nt.
6006 (FONT_H): Define after FRAME_H.
6007 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
6008 Update dependencies.
6009
6010 * w32term.c: Remove leftover declaration of keyboard_codepage.
6011
60122012-10-08 Eli Zaretskii <eliz@gnu.org>
6013
6014 * makefile.w32-in (FONT_H): Add $(FRAME_H).
6015 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
6016 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
6017 (GLOBAL_SOURCES): Add cygw32.c.
6018 ($(BLD)/unexw32.$(O)):
6019 ($(BLD)/w32.$(O)):
6020 ($(BLD)/w32console.$(O)):
6021 ($(BLD)/w32fns.$(O)):
6022 ($(BLD)/w32heap.$(O)):
6023 ($(BLD)/w32menu.$(O)):
6024 ($(BLD)/w32proc.$(O)): Add w32common.h.
6025
6026 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
6027 'const char *'.
6028 (x_to_w32_color): Don't modify the argument, modify a copy instead.
6029
60302012-10-08 Daniel Colascione <dancol@dancol.org>
6031
6032 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
6033 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
6034 accidental message numbering hole. Change other messages to
6035 match.
6036
6037 * w32select.h (HAVE_W32SELECT): Remove.
6038
6039 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
6040 w32common.h instead of w32heap.h.
6041
6042 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
6043 (get_allocation_unit, get_processor_type, get_w32_major_version)
6044 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
6045 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
6046 (OS_NT, os_subtype, cache_system_info): Move declarations to
6047 w32common.
6048
6049 * w32heap.c: Include w32common.h.
6050 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
6051 (w32_minor_version, w32_build_number, w32_subtype):
6052 Remove duplicate definitions.
6053
6054 * w32fns.c: Include w32common.h; include w32heap.h only in
6055 WINDOWSNT.
6056
6057 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
6058 Use `report_file_error' instead of `error' in order to better
6059 inform users of what went wrong. Increase NTGUI_UNICODE file
6060 dialog box file name length to 32k, the maximum allowed by the NT
6061 kernel.
6062
6063 * w32common.h: New file.
6064 (ROUND_UP, ROUND_DOWN, get_page_size)
6065 (get_allocation_unit, get_processor_type, get_w32_major_version)
6066 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
6067 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
6068 (OS_NT, os_subtype, cache_system_info): Move here.
6069
6070 * unexw32.c, unexcw.c: Include w32common.h.
6071
6072 * emacs.c (main): Use (defined (WINDOWSNT) || defined
6073 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
6074 to call syms_of_w32select.
6075
6076 * cygw32.h: Remove obsolete EXFUN declarations.
6077
6078 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
6079
6080 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
6081 of w32inevt.o from SOME_MACHINE_OBJECTS.
6082
60832012-10-08 Daniel Colascione <dancol@dancol.org>
6084
6085 * image.c: Permanent fix for JPEG compilation issue --- limit
6086 jpeglib `boolean' redefinition to Cygwin builds.
6087
60882012-10-08 Eli Zaretskii <eliz@gnu.org>
6089
6090 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
6091
6092 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
6093 Cygwin.
6094
60952012-10-08 Daniel Colascione <dancol@dancol.org>
6096
6097 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
6098 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
6099 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
6100 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
6101 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
6102 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
6103 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
6104 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
6105 now a supported configuration.
6106
6107 * Makefile.in: consolidate image variables into LIBIMAGE; add
6108 W32_OBJ and W32_LIBS. Compile new files.
6109
6110 * conf_post.h:
6111 (_DebPrint) declare tracing facility for W32 debugging. We need
6112 to unify tracing later.
6113
6114 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
6115 unconditional use of W32 Unicode functions. Cygwin runs only on
6116 100% Unicode operating systems.
6117
6118 * cygw32.c: New file. Define Cygwin-specific facilities.
6119 (Fcygwin_convert_path_to_windows)
6120 (Fcygwin_convert_path_from_windows): New user functions for
6121 accessing Cygwin path-munging routines.
6122
6123 * cygw32.h: New file.
6124 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
6125 UTF-16LE strings temporarily inside non-Lisp-visible string
6126 objects.
6127
6128 (w32_strerror): Just what it says on the tin.
6129
6130 * emacs.c: Make the NS fork-then-exec code for daemon-launching
6131 also run for Cygwin; both systems have the same problem with using
6132 GUI facilities in a forked child. Also call syms_of_cygw32,
6133 syms_of_w32select in correct places.
6134
6135 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
6136 needs fork-then-exec for daemon launching.
6137
6138 * font.h: Include frame.h.
6139
6140 * image.c: Use the image library cache machinery only when we're
6141 compiling for native WINDOWSNT; Cygwin can use shared libraries
6142 like any other Unixlike system.
6143
6144 * keyboard.c: Clarify a comment regarding the input loop.
6145
6146 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
6147 functions directly instead of trying to detect at runtime that our
6148 host operating system supports them. We make this change for two
6149 reasons: Cygwin lacks support for the multibyte character
6150 conversion functions used by the legacy menu code, and Cygwin
6151 never needs to rely on non-Unicode APIs.
6152
6153 * unexw32.c (hinst): Declare extern.
6154
6155 * w32.c: Change header order;
6156 (w32_strerror): Move to w32fns.c because we need it for
6157 non-WINDOWSNT builds.
6158
6159 * w32.h: Add #error macro to make sure we don't include w32.h for
6160 Cygwin builds. Remove w32select declarations.
6161
6162 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
6163 w32fns.c. w32console.c is WINDOWSNT-only.
6164
6165 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
6166 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
6167 POSIXy alternative.
6168 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
6169 (w32_major_version, w32_minor_version, w32_build_number)
6170 (os_subtype, sound_type): Define here
6171 (w32_defined_color): Make color parameter const for consistency
6172 with other _defined_color functions.
6173 (w32_createwindow): Unconditionally call w32_init_class instead of
6174 doing so only when hprevinst is non-NULL. Plumbing hprevinst
6175 through the code is complex and unnecessary because class
6176 registration is practically free.
6177 (w32_name_of_message): New EMACSDEBUG-only function.
6178 (Fset_message_beep): Move here
6179 (Fx_open_connection): Require that the display name for Windows be
6180 "w32" for consistency, emacsclient disambiguation, and maybe, one
6181 day, multi-window-system support.
6182 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
6183 Cygwin files for W32 GUI facilities, since these clearly don't
6184 expect Cygwin names.
6185 (_DebPrint): Define.
6186 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
6187 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
6188 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
6189 (w32_last_error): Remove.
6190
6191 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
6192
6193 * w32heap.c (syspage_mask): Declare here.
6194 (cache_system_info): Remove.
6195
6196 * w32inevt.c (faked_key): Define globally, not statically.
6197 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
6198 (w32_console_toggle_lock_key): Move to w32fns.c.
6199
6200 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
6201
6202 * w32proc.c (_DebPrint): Move to w32fns.c.
6203 * w32select.c: Include string.h, stdio.h for Cygwin.
6204 * w32select.h: New File.
6205
6206 * w32term.c: Include io.h for non-CYGWIN builds; needed for
6207 get_osfhandle.
6208 (w32_message_fd): New variable. Under Cygwin, holds the file
6209 descriptor the system used to tell us about pending thread
6210 messages.
6211
6212 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
6213 that prevented compilation under non-WINDOWSNT systems.
6214
6215 (w32_initialize): Open /dev/windows and assign it to
6216 w32_message_fd. Provide w32 feature.
6217
6218 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
6219 (WM_EMACS_INPUT_READY): add.
6220 (prepend_msg, w32_message_fd): Declare globally.
6221
6222 * w32xfns.c:
6223 (keyboard_handle): Use only when WINDOWSNT.
6224 (notify_msg_ready): New function. Posts a message to the main
6225 thread's message queue under CYGWIN, which wakes up the main
6226 thread from select(2) by making the /dev/windows file descriptor
6227 ready. Under WINDOWSNT, it sets an event the same way the old
6228 code did.
6229
6230 (post, prepend_msg): Actually call notify_msg_ready instead of
6231 setting the input event directly.
6232
62332012-10-07 Eli Zaretskii <eliz@gnu.org>
6234
6235 * ralloc.c (relinquish): If a heap is ready to be relinquished,
6236 but it still has blocs in it, don't return it to the system,
6237 instead of aborting. (Bug#12402)
6238
62392012-10-07 Jan Djärv <jan.h.d@swipnet.se>
6240
6241 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
6242
6243 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
6244 MAC_OS_X_VERSION_10_6.
6245 (syms_of_nsterm): Remove comment about Panther and above for
6246 ns-antialias-text.
6247 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
6248 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
6249 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
6250
6251 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
6252 MAC_OS_X_VERSION_10_4.
6253
6254 * nsmenu.m (fillWithWidgetValue:): Remove code for <
6255 MAC_OS_X_VERSION_10_2.
6256
6257 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
6258
6259 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
6260 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
6261
6262 * nsterm.m (ns_in_resize): Remove (Bug#12479).
6263 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
6264 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
6265 Remove ns_in_resize check.
6266 (ns_clear_frame_area): Remove resize handle code.
6267
6268 * nsfns.m (ns_in_resize): Remove.
6269 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
6270 Remove ns_in_resize check.
6271
62722012-10-07 Paul Eggert <eggert@cs.ucla.edu>
6273
6274 Improve sys_siglist detection.
6275 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
6276 defined as a macro, as is done in Solaris.
6277 (sys_siglist_entries): New macro.
6278 (save_strsignal): Use it.
6279 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
6280 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
6281
62822012-10-06 Jan Djärv <jan.h.d@swipnet.se>
6283
6284 * nsfns.m (Fx_create_frame): Call x_default_parameter with
6285 fullscreen/Fullscreen.
6286
6287 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
6288 tobar_height is new.
6289
6290 * nsterm.m (x_make_frame_visible): Check for fullscreen.
6291 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
6292 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
6293 (windowDidResize:): Check for correct window if old style fullscreen.
6294 Capitalize word in comment. Remove incorrect comment.
6295 (initFrameFromEmacs:): tbar_height renamed tibar_height.
6296 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
6297 error in drawing background.
6298 (toggleFullScreen:): Remove comment. Rearrange calls.
6299 Set toolbar values to zero, save old height in tobar_height.
6300 Restore tool bar height when leaving fullscreen.
6301 (canBecomeMainWindow): New function.
6302
63032012-10-06 Paul Eggert <eggert@cs.ucla.edu>
6304
6305 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
6306
63072012-10-05 Eli Zaretskii <eliz@gnu.org>
6308
6309 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
6310
6311 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
6312 that time stamps of directories could also be changed.
6313 Don't request the too broad GENERIC_WRITE, only the more restrictive
6314 FILE_WRITE_ATTRIBUTES access rights.
6315
6316 * fileio.c (Fset_file_times): Special-case ignoring errors for
6317 directories only on MSDOS, not on MS-Windows.
6318
63192012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
6320
6321 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
6322
63232012-10-04 Eli Zaretskii <eliz@gnu.org>
6324
6325 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
6326 see whether CreateFile failed.
6327
63282012-10-04 Paul Eggert <eggert@cs.ucla.edu>
6329
6330 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
6331 to avoid similar races.
6332 * keyboard.c (pending_signals): Now bool, not int.
6333
6334 Port timers to OpenBSD, plus check for timer failures.
6335 OpenBSD problem reported by Han Boetes.
6336 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
6337 and/or setitimer.
6338 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
6339 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
6340 like OpenBSD, which has timer_settime but does not declare it.
6341 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
6342 whether to use itimerspec-related primitives. All uses of
6343 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
6344
63452012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6346
6347 * profiler.c (handle_profiler_signal): Fix a malloc race
6348 that caused Emacs to hang on Fedora 17 when profiling Lisp.
6349
63502012-10-02 Jan Djärv <jan.h.d@swipnet.se>
6351
6352 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
6353
63542012-10-02 Eli Zaretskii <eliz@gnu.org>
6355
6356 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
6357 consistent with the change in return value of 'safe_strsignal'.
6358
63592012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6360
6361 Prefer plain 'static' to 'static inline' (Bug#12541).
6362 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
6363 (bidi_set_sor_type, bidi_push_embedding_level)
6364 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
6365 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
6366 (bidi_cache_search, bidi_cache_ensure_space)
6367 (bidi_cache_iterator_state, bidi_cache_find)
6368 (bidi_peek_at_next_level, bidi_set_paragraph_end)
6369 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6370 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
6371 Now 'static', not 'static inline'.
6372
6373 Count overruns when profiling; change units to ns.
6374 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
6375 Give extra weight to samples after overruns, to attempt to count
6376 the time more accurately.
6377 (setup_cpu_timer): Change sampling interval units from ms to ns, since
6378 the underlying primitives nominally do ns.
6379 (Fprofiler_cpu_start): Document the change. Mention that
6380 the sampling intervals are only approximate.
6381
63822012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6383
6384 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
6385
6386 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6387 case for the special 0 coding-system.
6388
6389 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
6390 (Fmake_overlay): Remove redundant tests.
6391 (fix_start_end_in_overlays): Remove redundant recentering.
6392
63932012-10-02 Juanma Barranquero <lekktu@gmail.com>
6394
6395 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
6396 Update dependencies.
6397
63982012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6399
6400 Fix a malloc race condition involving strsignal.
6401 A signal can arrive in the middle of a malloc, and Emacs's signal
6402 handler can invoke strsignal, which can invoke malloc, which is
6403 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6404 Fix it by altering the signal handler so that it does not invoke
6405 strsignal.
6406 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6407 * process.c (status_message): Use const pointer, in case strsignal
6408 is #defined to safe_strsignal.
6409 * sysdep.c (sys_siglist, init_signals): Always define and
6410 initialize a substitute sys_siglist if the system does not define
6411 one, even if HAVE_STRSIGNAL.
6412 (safe_strsignal): Rename from strsignal. Always define,
6413 using sys_siglist. Return a const pointer.
6414 * syssignal.h (safe_strsignal): New decl.
6415 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6416
64172012-10-01 Eli Zaretskii <eliz@gnu.org>
6418
6419 * w32proc.c (timer_loop): Fix code that waits for timer
6420 expiration, to avoid high CPU usage.
6421
64222012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6423
6424 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6425 (sweep_weak_table): Remove redundant prototypes.
6426
64272012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6428
6429 * emacs.c: Move the inclusion of TERM_HEADER after including
6430 windows.h on WINDOWSNT. This avoids compilation problems with
6431 MSVC.
6432
64332012-10-01 Eli Zaretskii <eliz@gnu.org>
6434
6435 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6436 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6437 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6438 as the previous version used 'void *'.
6439
6440 * ralloc.c (ROUNDUP): Fix last change.
6441 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6442 'size_t'.
6443
6444 * w32proc.c <disable_itimers>: New static flag.
6445 (init_timers): Initialize it to zero, after creating the critical
6446 sections used by the timer threads.
6447 (term_timers): Set to 1 before deleting the critical sections.
6448 (getitimer, setitimer): If disable_itimers is non-zero, return an
6449 error indication without doing anything. Reported by Fabrice
6450 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
6451 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6452 return results.
6453 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6454 support timers.
6455
6456 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6457 term_ntproc after all the other bookkeeping, to get timers working
6458 as long as possible.
6459
64602012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6461
6462 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6463 Suggested by Juri Linkov in
6464 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6465
6466 Prefer plain 'static' to 'static inline' (Bug#12541).
6467 With static functions, modern compilers inline pretty well by
6468 themselves; advice from programmers often hurts as much as it helps.
6469 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6470 this change shrinks the text size of the Emacs executable by 1.1%
6471 without affecting CPU significantly in my benchmark.
6472 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6473 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6474 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6475 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6476 (bset_auto_fill_function, bset_auto_save_file_format)
6477 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6478 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6479 (bset_cache_long_line_scans, bset_case_fold_search)
6480 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6481 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6482 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6483 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6484 (bset_header_line_format, bset_indicate_buffer_boundaries)
6485 (bset_indicate_empty_lines, bset_invisibility_spec)
6486 (bset_left_fringe_width, bset_major_mode, bset_mark)
6487 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6488 (bset_name, bset_overwrite_mode, bset_pt_marker)
6489 (bset_right_fringe_width, bset_save_length)
6490 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6491 (bset_scroll_up_aggressively, bset_selective_display)
6492 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6493 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6494 (set_buffer_overlays_after):
6495 * category.c (bset_category_table):
6496 * charset.c (read_hex):
6497 * coding.c (produce_composition, produce_charset)
6498 (handle_composition_annotation, handle_charset_annotation)
6499 (char_encodable_p):
6500 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6501 (assign_row, set_frame_matrix_frame, make_current)
6502 (add_row_entry):
6503 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6504 * fns.c (maybe_resize_hash_table):
6505 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6506 * gmalloc.c (register_heapinfo):
6507 * image.c (lookup_image_type):
6508 * intervals.c (set_interval_object, set_interval_left)
6509 (set_interval_right, copy_interval_parent, rotate_right)
6510 (rotate_left, balance_possible_root_interval):
6511 * keyboard.c (kset_echo_string, kset_kbd_queue)
6512 (kset_keyboard_translate_table, kset_last_prefix_arg)
6513 (kset_last_repeatable_command, kset_local_function_key_map)
6514 (kset_overriding_terminal_local_map, kset_real_last_command)
6515 (kset_system_key_syms, clear_event, set_prop):
6516 * lread.c (digit_to_number):
6517 * marker.c (attach_marker, live_buffer, set_marker_internal):
6518 * nsterm.m (ns_compute_glyph_string_overhangs):
6519 * process.c (pset_buffer, pset_command)
6520 (pset_decode_coding_system, pset_decoding_buf)
6521 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6522 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6523 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6524 * syntax.c (bset_syntax_table, dec_bytepos):
6525 * terminal.c (tset_param_alist):
6526 * textprop.c (interval_has_some_properties)
6527 (interval_has_some_properties_list):
6528 * window.c (wset_combination_limit, wset_dedicated)
6529 (wset_display_table, wset_hchild, wset_left_fringe_width)
6530 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6531 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6532 (wset_right_fringe_width, wset_right_margin_cols)
6533 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6534 (wset_vertical_scroll_bar_type, wset_window_parameters):
6535 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6536 (wset_column_number_displayed, wset_region_showing)
6537 (window_box_edges, run_window_scroll_functions)
6538 (append_glyph_string_lists, prepend_glyph_string_lists)
6539 (append_glyph_string, set_glyph_string_background_width)
6540 (append_glyph, append_composite_glyph)
6541 (take_vertical_position_into_account):
6542 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6543 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6544 (lface_hash, lface_same_font_attributes_p, lookup_face):
6545 * xml.c (libxml2_loaded_p):
6546 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6547 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6548 Now 'static', not 'static inline'.
6549
6550 * bidi.c: Tune.
6551 (bidi_copy_it): Do the whole copy with a single memcpy.
6552 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6553
6554 Revert the FOLLOW-SYMLINKS change for file-attributes.
6555 Doing it right would require several changes to Tramp, and there's
6556 not enough time to get that tested before the freeze today.
6557 * dired.c (directory_files_internal, Ffile_attributes):
6558 Undo last change.
6559
6560 * frame.c (x_report_frame_params): Port better to wider ints.
6561 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6562 or that pointers can be printed in 15 decimal digits.
6563 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6564
65652012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6566
6567 Support x64 build on MS-Windows.
6568 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6569 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6570 compatibility with x64.
6571 (x_get_focus_frame): Add prototype.
6572
6573 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6574 defining an XRectangle structure.
6575
6576 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6577 arithmetics for compatibility with x64.
6578
6579 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6580 compatibility with x64.
6581
6582 * w32heap.h: Adjust prototypes and declarations.
6583
6584 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6585 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6586 DWORD, long, and unsigned long, for compatibility with x64.
6587 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6588 (sbrk): Argument is now of type ptrdiff_t.
6589
6590 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6591 less than 0x0500.
6592 (w32_msg_pump): Use WPARAM type for 'result'.
6593
6594 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6595 architecture.
6596 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6597 compatibility with x64.
6598
6599 * vm-limit.c (lim_data): Now size_t.
6600 (check_memory_limits): Adjust prototypes of real_morecore and
6601 __morecore to receive argument of type ptrdiff_t. Use size_t for
6602 five_percent and data_size.
6603
6604 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6605 variables, for compatibility with x64.
6606 (rva_to_section, offset_to_section, relocate_offset)
6607 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6608 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6609 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6610 for compatibility with x64.
6611
6612 * sysdep.c (STDERR_FILENO): Define if not already defined.
6613
6614 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6615 (__morecore): Argument type is now ptrdiff_t.
6616 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6617 (relinquish): Use ptrdiff_t type for 'excess'.
6618 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6619
6620 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6621 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6622 instead of a literal number.
6623
6624 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6625 (min): Define only if not already defined.
6626
6627 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6628 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6629 hosts.
6630
6631 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6632 'bitmaps' is a pointer.
6633
6634 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6635
6636 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6637
66382012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6639
6640 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6641 * dired.c (directory_files_internal, Ffile_attributes):
6642 New arg follow_symlinks. All uses changed.
6643
66442012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6645
6646 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6647
66482012-09-30 Eli Zaretskii <eliz@gnu.org>
6649
6650 Support atimers and CPU profiler via profile.c on MS-Windows.
6651 * w32proc.c (sig_mask, crit_sig): New static variables.
6652 (sys_signal): Support SIGALRM and SIGPROF.
6653 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6654 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6655 sigfillset, and sigprocmask are no longer no-ops.
6656 (sigismember): New function.
6657 (struct itimer_data): New definition.
6658 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6659 (crit_prof): New static variables.
6660 (MAX_SINGLE_SLEEP): New definition.
6661 (timer_loop, stop_timer_thread, term_timers, init_timers)
6662 (start_timer_thread, getitimer, setitimer): New functions.
6663 (alarm): No longer a no-op, calls setitimer.
6664
6665 * w32.c (term_ntproc): Call term_timers.
6666 (init_ntproc): Make sure all signals are unblocked at startup, to
6667 erase any traces of dumping. Call init_timers.
6668
6669 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6670 Windows-specific code to display the hourglass mouse pointer is no
6671 longer used.
6672 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6673 to hourglass timer expiration.
6674 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6675 Remove, no longer used.
6676 (w32_note_current_window, show_hourglass, hide_hourglass):
6677 New functions, in support of hourglass cursor display similar to other
6678 window systems.
6679 (syms_of_w32fns): Don't initialize hourglass_timer.
6680
6681 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6682 WINDOWSNT as well.
6683 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6684
6685 * w32.h (init_timers, term_timers): Add prototypes.
6686
66872012-09-30 Kenichi Handa <handa@gnu.org>
6688
6689 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6690 to the buffer relocation which may be caused by ccl_driver.
6691
66922012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6693
6694 * xfns.c (Fx_file_dialog): Update comment.
6695
6696 * w32fns.c (Fx_file_dialog): Update comment.
6697
6698 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6699 Initialize panel name field if OSX >= 10.6.
6700
6701 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6702
6703 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6704
6705 * nsterm.m (NEW_STYLE_FS): New define.
6706 (ns_fullscreen_hook, windowWillEnterFullScreen)
6707 (windowDidEnterFullScreen, windowWillExitFullScreen)
6708 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6709 (setFSValue): New functions.
6710 (EmacsFSWindow): New implementation.
6711 (canBecomeKeyWindow): New function for EmacsFSWindow.
6712 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6713 (dealloc): Release nonfs_window if in fullscreen.
6714 (updateFrameSize:): Call windowDidMove to update top/left.
6715 (windowWillResize:toSize:): Check if frame is still maximized.
6716 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6717 next_maximized, maximized_width, maximized_height and nonfs_window.
6718 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6719 tbar_height.
6720 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6721 fullscreen. Set maximized_width/height. Act on next_maximized.
6722
6723 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6724 (EmacsView): Add variables for fullscreen.
6725 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6726 (EmacsFSWindow): New interface for fullscreen.
6727
67282012-09-30 Juanma Barranquero <lekktu@gmail.com>
6729
6730 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6731
67322012-09-30 Chong Yidong <cyd@gnu.org>
6733
6734 * fns.c (Frandom): Doc fix.
6735
67362012-09-30 Martin Rudalics <rudalics@gmx.at>
6737
6738 * window.c (Vwindow_combination_limit): New default value.
6739 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6740
67412012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6742
6743 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6744 Suggested by Eli Zaretskii in
6745 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6746
67472012-09-30 Eli Zaretskii <eliz@gnu.org>
6748
6749 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6750 HAVE_TIMER_SETTIME is defined.
6751
67522012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6753
6754 Profiler improvements: more-accurate timers, overflow checks.
6755 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6756 signal.h, setjmp.h. Include systime.h instead.
6757 (saturated_add): New function.
6758 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6759 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6760 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6761 New static vars.
6762 (enum profiler_cpu_running): New enum.
6763 (profiler_cpu_running): Now of that enum type, not bool.
6764 All uses changed to store the new value.
6765 (handle_profiler_signal): Rename from sigprof_handler_1,
6766 for consistency with other handlers. Do not check whether
6767 cpu_log is a hash-table if garbage collecting, since it
6768 doesn't matter in that case.
6769 (deliver_profiler_signal): Rename from sigprof_handler,
6770 for consistency with other handlers.
6771 (setup_cpu_timer): New function, with much of what used to be in
6772 Fprofiler_cpu_start. Check for out-of-range argument.
6773 Prefer timer_settime if available, and prefer
6774 thread cputime clocks, then process cputime clocks, then
6775 monotonic clocks, to the old realtime clock. Use make_timeval
6776 to round more-correctly when falling back to setitimer.
6777 (Fprofiler_cpu_start): Use it.
6778 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6779 Don't assume that passing NULL as the 2nd argument of setitimer
6780 is the same as passing a pointer to all-zero storage.
6781 Ignore SIGPROF afterwards.
6782 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6783 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6784 non-fatal signal handlers. Ignore SIGPROF on startup.
6785 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6786 in profiler.c, since sysdep.c now uses it.
6787
6788 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6789 Suggested by Eli Zaretskii in
6790 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6791
67922012-09-29 Juanma Barranquero <lekktu@gmail.com>
6793
6794 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6795
67962012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6797
6798 * lisp.h (struct backtrace): Remove indirection for `function' field.
6799 * xdisp.c (redisplay_internal):
6800 * profiler.c (record_backtrace, sigprof_handler_1):
6801 * alloc.c (Fgarbage_collect):
6802 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6803 (Fbacktrace_frame): Adjust accordingly.
6804
68052012-09-28 Glenn Morris <rgm@gnu.org>
6806
6807 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6808 (Frun_hook_with_args_until_failure): Doc fixes.
6809
68102012-09-28 Eli Zaretskii <eliz@gnu.org>
6811
6812 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6813 Qautomatic_redisplay and change the symbol name. All users changed.
6814
68152012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6816
6817 * profiler.c (sigprof_handler): Fix race condition.
6818
68192012-09-28 Glenn Morris <rgm@gnu.org>
6820
6821 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6822
68232012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6824
6825 Check more robustly for timer_settime.
6826 * Makefile.in (LIB_TIMER_TIME): New macro.
6827 (LIBES): Add it.
6828 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6829 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6830 call timer_settime.
6831
68322012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6833
6834 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6835
68362012-09-26 Juanma Barranquero <lekktu@gmail.com>
6837
6838 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6839
68402012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6841
6842 * character.h (MAYBE_UNIFY_CHAR): Remove.
6843 * charset.c, charset.h (maybe_unify_char): Now static.
6844 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6845 Since this stuff is now private to charset.c, there's no need for
6846 a public macro and no need to inline by hand.
6847
68482012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6849 Stefan Monnier <monnier@iro.umontreal.ca>
6850 Juanma Barranquero <lekktu@gmail.com>
6851
6852 * profiler.c: New file.
6853 * Makefile.in (base_obj): Add profiler.o.
6854 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6855 ($(BLD)/profiler.$(O)): New target.
6856 * emacs.c (main): Call syms_of_profiler.
6857 * alloc.c (Qautomatic_gc): New constant.
6858 (MALLOC_PROBE): New macro.
6859 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6860 (total_bytes_of_live_objects): New function.
6861 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6862 Call malloc_probe for the memory profiler.
6863 (syms_of_alloc): Define Qautomatic_gc.
6864 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6865 race condition.
6866 (struct backtrace): Move definition...
6867 * lisp.h (struct backtrace): ..here.
6868 (Qautomatic_gc, profiler_memory_running): Declare vars.
6869 (malloc_probe, syms_of_profiler): Declare functions.
6870 * xdisp.c (Qautomatic_redisplay): New constant.
6871 (redisplay_internal): Record itself in backtrace_list.
6872 (syms_of_xdisp): Define Qautomatic_redisplay.
6873
68742012-09-25 Eli Zaretskii <eliz@gnu.org>
68752012-09-25 Juanma Barranquero <lekktu@gmail.com>
6876
6877 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6878
68792012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6880
6881 Prefer POSIX timers if available.
6882 They avoid a race if the timer is too close to the current time.
6883 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6884 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6885 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6886
68872012-09-25 Eli Zaretskii <eliz@gnu.org>
6888
6889 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6890 CHAR_STRING_ADVANCE.
6891 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6892 STRING_CHAR_ADVANCE.
6893
68942012-09-25 Juanma Barranquero <lekktu@gmail.com>
6895
6896 Move Vlibrary_cache to emacs.c and reset before dumping.
6897
6898 * lisp.h (reset_image_types): Declare.
6899 [WINDOWSNT] (Vlibrary_cache): Declare.
6900
6901 * image.c (reset_image_types): New function.
6902
6903 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6904 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6905 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6906
6907 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6908 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6909
6910 * w32.h (Vlibrary_cache): Do not declare.
6911
69122012-09-25 Eli Zaretskii <eliz@gnu.org>
6913
6914 * w32proc.c (sys_signal): Handle all signals defined by the
6915 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6916 handlers for signals supported by Windows. Don't override
6917 term_ntproc as the handler for SIGABRT.
6918 (sigaction): Rewrite to call sys_signal instead of duplicating its
6919 code.
6920 (sys_kill): Improve commentary.
6921
6922 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6923 consistency with a signature of a signal handler. All callers
6924 changed.
6925 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6926 install term_ntproc as a signal handler for SIGABRT, as that
6927 should be done by the dumped Emacs.
6928
6929 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6930
6931 * w32select.c (term_w32select): Protect against repeated
6932 invocation by setting clipboard_owner to NULL after calling
6933 DestroyWindow.
6934
6935 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6936 and term_ntproc to their modified signatures.
6937
6938 * character.c (char_string, string_char): Remove calls to
6939 MAYBE_UNIFY_CHAR. See the discussion starting at
6940 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6941 for the details.
6942
69432012-09-25 Chong Yidong <cyd@gnu.org>
6944
6945 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6946
69472012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6948
6949 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6950 when encountering an unknown bytecode.
6951
69522012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6953
6954 image.c, indent.c: Use bool for booleans.
6955 * dispextern.h (struct image_type): Members valid_p, load, init
6956 now return bool, not int. All uses changed.
6957 * image.c: Omit unnecessary static decls.
6958 (x_create_bitmap_mask, x_build_heuristic_mask):
6959 Return void, not int, since callers don't care about the return value.
6960 (x_create_bitmap_mask, define_image_type, valid_image_p)
6961 (struct image_keyword, parse_image_spec, image_spec_value)
6962 (check_image_size, image_background)
6963 (image_background_transparent, x_clear_image_1)
6964 (postprocess_image, lookup_image, x_check_image_size)
6965 (x_create_x_image_and_pixmap, xbm_image_p)
6966 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6967 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6968 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6969 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6970 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6971 (png_image_p, init_png_functions, png_load_body, png_load)
6972 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6973 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6974 (init_gif_functions, gif_load, imagemagick_image_p)
6975 (imagemagick_load_image, imagemagick_load, svg_image_p)
6976 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6977 (gs_load):
6978 * nsimage.m (ns_load_image):
6979 * nsterm.m (ns_defined_color):
6980 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6981 * xfns.c (x_defined_color):
6982 * xterm.c (x_alloc_lighter_color_for_widget)
6983 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6984 (x_alloc_lighter_color):
6985 * indent.c (disptab_matches_widthtab, current_column)
6986 (scan_for_column, string_display_width, indented_beyond_p)
6987 (compute_motion, vmotion, Fvertical_motion):
6988 Use bool for booleans.
6989
69902012-09-24 Chong Yidong <cyd@gnu.org>
6991
6992 * chartab.c (Fset_char_table_default): Obsolete function removed.
6993
69942012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6995
6996 Move pid_t related decls out of lisp.h.
6997 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6998 (interruptible_wait_for_termination):
6999 Move these decls from lisp.h to syswait.h, since they use pid_t.
7000 Needed on FreeBSD; see Herbert J. Skuhra in
7001 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
7002 * callproc.c: Include syswait.h.
7003
7004 gnutls.c, gtkutil.c: Use bool for boolean.
7005 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
7006 (emacs_gnutls_handle_error):
7007 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
7008 (xg_hide_tooltip, xg_create_frame_widgets)
7009 (create_dialog, xg_uses_old_file_dialog)
7010 (xg_get_file_with_chooser, xg_get_file_with_selection)
7011 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
7012 (xg_item_label_same_p, xg_update_menubar)
7013 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
7014 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
7015 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
7016 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
7017 (update_frame_tool_bar, free_frame_tool_bar):
7018 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
7019 * nsmenu.m (ns_update_menubar):
7020 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
7021 * xfns.c (Fx_show_tip) [USE_GTK]:
7022 Use bool for boolean.
7023 * gtkutil.c (xg_update_frame_menubar):
7024 * xmenu.c (update_frame_menubar):
7025 Return void, not int, since caller ignores return value.
7026 * gtkutil.c (xg_change_toolbar_position):
7027 Return void, not 1.
7028
70292012-09-23 Juanma Barranquero <lekktu@gmail.com>
7030
7031 * makefile.w32-in (BLOCKINPUT_H): Remove.
7032 (SYSSIGNAL_H): New macro.
7033 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
7034 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
7035 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
7036 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
7037 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
7038 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
7039 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
7040 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
7041 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
7042 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
7043 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
7044 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
7045 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
7046 ($(BLD)/w32xfns.$(O)): Update dependencies.
7047
70482012-09-23 Eli Zaretskii <eliz@gnu.org>
7049
7050 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
7051 fatal_error_backtrace.
7052
7053 * w32proc.c (sys_kill): Undo last change: don't do anything when
7054 invoked to deliver SIGABRT to our own process. This is now
7055 handled by emacs_raise.
7056
70572012-09-23 Juanma Barranquero <lekktu@gmail.com>
7058
7059 * w32term.c (w32_read_socket): Remove leftover reference to
7060 interrupt_input_pending.
7061
70622012-09-23 Paul Eggert <eggert@cs.ucla.edu>
7063
7064 Do not use SA_NODEFER.
7065 Problem reported by Dani Moncayo in
7066 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
7067 * alloc.c (die):
7068 * sysdep.c (emacs_abort): Do not reset signal handler.
7069 * emacs.c (terminate_due_to_signal): Reset signal handler here.
7070 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
7071 wanted even on POSIXish hosts, and it doesn't work on Windows.
7072
70732012-09-23 Jan Djärv <jan.h.d@swipnet.se>
7074
7075 * xterm.c (x_term_init): Call fixup_locale before and after calling
7076 gtk_init (Bug#12392).
7077
70782012-09-23 Chong Yidong <cyd@gnu.org>
7079
7080 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
7081 Vdynamic_library_alist.
7082
7083 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
7084 (Fgnutls_available_p): Caller changed.
7085
7086 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
7087 (Flibxml_parse_xml_region): Likewise.
7088
7089 * dispextern.h (struct image_type): Remove arg from init function.
7090
7091 * image.c (Finit_image_library, lookup_image_type)
7092 (define_image_type): Remove now-unneeded second arg.
7093 (init_xpm_functions, init_png_functions, init_jpeg_functions)
7094 (init_tiff_functions, init_gif_functions, init_svg_functions):
7095 Arglist and w32_delayed_load calling convention changed.
7096 (gs_type): Remove init_gs_functions; there is no such function.
7097 (valid_image_p, make_image): Fix caller to lookup_image_type.
7098
70992012-09-23 Paul Eggert <eggert@cs.ucla.edu>
7100
7101 Simplify and avoid signal-handling races (Bug#12471).
7102 * alloc.c (die):
7103 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
7104 Avoid recursive loop if there's a fatal error in the function itself.
7105 * atimer.c (pending_atimers):
7106 * blockinput.h: Don't include "atimer.h"; no longer needed.
7107 (interrupt_input_pending): Remove. All uses removed.
7108 pending_signals now counts both atimers and ordinary interrupts.
7109 This is less racy than having three separate pending-signal flags.
7110 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
7111 (input_blocked_p):
7112 Rename from their upper-case counterparts BLOCK_INPUT,
7113 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
7114 INPUT_BLOCKED_P, and turn into functions. All uses changed.
7115 This makes it easier to access volatile variables more accurately.
7116 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
7117 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
7118 that's more reliable if the code is buggy and sets
7119 interrupt_input_blocked to a negative value. All uses changed.
7120 * atimer.c (deliver_alarm_signal):
7121 Remove. No need to deliver this to the parent; any thread can
7122 handle this signal now. All uses replaced by underlying handler.
7123 * atimer.c (turn_on_atimers):
7124 * dispnew.c (handle_window_change_signal):
7125 * emacs.c (handle_danger_signal):
7126 * keyboard.c (kbd_buffer_get_event):
7127 Don't reestablish signal handler; not needed with sigaction.
7128 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
7129 (UNBLOCK_INPUT_TO):
7130 Rework to avoid unnecessary accesses to volatile variables.
7131 (UNBLOCK_INPUT_TO): Now a function.
7132 (totally_unblock_input, unblock_input): New decls.
7133 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
7134 (init_data): Remove. Necessary stuff now done in init_signal.
7135 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
7136 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
7137 (fatal_error_code): Remove; no longer needed.
7138 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
7139 it doesn't always backtrace. All uses changed. No need to reset
7140 signal to default, since sigaction and/or die does that for us now.
7141 Use emacs_raise (FOO), not kill (getpid (), FOO).
7142 (main): Check more-accurately whether we're dumping.
7143 Move fatal-error setup to sysdep.c
7144 * floatfns.c: Do not include "syssignal.h"; no longer needed.
7145 * gtkutil.c (xg_get_file_name, xg_get_font):
7146 Remove no-longer-needed signal-mask manipulation.
7147 * keyboard.c, process.c (POLL_FOR_INPUT):
7148 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
7149 * keyboard.c (read_avail_input): Remove.
7150 All uses replaced by gobble_input.
7151 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
7152 (kbd_buffer_store_event_hold, gobble_input):
7153 (record_asynch_buffer_change) [USABLE_SIGIO]:
7154 (store_user_signal_events):
7155 No need to mess with signal mask.
7156 (gobble_input): If blocking input and there are terminals, simply
7157 set pending_signals to 1 and return. All hooks changed to not
7158 worry about whether input is blocked.
7159 (process_pending_signals): Clear pending_signals before processing
7160 them, in case a signal comes in while we're processing.
7161 By convention callers now test pending_signals before calling us.
7162 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
7163 New functions, to support changes to blockinput.h.
7164 (handle_input_available_signal): Now extern.
7165 (reinvoke_input_signal): Remove. All uses replaced by
7166 handle_async_input.
7167 (quit_count): Now volatile, since a signal handler uses it.
7168 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
7169 All callers changed. Block SIGINT only if not already blocked.
7170 Clear sigmask reliably, even if Fsignal returns, which it can.
7171 Omit unnecessary accesses to volatile var.
7172 (quit_throw_to_read_char): No need to restore sigmask.
7173 * keyboard.c (gobble_input, handle_user_signal):
7174 * process.c (wait_reading_process_output):
7175 Call signal-handling code rather than killing ourselves.
7176 * lisp.h: Include <float.h>, for...
7177 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
7178 (pending_signals): Now volatile.
7179 (syms_of_data): Now const if IEEE floating point.
7180 (handle_input_available_signal) [USABLE_SIGIO]:
7181 (terminate_due_to_signal, record_child_status_change): New decls.
7182 * process.c (create_process): Avoid disaster if memory is exhausted
7183 while we're processing a vfork, by tightening the critical section
7184 around the vfork.
7185 (send_process_frame, process_sent_to, handle_pipe_signal)
7186 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
7187 ignores SIGPIPE.
7188 (send_process): No need for setjmp/longjmp any more, since the
7189 SIGPIPE stuff is now gone. Instead, report an error if errno
7190 is EPIPE.
7191 (record_child_status_change): Now extern. PID and W are now args.
7192 Return void, not bool. All callers changed.
7193 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
7194 Remove. All uses removed. This bug should be fixed now in a
7195 different way.
7196 (wait_for_termination_1): Use waitpid rather than sigsuspend,
7197 and record the child status change directly. This avoids the
7198 need to futz with the signal mask.
7199 (process_fatal_action): Move here from emacs.c.
7200 (emacs_sigaction_flags): New function, containing
7201 much of what used to be in emacs_sigaction_init.
7202 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
7203 caught by emacs, to make races less likely.
7204 (deliver_process_signal): Rename from handle_on_main_thread.
7205 All uses changed.
7206 (BACKTRACE_LIMIT_MAX): Now at top level.
7207 (thread_backtrace_buffer, threadback_backtrace_pointers):
7208 New static vars.
7209 (deliver_thread_signal, deliver_fatal_thread_signal):
7210 New functions, for more-accurate delivery of thread-specific signals.
7211 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
7212 (deliver_arith_signal): Handle in this thread, not
7213 in the main thread, since it's triggered by this thread.
7214 (maybe_fatal_sig): New function.
7215 (init_signals): New arg DUMPING so that we can be more accurate
7216 about whether we're dumping. Caller changed.
7217 Treat thread-specific signals differently from process-general signals.
7218 Block all signals while handling fatal error; that's safer.
7219 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
7220 on IEEE hosts.
7221 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
7222 Ignore SIGPIPE unless batch.
7223 (emacs_backtrace): Output backtrace for the appropriate thread,
7224 which is not necessarily the main thread.
7225 * syssignal.h: Include <stdbool.h>.
7226 (emacs_raise): New macro.
7227 * xterm.c (x_connection_signal): Remove; no longer needed
7228 now that we use sigaction.
7229 (x_connection_closed): No need to mess with sigmask now.
7230 (x_initialize): No need to reset SIGPIPE handler here, since
7231 init_signals does this for us now.
7232
72332012-09-23 Jan Djärv <jan.h.d@swipnet.se>
7234
7235 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
7236 background rect may be larger (Bug#12245).
7237
72382012-09-23 Chong Yidong <cyd@gnu.org>
7239
7240 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
7241
72422012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7243
7244 * .gdbinit: Just stop at fatal_error_backtrace.
7245 See Stefan Monnier's request in
7246 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
7247 Remove no-longer-used query of system type.
7248
72492012-09-22 Chong Yidong <cyd@gnu.org>
7250
7251 * search.c (Freplace_match): Doc fix (Bug#12325).
7252
7253 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
7254
7255 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
7256 (Fline_end_position): Doc fix.
7257
7258 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
7259
72602012-09-22 Chong Yidong <cyd@gnu.org>
7261
7262 * dispextern.h (struct image_type): Add new slot, storing a type
7263 initialization function.
7264
7265 * image.c (define_image_type): Call the image initializer function
7266 if it is defined. Arguments and return value changed.
7267 (valid_image_p, make_image): Callers changed.
7268 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
7269 (gif_type, imagemagick_type, svg_type, gs_type):
7270 Add initialization functions.
7271 (Finit_image_library): Call lookup_image_type.
7272 (CHECK_LIB_AVAILABLE): Macro deleted.
7273 (lookup_image_type): Call define_image_type here, rather than via
7274 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
7275 (syms_of_image): Move define_image_type calls for xbm_type and
7276 pbm_type to lookup_image_type.
7277
72782012-09-22 Eli Zaretskii <eliz@gnu.org>
7279
7280 * keyboard.c (timer_check_2): Move calculation of 'timers' and
7281 'idle_timers' from here ...
7282 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
7283 lists, to avoid infloops when the timer does something stupid,
7284 like reinvoke itself with the same or smaller time-out.
7285 (Bug#12447)
7286
72872012-09-22 Martin Rudalics <rudalics@gmx.at>
7288
7289 * window.c (Fsplit_window_internal): Handle only Qt value of
7290 Vwindow_combination_limit separately.
7291 (Qtemp_buffer_resize): New symbol.
7292 (Vwindow_combination_limit): New default value.
7293 Rewrite doc-string.
7294
72952012-09-22 Eli Zaretskii <eliz@gnu.org>
7296
7297 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
7298 the new overlay string. (Bug#10159)
7299
73002012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7301
7302 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
7303 or that fprintf is async-signal-safe. POSIX doesn't require
7304 either assumption.
7305
73062012-09-22 Chong Yidong <cyd@gnu.org>
7307
7308 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
7309 (Bug#8207).
7310
73112012-09-22 Kenichi Handa <handa@gnu.org>
7312
7313 * composite.c (composition_reseat_it): Handle the case that a
7314 grapheme cluster is not covered by a single font (Bug#12352).
7315
73162012-09-21 Chong Yidong <cyd@gnu.org>
7317
7318 * image.c (define_image_type): Avoid adding duplicate types to
7319 image_types (Bug#12463). Suggested by Jörg Walter.
7320
73212012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7322
7323 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
7324 (print_load_command_name): Add case LC_DATA_IN_CODE.
7325 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
7326
73272012-09-21 Glenn Morris <rgm@gnu.org>
7328
7329 * eval.c (Frun_hook_with_args_until_success)
7330 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
7331
73322012-09-21 Andreas Schwab <schwab@linux-m68k.org>
7333
7334 * fileio.c (Ffile_selinux_context): Only call freecon when
7335 lgetfilecon succeeded.
7336 (Fset_file_selinux_context): Likewise. (Bug#12444)
7337
73382012-09-21 Eli Zaretskii <eliz@gnu.org>
7339
7340 * xdisp.c (try_window_reusing_current_matrix): Under bidi
7341 reordering, locate the cursor by calling set_cursor_from_row; if
7342 that fails, clear the desired glyph matrix before returning a
7343 failure indication to the caller. Fixes leaving garbled display
7344 when fast scrolling with a down-key. (Bug#12403)
7345 (compute_stop_pos_backwards): Fix a typo that caused crashes while
7346 scrolling through multibyte text.
7347
73482012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
7349
7350 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
7351 calling mark_vectorlike since that's the one that marks the window.
7352 (mark_discard_killed_buffers): Mark the final cdr.
7353 * window.h (struct window): Move prev/next_buffers to the
7354 non-standard fields.
7355 * window.c (make_window): Initialize prev/next_buffers manually.
7356
73572012-09-20 Paul Eggert <eggert@cs.ucla.edu>
7358
7359 Omit unused arg EXPECTED from socket hooks.
7360 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
7361 * nsterm.m (ns_term_init):
7362 * termhooks.h (struct terminal.read_socket_hook):
7363 * w32inevt.c (w32_console_read_socket):
7364 * w32term.c (w32_read_socket):
7365 * xterm.c (XTread_socket):
7366 Omit unused arg EXPECTED. All callers changed.
7367 (store_user_signal_events): Return void, not int, since callers no
7368 longer care about the return value. All uses changed.
7369
73702012-09-20 Juanma Barranquero <lekktu@gmail.com>
7371
7372 * w32gui.h (XParseGeometry): Do not declare.
7373
73742012-09-19 Paul Eggert <eggert@cs.ucla.edu>
7375
7376 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
7377 Ignore 'expected'. See Eli Zaretskii in
7378 <http://bugs.gnu.org/12471#8> (last line).
7379
7380 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
7381 (XParseGeometry): Now static. Substitute extremal values for
7382 values that are out of range.
7383
73842012-09-19 Jan Djärv <jan.h.d@swipnet.se>
7385
7386 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
7387
7388 * nsfns.m (XParseGeometry): Remove.
7389 (Fx_create_frame): Call x_set_offset to correctly interpret
7390 top_pos in geometry.
7391
7392 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
7393 (Fx_parse_geometry): If there is a space in string, call
7394 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
7395
73962012-09-17 Eli Zaretskii <eliz@gnu.org>
7397
7398 * search.c (scan_buffer): Use character positions in calls to
7399 region_cache_forward and region_cache_backward, not byte
7400 positions. (Bug#12196)
7401
7402 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7403 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7404
7405 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7406 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7407 emacs_blocked_malloc, now deleted.
7408
74092012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7410
7411 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7412 The workaround was for improving performance on Solaris 2.4, but
7413 is getting in the way now. Emacs will still work if someone is
7414 still running Solaris 2.4 in a museum somewhere; Sun dropped
7415 support for Solaris 2.4 in 2003.
7416 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7417 * process.c (create_process) [HAVE_WORKING_VFORK]:
7418 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7419 since Emacs no longer uses vfork on that platform.
7420
74212012-09-17 Glenn Morris <rgm@gnu.org>
7422
7423 * emacs.c: Use COPYRIGHT.
7424
74252012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7426
7427 Remove configure's --without-sync-input option (Bug#12450).
7428 When auditing signal-handling in preparation for cleaning it up,
7429 I found that SYNC_INPUT has race conditions and would be a real
7430 pain to fix. Since it's an undocumented and deprecated
7431 configure-time option, now seems like a good time to remove it.
7432 Also see <http://bugs.gnu.org/11080#16>.
7433 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7434 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7435 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7436 (malloc_hysteresis):
7437 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7438 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7439 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7440 (dont_register_blocks, bytes_used_when_reconsidered)
7441 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7442 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7443 [!SYSTEM_MALLOC && !SYNC_INPUT]:
7444 Remove. All uses removed.
7445 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7446 implementation, one that depends on whether the new macro
7447 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7448 is defined.
7449 * atimer.c (run_timers, handle_alarm_signal):
7450 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7451 (handle_async_input, process_pending_signals)
7452 (handle_input_available_signal, init_keyboard):
7453 * nsterm.m (ns_read_socket):
7454 * process.c (wait_reading_process_output):
7455 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7456 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7457 (emacs_write):
7458 * xterm.c (XTread_socket):
7459 Assume SYNC_INPUT.
7460 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7461 * eval.c (handling_signal): Remove. All uses removed.
7462 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7463 All uses replaced with the SYNC_INPUT version.
7464 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7465 Remove decls.
7466 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7467 Now static.
7468
7469 * font.c (Ffont_shape_gstring): Remove unused local.
7470
74712012-09-16 Glenn Morris <rgm@gnu.org>
7472
7473 * Makefile.in (clean): No longer run nextstep's clean.
7474
7475 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7476 (ns_frag): Remove.
7477 (ns-app): Move here from ns.mk, and simplify.
7478 (clean): Simplify nextstep entry.
7479 * ns.mk: Remove file.
7480
74812012-09-17 Kenichi Handa <handa@gnu.org>
7482
7483 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7484 not covert the last few charactes.
7485
74862012-09-16 Kenichi Handa <handa@gnu.org>
7487
7488 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7489 here, but just check the validity of glyphs in the glyph-string.
7490
74912012-09-16 Martin Rudalics <rudalics@gmx.at>
7492
7493 * window.c (Fwindow_parameter, Fset_window_parameter):
7494 Accept any window as argument (Bug#12452).
7495
74962012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7497
7498 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7499 to ns_term_init to avoid memory leak.
7500
7501 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7502 explicit retain/release.
7503 (ns_term_init): Only allow one display. Initialize outerpool and
7504 ns_*_types.
7505
75062012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7507
7508 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7509 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7510 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7511 the Microsoft problem in a different way, by altering ../nt/config.nt.
7512
75132012-09-15 Eli Zaretskii <eliz@gnu.org>
7514
7515 * w32xfns.c:
7516 * w32uniscribe.c:
7517 * w32term.c:
7518 * w32select.c:
7519 * w32reg.c:
7520 * w32proc.c:
7521 * w32menu.c:
7522 * w32inevt.c:
7523 * w32heap.c:
7524 * w32font.c:
7525 * w32fns.c:
7526 * w32console.c:
7527 * w32.c:
7528 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7529 by lisp.h. This completes removal of setjmp.h inclusion
7530 erroneously announced in the previous commit. (Bug#12446)
7531
7532 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7533 more accurate.
7534
7535 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7536 not defined as a macro. The latter happens on MS-Windows.
7537 (Bug#12446)
7538
75392012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7540
7541 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7542 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7543 Some instances of '#include <setjmp.h>' removed, if the
7544 only reason for the instance was because "lisp.h" was included.
7545 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7546 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7547 and _longjmp with the new symbols. Emacs already uses _setjmp if
7548 available, so this change affects only POSIXish hosts that have
7549 sigsetjmp but not _setjmp, such as some versions of Solaris and
7550 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7551 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7552 (png_load_body) [HAVE_PNG]:
7553 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7554 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7555 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7556 since PNG requires jmp_buf. This is the only exception to the
7557 general rule that we now use sys_setjmp and sys_longjmp.
7558 This exception is OK since this code does not change the signal
7559 mask or longjmp out of a signal handler.
7560
75612012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7562
7563 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7564 Include "syssignal.h", for 'main_thread'.
7565
75662012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7567
7568 Avoid out-of-range marker position (Bug#12426).
7569 * insdel.c (replace_range, replace_range_2):
7570 Adjust markers before overlays, as suggested by comments.
7571 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7572 Remove redundant check before calling offset_intervals.
7573
75742012-09-14 Martin Rudalics <rudalics@gmx.at>
7575
7576 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7577 current buffer (Bug#12387).
7578
75792012-09-14 Juanma Barranquero <lekktu@gmail.com>
7580
7581 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7582
75832012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7584
7585 Use a more backwards-compatible timer format (Bug#12430).
7586 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7587 vector element, not from the 4th, since PSECS is now at the end.
7588 (Fcurrent_idle_time): Doc fix.
7589
75902012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7591
7592 Function to mark objects and remove killed buffers at once.
7593 * alloc.c (discard_killed_buffers): Rename to ...
7594 (mark_discard_killed buffers) ... new name. Add marking
7595 of remaining objects. Fix comment. Adjust users.
7596 (mark_object): Do not touch frame buffer lists here.
7597 * frame.c (delete_frame): Reset frame buffer lists here.
7598
75992012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7600
7601 Better workaround for GNOME bug when --enable-gcc-warnings.
7602 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7603 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7604 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7605
7606 Simplify SIGIO usage (Bug#12408).
7607 The code that dealt with SIGIO was crufty and confusing, e.g., it
7608 played tricks like "#undef SIGIO" but these tricks were not used
7609 consistently. Simplify mostly by not #undeffing standard symbols,
7610 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7611 or not as we please) rather than "defined SIGIO" (standard symbol
7612 that we probably shouldn't #undef).
7613 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7614 Modules that need it can include it.
7615 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7616 * dispextern.h (ignore_sigio): New decl.
7617 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7618 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7619 * emacs.c (shut_down_emacs):
7620 * keyboard.c (kbd_buffer_store_event_hold):
7621 Use ignore_sigio rather than invoking 'signal' directly.
7622 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7623 for FIONREAD.
7624 (FIONREAD, SIGIO): Do not #undef.
7625 (tty_read_avail_input): Use #error rather than a syntax error.
7626 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7627 for I_PIPE, used by SETUP_SLAVE_PTY.
7628 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7629 * sysdep.c (croak): Remove; no longer needed. This bit of
7630 temporary code, with Fred N. Fish's comment that it's temporary,
7631 has been in Emacs since at least 1992!
7632 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7633 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7634 * syssignal.h (croak): Remove decl.
7635 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7636 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7637 now that we're termios-only.
7638 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7639 * term.c (dissociate_if_controlling_tty): Use #error rather than
7640 a run-time error.
7641
7642 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7643 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7644 to work around GNOME bug 683906.
7645 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7646 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7647 This works around GCC bug 54561.
7648
76492012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7650
7651 More fixes for 'volatile' and setjmp/longjmp.
7652 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7653 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7654 (png_load_body) [HAVE_PNG]:
7655 (jpeg_load_body) [HAVE_JPEG]:
7656 New function, with most of the old parent function's body.
7657 (png_load) [HAVE_PNG]:
7658 (jpeg_load) [HAVE_JPEG]:
7659 Invoke the new function, to avoid longjmp munging our locals.
7660 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7661 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7662 longjmp is passed 2, as the C standard doesn't guarantee this.
7663 Instead, store the failure code into mgr->failure_code.
7664
76652012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7666
7667 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7668 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7669 (syms_of_keyboard): Remove support for unread-command-char.
7670
76712012-09-12 Eli Zaretskii <eliz@gnu.org>
7672
7673 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7674 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7675 violation. (Bug#12426)
7676
76772012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7678
7679 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7680
76812012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7682
7683 * eval.c: Add `inhibit-debugger'.
7684 (Qinhibit_debugger): New symbol.
7685 (call_debugger): Bind it instead of Qdebug_on_error.
7686 (maybe_call_debugger): Test Vinhibit_debugger.
7687 (syms_of_eval): Define inhibit-debugger.
7688 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7689 (syms_of_xdisp): Remove inhibit-debug-on-message.
7690
76912012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7692
7693 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7694 If a nonvolatile local variable is written before a _longjmp to
7695 the frame containing the variable, and is read after the _longjmp,
7696 the value read is indeterminate. Some local variables of type
7697 'struct handler' and 'struct catchtag' are used in this way, so
7698 mark each of their slots as volatile if the slot can be set before
7699 _longjmp and read afterwards.
7700 * lisp.h (struct handler): var and chosen_clause are now volatile.
7701 (struct catchtag): val, next, and pdlcount are now volatile.
7702
7703 * bidi.c (bidi_push_it, bidi_pop_it):
7704 * fns.c (copy_hash_table):
7705 * image.c (define_image_type):
7706 * keyboard.c (kbd_buffer_store_event_hold):
7707 * process.c (Fprocess_send_eof):
7708 * xfaces.c (x_create_gc) [HAVE_NS]:
7709 * xgselect.c (xg_select):
7710 Prefer assignment to memcpy when either will do.
7711
7712 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7713 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7714 time an item is removed. No need to mark this function 'inline';
7715 the compiler knows better than we do.
7716
77172012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7718
7719 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7720 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7721 to change_frame_size (Bug#12388).
7722 (windowDidResize:): Pass YES to updateFrameSize.
7723
7724 * nsterm.h: Add delay parameter to updateFrameSize.
7725
77262012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7727
7728 Discard killed buffers from deleted window and frame objects.
7729 This reduces an amount of references to killed buffers and
7730 helps GC to reclaim them faster.
7731 * alloc.c (discard_killed_buffers): New function.
7732 (mark_object): Use it for deleted windows and frames.
7733 (mark_object): If symbol's value is set up for a killed buffer
7734 or deleted frame, restore its global binding.
7735 * data.c (swap_in_global_binding): Add GC notice.
7736 (swap_in_symval_forwarding): Use convenient set_blv_where.
7737 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7738 * window.h: ... to here.
7739
77402012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7741
7742 Convenient macro to check whether the buffer is live.
7743 * buffer.h (BUFFER_LIVE_P): New macro.
7744 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7745 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7746
77472012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7748
7749 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7750 composition cases (Bug#12364).
7751
7752 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7753 overhang of succeeding glyphs overlapping box cursor.
7754
7755 * w32term.c (x_draw_glyph_string): Likewise.
7756
77572012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7758
7759 Simplify, document, and port floating-point (Bug#12381).
7760 The porting part of this patch fixes bugs on non-IEEE platforms
7761 with frexp, ldexp, logb.
7762 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7763 Now static.
7764 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7765 support, by removing commented-out code and briefly listing the
7766 C89 functions excluded. The commented-out stuff was confusing
7767 maintenance, e.g., we thought we needed cbrt but it was commented out.
7768 (logb): Remove decl; no longer needed.
7769 (isfinite): New macro, if not already supplied.
7770 (isnan): Don't replace any existing macro.
7771 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7772 are present on all C89 platforms.
7773 (Ffrexp): Do not special-case zero, as frexp does the right thing
7774 for that case.
7775 (Flogb): Do not use logb, as it doesn't have the desired meaning
7776 on hosts that use non-base-2 floating point. Instead, stick with
7777 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7778 frexp, to avoid getting an unspecified result.
7779
7780 * xdisp.c (Qinhibit_debug_on_message): Now static.
7781
77822012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7783
7784 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7785 NSBezierPath (Bug#12131).
7786
77872012-09-10 Chong Yidong <cyd@gnu.org>
7788
7789 * fns.c (Fdelq, Fdelete): Doc fix.
7790
77912012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7792
7793 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7794 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7795
77962012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7797
7798 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7799 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7800 Use it.
7801
78022012-09-09 Eli Zaretskii <eliz@gnu.org>
7803
7804 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7805 left fringe if the window has a left margin. This avoids leaving
7806 traces of the cursor because its leftmost pixel is not drawn over.
7807
7808 * dispnew.c (update_window_line): When the left margin area of a
7809 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7810 that screen line. (Bug#12277)
7811
78122012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7813
7814 Assume C89 or later for math functions (Bug#12381).
7815 This simplifies the code, and makes it a bit smaller and faster,
7816 and (most important) makes it easier to clean up signal handling
7817 since we can stop worring about floating-point exceptions in
7818 library code. That was a problem before C89, but the problem
7819 went away many years ago on all practical Emacs targets.
7820 * data.c, image.c, lread.c, print.c:
7821 Don't include <math.h>; no longer needed.
7822 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7823 might be autoconfigured, as that never happens.
7824 * data.c (fmod):
7825 * doprnt.c (DBL_MAX_10_EXP):
7826 * print.c (DBL_DIG):
7827 Remove. C89 or later always defines these.
7828 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7829 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7830 (arith_error, domain_error, domain_error2):
7831 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7832 no longer needed -- we simply return what C returns. All uses removed.
7833 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7834 the wrapped code.
7835 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7836 Remove. All uses expanded, as these macros are no longer used
7837 more than once and are now more trouble than they're worth.
7838 (Ftan): Use tan, not sin / cos.
7839 (Flogb): Assume C89 frexp.
7840 (fmod_float): Assume C89 fmod.
7841 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7842 (init_floatfns): Remove. All uses removed.
7843
78442012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7845
7846 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7847 compositeToPoint for OSX < 10.6 (Bug#12390).
7848
78492012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7850
7851 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7852 This produces more-accurate results.
7853
78542012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7855
7856 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7857 changes (Bug#12088).
7858
78592012-09-08 Chong Yidong <cyd@gnu.org>
7860
7861 * syntax.c (Fstring_to_syntax): Doc fix.
7862
78632012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7864
7865 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7866 in the internal border.
7867 (x_set_window_size): Remove static variables and their usage.
7868 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7869 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7870 Remove fringe/internal border adjustment (Bug#11052).
7871 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7872 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7873 (ns_fix_rect_ibw): Remove.
7874 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7875 (ns_dumpglyphs_box_or_relief): Ditto.
7876 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7877 adjustment.
7878 (ns_dumpglyphs_image): Ditto.
7879 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7880 border adjustment.
7881 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7882 their usage. Add fringe_extended_p and its use as in other terms.
7883 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7884 scroll bar was removed.
7885 (updateFrameSize): New function.
7886 (windowDidResize): Move code to updateFrameSize and call it.
7887
7888 * nsterm.h (EmacsView): Add updateFrameSize.
7889
78902012-09-07 Chong Yidong <cyd@gnu.org>
7891
7892 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7893
7894 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7895
78962012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7897
7898 More signal-handler cleanup (Bug#12327).
7899 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7900 Problem introduced when merging patches. Noted by Eli Zaretskii in
7901 <http://bugs.gnu.org/12327#67>.
7902 * floatfns.c: Comment fix.
7903 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7904 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7905 and anyway the declaration is harmless even if SIGDANGER is not defined.
7906 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7907 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7908 source files not surprisingly expected syssignal.h to define, or
7909 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7910 Include <sys/ioctl.h>, for FIONREAD.
7911 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7912 This eliminates a problem whereby other files mysteriously had
7913 to include "syssignal.h" before including "systty.h" if they
7914 wanted to use "#ifdef SIGIO".
7915
79162012-09-07 Eli Zaretskii <eliz@gnu.org>
7917
7918 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7919
7920 * w32.c (sigemptyset): Empty the set.
7921 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7922
7923 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7924
79252012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7926
7927 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7928 (mark_object): Likewise for frame objects.
7929
79302012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7931
7932 * syssignal.h (handle_on_main_thread): Always declare,
7933 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7934 This ports to platforms without HAVE_PTHREAD.
7935
79362012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7937
7938 Signal-handler cleanup (Bug#12327).
7939 Emacs's signal handlers were written in the old 4.2BSD style with
7940 sigblock and sigmask and so forth, and this led to some
7941 inefficiencies and confusion. Rewrite these to use
7942 pthread_sigmask etc. without copying signal sets around. Also,
7943 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7944 'signal', and instead use functions that do not attempt to take
7945 over the system name space. This patch causes Emacs's text
7946 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7947 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7948 Do not include <signal.h> or "syssignal.h", as these
7949 modules do not use signals.
7950 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7951 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7952 Do not include <signal.h>, as "syssignal.h" does that for us now.
7953 * atimer.c (sigmask_atimers): New function.
7954 (block_atimers, unblock_atimers): New functions,
7955 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7956 All uses replaced.
7957 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7958 no longer needed here.
7959 * emacs.c (main): Inspect existing signal handler with sigaction,
7960 so that there's no need to block and unblock SIGHUP.
7961 * sysdep.c (struct save_signal): New member 'action', replacing
7962 old member 'handler'.
7963 (save_signal_handlers, restore_signal_handlers):
7964 Use sigaction instead of 'signal' to save and restore.
7965 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7966 New function. All users of 'signal' modified to use set_sighandler
7967 if they're writeonly, and to use sys_signal if they're read+write.
7968 (emacs_sigaction_init, forwarded_signal): New functions.
7969 (sys_signal): Remove. All uses replaced by calls to sigaction
7970 and emacs_sigaction_init, or by direct calls to 'signal'.
7971 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7972 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7973 all uses replaced by pthread_sigmask etc. calls.
7974 * syssignal.h: Include <signal.h>.
7975 (emacs_sigaction_init, forwarded_signal): New decls.
7976 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7977 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7978 (sigmask, sys_sigmask): Remove; no longer needed.
7979 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7980 (sigblock, sigunblock, sigfree):
7981 (sigsetmask) [!defined sigsetmask]:
7982 Remove. All uses replaced by pthread_sigmask.
7983 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7984 no longer need to be replaced, and its typical old uses
7985 are now done via emacs_sigaction_init and sigaction.
7986 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7987 (sys_sigdel): Remove; unused.
7988 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7989
79902012-09-06 Eli Zaretskii <eliz@gnu.org>
7991
7992 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7993 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7994
79952012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7996
7997 Explicitly mark buffer_defaults and buffer_local_symbols.
7998 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7999 mark_local_symbols here.
8000 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
8001 since special buffers aren't marked here any more.
8002 (allocate_buffer): Chain new buffer with all_buffers here...
8003 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
8004 not here.
8005 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
8006 (syms_of_buffer): Remove staticpro of the above.
8007 (init_buffer_once): Set names for buffer_defaults and
8008 buffer_local_symbols.
8009
80102012-09-06 Paul Eggert <eggert@cs.ucla.edu>
8011
8012 Use bool for booleans in font-related modules.
8013 * font.c (font_intern_prop, font_style_to_value)
8014 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
8015 (generate_otf_features, font_check_otf_features, font_check_otf)
8016 (font_match_p, font_list_entities, font_at):
8017 * fontset.c (fontset_id_valid_p, reorder_font_vector
8018 (fontset_find_font, Fset_fontset_font)
8019 (face_suitable_for_char_p) [0]:
8020 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
8021 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
8022 (m17n_flt_initialized, ftfont_shape_by_flt):
8023 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
8024 * nsfont.m (nsfont_draw):
8025 * w32font.c (w32font_draw):
8026 * w32term.c (x_draw_glyphless_glyph_string_foreground):
8027 Use bool for booleans.
8028 * font.h: Adjust to above API changes.
8029 (struct font, struct font_driver, struct font_driver_list):
8030 Use bool for booleans.
8031 (struct font): Remove useless member encoding_type.
8032 All users removed.
8033 * fontset.c, xftfont.c: Omit unnecessary static decls.
8034
80352012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
8036
8037 * alloc.c (mark_object): Revert window marking code
8038 since it's unsafe for the Fset_window_configuration.
8039
80402012-09-05 Paul Eggert <eggert@cs.ucla.edu>
8041
8042 Fix race conditions with signal handlers and errno (Bug#12327).
8043 Be more systematic about preserving errno whenever a signal
8044 handler returns, even if it's not in the main thread. Do this by
8045 renaming signal handlers to distinguish between signal delivery
8046 and signal handling. All uses changed.
8047 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
8048 * data.c (deliver_arith_signal): Rename from arith_error.
8049 * dispnew.c (deliver_window_change_signal): Rename from
8050 window_change_signal.
8051 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
8052 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
8053 * keyboard.c (deliver_input_available_signal): Rename from
8054 input_available_signal.
8055 (deliver_user_signal): Rename from handle_user_signal.
8056 (deliver_interrupt_signal): Rename from interrupt_signal.
8057 * process.c (deliver_pipe_signal): Rename from send_process_trap.
8058 (deliver_child_signal): Rename from sigchld_handler.
8059 * atimer.c (handle_alarm_signal):
8060 * data.c (handle_arith_signal):
8061 * dispnew.c (handle_window_change_signal):
8062 * emacs.c (handle_fatal_signal, handle_danger_signal):
8063 * keyboard.c (handle_input_available_signal):
8064 * keyboard.c (handle_user_signal, handle_interrupt_signal):
8065 * process.c (handle_pipe_signal, handle_child_signal):
8066 New functions, with the actual signal-handling code taken from the
8067 original respective signal handlers, sans the sporadic attempts to
8068 preserve errno, since that's now done by handle_on_main_thread.
8069 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
8070 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
8071 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
8072 Move to sysdep.c.
8073 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
8074 Move initialization of main_thread to sysdep.c's init_signals.
8075 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
8076 our usage, and simplifies the mainline code.
8077 (record_child_status_change): New static function, as a helper
8078 for handle_child_signal, and with most of the old child handler's
8079 contents.
8080 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
8081 (handle_child_signal): Use the above.
8082 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
8083 Moved here from emacs.c.
8084 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
8085 code moved here from emacs.c's main function.
8086 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
8087 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
8088 This lets callers save and restore errno properly.
8089
80902012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
8091
8092 Remove redundant or unused things here and there.
8093 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
8094 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
8095 * editfns.c (Fcompare_buffer_substrings): Likewise.
8096 * frame.h (struct terminal, struct font_driver_list):
8097 Remove redundant declarations.
8098 * window.h (Qleft, Qright): Likewise.
8099
81002012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
8101
8102 Do not mark objects from deleted buffers, windows and frames.
8103 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
8104 (mark_object): Likewise for windows and frames.
8105
81062012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
8107
8108 * alloc.c (valid_lisp_object_p): Treat killed buffers,
8109 buffer_defaults and buffer_local_symbols as valid objects.
8110 Return special value to denote them.
8111
81122012-09-05 Paul Eggert <eggert@cs.ucla.edu>
8113
8114 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
8115 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
8116 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
8117 (file_name_absolute_p, Fsubstitute_in_file_name):
8118 (check_executable, check_writable, Ffile_accessible_directory_p)
8119 (Fset_file_selinux_context, Fdefault_file_modes)
8120 (Finsert_file_contents, choose_write_coding_system)
8121 (Fwrite_region, build_annotations, a_write, e_write)
8122 (Fdo_auto_save):
8123 * filelock.c (boot_time_initialized, get_boot_time)
8124 (get_boot_time_1, lock_file_1, within_one_second):
8125 * floatfns.c (in_float):
8126 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
8127 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
8128 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
8129 * lisp.h (struct Lisp_Hash_Table.cmpfn):
8130 * window.c (compare_window_configurations):
8131 Use bool for booleans.
8132 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
8133 (Fdefault_file_modes): Now mode_t, not int, for modes.
8134 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
8135 (internal_delete_file): Now returns void, not a (boolean) int,
8136 since nobody was looking at the return value.
8137 * lisp.h, window.h: Adjust to above API changes.
8138
8139 * xdisp.c (set_message): Simplify and reindent last change.
8140
81412012-09-05 Juanma Barranquero <lekktu@gmail.com>
8142
8143 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
8144
81452012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
8146
8147 * eval.c (call_debugger): Make the function non-static so that we
8148 can call it from set_message.
8149
8150 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
8151 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
8152
81532012-09-04 Paul Eggert <eggert@cs.ucla.edu>
8154
8155 Give more-useful info on a fatal error (Bug#12328).
8156 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
8157 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
8158 of doing the work ourselves.
8159 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
8160 do most of the work.
8161 (fatal_error_backtrace): New function, taken from the guts
8162 of the old fatal_error_signal, but with a new option to output
8163 a backtrace.
8164 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
8165 info about the signal than just its number.
8166 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
8167 * sysdep.c: Include <execinfo.h>
8168 (emacs_backtrace): New function, taken partly from the previous
8169 code of the 'die' function.
8170 (emacs_abort): Call fatal_error_backtrace rather than abort.
8171
81722012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
8173
8174 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
8175 eager (load-time) macro-expansion.
8176 * lisp.mk (lisp): Add macroexp.
8177
81782012-09-04 Paul Eggert <eggert@cs.ucla.edu>
8179
8180 Simplify redefinition of 'abort' (Bug#12316).
8181 Do not try to redefine the 'abort' function. Instead, redo
8182 the code so that it calls 'emacs_abort' rather than 'abort'.
8183 This removes the need for the NO_ABORT configure-time macro
8184 and makes it easier to change the abort code to do a backtrace.
8185 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
8186 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
8187 Remove; sysdep.c's emacs_abort now takes its place.
8188 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
8189 'abort' changed to use 'emacs_abort'.
8190 * msdos.c (dos_abort) [defined abort]: Remove; not used.
8191 (abort) [!defined abort]: Rename to ...
8192 (emacs_abort): ... new name.
8193 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
8194 the place of the old 'abort' in emacs.c.
8195 * w32.c, w32fns.c (abort): Do not #undef.
8196 * w32.c (emacs_abort): Rename from w32_abort.
8197
81982012-09-04 Eli Zaretskii <eliz@gnu.org>
8199
8200 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
8201 offsets[j].dv, since the y axis of the screen coordinates points
8202 down, while the y axis of the font definition coordinates points
8203 up. This fixes display of Arabic diacritics such as KASRA and
8204 KASRATAN. (Bug#11860)
8205
82062012-09-04 Paul Eggert <eggert@cs.ucla.edu>
8207
8208 Be more systematic about _setjmp vs setjmp.
8209 * alloc.c (test_setjmp, mark_stack):
8210 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
8211 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
8212 (png_load, my_error_exit, jpeg_load):
8213 * process.c (send_process_trap, send_process):
8214 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
8215 The underscored versions are up to 30x faster on some hosts.
8216 Formerly, the code used setjmp+longjmp sometimes and
8217 _setjmp+_longjmp at other times, with no particular reason to
8218 prefer setjmp+longjmp.
8219
82202012-09-03 Paul Eggert <eggert@cs.ucla.edu>
8221
8222 Fix minor problem found by static checking.
8223 * buffer.c (Fdelete_all_overlays): Return nil.
8224
82252012-09-03 Martin Rudalics <rudalics@gmx.at>
8226
8227 * buffer.c (Fdelete_all_overlays): New function.
8228
82292012-09-03 Chong Yidong <cyd@gnu.org>
8230
8231 * gtkutil.c: Add extern decl for Qxft.
8232
82332012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8234
8235 * emacs.c, eval.c: Use bool for boolean.
8236 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
8237 (malloc_using_checking) [DOUG_LEA_MALLOC]:
8238 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
8239 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
8240 (main, decode_env_path, Fdaemon_initialized):
8241 * eval.c (call_debugger, Finteractive_p, interactive_p):
8242 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
8243 (maybe_call_debugger, Fbacktrace):
8244 * process.c (read_process_output, exec_sentinel):
8245 Use bool for booleans.
8246 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
8247 All callers changed.
8248 * eval.c (interactive_p): Omit always-true boolean argument
8249 EXCLUDE_SUBRS_P. All callers changed.
8250 * dispextern.h, lisp.h: Reflect above API changes.
8251 * firstfile.c (dummy): Use the address of 'main', whose signature
8252 won't change, instead of the address of 'initialize', whose
8253 signature just changed from int to bool.
8254 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
8255 * msdos.c (fatal_error_in_progress): ... from here.
8256 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
8257 of incrementing it.
8258 (redisplay_internal, unwind_redisplay): Simply clear
8259 REDISPLAYING_P when unwinding, instead of saving its previous,
8260 always-false value and then restoring it.
8261
8262 Clean up some extern decls.
8263 Mostly, this hoists extern decls out of .c files and into .h files.
8264 That way, we're more likely to catch errors if the interfaces change.
8265 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
8266 declare xg_mark_data.
8267 * dispextern.h (x_frame_parm_handlers):
8268 * font.h (Qxft):
8269 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
8270 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
8271 (Qultra_bold, Qoblique, Qitalic):
8272 Move extern decl here from .c file.
8273 * alloc.c (xg_mark_data) [USE_GTK]:
8274 * doc.c (Qclosure):
8275 * eval.c (Qlexical_binding):
8276 * fns.c (time) [!HAVE_UNISTD_H]:
8277 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
8278 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
8279 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
8280 * lread.c (Qinternal_interpreter_environment):
8281 * minibuf.c (Qbuffer):
8282 * process.c (QCfamily, QCfilter):
8283 * widget.c (free_frame_faces):
8284 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
8285 * xfont.c (x_clear_errors):
8286 * xterm.c (x_frame_parm_handlers):
8287 Remove now-redundant extern decls.
8288 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
8289 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
8290 Now static.
8291 * xfaces.c: Remove unnecessary static decls.
8292 * xterm.c (updating_frame): Remove decl of nonexistent object.
8293
8294 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
8295 when building globals.h, as the objects that are not built on
8296 this host are not needed to compile C files on this host.
8297
82982012-09-02 Jan Djärv <jan.h.d@swipnet.se>
8299
8300 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
8301
8302 * frame.h: Add missing prototype for x_wm_set_size_hint.
8303
83042012-09-02 Paul Eggert <eggert@cs.ucla.edu>
8305
8306 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
8307 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
8308 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
8309 (Fsubstitute_command_keys):
8310 * editfns.c (region_limit, find_field, Fconstrain_to_field)
8311 (save_excursion_save, save_excursion_restore)
8312 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
8313 (format_time_string, general_insert_function)
8314 (make_buffer_string, make_buffer_string_both)
8315 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
8316 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
8317 (copy_text, insert_1, insert_1_both, insert_from_string)
8318 (insert_from_string_before_markers, insert_from_string_1)
8319 (insert_from_buffer, insert_from_buffer_1, replace_range)
8320 (replace_range_2, del_range_1, del_range_byte, del_range_both)
8321 (del_range_2, modify_region):
8322 * intervals.c (intervals_equal, balance_possible_root_interval)
8323 (adjust_intervals_for_insertion, merge_properties_sticky)
8324 (graft_intervals_into_buffer, lookup_char_property)
8325 (adjust_for_invis_intang, set_point_both)
8326 (get_property_and_range, compare_string_intervals)
8327 (set_intervals_multibyte_1, set_intervals_multibyte):
8328 * keyboard.c (decode_timer):
8329 Use bool for boolean.
8330 * intervals.h, lisp.h, systime.h: Reflect above API changes.
8331 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
8332
83332012-09-02 Chong Yidong <cyd@gnu.org>
8334
8335 * keymap.c (push_key_description): Print M-TAB as C-M-i
8336 (Bug#11758).
8337
83382012-09-02 Juanma Barranquero <lekktu@gmail.com>
8339
8340 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
8341 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
8342 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
8343 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
8344 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
8345 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
8346 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8347
83482012-09-01 Eli Zaretskii <eliz@gnu.org>
8349
8350 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
8351 more than one grapheme cluster passed to the shaper: compute the
8352 offset adjustment values separately for each cluster. (Bug#11860)
8353
8354 * image.c: Restore mistakenly removed inclusion of w32.h. Without
8355 it, GCC doesn't see prototypes of w32_delayed_load, and complains
8356 about implicit conversions from integer to pointer.
8357
83582012-09-01 Daniel Colascione <dancol@dancol.org>
8359
8360 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
8361 system used too early.
8362
83632012-09-01 Paul Eggert <eggert@cs.ucla.edu>
8364
8365 Better seed support for (random).
8366 * emacs.c (main): Call init_random.
8367 * fns.c (Frandom): Set the seed from a string argument, if given.
8368 Remove long-obsolete Gentzel cruft.
8369 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
8370 (init_random): New function.
8371
83722012-09-01 Daniel Colascione <dancol@dancol.org>
8373
8374 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
8375 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
8376 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
8377 x_wm_set_size_hint, x_query_colors, x_real_positions,
8378 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8379 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
8380 all of which have been moved to common code.
8381
8382 * xfaces.c: Include TERM_HEADER instead of listing all possible
8383 window-system headers.
8384
8385 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
8386 to match header.
8387
8388 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
8389 directly accessing frame internals.
8390
8391 * w32font.h: Include font.h. Define syms_of_w32font and
8392 globals_of_w32font.
8393
8394 * process.c: Include TERM_HEADER instead of listing all possible
8395 window-system headers.
8396
8397 * nsterm.h: Remove declarations now in frame.h.
8398 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
8399
8400 * menu.c: Include TERM_HEADER instead of listing all possible
8401 window-system headers.
8402
8403 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8404 window system.
8405
8406 * keyboard.c: Include TERM_HEADER instead of listing all possible
8407 window-system headers.
8408
8409 * image.c: Include TERM_HEADER instead of listing all possible
8410 window-system headers. Declare Vlibrary_cache when compiling for
8411 Windows.
8412
8413 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8414 window system declarations.
8415
8416 * frame.h: Move common functions here: set_frame_menubar,
8417 x_set_window_size, x_sync, x_get_focus_frame,
8418 x_set_mouse_position, x_set_mouse_pixel_position,
8419 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8420 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8421 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8422 x_activate_menubar, x_real_positions, x_bitmap_icon,
8423 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8424 and x_query_colors.
8425
8426 * frame.c: Include TERM_HEADER instead of listing all possible
8427 window-system headers.
8428
8429 * font.c: Include TERM_HEADER instead of listing all possible
8430 window-system headers.
8431
8432 * emacs.c: Include TERM_HEADER.
8433
8434 * dispnew.c: Include TERM_HEADER instead of listing all possible
8435 window-system headers.
8436
8437 * ccl.h: Include character.h.
8438
8439 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8440 the current window system; include in list of objects to link into
8441 Emacs.
8442
84432012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8444
8445 Remove mark_ttys function and fix tty_display_info initialization.
8446 * lisp.h (mark_ttys): Remove prototype.
8447 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8448 to mark_ttys because all possible values of 'top_frame' slot are
8449 the frames which are reachable from Vframe_list.
8450 * term.c (mark_ttys): Remove.
8451 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8452
84532012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8454
8455 Change struct frame bitfields from unsigned char to unsigned.
8456 * frame.h (struct frame): Change type of 'display_preempted',
8457 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8458 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8459 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8460 bitfields from unsigned char to unsigned.
8461
84622012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8463
8464 Remove unused member of struct x_output and struct w32_output.
8465 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8466 * w32term.h (struct w32_output): Likewise.
8467
84682012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8469
8470 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8471 does not become zero (Bug#12234).
8472
84732012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8474
8475 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8476 for GCC 4.7.1 x86-64.
8477
84782012-08-30 Glenn Morris <rgm@gnu.org>
8479
8480 * lread.c (init_lread): For out-of-tree builds, only add the
8481 source directory's site-lisp dir to the load-path if it exists,
8482 consistent with in-tree builds. (Bug#12302)
8483
84842012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8485
8486 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
8487 button_values to NULL. Call setStykeMask so dialogs get a close button.
8488 (windowShouldClose:): Set window_closed.
8489 (dealloc): New member, free button_values.
8490 (process_dialog:): Make member function. Remove window argument,
8491 replace window with self. Count buttons and allocate and store values
8492 in button_values.
8493 (addButton:value:row:): value is int with the name tag. Call setTag
8494 with tag. Remove return self, declare return value as void.
8495 (addString:row:): Remove return self, declare return value as void.
8496 (addSplit): Remove return self, declare return value as void.
8497 (clicked:): Remove return self, declare return value as void.
8498 Set dialog_return to button_values[seltag]. Code formatting change.
8499 (initFromContents:isQuestion:): Adjust call to process_dialog.
8500 Code formatting change.
8501 (timeout_handler:): Set timer_fired to YES.
8502 (runDialogAt:): Set timer_fired to NO.
8503 Handle click on close button as quit.
8504
8505 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8506 Add window_closed and button_values. Add void as return value for
8507 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8508 Add process_dialog as new member.
8509
85102012-08-28 Eli Zaretskii <eliz@gnu.org>
8511
8512 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8513 is not one of the heaps we manage. (Bug#12242)
8514
85152012-08-28 Glenn Morris <rgm@gnu.org>
8516
8517 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8518
85192012-08-28 Martin Rudalics <rudalics@gmx.at>
8520
8521 * window.c (Fset_window_configuration): Remove handling of
8522 auto-buffer-name window parameter. Install revision of reverted
8523 fix.
8524
85252012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8526
8527 Do not allow to set major mode for a dead buffer.
8528 * buffer.c (Fset_buffer_major_mode): Signal an error
8529 if the buffer is dead.
8530 (Fother_buffer, other_buffer_safely): Remove redundant
8531 nested declaration.
8532
85332012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8534
8535 Always use set_buffer_if_live to restore original buffer at unwind.
8536 * buffer.h (record_unwind_current_buffer): New function.
8537 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8538 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8539 * undo.c, window.c: Adjust users.
8540 * buffer.c (set_buffer_if_live): Fix comment.
8541
85422012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8543
8544 Fix usage of set_buffer_internal.
8545 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8546 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8547 * coding.c (decode_coding): Omit redundant test.
8548 * fileio.c (decide_coding_unwind): Likewise.
8549 * fns.c (secure_hash): Likewise.
8550 * insdel.c (modify_region): Likewise.
8551 * keyboard.c (command_loop_1): Likewise.
8552 * print.c (PRINTFINISH): Likewise.
8553 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8554
85552012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8556
8557 * dispnew.c: Use bool for boolean.
8558 (frame_garbaged, display_completed, delayed_size_change)
8559 (fonts_changed_p, add_window_display_history)
8560 (add_frame_display_history, verify_row_hash)
8561 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8562 (row_equal_p, realloc_glyph_pool)
8563 (allocate_matrices_for_frame_redisplay)
8564 (showing_window_margins_p)
8565 (adjust_frame_glyphs_for_frame_redisplay)
8566 (build_frame_matrix_from_leaf_window, make_current)
8567 (mirrored_line_dance, mirror_line_dance, update_frame)
8568 (update_window_tree, update_single_window)
8569 (check_current_matrix_flags, update_window, update_text_area)
8570 (update_window_line, set_window_update_flags, scrolling_window)
8571 (update_frame_1, scrolling, buffer_posn_from_coords)
8572 (do_pending_window_change, change_frame_size)
8573 (change_frame_size_1, sit_for):
8574 Use bool for boolean.
8575 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8576 and remove last int (actually boolean) argument, which was always 0.
8577 All callers changed.
8578 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8579 * dispextern.h (struct composition_it): Use bool for boolean.
8580 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8581 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8582 * dired.c (file_name_completion):
8583 Use bool for boolean. (This was missed in an earlier change.)
8584
85852012-08-27 Martin Rudalics <rudalics@gmx.at>
8586
8587 * window.c (Fset_window_configuration): Revert first part of
8588 last change.
8589
85902012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8591
8592 * nsterm.h (NSPanel): New class variable dialog_return.
8593
8594 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8595 Initialize dialog_return.
8596 (windowShouldClose:): Use stop instead of stopModalWithCode.
8597 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8598 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8599 event.
8600 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8601 modal loop returns.
8602
86032012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8604
8605 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8606 * composite.c (find_composition, composition_gstring_p)
8607 (composition_reseat_it, find_automatic_composition):
8608 * data.c (let_shadows_buffer_binding_p)
8609 (let_shadows_global_binding_p, set_internal, make_blv)
8610 (Fmake_variable_buffer_local, Fmake_local_variable)
8611 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8612 (cons_to_signed, arith_driver):
8613 * dbusbind.c (xd_in_read_queued_messages):
8614 * dired.c (directory_files_internal, file_name_completion):
8615 Use bool for booleans.
8616 * dired.c (file_name_completion):
8617 * process.h (fd_callback):
8618 Omit int (actually boolean) argument. It wasn't being used.
8619 All uses changed.
8620 * composite.h, lisp.h: Reflect above API changes.
8621
8622 * cmds.c, coding.c: Use bool for booleans.
8623 * cmds.c (move_point, Fself_insert_command):
8624 * coding.h (struct composition status, struct coding_system):
8625 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8626 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8627 (emacs_mule_char, decode_coding_emacs_mule)
8628 (encode_coding_emacs_mule, detect_coding_iso_2022)
8629 (decode_coding_iso_2022, encode_invocation_designation)
8630 (encode_designation_at_bol, encode_coding_iso_2022)
8631 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8632 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8633 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8634 (encode_coding_raw_text, detect_coding_charset)
8635 (decode_coding_charset, encode_coding_charset, detect_eol)
8636 (detect_coding, get_translation_table, produce_chars)
8637 (consume_chars, reused_workbuf_in_use)
8638 (make_conversion_work_buffer, code_conversion_save)
8639 (decode_coding_object, encode_coding_object)
8640 (detect_coding_system, char_encodable_p)
8641 (Funencodable_char_position, code_convert_region)
8642 (code_convert_string, code_convert_string_norecord)
8643 (Fset_coding_system_priority):
8644 * fileio.c (Finsert_file_contents):
8645 Use bool for booleans.
8646 * coding.h, lisp.h: Reflect above API changes.
8647 * coding.c: Remove unnecessary static function decls.
8648 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8649 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8650 not a boolean 'int', since callers never look at the return value.
8651 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8652 * coding.h (decoding_buffer_size, encoding_buffer_size)
8653 (emacs_mule_string_char): Remove unused extern decls.
8654 (struct iso_2022_spec, struct coding_system):
8655 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8656 (struct emacs_mule_spec): Remove unused field 'full_support'.
8657 All initializations removed.
8658 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8659
86602012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8661
8662 Fix spare memory change (Bug#12286).
8663 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8664 (valid_lisp_object_p): Likewise.
8665
86662012-08-27 Martin Rudalics <rudalics@gmx.at>
8667
8668 * window.c (Fset_window_configuration): Record any window's old
8669 buffer if it's replaced (see Bug#8789). If the new current
8670 buffer doesn't appear in the selected window, go to its old
8671 point (Bug#12208).
8672
86732012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8674
8675 Special MEM_TYPE_SPARE to denote reserved memory.
8676 * alloc.c (enum mem_type): New memory type.
8677 (refill_memory_reserve): Use new type for spare memory.
8678 This prevents live_cons_p and live_string_p from incorrect
8679 detection of uninitialized objects from spare memory as live.
8680
86812012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8682
8683 Spelling fixes.
8684 * Makefile.in (.PHONY): versioclean -> versionclean.
8685
8686 Remove unused external symbols.
8687 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8688 * window.c (Qwindow_valid_p, decode_valid_window):
8689 Now static, not extern.
8690 * data.c (Qinterval): Remove; unused.
8691 (syms_of_data): Do not define 'interval'.
8692 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8693 * window.h (decode_valid_window):
8694 Remove decls.
8695
8696 * character.c, charset.c, chartab.c: Use bool for booleans.
8697 * character.c (lisp_string_width, string_count_byte8)
8698 (string_escape_byte8):
8699 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8700 (load_charset_map_from_file, map_charset_chars)
8701 (Fdefine_charset_internal, define_charset_internal)
8702 (Fdeclare_equiv_charset, find_charsets_in_text)
8703 (Ffind_charset_region, char_charset, Fiso_charset):
8704 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8705 (sub_char_table_set, sub_char_table_set_range)
8706 (char_table_set_range, optimize_sub_char_table)
8707 (map_sub_char_table):
8708 Use bool for boolean.
8709 * character.c (str_to_unibyte): Omit last boolean argument; it was
8710 always 0. All callers changed.
8711 * character.h, charset.h: Adjust to match previous changes.
8712 * character.h (char_printable_p): Remove decl of nonexistent function.
8713 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8714 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8715 are all boolean, so make them single-bit bitfields.
8716
8717 * lisp.h (ASET): Remove attempt to detect side effects.
8718 It was meant to be temporary and it often doesn't work,
8719 because when IDX has side effects the behavior of IDX==IDX
8720 is undefined. See Stefan Monnier in
8721 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8722
87232012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8724
8725 * lisp.h (functionp): New function (extracted from Ffunctionp).
8726 (FUNCTIONP): Use it.
8727 * eval.c (Ffunctionp): Use it.
8728
87292012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8730
8731 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8732 as that's faster and simpler than static storage. Don't bother
8733 with the g_main_context_query overhead if g_main_context_pending
8734 says no events are pending.
8735 (gfds, gfds_size): Remove these static vars.
8736 (xgselect_initialize): Remove; no longer needed.
8737 All uses and decls removed.
8738
8739 * emacs.c (fatal_error_signal_hook): Remove.
8740 All uses removed. This leftover from old code was always 0.
8741
8742 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8743 * casefiddle.c (casify_object, casify_region):
8744 * casetab.c (set_case_table):
8745 * category.c, category.h (word_boundary_p):
8746 * category.h (CHAR_HAS_CATEGORY):
8747 Use bool for booleans, instead of int.
8748
87492012-08-25 Eli Zaretskii <eliz@gnu.org>
8750
8751 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8752
87532012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8754
8755 On assertion failure, print backtrace if available.
8756 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8757 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8758 * Makefile.in (LIB_EXECINFO): New macro.
8759 (LIBES): Use it.
8760
8761 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8762 * bytecode.c (exec_byte_code):
8763 * callint.c (check_mark, Fcall_interactively):
8764 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8765 (getenv_internal, sync_process_alive, call_process_exited):
8766 * lisp.h (USE_SAFE_ALLOCA):
8767 Use bool for booleans, instead of int.
8768 * lisp.h, process.h: Adjust prototypes to match above changes.
8769 * callint.c (Fcall_interactively): Don't assume the mark's
8770 offset fits in 'int'.
8771
87722012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8773
8774 * buffer.c, buffer.h: Use bool for boolean.
8775 * buffer.c (reset_buffer_local_variables)
8776 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8777 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8778 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8779 (overlay_touches_p, overlay_strings, Foverlay_put)
8780 (report_overlay_modification, call_overlay_mod_hooks):
8781 (mmap_enlarge, mmap_set_vars):
8782 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8783 Use bool for booleans, instead of int.
8784 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8785 since the 1-or-0 return value is always ignored anyway.
8786 (mmap_initialized_p):
8787 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8788 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8789
87902012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8791
8792 * bidi.c: Use bool for boolean.
8793 This is a bit more readable, and makes the text segment of bidi.o
8794 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8795 Presumably it's faster too.
8796 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8797 Now bool.
8798 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8799 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8800 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8801 (bidi_explicit_dir_char, bidi_level_of_next_char)
8802 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8803 Use bool for booleans, instead of int.
8804 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8805 (bidi_unshelve_cache): Adjust decls to match code.
8806
88072012-08-23 Martin Rudalics <rudalics@gmx.at>
8808
8809 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8810 argument.
8811
88122012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8813
8814 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8815 * atimer.h: Include <stdbool.h>.
8816
88172012-08-22 Dan Nicolaescu <dann@gnu.org>
8818
8819 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8820 compile time tests instead of run time tests on systems that do
8821 not use them.
8822 (FRAME_MAC_P): Remove leftover from deleted code.
8823 * frame.c (syms_of_frame): Remove leftover from deleted code.
8824
88252012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8826
8827 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8828
88292012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8830
8831 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8832 Otherwise, the compiler complains about (A?B:C) where B is void
8833 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8834 (fontset_add): Return void, for FONTSET_ADD.
8835
88362012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8837
8838 * alloc.c: Use bool for booleans.
8839 (gc_in_progress, abort_on_gc)
8840 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8841 (dont_register_blocks) [GC_MALLOC_CHECK]:
8842 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8843 (check_string_bytes, make_specified_string, memory_full)
8844 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8845 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8846 (mark_stack, valid_pointer_p, make_pure_string)
8847 (Fgarbage_collect, survives_gc_p, gc_sweep):
8848 Use bool for booleans, instead of int.
8849 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8850 Remove unused local.
8851 * alloc.c (PURE_POINTER_P):
8852 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8853 * editfns.c (Fformat):
8854 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8855 (Fdo_auto_save):
8856 * fns.c (sweep_weak_table):
8857 * lisp.h (suppress_checking, push_message, survives_gc_p)
8858 (make_pure_string, gc_in_progress, abort_on_gc):
8859 * lread.c (readchar, read1):
8860 * print.c (Fprin1_to_string):
8861 * xdisp.c (push_message):
8862 Use bool for booleans affected directly or indirectly by
8863 alloc.c's changes.
8864
8865 Make recently-introduced setters macros.
8866 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8867 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8868 (set_fontset_default, set_fontset_fallback): Rename from their
8869 upper-case counterparts, and make them functions rather than macros.
8870 This is more consistent with the other recently-introduced setters.
8871 These don't need to be inline, since they're local.
8872
88732012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8874
8875 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8876 the loop (Bug#12247).
8877
88782012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8879
8880 * lisp.h (vcopy): Use memcpy rather than our own loop.
8881 This fixes a performance regression introduced by the recent
8882 addition of vcopy. This means 'vcopy' will need to be modified
8883 for a copying collector, but that's OK. Also, tighten the
8884 checking in the assertion.
8885
88862012-08-21 Eli Zaretskii <eliz@gnu.org>
8887
8888 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8889 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8890 non-base glyph for the width of the base character, according to
8891 what x_draw_composite_glyph_string_foreground expects.
8892 Generate WADJUST value according to composition_gstring_width's
8893 expectations, to produce correct width of the composed character.
8894 Reverse the sign of the DU offset produced by ScriptPlace.
8895
88962012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8897
8898 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8899
89002012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8901
8902 Avoid direct writes to contents member of struct Lisp_Vector.
8903 * lisp.h (vcopy): New function to copy data into vector.
8904 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8905 * fns.c (Ffillarray): Use ASET.
8906 * keyboard.c (timer_check_2): Use AREF and ASET.
8907 (append_tool_bar_item, Frecent_keys): Use vcopy.
8908 * lread.c (read_vector): Use ASET.
8909 * msdos.c (Frecent_doskeys): Use vcopy.
8910 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8911 (Finternal_merge_in_global_face): Use ASET and vcopy.
8912 * xfont.c (xfont_list_pattern): Likewise.
8913
89142012-08-21 Martin Rudalics <rudalics@gmx.at>
8915
8916 * window.c (Fwindow_point): For the selected window always return
8917 the position of its buffer's point.
8918 (Fset_window_point): For the selected window always go in its
8919 buffer to the specified position.
8920
89212012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8922
8923 Setter macros for fontsets.
8924 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8925 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8926 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8927 Adjust users.
8928
89292012-08-20 Glenn Morris <rgm@gnu.org>
8930
8931 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8932 Don't assume that `ln -f' works.
8933
89342012-08-20 Eli Zaretskii <eliz@gnu.org>
8935
8936 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8937 and later about non-assignments with no effect. See discussion at
8938 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8939 details.
8940
89412012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8942
8943 Inline setter functions for Lisp_Objects slots of struct specbinding.
8944 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8945 Adjust users.
8946
89472012-08-20 Martin Rudalics <rudalics@gmx.at>
8948
8949 * window.c (select_window): Always make selected window's buffer
8950 current.
8951
89522012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8953
8954 Use AREF and ASET for docstrings of category tables.
8955 * category.h (CATEGORY_DOCSTRING): Use AREF.
8956 (SET_CATEGORY_DOCSTRING): Use ASET.
8957 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8958
89592012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8960
8961 Inline setter functions for hash table members.
8962 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8963 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8964 (set_hash_key_and_value, set_hash_index, set_hash_next)
8965 (set_hash_hash): New functions.
8966 * charset.c, fns.c: Adjust users.
8967
89682012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8969
8970 Inline getter and setter functions for per-buffer values.
8971 * buffer.h (per_buffer_default, set_per_buffer_default)
8972 (per_buffer_value, set_per_buffer_value): New functions.
8973 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8974 * buffer.c, data.c: Adjust users.
8975
89762012-08-20 Juanma Barranquero <lekktu@gmail.com>
8977
8978 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8979
89802012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8981
8982 Rely on <config.h> + <unistd.h> to declare 'environ',
8983 as gnulib does this if the system doesn't.
8984 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8985 Remove declaration. MS-Windows declares it on stdlib.h which is
8986 included by conf_post.h.
8987 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8988 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8989 * vm-limit.c: Include <unistd.h>, for 'environ'.
8990
8991 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8992 (start_of_data): Remove decl; mem-limits.h provides it.
8993
8994 * xdisp.c (handle_invisible_prop): Make it a bit faster
8995 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8996
89972012-08-19 Chong Yidong <cyd@gnu.org>
8998
8999 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
9000 ends (Bug#3874).
9001
90022012-08-19 Andreas Schwab <schwab@linux-m68k.org>
9003
9004 * .gdbinit: Use call instead of set when calling a function in the
9005 inferior.
9006
9007 * data.c (set_internal): Don't use set_blv_found.
9008 (Fkill_local_variable): Likewise.
9009
90102012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
9011
9012 * nsfont.m (ns_ascii_average_width): Ensure the string
9013 ascii_printable is initialized with a null-terminated character
9014 array. Otherwise, it can contain undesired extra characters.
9015
90162012-08-18 Paul Eggert <eggert@cs.ucla.edu>
9017
9018 port new setting code to Sun C 5.8 2005/10/13
9019 * chartab.c, lisp.h (char_table_set, char_table_set_range):
9020 Return void, not Lisp_Object. Otherwise, the compiler
9021 complains about (A?B:C) where B is void and C is Lisp_Object
9022 when compiling CHAR_TABLE_SET, due to the recent change to
9023 the API of sub_char_table_set_contents.
9024
90252012-08-18 Chong Yidong <cyd@gnu.org>
9026
9027 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
9028 for the string case (Bug#3874).
9029
90302012-08-18 Paul Eggert <eggert@cs.ucla.edu>
9031
9032 * buffer.h (BSET): Remove (Bug#12215).
9033 Replace all uses with calls to new setter functions.
9034 (bset_bidi_paragraph_direction, bset_case_canon_table)
9035 (bset_case_eqv_table, bset_directory, bset_display_count)
9036 (bset_display_time, bset_downcase_table)
9037 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
9038 (bset_last_selected_window, bset_local_var_alist)
9039 (bset_mark_active, bset_point_before_scroll, bset_read_only)
9040 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
9041 (bset_width_table):
9042 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
9043 (bset_auto_fill_function, bset_auto_save_file_format)
9044 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
9045 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
9046 (bset_cache_long_line_scans, bset_case_fold_search)
9047 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
9048 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
9049 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
9050 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
9051 (bset_header_line_format, bset_indicate_buffer_boundaries)
9052 (bset_indicate_empty_lines, bset_invisibility_spec)
9053 (bset_left_fringe_width, bset_major_mode, bset_mark)
9054 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
9055 (bset_name, bset_overwrite_mode, bset_pt_marker)
9056 (bset_right_fringe_width, bset_save_length)
9057 (bset_scroll_bar_width, bset_scroll_down_aggressively)
9058 (bset_scroll_up_aggressively, bset_selective_display)
9059 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
9060 (bset_word_wrap, bset_zv_marker):
9061 * category.c (bset_category_table):
9062 * syntax.c (bset_syntax_table):
9063 New setter functions.
9064
9065 * process.h (PSET): Remove (Bug#12215).
9066 Replace all uses with calls to new setter functions.
9067 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9068 (PROCESS_INLINE): New macro.
9069 (pset_childp): New setter function.
9070 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
9071 * process.c (PROCESS_INLINE):
9072 Define to EXTERN_INLINE, so that the corresponding functions
9073 are compiled into code.
9074 (pset_buffer, pset_command, pset_decode_coding_system)
9075 (pset_decoding_buf, pset_encode_coding_system)
9076 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
9077 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
9078 (pset_type, pset_write_queue): New setter functions.
9079
9080 * window.h (WSET): Remove (Bug#12215).
9081 Replace all uses with calls to new setter functions.
9082 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9083 (WINDOW_INLINE): New macro.
9084 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
9085 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
9086 (wset_total_lines, wset_vertical_scroll_bar)
9087 (wset_window_end_pos, wset_window_end_valid)
9088 (wset_window_end_vpos): New setter functions.
9089 * window.c (WINDOW_INLINE):
9090 Define to EXTERN_INLINE, so that the corresponding functions
9091 are compiled into code.
9092 (wset_combination_limit, wset_dedicated, wset_display_table)
9093 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
9094 (wset_new_normal, wset_new_total, wset_next_buffers)
9095 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
9096 (wset_prev_buffers, wset_right_fringe_width)
9097 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
9098 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
9099 (wset_window_parameters):
9100 * xdisp.c (wset_base_line_number, wset_base_line_pos)
9101 (wset_column_number_displayed, wset_region_showing):
9102 New setter functions.
9103
9104 * termhooks.h (TSET): Remove (Bug#12215).
9105 Replace all uses with calls to new setter functions.
9106 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9107 (TERMHOOKS_INLINE): New macro.
9108 (tset_charset_list, tset_selection_alist): New setter functions.
9109 * terminal.c (TERMHOOKS_INLINE):
9110 Define to EXTERN_INLINE, so that the corresponding functions
9111 are compiled into code.
9112 (tset_param_alist): New setter function.
9113
91142012-08-17 Paul Eggert <eggert@cs.ucla.edu>
9115
9116 * keyboard.h (KSET): Remove (Bug#12215).
9117 Replace all uses with calls to new setter functions.
9118 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9119 (KEYBOARD_INLINE): New macro.
9120 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
9121 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
9122 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
9123 New setter functions.
9124 * keyboard.c (KEYBOARD_INLINE):
9125 Define to EXTERN_INLINE, so that the corresponding functions
9126 are compiled into code.
9127 (kset_echo_string, kset_kbd_queue)
9128 (kset_keyboard_translate_table, kset_last_prefix_arg)
9129 (kset_last_repeatable_command, kset_local_function_key_map)
9130 (kset_overriding_terminal_local_map, kset_real_last_command)
9131 (kset_system_key_syms): New setter functions.
9132
9133 * frame.h (FSET): Remove (Bug#12215).
9134 Replace all uses with calls to new setter functions.
9135 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9136 (FRAME_INLINE): New macro.
9137 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
9138 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
9139 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
9140 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
9141 (fset_param_alist, fset_root_window, fset_scroll_bars)
9142 (fset_selected_window, fset_title, fset_tool_bar_items)
9143 (fset_tool_bar_position, fset_tool_bar_window): New functions.
9144 * frame.c (FRAME_INLINE):
9145 Define to EXTERN_INLINE, so that the corresponding functions
9146 are compiled into code.
9147 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
9148
9149 A few more naming-convention fixes for getters and setters.
9150 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
9151 and rename from buffer_overlays_set_before.
9152 (set_buffer_overlays_after): Move here from buffer.h, and rename
9153 from buffer_overlays_set_after.
9154 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
9155 All uses changed.
9156 (set_buffer_intervals): Rename from buffer_set_intervals.
9157 * intervals.c (set_interval_object): Move here from intervals.h,
9158 and rename from interval_set_object.
9159 (set_interval_left): Move here from intervals.h, and rename from
9160 interval_set_left.
9161 (set_interval_right): Move here from intervals.h, and rename from
9162 interval_set_right.
9163 (copy_interval_parent): Move here from intervals.h, and rename from
9164 interval_copy_parent.
9165 * intervals.h (set_interval_parent): Rename from interval_set_parent.
9166 (set_interval_plist): Rename from interval_set_plist.
9167 Return void, not Lisp_Object, since no caller uses the result.
9168 * lisp.h (string_intervals): Rename from string_get_intervals.
9169 (set_string_intervals): Rename from string_set_intervals.
9170
9171 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
9172 (set_char_table_contents): Rename from char_table_set_contents.
9173 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
9174 All uses changed. See the end of
9175 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
9176
9177 * lisp.h (CSET): Remove (Bug#12215).
9178 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
9179 (set_char_table_purpose): New functions,
9180 replacing CSET. All uses changed. For example, replace
9181 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
9182 "set_char_table_parent (char_table, parent);".
9183 The old version was confusing because it used the same name
9184 'parent' for two different things.
9185
91862012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
9187
9188 Functions to get and set Lisp_Object fields of buffer-local variables.
9189 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
9190 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
9191 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
9192 * data.c, eval.c, frame.c: Adjust users.
9193
91942012-08-17 Chong Yidong <cyd@gnu.org>
9195
9196 * xfaces.c (merge_face_vectors): If the target font specfies a
9197 font spec, make the font's attributes take precedence over
9198 directly-specified attributes.
9199 (merge_face_ref): Recognize :font.
9200
92012012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
9202
9203 Do not use memcpy for copying intervals.
9204 * intervals.c (reproduce_interval): New function.
9205 (reproduce_tree, reproduce_tree_obj): Use it.
9206 (reproduce_tree_obj): Remove prototype.
9207
92082012-08-17 Paul Eggert <eggert@cs.ucla.edu>
9209
9210 * lisp.h (duration_to_sec_usec): Remove unused decl.
9211
92122012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
9213
9214 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
9215 to an allocated instance of NSString, not to the class itself.
9216
92172012-08-17 Juanma Barranquero <lekktu@gmail.com>
9218
9219 * makefile.w32-in (C_CTYPE_H): New macro.
9220 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
9221 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
9222 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
9223
92242012-08-16 Paul Eggert <eggert@cs.ucla.edu>
9225
9226 Use ASCII tests for character types.
9227 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
9228 * xfns.c, xterm.c:
9229 Don't include <ctype.h>; was not needed.
9230 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
9231 * sysdep.c, xfaces.c:
9232 Include <c-ctype.h> instead of <ctype.h>.
9233 * nsterm.m: Include <c-ctype.h>.
9234 * charset.c (read_hex):
9235 * doc.c (Fsnarf_documentation):
9236 * fileio.c (IS_DRIVE) [WINDOWSNT]:
9237 (DRIVE_LETTER) [DOS_NT]:
9238 (Ffile_name_directory, Fexpand_file_name)
9239 (Fsubstitute_in_file_name):
9240 * font.c (font_parse_xlfd, font_parse_fcname):
9241 * frame.c (x_set_font_backend):
9242 * gtkutil.c (xg_get_font):
9243 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
9244 * nsimage.m (hexchar):
9245 * nsterm.m (ns_xlfd_to_fontname):
9246 * sysdep.c (system_process_attributes):
9247 * xfaces.c (hash_string_case_insensitive):
9248 Use C-locale tests instead of locale-specific tests for character
9249 types, since we want the ASCII interpretation here, not the
9250 interpretation suitable for whatever happens to be the current locale.
9251
92522012-08-16 Martin Rudalics <rudalics@gmx.at>
9253
9254 Consistently check windows for validity/liveness
9255 (Bug#11984, Bug#12025, Bug#12026).
9256 * lisp.h (CHECK_VALID_WINDOW): New macro.
9257 * window.c (decode_window): Rename to decode_live_window.
9258 (decode_valid_window, Fwindow_valid_p): New functions.
9259 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
9260 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
9261 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
9262 (Fwindow_prev_sibling, Fwindow_combination_limit)
9263 (Fset_window_combination_limit, Fwindow_use_time)
9264 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
9265 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
9266 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
9267 (Fwindow_hscroll, Fset_window_hscroll)
9268 (Fwindow_redisplay_end_trigger)
9269 (Fset_window_redisplay_end_trigger, Fwindow_edges)
9270 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
9271 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9272 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
9273 (Fwindow_end, Fset_window_point, Fset_window_start)
9274 (Fpos_visible_in_window_p, Fwindow_line_height)
9275 (Fwindow_dedicated_p, Fset_window_dedicated_p)
9276 (Fwindow_prev_buffers, Fset_window_prev_buffers)
9277 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
9278 (Fset_window_parameter, Fwindow_display_table)
9279 (Fset_window_display_table, Fdelete_other_windows_internal)
9280 (Fset_window_buffer, Fset_window_new_total)
9281 (Fset_window_new_normal, Fdelete_window_internal)
9282 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
9283 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
9284 (Fwindow_scroll_bars): Check whether argument window is a valid or
9285 live window. Update doc-strings.
9286 (syms_of_window): New symbol Qwindow_valid_p.
9287 * keyboard.c (Fposn_at_x_y): Check whether argument
9288 frame_or_window denotes a valid window.
9289
92902012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9291
9292 Fix previous char table change.
9293 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
9294 * chartab.c (optimize_sub_char_table): Likewise.
9295
92962012-08-16 Chong Yidong <cyd@gnu.org>
9297
9298 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
9299
9300 * xfont.c (xfont_open):
9301 * xftfont.c (xftfont_open): Set the font's max_width field.
9302
9303 * nsfont.m (nsfont_open): Similar to the Xft backend, set
9304 min_width to space_width and average_width to the average over
9305 printable ASCII characters.
9306 (ns_char_width): Code cleanup.
9307 (ns_ascii_average_width): New utility function.
9308
9309 * font.h (struct font): Update comments.
9310
93112012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
9312
9313 Simple interface to set Lisp_Object fields of character tables.
9314 * lisp.h (CSET): New macro.
9315 (char_table_set_extras, char_table_set_contents)
9316 (sub_char_table_set_contents): New function.
9317 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
9318 * syntax.c: Adjust users.
9319
93202012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
9321
9322 * eval.c (eval_sub): Bind lexical-binding.
9323 * lread.c (Qlexical_binding): Make non-static.
9324
93252012-08-15 Jan Djärv <jan.h.d@swipnet.se>
9326
9327 * nsmenu.m (popupSession): Remove.
9328 (pop_down_menu): Remove endModalSession.
9329 (timeout_handler:): New method.
9330 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
9331 Call runModalForWindow. Check timer_fired when it returns.
9332 If not set, cancel timer and break out of loop.
9333 Otherwise loop again, with a new timeout.
9334
9335 * nsterm.m: Include fcntl.h if present.
9336 (fd_entry, t_readfds, inNsSelect): Remove.
9337 (select_writefds, select_valid, select_timeout, selfds)
9338 (select_mutex, apploopnr): Add.
9339 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
9340 Otherwise call kbd_buffer_store_event.
9341 (ns_send_appdefined): Remove release of fd_entry.
9342 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
9343 Increment and decrement apploopnr.
9344 (ns_select): If no file descriptors, just do a NSTimer.
9345 Otherwise copy read/write masks and start select thread (fd_handler).
9346 Start main loop and wait for application defined event.
9347 Inform select thread to stop selecting after main loop is exited.
9348 (ns_term_init): Create selfds pipe and set non-blocking.
9349 Initialize select_mutex. Start the select thread (fd_handler).
9350 (fd_handler:): Loop forever, wait for info from the main thread
9351 to either start or stop selecting. When select returns, send
9352 and appdefined event.
9353 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
9354 If not call kbd_buffer_store_event.
9355
9356 * nsterm.h (EmacsApp): fd_handler takes id argument.
9357 (EmacsDialogPanel): Add timer_fired and timeout_handler.
9358
9359 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
9360
93612012-08-15 Eli Zaretskii <eliz@gnu.org>
9362
9363 * region-cache.c (move_cache_gap): Update gap_len using the actual
9364 growth of the boundaries array. Do not change cache_len.
9365 (Bug#12196)
9366
93672012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9368
9369 Generalize and cleanup font subsystem checks.
9370 * font.h (FONT_DEBUG, font_assert): Remove.
9371 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
9372 Change font_assert to eassert. Use eassert where appropriate.
9373
93742012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9375
9376 * gtkutil.c (xg_get_font): Use pango_units_to_double.
9377
93782012-08-15 Chong Yidong <cyd@gnu.org>
9379
9380 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
9381 When using the new font chooser, use gtk_font_chooser_get_font_desc to
9382 extract the font descriptor instead of just the font name.
9383 In that case, return a font spec instead of a string.
9384 (x_last_font_name): Move to this file from xfns.c.
9385
9386 * xfns.c (Fx_select_font): The return value can also be a font
9387 spec. Move x_last_font_name management to gtkutil.c.
9388
9389 * xfaces.c: Make font weight and style symbols non-static.
9390
93912012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
9392
9393 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
9394 (bug#12117).
9395
93962012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
9397
9398 * alloc.c (Fgarbage_collect): Use plural form consistently.
9399
94002012-08-14 Eli Zaretskii <eliz@gnu.org>
9401
9402 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9403 iteration through the command loop. Fixes a problem whereby mouse
9404 movements are ignored until the first mouse click.
9405
94062012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9407
9408 Use bool, not int, for Lisp booleans.
9409 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9410 makes Emacs a bit smaller and presumably a bit faster.
9411 * lisp.h: Include <stdbool.h>.
9412 (struct Lisp_Boolfwd, defvar_bool):
9413 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9414 * regex.c [!emacs]: Include <stdbool.h>.
9415 (false, true): Remove; <stdbool.h> does this for us now.
9416
94172012-08-14 Chong Yidong <cyd@gnu.org>
9418
9419 * character.c (Fcharacterp): Doc fix (Bug#12076).
9420
9421 * data.c (Findirect_variable): Doc fix (Bug#11040).
9422
9423 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9424
9425 * editfns.c (Fformat): Doc fix (Bug#12059).
9426 (Fsave_current_buffer): Doc fix (Bug#11542).
9427
94282012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9429
9430 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9431 (bug#12022).
9432
94332012-08-14 Martin Rudalics <rudalics@gmx.at>
9434
9435 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9436 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9437 * minibuf.c (choose_minibuf_frame, read_minibuf):
9438 * w32fns.c (x_create_tip_frame):
9439 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9440 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9441
94422012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9443
9444 * intervals.c (offset_intervals): Remove obsolete comment.
9445
94462012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9447
9448 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9449
94502012-08-14 Gergely Risko <gergely@risko.hu>
9451
9452 * coding.c (decode_coding): Record buffer modification before
9453 disabling undo_list (Bug#11773).
9454
94552012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9456
9457 Revert and cleanup some recent overlay changes.
9458 * buffer.h (enum overlay_type): Remove.
9459 (buffer_get_overlays, buffer_set_overlays): Likewise.
9460 (buffer_set_overlays_before, buffer_set_overlays_after):
9461 New function. Adjust users.
9462 (unchain_both): Add eassert.
9463
94642012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9465
9466 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9467
94682012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9469
9470 * gtkutil.c (xg_mark_data): Don't assume C99.
9471
94722012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9473
9474 * gtkutil.c (xg_frame_tb_info): New struct.
9475 (TB_INFO_KEY): New define.
9476 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9477 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9478 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9479 if not present.
9480 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
9481 is up to date. Otherwise store new data.
9482 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9483
94842012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9485
9486 Use KSET for write access to Lisp_Object members of struct kboard.
9487 * keyboard.h (KSET): New macro.
9488 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9489 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9490 * xterm.c: Adjust users.
9491
94922012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9493
9494 Use BSET for write access to Lisp_Object members of struct buffer.
9495 * buffer.h (BSET): New macro.
9496 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9497 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9498 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9499 * window.c, xdisp.c, xfns.c: Adjust users.
9500
95012012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9502
9503 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9504
95052012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9506
9507 * nsterm.m (not_in_argv): New function.
9508 (application:openFile, application:openTempFile:):
9509 (application:openFileWithoutUI:, application:openFiles:): Open file
9510 if not_in_argv returns non-zero (bug#12171).
9511
9512 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
9513 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9514 Define for Gtk+ versions less than 3.2.
9515 (xg_get_font_name): Use those functions/macros here.
9516 Reported by Frans Oilinki <moilinki@gmail.com>.
9517
95182012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9519
9520 * unexmacosx.c (copy_data_segment): Copy initialized data in
9521 statically linked libraries from input file rather than memory.
9522
9523 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9524 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9525 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9526
95272012-08-10 Glenn Morris <rgm@gnu.org>
9528
9529 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9530 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9531
95322012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9533
9534 Fix last change to allow compilation with low optimization levels.
9535 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9536 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9537
95382012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9539
9540 Use common inline syntax in intervals.h.
9541 * intervals.h (INTERVALS_INLINE): New macro.
9542 Change all users from LISP_INLINE.
9543
95442012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9545
9546 Define Qnone once for all platforms.
9547 * frame.c (Qnone): Define here.
9548 (syms_of_frame): DEFSYM it.
9549 * lisp.h (Qnone): New declaration.
9550 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9551 * xfns.c: Remove duplication. Adjust users.
9552
95532012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9554
9555 Remove unused macros from intervals.h.
9556 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9557 * intervals.c: Adjust comment.
9558
95592012-08-10 Eli Zaretskii <eliz@gnu.org>
9560
9561 * w32fns.c <w32_unicode_gui>: New static variable.
9562 (globals_of_w32fns): Initialize it according to os_subtype.
9563 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9564 testing os_subtype.
9565
95662012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
9567 Eli Zaretskii <eliz@gnu.org>
9568
9569 Fix bug #10299 with Unicode characters sent by customized
9570 keyboards created by MSKLC.
9571 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9572 (w32_init_class): Use it to initialize the Emacs class with either
9573 ANSI or Unicode API calls.
9574 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9575 later.
9576 (w32_wnd_proc): If the character code sent by WM_CHAR or
9577 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9578 original message. Call DefWindowProcW on NT and later.
9579
95802012-08-10 Glenn Morris <rgm@gnu.org>
9581
9582 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9583
9584 * lisp.h (DIRECTORY_SEP): Let configure set it.
9585
95862012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9587
9588 Use TSET for write access to Lisp_Object slots of struct terminal.
9589 * termhooks.h (TSET): New macro.
9590 * coding.c, terminal.c, xselect.c: Adjust users.
9591
95922012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9593
9594 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9595 the failing expression, include them in the error message.
9596 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9597 * lisp.h (internal_condition_case_n): Update declaration.
9598
95992012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9600
9601 Inline functions to examine and change buffer overlays.
9602 * buffer.c (unchain_both): New function.
9603 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9604 (buffer_has_overlays): New function.
9605 (enum overlay_type): New enum.
9606 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9607 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9608
96092012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9610
9611 Inline functions to examine and change buffer intervals.
9612 * alloc.c (mark_interval_tree): Remove.
9613 (MARK_INTERVAL_TREE): Simplify.
9614 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9615 * intervals.c (buffer_balance_intervals): New function.
9616 (graft_intervals_into_buffer): Adjust indentation.
9617 (set_intervals_multibyte): Simplify.
9618 * buffer.h (BUF_INTERVALS): Remove.
9619 (buffer_get_intervals, buffer_set_intervals): New function.
9620 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9621 * intervals.c, textprop.c: Adjust users.
9622
96232012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9624
9625 Inline functions to examine and change string intervals.
9626 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9627 (string_get_intervals, string_set_intervals): New function.
9628 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9629 * lread.c, print.c, textprop.c: Adjust users.
9630
96312012-08-08 Glenn Morris <rgm@gnu.org>
9632
9633 * lisp.mk (lisp): Remove language/persian.elc.
9634
96352012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9636
9637 Cleanup intervals.
9638 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9639 (NULL_INTERVAL_P): Likewise. Adjust users.
9640 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9641 Adjust comment. Move under #if 0.
9642 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9643 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9644
96452012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9646
9647 Check total length of intervals with eassert.
9648 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9649 * intervals.c: Change all users to eassert.
9650
96512012-08-07 Eli Zaretskii <eliz@gnu.org>
9652
9653 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9654 Rename fields to match removal of FGET and WGET and disuse of
9655 INTERNAL_FIELD in Lisp_Cons.
9656
96572012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9658
9659 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9660 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9661 name since all xname users are fixed long time ago. Do not
9662 use INTERNAL_FIELD.
9663 (set_symbol_name, set_symbol_function, set_symbol_plist):
9664 (set_symbol_next, set_overlay_plist): New function.
9665 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9666 (struct Lisp_Overlay): Likewise.
9667 (CVAR, MVAR, SVAR): Remove.
9668 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9669 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9670 * xterm.c: Adjust users.
9671 * .gdbinit: Change to use name field of struct Lisp_Symbol
9672 where appropriate.
9673
96742012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9675
9676 Basic functions to set Lisp_Object and pointer slots of intervals.
9677 * intervals.h (interval_set_parent, interval_set_object):
9678 (interval_set_left, interval_set_right, interval_set_plist):
9679 (interval_copy_parent): New function.
9680 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9681 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9682 Adjust indentation.
9683 (INTERVAL_SIZE): Remove. Adjust users.
9684 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9685
96862012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9687
9688 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9689 * process.h (PGET): Remove.
9690 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9691 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9692
96932012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9694
9695 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9696 * window.h (WGET): Remove.
9697 (struct window): Do not use INTERNAL_FIELD.
9698 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9699 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9700 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9701 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9702 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9703 Adjust users.
9704
97052012-08-07 Chong Yidong <cyd@gnu.org>
9706
9707 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9708 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9709 (Fdelete_window_internal): Signal an error if the window is not on
9710 a live frame (Bug#12025).
9711
97122012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9713
9714 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9715 * frame.h (FGET): Remove.
9716 (struct frame): Do not use INTERNAL_FIELD.
9717 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9718 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9719 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9720 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9721
97222012-08-06 Juanma Barranquero <lekktu@gmail.com>
9723
9724 * w32.c: Silence compiler warnings.
9725 (map_w32_filename): Remove unused variable `is_fat'.
9726 (chase_symlinks): Add parentheses around expression.
9727
97282012-08-06 Glenn Morris <rgm@gnu.org>
9729
9730 * sysdep.c: Respect BROKEN_GETWD.
9731
9732 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9733 Let configure handle it.
9734 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9735
97362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9737
9738 Use GCALIGNMENT where appropriate.
9739 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9740 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9741 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9742
97432012-08-06 Eli Zaretskii <eliz@gnu.org>
9744
9745 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9746 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9747
97482012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9749
9750 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9751 that should be sufficient for everyone.
9752
97532012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9754
9755 * keyboard.c (timer_check_2): Add break so timer_check returns next
9756 timeout.
9757
97582012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9759
9760 Fix Windows build errors introduced after converting to WGET and WSET.
9761 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9762 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9763
97642012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9765
9766 * nsterm.m (ns_frame_rehighlight): Use FSET.
9767
9768 * nsmenu.m (ns_update_menubar): Use FSET.
9769
97702012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9771
9772 Separate read and write access to Lisp_Object slots of Lisp_Process.
9773 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9774 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9775
97762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9777
9778 Separate read and write access to Lisp_Object slots of struct window.
9779 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9780 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9781 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9782 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9783 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9784 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9785 Adjust users.
9786
97872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9788
9789 Fix Windows build errors introduced after converting to FGET and FSET.
9790 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9791 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9792 (w32_judge_scroll_bars): Change to use FSET.
9793 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9794
97952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9796
9797 Fix replacement typo.
9798 * window.c (replace_window): Set root_window instead of
9799 selected_window. This fixes a total window subsystem
9800 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9801
98022012-08-06 Glenn Morris <rgm@gnu.org>
9803
9804 * lisp.mk (lisp): Add language/persian.elc.
9805
98062012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9807
9808 Separate read and write access to Lisp_Object slots of struct frame.
9809 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9810 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9811 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9812 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9813 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9814
98152012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9816
9817 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9818
98192012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9820
9821 Generalize common compile-time constants.
9822 * lisp.h (header_size, bool_header_size, word_size): Now here.
9823 (struct Lisp_Vector): Add comment.
9824 (struct Lisp_Bool_Vector): Move up to define handy constants.
9825 (VECSIZE, PSEUDOVECSIZE): Simplify.
9826 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9827 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9828 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9829 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9830 * xfont.c, xmenu.c: Use word_size where appropriate.
9831
98322012-08-05 Lawrence Mitchell <wence@gmx.li>
9833
9834 * search.c (Freplace_match): Treat \? in the replacement text
9835 literally (Bug#8161).
9836
98372012-08-05 Chong Yidong <cyd@gnu.org>
9838
9839 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9840 * frame.c (Vdelete_frame_functions):
9841 * emacs.c (Vkill_emacs_hook): Doc fix.
9842
98432012-08-04 Eli Zaretskii <eliz@gnu.org>
9844
9845 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9846 --with-x-toolkit=no builds.
9847 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9848
98492012-08-04 Chong Yidong <cyd@gnu.org>
9850
9851 * syntax.c (Fmodify_syntax_entry): Doc fix.
9852
98532012-08-04 Eli Zaretskii <eliz@gnu.org>
9854
9855 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9856 * w32.c (init_environment): Change the default values of many
9857 environment variables in dflt_envvars[] to NULL, to avoid pushing
9858 them into environment when they were not already defined.
9859 Remove the code that deletes site-lisp subdirectories from the default
9860 value of EMACSLOADPATH, as it is no longer needed.
9861 (check_windows_init_file): Now external, not static.
9862 Use Vload_path as is, without adding anything, as this function is now
9863 called when Vload_path is already set up.
9864
9865 * w32.h (check_windows_init_file): Add prototype.
9866
9867 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9868 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9869 compatibility with Posix platforms.
9870 (main): Move the call to check_windows_init_file to here from
9871 w32.c.
9872 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9873 any, in the DEFALT argument into the root of the Emacs build or
9874 installation tree, as appropriate.
9875
9876 * callproc.c (init_callproc_1): Call decode_env_path instead of
9877 doing its equivalent by hand.
9878 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9879 the code that sets Vexec_path run on MS-Windows.
9880
9881 * lread.c (init_lread): Add comments to #ifdef's.
9882
9883 * msdos.c (dos_set_window_size, IT_update_begin)
9884 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9885 instead of direct references.
9886
98872012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9888
9889 Export DEFAULT_REHASH_* to GDB.
9890 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9891 Now constants, not macros.
9892
98932012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9894
9895 Remove unnecessary casts involving pointers.
9896 These casts are no longer needed now that we assume C89 or later,
9897 since they involve casting to or from void *.
9898 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9899 (make_pure_float, make_pure_vector):
9900 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9901 * macros.c (Fstart_kbd_macro):
9902 * menu.c (find_and_return_menu_selection):
9903 * minibuf.c (read_minibuf_noninteractive):
9904 * sysdep.c (closedir):
9905 * xdisp.c (x_produce_glyphs):
9906 * xfaces.c (compare_fonts_by_sort_order):
9907 * xfns.c (x_real_positions, select_visual):
9908 * xselect.c (x_stop_queuing_selection_requests)
9909 (x_get_window_property, x_get_window_property_as_lisp_data):
9910 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9911 Remove unnecessary pointer casts.
9912 * alloc.c (record_xmalloc): New function.
9913 * lisp.h (record_xmalloc): New decl.
9914 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9915 more like a function. This is because the pointer cast is not
9916 needed. All uses changed.
9917 * print.c (print_string, print_error_message): Avoid length recalc.
9918
9919 Improve fix for macroexp crash with debugging (Bug#12118).
9920 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9921 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9922 not supposed to be invoked from the garbage collector.
9923 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9924 (gc_aset): New function, which is like ASET but can be
9925 used in the garbage collector.
9926 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9927 (set_hash_index): Use it instead of ASET.
9928
99292012-08-03 Eli Zaretskii <eliz@gnu.org>
9930
9931 Support symlinks on latest versions of MS-Windows.
9932 * w32.c: Include winioctl.h and aclapi.h.
9933 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9934 (revert_to_self): Forward declarations of static functions.
9935 <static BOOL g_b_init_get_security_info>:
9936 <g_b_init_create_symbolic_link>: New static flags.
9937 (globals_of_w32): Initialize them to zero.
9938 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9939 (map_w32_filename): Improve commentary. Simplify switch.
9940 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9941 headers (most versions of MinGW w32api don't).
9942 (get_security_info, create_symbolic_link)
9943 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9944 New functions.
9945 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9946 in the argument file name.
9947 (sys_access): Call unc_volume_file_attributes only if
9948 GetFileAttributes fails with network-related error codes.
9949 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9950 have the required privileges.
9951 (get_file_security_desc_by_name): Rename from
9952 get_file_security_desc.
9953 (stat_worker): New function, with most of the guts of 'stat', and
9954 with addition of handling of symlinks and support for 'lstat'.
9955 If possible, get file's attributes and security information by
9956 handle, not by name. Produce S_IFLNK bit for symlinks, when
9957 called from 'lstat'.
9958 (stat, lstat): New functions, call 'stat_worker'.
9959 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9960 symlinks when the underlying filesystem supports them.
9961
99622012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 Fix macroexp crash on Windows with debugging (Bug#12118).
9965 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9966 checking subscripts; problem introduced with the recent
9967 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9968 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9969 since it's used in non-static inline functions now.
9970
9971 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9972 Don't assume buffer size fits in 'int'. Remove unused local.
9973
9974 Use C99-style 'extern inline' if available.
9975 * buffer.h (BUFFER_INLINE):
9976 * category.h (CATEGORY_INLINE):
9977 * character.h (CHARACTER_INLINE):
9978 * charset.h (CHARSET_INLINE):
9979 * composite.h (COMPOSITE_INLINE):
9980 * dispextern.h (DISPEXTERN_INLINE):
9981 * lisp.h (LISP_INLINE):
9982 * systime.h (SYSTIME_INLINE):
9983 New macro, replacing 'static inline' in this header.
9984 * buffer.h, category.h, character.h, charset.h, composite.h:
9985 * dispextern.h, lisp.h, systime.h:
9986 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9987 * alloc.c (LISP_INLINE):
9988 * buffer.c (BUFFER_INLINE):
9989 * category.c (CATEGORY_INLINE):
9990 * character.c (CHARACTER_INLINE):
9991 * charset.c (CHARSET_INLINE):
9992 * composite.c (COMPOSITE_INLINE):
9993 * dispnew.c (DISPEXTERN_INLINE):
9994 * sysdep.c (SYSTIME_INLINE):
9995 Define to EXTERN_INLINE, so that the corresponding functions
9996 are compiled into code.
9997 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9998 (INLINE_HEADER_END): New macros.
9999 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
10000 since it's used in non-static inline functions now.
10001 (VALMASK) [!USE_LSB_TAG]: Likewise.
10002
100032012-08-02 Glenn Morris <rgm@gnu.org>
10004
10005 * s/: Remove empty directory.
10006
10007 * s/ms-w32.h: Move to ../nt/inc.
10008 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
10009 Update for new ms-w32.h location.
10010
100112012-08-02 Paul Eggert <eggert@cs.ucla.edu>
10012
10013 Port to Solaris 8.
10014 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
10015
100162012-08-02 Glenn Morris <rgm@gnu.org>
10017
10018 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
10019 hard-coding the path separator.
10020
100212012-08-01 Paul Eggert <eggert@cs.ucla.edu>
10022
10023 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
10024 This how ASET and AREF are supposed to work, and makes
10025 it easier to think about future improvements. See
10026 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
10027 * charset.h (set_charset_attr): New function.
10028 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
10029 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
10030 (aref_addr): New function. All uses of &AREF(...) changed.
10031 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
10032 (set_hash_index): New functions. All lvalue-style uses of
10033 HASH_KEY etc. changed.
10034 * keyboard.c (set_prop): New function. All lvalue-style uses
10035 of PROP changed.
10036
100372012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
10038
10039 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
10040 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
10041 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
10042 * nsfns.m (ns_set_name_as_filename): Likewise.
10043 * nsmenu.m (ns_update_menubar): Likewise.
10044 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
10045
100462012-08-01 Eli Zaretskii <eliz@gnu.org>
10047
10048 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
10049 Adapt to latest changes in field names of the corresponding Lisp
10050 objects.
10051
10052 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
10053
100542012-08-01 Glenn Morris <rgm@gnu.org>
10055
10056 * s/msdos.h: Remove file.
10057 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
10058 * Makefile.in (S_FILE): Remove.
10059 (config_h): Remove S_FILE.
10060
100612012-08-01 Juanma Barranquero <lekktu@gmail.com>
10062
10063 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
10064 Remove; moved to nt/config.nt.
10065
100662012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
10067
10068 Use INTERNAL_FIELD for conses and overlays.
10069 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
10070 Remove obsolete comment.
10071 (MVAR): New macro.
10072 (struct Lisp_Overlay): Use INTERNAL_FIELD.
10073 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
10074
100752012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
10076
10077 Use INTERNAL_FIELD for symbols.
10078 * lisp.h (SVAR): New macro. Adjust users.
10079 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
10080 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
10081
100822012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
10083
10084 Use INTERNAL_FIELD for processes.
10085 * process.h (PVAR): New macro. Adjust style.
10086 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
10087 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
10088
100892012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
10090
10091 Use INTERNAL_FIELD for windows.
10092 * window.h (WVAR): New macro.
10093 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
10094 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
10095 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
10096 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
10097 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
10098 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
10099
101002012-08-01 Paul Eggert <eggert@cs.ucla.edu>
10101
10102 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
10103
101042012-08-01 Glenn Morris <rgm@gnu.org>
10105
10106 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
10107 Move to configure.ac.
10108
101092012-08-01 Juanma Barranquero <lekktu@gmail.com>
10110
10111 * makefile.w32-in (CONFIG_H): Update dependencies.
10112 (CONF_POST_H): New macro.
10113
10114 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
10115
101162012-07-31 Glenn Morris <rgm@gnu.org>
10117
10118 * Makefile.in (S_FILE): No longer set by configure.
10119
10120 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
10121 is available.
10122 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
10123
10124 * process.h (NULL_DEVICE):
10125 * emacs.c (SEPCHAR):
10126 * editfns.c (USER_FULL_NAME): Let configure set them.
10127
10128 * s/README, s/template.h: Remove files.
10129
10130 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
10131
10132 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
10133 Move to configure.ac.
10134
101352012-07-31 Eli Zaretskii <eliz@gnu.org>
10136
10137 * .gdbinit (xframe): Adapt to introduction of FVAR and the
10138 resulting renaming of 'struct frame' members.
10139
10140 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
10141
10142 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
10143 after introduction of FVAR.
10144
101452012-07-31 Jan Djärv <jan.h.d@swipnet.se>
10146
10147 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
10148
10149 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
10150 instead of compositeToPoint.
10151 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
10152
10153 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
10154
101552012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
10156
10157 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
10158 * lisp.h (INTERNAL_FIELD): New macro.
10159 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
10160 (BVAR): Change to use INTERNAL_FIELD.
10161 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
10162 (KVAR): Change to use INTERNAL_FIELD.
10163 * frame.h (FVAR): New macro.
10164 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
10165 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
10166 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
10167 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
10168 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
10169
101702012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
10171
10172 Miscellaneous fixes for non-default X toolkits.
10173 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
10174 * xterm.c (x_frame_of_widget): Remove redundant prototype.
10175 Move under #ifdef USE_LUCID.
10176 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
10177 definition and usage to avoid warnings.
10178
101792012-07-31 Jan Djärv <jan.h.d@swipnet.se>
10180
10181 * nsterm.m (openFiles): Fix previous checkin.
10182
101832012-07-31 Paul Eggert <eggert@cs.ucla.edu>
10184
10185 * indent.c (compute_motion): Remove unused local.
10186
101872012-07-31 Glenn Morris <rgm@gnu.org>
10188
10189 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
10190
10191 * conf_post.h [USG5_4]:
10192 Move remaining contents of s/usg5-4-common.h here.
10193 * s/usg5-4-common.h: Remove file.
10194
10195 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
10196 * s/irix6-5.h: Remove file.
10197
10198 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
10199 * s/darwin.h: Remove file.
10200
10201 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
10202 * s/hpux10-20.h: Remove file, which is now empty.
10203
102042012-07-30 Glenn Morris <rgm@gnu.org>
10205
10206 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
10207 * Makefile.in (config_h): Add conf_post.h.
10208 * makefile.w32-in (CONFIG_H): Add conf_post.h.
10209
102102012-07-30 Jan Djärv <jan.h.d@swipnet.se>
10211
10212 * nsterm.m (ns_do_open_file): New variable.
10213 (ns_term_init): Set ns_do_open_file to YES after run returns.
10214 (openFile, openTempFile, openFileWithoutUI, openFiles):
10215 Open files only if ns_do_open_file.
10216
102172012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10218
10219 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
10220 This no-op macro hasn't been needed for many years.
10221 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
10222
10223 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
10224 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
10225 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
10226 gdb_make_enums_visible.
10227 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
10228 (DIRECTORY_SEP): Now a constant, not a macro.
10229
102302012-07-30 Eli Zaretskii <eliz@gnu.org>
10231
10232 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
10233 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
10234
10235 * w32term.c <w32_keyboard_codepage>: Renamed from
10236 keyboard_codepage and now external. All users changed.
10237
10238 * w32term.h: Add declaration of w32_keyboard_codepage.
10239
10240 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
10241 the codepage to translate keys to Unicode. If this argument is
10242 -1, use the value returned by GetConsoleCP. All callers changed.
10243
102442012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10245
10246 Update .PHONY listings in makefiles.
10247 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
10248 bootstrap-clean, distclean, maintainer-clean, versioclean,
10249 extraclean, frc.
10250
10251 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
10252 This is a bit clearer. Fix some commentary typos.
10253
102542012-07-30 Glenn Morris <rgm@gnu.org>
10255
10256 * s/netbsd.h: Let configure include signal.h if needed.
10257 Remove file, which is now empty.
10258
10259 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
10260 Let configure set them.
10261 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
10262 No more need to undefine.
10263
102642012-07-30 Andreas Schwab <schwab@linux-m68k.org>
10265
10266 * keymap.c (Fkey_description): Don't remove 0x80 bit from
10267 non-single-byte char when adding meta modifier. (Bug#12090)
10268
102692012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10270
10271 Convert safe_call to use variable number of arguments.
10272 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
10273 (safe_call2): Fix comment.
10274 * lisp.h (safe_call): Adjust prototype.
10275 * coding.c (encode_coding_object): Change to use safe_call2.
10276 * xfaces.c (merge_face_heights): Change to use safe_call1.
10277
102782012-07-30 Glenn Morris <rgm@gnu.org>
10279
10280 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
10281 does that unconditionally. Remove file, which is now empty.
10282
10283 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
10284 Remove empty files.
10285
102862012-07-30 Paul Eggert <eggert@cs.ucla.edu>
10287
10288 Export to GDB most of lisp.h's remaining object-like macros.
10289 * lisp.h (min, max): Move earlier, because they're used earlier now.
10290 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
10291 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
10292 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
10293 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
10294 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
10295 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
10296 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
10297 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
10298 Now constants, for GDB. They need not be macros.
10299 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
10300 Now constants, for GDB, as well as macros, for static initializers.
10301 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
10302 Move to after the definition of struct Lisp_Char_Table,
10303 since the former now needs that type defined.
10304 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
10305 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
10306 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
10307 New enums, for gdb_make_enums_visible.
10308 (GLYPH_MODE_LINE_FACE): Remove; unused.
10309 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
10310 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
10311 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
10312 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
10313 enum maxargs, enum MAX_ALLOCA.
10314 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
10315 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
10316 no longer needed, now that they are done in lisp.h.
10317
103182012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
10319
10320 Cleanup string bytes checking.
10321 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
10322 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
10323 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
10324 (check_sblock, compact_small_strings): Simplify.
10325
103262012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10327
10328 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
10329 These macros are confusing and no longer need to be defined, as
10330 the enum values now suffice. All uses replaced with definiens.
10331 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
10332
103332012-07-29 Juanma Barranquero <lekktu@gmail.com>
10334
10335 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
10336 ($(BLD)/w32console.$(O)): Update dependencies.
10337
103382012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10339
10340 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
10341 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
10342 time. Adjust users.
10343 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
10344
103452012-07-29 Jan Djärv <jan.h.d@swipnet.se>
10346
10347 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
10348 setting sitelisp (Bug#12010).
10349
103502012-07-29 Eli Zaretskii <eliz@gnu.org>
10351
10352 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
10353
10354 * w32heap.c (cache_system_info):
10355 * w32.c (sys_rename):
10356 * w32proc.c (find_child_console, sys_kill): All users changed.
10357
103582012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10359
10360 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
10361
103622012-07-29 Eli Zaretskii <eliz@gnu.org>
10363
10364 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
10365
103662012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10367
10368 Cleanup statistics calculation in Fgarbage_collect.
10369 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
10370 Fix zombies percentage calculation. Simplify elapsed time calculation.
10371
103722012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10373
10374 Generalize marker debugging code under MARKER_DEBUG and use eassert.
10375 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
10376 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
10377 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
10378 (replace_range, replace_range_2, del_range_2): Change to eassert.
10379 * marker.c (byte_char_debug_check): Adjust style.
10380
103812012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10382
10383 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
10384 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
10385 long-ago-commented-out code that talks about "WIN32".
10386 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
10387 All uses changed.
10388
103892012-07-28 Paul Eggert <eggert@cs.ucla.edu>
10390
10391 Use Gnulib stdalign module (Bug#9772, Bug#9960).
10392 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
10393 Simplify by using alignof.
10394 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
10395 * lisp.h: Include <stdalign.h>.
10396 (GCALIGNMENT): New macro and constant.
10397 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
10398 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
10399 (stdalign): New macro, if not already defined.
10400
104012012-07-28 Eli Zaretskii <eliz@gnu.org>
10402
10403 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10404 * w32inevt.c: Include w32inevt.h.
10405 (w32_read_console_input): New inline function, calls either
10406 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10407 w32_console_unicode_input.
10408 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10409 (w32_kbd_patch_key, key_event): Use the codepage returned by
10410 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10411 (key_event): use uChar.UnicodeChar only if
10412 w32_console_unicode_input is non-zero.
10413
10414 * w32console.c: Include w32heap.h.
10415 <w32_console_unicode_input>: New global variable.
10416 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10417 family of Windows, zero otherwise.
10418
10419 * w32inevt.h: Declare w32_console_unicode_input.
10420
10421 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10422 --without-x. (Bug#11742)
10423
104242012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10425
10426 Adjust GDB to reflect pvec_type changes (Bug#12036).
10427 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
10428 2012-07-04 changes to pseudovector representation.
10429 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
10430
104312012-07-27 Michael Albinus <michael.albinus@gmx.de>
10432
10433 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10434 bus address.
10435 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10436
104372012-07-27 Eli Zaretskii <eliz@gnu.org>
10438
10439 * alloc.c (listn): Fix the order the arguments are consed onto the
10440 list.
10441
10442 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10443 enumeration constants, as PURE and HEAP are too general, and clash
10444 with other headers and sources, such as gmalloc.c and the
10445 MS-Windows system headers. All users changed.
10446
104472012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10448
10449 Revert last save_excursion_save and save_excursion_restore changes.
10450 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10451 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10452
104532012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10454
10455 Fix recently-introduced typos in Windows port.
10456 Reported by Martin Rudalics <rudalics@gmx.at>.
10457 * w32.c (init_environment): Replace comma with semicolon.
10458 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
10459
104602012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10461
10462 Improve GDB symbol export (Bug#12036).
10463 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10464 arms of an 'if', not using conditional expressions; otherwise GDB
10465 complains about the types in the unevaluated arm when the argument
10466 is an integer literal.
10467 (xgetint): Simplify expression.
10468 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10469 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10470 Zaretskii in <http://bugs.gnu.org/12036#13>.
10471 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10472 needed now that we have gdb_make_enums_visible.
10473 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10474 (enum enum_USE_LSB_TAG):
10475 New enum types, packaging up enums that need to be exported to GDB.
10476
104772012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10478
10479 Utility function to make a list from specified amount of objects.
10480 * lisp.h (enum constype): New datatype.
10481 (listn): New prototype.
10482 * alloc.c (listn): New function.
10483 (Fmemory_use_count, syms_of_alloc): Use it.
10484 * buffer.c (syms_of_buffer): Likewise.
10485 * callint.c (syms_of_callint): Likewise.
10486 * charset.c (define_charset_internal): Likewise.
10487 * coding.c (syms_of_coding): Likewise.
10488 * keymap.c (syms_of_keymap): Likewise.
10489 * search.c (syms_of_search): Likewise.
10490 * syntax.c (syms_of_syntax): Likewise.
10491 * w32.c (init_environment): Likewise.
10492 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10493 * xdisp.c (syms_of_xdisp): Likewise.
10494 * xfns.c (syms_of_xfns): Likewise.
10495
104962012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10497
10498 Fast save_excursion_save and save_excursion_restore.
10499 * lisp.h (struct Lisp_Excursion): New data type.
10500 (PVEC_EXCURSION): New pseudovector type.
10501 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10502 to deal with it. Adjust comments.
10503 (init_marker, attach_marker): New prototype.
10504 (unchain_marker): Adjust prototype.
10505 * marker.c (attach_marker): Change to global.
10506 (init_marker): New function.
10507 * alloc.c (Fmake_marker, build_marker): Use it.
10508 (build_marker): More easserts.
10509 (mark_object): Handle struct Lisp_Excursion.
10510 * editfns.c (save_excursion_save, save_excursion_restore):
10511 Reimplement to use struct Lisp_Excursion. Add comments.
10512
105132012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10514
10515 Fix export of symbols to GDB (Bug#12036).
10516 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10517 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10518 emacs.c, as this is a more-suitable home. Had this been done earlier
10519 the fix for 12036 would have avoided some of the problems noted in
10520 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10521 would have been more obvious.
10522 * emacs.c: Do not include <verify.h>; no longer needed.
10523 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
10524 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10525 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10526 Remove; now done in lisp.h.
10527 * lisp.h (PUBLISH_TO_GDB): New macro.
10528 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10529 (DATA_SEG_BITS): Use it.
10530 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10531 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10532 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10533 not be usable in #if. This simplifies things.
10534
105352012-07-26 Juanma Barranquero <lekktu@gmail.com>
10536
10537 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10538
105392012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10540
10541 Simplify export of symbols to GDB (Bug#12036).
10542 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10543 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10544 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10545 Adjust to changes in lisp.h and emacs.c, by using
10546 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10547 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10548 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10549 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10550 instead of gdb_valbits.
10551 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10552 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10553 instead of gdb_array_mark_flag.
10554 (xboolvector): Get size from $->size, not $->header.size.
10555 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10556 (xreload, hook-run, hookpost-run): Remove.
10557 * emacs.c: Include <verify.h>.
10558 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10559 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10560 Remove.
10561 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10562 (gdb_USE_LSB_TAG): New enum constants.
10563 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10564 Also define these as enum constants, so they're visible to GDB.
10565 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10566 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10567 as constants, so they're visible to GDB.
10568 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10569 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10570 Now enum constants, not macros, so they're visible to GDB.
10571 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10572 more convenient now. All uses changed.
10573 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10574 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10575
105762012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10577
10578 Explicitly free restriction data that are not needed anymore.
10579 * editfns.c (save_restriction_restore): Free restriction data.
10580
105812012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10582
10583 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10584 add argument, tune behavior, and adjust all callers.
10585
105862012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10587
10588 Use typedef for EMACS_INT, EMACS_UINT.
10589 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10590 than macros. This simplifies debugging in the usual case, since
10591 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10592 and it allows expressions involving EMACS_INT casts.
10593 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10594
105952012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10596
10597 * nsterm.m (ns_read_socket): Return early if there is a modal
10598 window (Bug#12043).
10599
106002012-07-25 Martin Rudalics <rudalics@gmx.at>
10601
10602 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10603 that FOCUS-FRAME can be omitted.
10604
106052012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10606
10607 Adjust buffer text indirection counters at the end of Fkill_buffer.
10608 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10609 buffer is definitely dead. This should really fix an issue reported
10610 by Christoph Scholtes again. (Bug#12007).
10611 (init_buffer_once): Initialize indirection counters of
10612 buffer_defaults and buffer_local_symbols (for sanity and safety).
10613
106142012-07-24 Eli Zaretskii <eliz@gnu.org>
10615
10616 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10617 and continuation glyphs on tooltip frames, leave them at zero.
10618 Avoids continued lines in tooltips. (Bug#11832)
10619
106202012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10621
10622 Simplify copy_overlay.
10623 * buffer.c (copy_overlay): Simplify. Use build_marker.
10624 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10625
106262012-07-23 Eli Zaretskii <eliz@gnu.org>
10627
10628 * print.c (print_object): Don't crash when a frame's name is nil
10629 or invalid. (Bug#12025)
10630
10631 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10632 it signals an error when a tooltip frame is being created.
10633
106342012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10635
10636 Cleanup miscellaneous objects allocation and initialization.
10637 * alloc.c (allocate_misc): Change to static. Add argument to
10638 specify the subtype. Adjust comment and users.
10639 (build_overlay): New function.
10640 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10641 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10642 (allocate_misc): Remove prototype.
10643 (build_overlay): Add prototype.
10644
106452012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10646
10647 Swap buffer text indirection counters in Fbuffer_swap_text.
10648 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10649 This avoids crash reported by Christoph Scholtes at
10650 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10651
106522012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10653
10654 * nsmenu.m (Popdown_data): New struct.
10655 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10656 free Popdown_data.
10657 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10658 (initWithContentRect): Make imgView and contentView non-static
10659 and autorelease them. Also autorelease img and matrix (Bug#12005).
10660 (dealloc): Remove (Bug#12005).
10661
106622012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10663
10664 Adjust consing_since_gc when objects are explicitly freed.
10665 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10666 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10667 (free_cons, free_misc): Subtract object size from consing_since_gc.
10668
106692012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10670
10671 Simplify and cleanup markers positioning code.
10672 * marker.c (attach_marker): More useful eassert.
10673 (live_buffer, set_marker_internal): New function.
10674 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10675 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10676
106772012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10678
10679 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10680 as it's limited by the amount of memory, not by INT_MAX.
10681
106822012-07-21 Eli Zaretskii <eliz@gnu.org>
10683
10684 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10685 in special-event-map. See the discussion at
10686 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10687 for the reasons.
10688
10689 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10690 info.dwItemData. Fixes crashes on 64-bit Windows.
10691 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10692
106932012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10694
10695 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10696 (conversationIdentifier): Return value is NSInteger.
10697 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10698
106992012-07-21 Chong Yidong <cyd@gnu.org>
10700
10701 * window.c (decode_any_window): Signal an error if the window is
10702 on a dead frame (Bug#11984).
10703
107042012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10705
10706 Add indirection counting to speed up Fkill_buffer.
10707 * buffer.h (struct buffer): New member.
10708 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10709 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10710 base buffer indirection counter.
10711 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10712 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10713 through buffer list if indirection counter is 0.
10714
107152012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10716
10717 Extend the value returned by Fgarbage_collect with heap statistics.
10718 * alloc.c (Qheap): New symbol.
10719 (syms_of_alloc): DEFSYM it.
10720 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10721 (Fmemory_free): Remove.
10722 (syms_of_alloc): Don't defsubr it.
10723 * buffer.c (Fcompact_buffer): Remove.
10724 (syms_of_buffer): Don't defsubr it.
10725
107262012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10727
10728 Make maybe_gc inline.
10729 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10730 * lisp.h (consing_since_gc, gc_relative_threshold)
10731 (memory_full_cons_threshold): Revert declaration.
10732 (maybe_gc): Remove prototype, define as inline.
10733 * alloc.c: Remove old commented-out code.
10734 (consing_since_gc, gc_relative_threshold)
10735 (memory_full_cons_threshold): Revert to global.
10736 (maybe_gc): Remove.
10737
107382012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10739
10740 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10741 * lisp.h (build_unibyte_string): New function.
10742 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10743 * sysdep.c, w32fns.c, xfns.c: Use it.
10744 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10745 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10746 Adjust users accordingly.
10747 * font.h (font_open_by_name): Adjust prototype.
10748
107492012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10750
10751 Cleanup calls to Fgarbage_collect.
10752 * lisp.h (maybe_gc): New prototype.
10753 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10754 Remove declarations.
10755 * alloc.c (maybe_gc): New function.
10756 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10757 Make them static.
10758 * bytecode.c (MAYBE_GC): Use maybe_gc.
10759 * eval.c (eval_sub, Ffuncall): Likewise.
10760 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10761 to avoid dependency from auto-save feature.
10762
107632012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10764
10765 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10766 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10767 'for_each_per_buffer_object_at'.
10768 All uses changed. It's better to use upper-case for macros that
10769 cannot be implemented as functions, to give the reader a clue
10770 that they're special.
10771
107722012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10773
10774 * alloc.c (Fgarbage_collect): Tweak docstring.
10775
107762012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10777
10778 Tweak the value returned from Fgarbage_collect again.
10779 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10780 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10781 Adjust documentation.
10782 (total_vector_bytes): Rename to total_vector_slots, adjust
10783 accounting.
10784 (total_free_vector_bytes): Rename to total_free_vector_slots,
10785 adjust accounting.
10786 (Qstring_bytes, Qvector_slots): New symbols.
10787 (syms_of_alloc): DEFSYM them.
10788
107892012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10790
10791 Buffer compaction primitive which may be used from Lisp.
10792 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10793 (syms_of_buffer): Register Fcompact_buffer.
10794 * alloc.c (Fgarbage_collect): Use compact_buffer.
10795 * buffer.h (compact_buffer): New prototype.
10796 (struct buffer_text): New member.
10797
107982012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10799
10800 New macro to iterate over all buffers, miscellaneous cleanups.
10801 * lisp.h (all_buffers): Remove declaration.
10802 * buffer.h (all_buffers): Add declaration, with comment.
10803 (for_each_buffer): New macro.
10804 * alloc.c (Fgarbage_collect, mark_object): Use it.
10805 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10806 (init_buffer): Likewise.
10807 * data.c (Fset_default): Likewise.
10808 * coding.c (code_conversion_restore): Remove redundant check
10809 for dead buffer.
10810 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10811
108122012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10813
10814 Fix bug that created negative-length intervals.
10815 * intervals.c (merge_interval_right, merge_interval_left):
10816 Do not zero out this interval if it is absorbed by its children,
10817 as this interval's total length doesn't change in that case. See
10818 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10819
108202012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10821
10822 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10823 when invoking (make-bool-vector N t) and N is a positive
10824 multiple of 8 -- the last 8 bits were mistakenly cleared.
10825
10826 Remove some struct layout assumptions in bool vectors.
10827 * alloc.c (bool_header_size): New constant.
10828 (header_size, word_size): Move earlier, as they're now used earlier.
10829 Use 'word_size' in a few more places, where it's appropriate.
10830 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10831 padding before the data member of a bool vector.
10832 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10833 than doing the check by hand with an abort ().
10834
108352012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10836
10837 * eval.c (Fdefvar): Don't check constants since we only set the var if
10838 it's not yet defined anyway (bug#11904).
10839
10840 * lisp.h (last_undo_boundary): Declare new var.
10841 * keyboard.c (command_loop_1): Set it.
10842 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10843 were auto-added by the command loop (bug#11774).
10844
108452012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10846
10847 * w32font.c (Qsymbol): Remove local definition.
10848 (syms_of_w32font): Don't DEFSYM it.
10849
108502012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10851
10852 Fix sweep_vectors to handle large bool vectors correctly.
10853 * alloc.c (sweep_vectors): Account total_vector_bytes for
10854 bool vectors larger than VBLOCK_BYTES_MAX.
10855
108562012-07-18 Chong Yidong <cyd@gnu.org>
10857
10858 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10859 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10860
108612012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10862
10863 Return more descriptive data from Fgarbage_collect.
10864 Suggested by Stefan Monnier in
10865 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10866 * alloc.c (bounded_number): New function.
10867 (total_buffers, total_vectors): New variable.
10868 (total_string_size): Rename to total_string_bytes, adjust users.
10869 (total_vector_size): Rename to total_vector_bytes, adjust users.
10870 (sweep_vectors): Account total_vectors and total_vector_bytes.
10871 (Fgarbage_collect): New return value. Adjust documentation.
10872 (gc_sweep): Account total_buffers.
10873 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10874 (VECTOR_SIZE): Remove.
10875 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10876 (Qinterval, Qmisc): New symbols.
10877 (syms_of_data): Initialize them.
10878 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10879 (Qcons, Qbuffer): New declarations.
10880
108812012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10882
10883 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10884 Round up, not down. Improve doc.
10885
108862012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10887
10888 Restore old code in allocate_string_data to avoid Faset breakage.
10889 Reported by Julien Danjou <julien@danjou.info> in
10890 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10891 * alloc.c (allocate_string_data): Restore old code with minor
10892 adjustments, fix comment to explain this subtle issue.
10893
108942012-07-17 Eli Zaretskii <eliz@gnu.org>
10895
10896 Remove FILE_SYSTEM_CASE.
10897 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10898
10899 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10900 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10901 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10902 call-process-region passes it through expand-file-name.
10903
10904 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10905
109062012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10907
10908 Fix crash when creating indirect buffer (Bug#11917)
10909 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10910 Don't handle unbound variables specially if non-zero.
10911 (Fbuffer_local_variables): Pass zero.
10912 (clone_per_buffer_values): Pass non-zero.
10913
109142012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10915
10916 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10917 to make the loop interruptible.
10918
109192012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10920
10921 * gnutls.c (emacs_gnutls_handshake): Only retry if
10922 GNUTLS_E_INTERRUPTED.
10923
109242012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10925
10926 Cleanup and convert miscellaneous checks to eassert.
10927 * alloc.c (mark_interval): Fix comment, partially rephrase
10928 old comment from intervals.h (see below).
10929 * intervals.c (find_interval, adjust_intervals_for_insertion)
10930 (delete_interval, adjust_intervals_for_deletion)
10931 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10932 Convert to eassert.
10933 (adjust_intervals_for_insertion, make_new_interval):
10934 Remove obsolete and unused code.
10935 * intervals.h (struct interval): Remove obsolete comment.
10936 * textprotp.c (erase_properties): Remove unused code.
10937 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10938 (Fremove_list_of_text_properties): Convert to eassert.
10939
109402012-07-17 Chong Yidong <cyd@gnu.org>
10941
10942 * editfns.c (Finsert_char): Doc fix.
10943
109442012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10945
10946 Fix previous change to make Fmemory_free always accurate.
10947 * alloc.c (make_interval): Update total_free_intervals.
10948 (make_float): Likewise for total_free_floats.
10949 (free_cons, Fcons): Likewise for total_free_conses.
10950 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10951 Likewise for total_free_vector_bytes.
10952 (Fmake_symbol): Likewise for total_free_symbols.
10953 (bytes_free): Remove.
10954
109552012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10956
10957 Simple free memory accounting feature.
10958 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10959 (sweep_vectors): Accumulate size of free vectors.
10960 (Fgarbage_collect): Setup bytes_free.
10961 (Fmemory_free): New function.
10962 (syms_of_alloc): Register it.
10963
109642012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10965
10966 Cleanup overlays checking.
10967 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10968 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10969 eassert and OVERLAYP.
10970 (sort_overlays): Change to use OVERLAYP.
10971
109722012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10973
10974 * editfns.c (Finsert_char): Make it interactive, and make the
10975 second arg optional. Copy interactive spec and docstring from
10976 ucs-insert.
10977
109782012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10979
10980 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10981 Unlike the other wrapped functions, fabs has an unspecified
10982 effect on errno.
10983
109842012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10985
10986 * nsterm.m (keyDown): Interpret flags without left/right bits
10987 as the left key (Bug#11670).
10988
109892012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10990
10991 Remove empty and useless init functions.
10992 * lisp.h (init_character_once, init_fns, init_image)
10993 (init_filelock, init_sound): Remove prototype.
10994 * character.c (init_character_once): Remove.
10995 * filelock.c (init_filelock): Likewise.
10996 * fns.c (init_fns): Likewise.
10997 * image.c (init_image): Likewise.
10998 * sound.c (init_sound): Likewise.
10999 * emacs.c (main): Adjust accordingly.
11000
110012012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
11002
11003 * gtkutil.h: Tiny cleanups.
11004 (use_old_gtk_file_dialog): Remove useless declaration.
11005 (xg_uses_old_file_dialog): Add suggested const attribute.
11006
110072012-07-15 Eli Zaretskii <eliz@gnu.org>
11008
11009 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
11010 (bidi_paragraph_init): Use it to limit search forward for a strong
11011 directional character in abnormally large paragraphs full of
11012 neutral or weak characters. (Bug#11943)
11013
110142012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
11015
11016 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
11017 the toolbar (Bug#9451).
11018 (xg_make_tool_item): Give the widget event box a transparent
11019 background.
11020
110212012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
11022
11023 Cleanup basic allocation variables and functions.
11024 * alloc.c (ignore_warnings, init_intervals, init_float)
11025 (init_cons, init_symbol, init_marker): Remove.
11026 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
11027 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
11028 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
11029 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
11030 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
11031 (staticidx, init_alloc_once, init_strings, free_ablock):
11032 Remove redundant initialization.
11033 * fns.c (init_weak_hash_tables): Remove.
11034 * lisp.h (init_weak_hash_tables): Remove prototype.
11035
110362012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
11037
11038 Use zero_vector where appropriate.
11039 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
11040 accordingly.
11041 * lisp.h (zero_vector): New declaration.
11042 * font.c (null_vector): Remove.
11043 (syms_of_font): Remove initialization and staticpro.
11044 (font_list_entities, font_find_for_lface): Change to use zero_vector.
11045 * keymap.c (Faccessible_keymaps): Likewise.
11046
110472012-07-15 Leo Liu <sdl.web@gmail.com>
11048
11049 * fringe.c: Fix typo in comments.
11050
110512012-07-14 Leo Liu <sdl.web@gmail.com>
11052
11053 * fringe.c: Add a new bitmap exclamation-mark.
11054
110552012-07-14 Eli Zaretskii <eliz@gnu.org>
11056
11057 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
11058
11059 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
11060 (HAVE_MENUS): Don't define, defined by editing config.in with
11061 msdos/sed2v2.inp.
11062 (GMALLOC_INHIBIT_VALLOC): Don't define.
11063 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
11064
110652012-07-14 Juanma Barranquero <lekktu@gmail.com>
11066
11067 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
11068
110692012-07-14 Glenn Morris <rgm@gnu.org>
11070
11071 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
11072 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
11073 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
11074
110752012-07-13 Glenn Morris <rgm@gnu.org>
11076
11077 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
11078
11079 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
11080 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
11081
110822012-07-13 Jan Djärv <jan.h.d@swipnet.se>
11083
11084 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
11085 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
11086 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
11087 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
11088 where appropriate.
11089 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
11090 as boolean expression.
11091 (x_set_window_size): Remove unused variable toolbar.
11092 (ns_get_color_default, ns_mod_to_lisp): Remove.
11093 (ns_mouse_position): Remove unused variables xchar and ychar.
11094 (ns_compute_glyph_string_overhangs): Remove unused variable face.
11095 (ns_set_vertical_scroll_bar): Remove unused variable count.
11096 (ns_delete_terminal): Remove unused variable i.
11097 (ns_term_init): Remove unused variables r, g and b.
11098 (mouseDown): Remove unused variable window.
11099 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
11100 (initFrameFromEmacs): Remove unused variable vbextra.
11101 (mouseEntered): Remove unused variables p and dpyinfo.
11102 (mouseExited): Remove unused variables p and r.
11103 (ns_define_frame_cursor, ns_clear_frame_area)
11104 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
11105 (menuDown): Assign [sender tag] to variable and cast the variable.
11106
11107 * nsterm.h (menuDown): Add id as type to argument sender.
11108 (ns_display_info_for_name): Add Lisp_Object argument.
11109 (ns_term_init): Add Lisp_Object argument.
11110 (ns_map_event_to_object): Add void argument.
11111 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
11112 prototype with arguments and only declare if __OBJC__.
11113 (nxatoms_of_nsselect): Add void argument.
11114 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
11115 (ns_alloc_autorelease_pool): Add void argument.
11116 (ns_release_autorelease_pool): Add void* argument.
11117 (ns_get_defaults_value): Add const char* argument.
11118
11119 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
11120 (initFromContents): Use SSDATA where appropriate.
11121 (ns_update_menubar): Add braces to ambigous if-else.
11122 (initWithTitle): Put () around assignment in if statement.
11123 (ns_menu_show): Remove unused variables window and keymap.
11124 (update_frame_tool_bar): Remove unused variable selected_p.
11125 (initWithContentRect): Remove unused variable this_cmd_name.
11126
11127 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
11128 appropriate.
11129 (setXBMColor): Remove unused variable len.
11130 (setPixmapData): Put () around assignment in loop statement.
11131
11132 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
11133 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
11134 where appropriate.
11135 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
11136 around assignment in loop statement.
11137 (nsfont_open): Remove unused variable i.
11138 (nsfont_open): Remove unused variable len.
11139 (nsfont_draw): Remove unused variable cs.
11140
11141 * nsfns.m (x_set_icon_name, ns_set_name_internal)
11142 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
11143 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
11144 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
11145 (Fns_font_name, Fns_perform_service)
11146 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
11147 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
11148 (ns_set_name): Remove unused variable view.
11149 (x_set_menu_bar_lines): Remove unused variable olines.
11150 (x_set_tool_bar_lines): Remove unused variable root_window.
11151 (Fns_list_colors): Put () around assignment in while statement.
11152 (Fns_perform_service): Remove unused variable len.
11153 (Fns_display_usable_bounds): Remove unused variable top.
11154 (syms_of_nsfns): Remove unused variable i.
11155
11156 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
11157 memcpy (Bug#11907).
11158
111592012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
11160
11161 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
11162 and free it with DestroyExceptionInfo (Bug#11558).
11163
111642012-07-13 Juanma Barranquero <lekktu@gmail.com>
11165
11166 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
11167 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
11168 Set here, not in nt/config.nt.
11169
111702012-07-13 Eli Zaretskii <eliz@gnu.org>
11171
11172 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
11173 cursor overflow into the last glyph on display line when the right
11174 fringe is off. (Bug#11832)
11175
111762012-07-13 Paul Eggert <eggert@cs.ucla.edu>
11177
11178 * xdisp.c (produce_special_glyphs): Now static.
11179 * dispextern.h (produce_special_glyphs): Remove decl.
11180
111812012-07-13 Glenn Morris <rgm@gnu.org>
11182
11183 * s/bsd-common.h, s/cygwin.h: Remove empty files.
11184 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
11185
11186 * s/usg5-4-common.h (USG, USG5):
11187 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
11188 * s/sol2-6.h (SOLARIS2):
11189 * s/irix6-5.h (IRIX6_5):
11190 * s/hpux10-20.h (USG, USG5, HPUX):
11191 * s/gnu-linux.h (USG, GNU_LINUX):
11192 * s/freebsd.h (BSD_SYSTEM):
11193 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
11194 * s/cygwin.h (CYGWIN):
11195 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
11196 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
11197
111982012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
11199
11200 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
11201
112022012-07-13 Glenn Morris <rgm@gnu.org>
11203
11204 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
11205
11206 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
11207
11208 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
11209 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
11210
112112012-07-12 Glenn Morris <rgm@gnu.org>
11212
11213 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
11214
11215 * process.c (init_process_emacs): Rename from init_process.
11216 The old name is also the name of a Mach system call.
11217 * lisp.h, emacs.c: Update for this name change.
11218 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
11219 longer needed.
11220
112212012-07-12 Eli Zaretskii <eliz@gnu.org>
11222
11223 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
11224 memmove call that removes glyphs covered by the left truncation
11225 glyph. Improve commentary.
11226 (display_line): Fix display of continuation glyphs on GUI frames
11227 when the right fringe is turned off and variable-size fonts are
11228 used in the window. Move the code that appends a stretch glyph to
11229 produce_special_glyphs, so that it could be used for truncation
11230 and continuation glyphs alike.
11231 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
11232 glyph of a suitably computed width, to align the special glyphs at
11233 the window margin. Code moved from display_line. (Bug#11832)
11234
112352012-07-12 Glenn Morris <rgm@gnu.org>
11236
11237 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
11238
11239 * s/gnu-linux.h, s/hpux10-20.h:
11240 Do not unconditionally define HAVE_XRMSETDATABASE.
11241
11242 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
11243
112442012-07-12 Paul Eggert <eggert@cs.ucla.edu>
11245
11246 Fix typos that broke OS X build.
11247 Reported by Randal L. Schwartz in
11248 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
11249 * nsterm.m (ns_timeout): Add missing local decl.
11250 (ns_get_color): snprintf -> sprintf, to fix typo.
11251
112522012-07-12 Glenn Morris <rgm@gnu.org>
11253
11254 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
11255 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
11256 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
11257 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
11258
11259 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
11260 Move PTY_OPEN to configure.
11261
11262 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11263 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
11264 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
11265
112662012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
11267
11268 Use empty_unibyte_string where applicable.
11269 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
11270 * lread.c (read1): Likewise.
11271 * xsettings.c (syms_of_xsettings): Likewise.
11272
112732012-07-12 Glenn Morris <rgm@gnu.org>
11274
11275 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
11276 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
11277 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
11278 * s/hpux10-20.h (RUN_TIME_REMAP):
11279 * s/bsd-common.h (TABDLY): Move to configure.
11280
11281 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
11282
11283 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
11284
11285 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
11286 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
11287
11288 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
11289
11290 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
11291 * s/template.h: Move NARROWPROTO to configure.
11292
112932012-07-11 Glenn Morris <rgm@gnu.org>
11294
11295 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
11296 unused since 2011-01-17 change to systty.h.
11297
11298 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
11299 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11300 Move HAVE_PTYS and HAVE_SOCKETS to configure.
11301
113022012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11303
11304 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
11305
113062012-07-11 Glenn Morris <rgm@gnu.org>
11307
11308 * s/darwin.h, s/gnu-linux.h, s/template.h:
11309 Move INTERRUPT_INPUT to configure.
11310
113112012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11312
11313 Minor adjustments to interning code.
11314 * lisp.h (intern, intern_c_string): Redefine as static inline
11315 wrappers for intern_1 and intern_c_string_1, respectively.
11316 (intern_1, intern_c_string_1): Rename prototypes.
11317 * lread.c (intern_1, intern_c_string_1, oblookup):
11318 Simplify Vobarray checking.
11319 * font.c (font_intern_prop): Likewise. Adjust comment.
11320 * w32font.c (intern_font_name): Likewise.
11321
113222012-07-11 Andreas Schwab <schwab@linux-m68k.org>
11323
11324 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
11325
11326 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
11327 of Fcar/Fcdr if possible.
11328 * font.c (check_otf_features): Likewise.
11329 * fontset.c (Fnew_fontset): Likewise.
11330 * gnutls.c (Fgnutls_boot): Likewise.
11331 * minibuf.c (read_minibuf): Likewise.
11332 * msdos.c (IT_set_frame_parameters): Likewise.
11333 * xmenu.c (Fx_popup_dialog): Likewise.
11334 * w32menu.c (Fx_popup_dialog): Likewise.
11335
113362012-07-11 Glenn Morris <rgm@gnu.org>
11337
11338 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
11339 since nothing has defined it on these platforms.
11340
11341 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
11342 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
11343
11344 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11345 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11346 Move CLASH_DETECTION to configure.
11347
11348 * s/gnu.h: Remove file, which is now empty.
11349
11350 * s/gnu.h, s/gnu-linux.h:
11351 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
11352
113532012-07-11 John Wiegley <johnw@newartisans.com>
11354
11355 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
11356 function attribute, so we only use it if it exists in the
11357 compiler.
11358
113592012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11360
11361 Avoid call to strlen in fast_c_string_match_ignore_case.
11362 * search.c (fast_c_string_match_ignore_case): Change to use
11363 length argument. Adjust users accordingly.
11364 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
11365
113662012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11367
11368 Assume mkdir, rmdir.
11369 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
11370 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
11371
11372 Assume rename.
11373 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
11374
11375 Assume perror.
11376 * s/hpux10-20.h (HAVE_PERROR): Remove.
11377 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
11378 Remove dummy definition, as this problem was obsolete long ago.
11379
11380 Assume strerror.
11381 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
11382
113832012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11384
11385 Avoid calls to strlen in font processing functions.
11386 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
11387 (font_open_by_name): Change to use length argument.
11388 Adjust users accordingly.
11389 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
11390 Adjust prototypes.
11391 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
11392 Change to return ptrdiff_t.
11393 (xfont_list_pattern, xfont_match): Use length returned by
11394 xfont_decode_coding_xlfd.
11395 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
11396
113972012-07-11 Glenn Morris <rgm@gnu.org>
11398
11399 * s/darwin.h, s/freebsd.h, s/netbsd.h:
11400 Move DONT_REOPEN_PTY to configure.
11401
11402 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11403 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11404
114052012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11406
11407 Remove "#define unix" that is no longer needed (Bug#11905).
11408 * s/aix4-2.h (unix): Remove; no longer needed.
11409
11410 EMACS_TIME simplification (Bug#11875).
11411 This replaces macros (which typically do not work in GDB)
11412 with functions, typedefs and enums, making the code easier to debug.
11413 The functional style also makes code easier to read and maintain.
11414 * systime.h: Include <sys/time.h> on all hosts, not just if
11415 WINDOWSNT, since 'struct timeval' is needed in general.
11416 (EMACS_TIME): Now a typedef, not a macro.
11417 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11418 not macros.
11419 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11420 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11421 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11422 (EMACS_TIME_LE): Now functions, not macros.
11423 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11424 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11425 which are not functions. All uses rewritten to use:
11426 (make_emacs_time): New function.
11427 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11428 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11429 not functions. All uses rewritten to use the following, respectively:
11430 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11431 (add_emacs_time, sub_emacs_time): New functions.
11432 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
11433 * fileio.c (Fcopy_file):
11434 * xterm.c (XTflash): Get the current time closer to when it's used.
11435 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11436
11437 * bytecode.c (targets): Suppress -Woverride-init warnings.
11438
11439 Simplify by avoiding confusing use of strncpy etc.
11440 * doc.c (Fsnarf_documentation):
11441 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11442 * frame.c (Fmake_terminal_frame):
11443 * gtkutil.c (get_utf8_string):
11444 * lread.c (openp):
11445 * nsmenu.m (ns_update_menubar):
11446 * regex.c (regerror):
11447 Prefer memcpy to strncpy and strncat when either will do.
11448 * fileio.c (Fsubstitute_in_file_name):
11449 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11450 (menu_separator_name_p):
11451 * nsmenu.m (ns_update_menubar):
11452 Prefer memcmp to strncmp when either will do.
11453 * nsterm.m: Include <ftoastr.h>.
11454 (ns_get_color):
11455 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11456 Prefer snprintf to strncpy.
11457 * nsterm.m (ns_term_init):
11458 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11459 * nsterm.m (ns_term_init):
11460 Avoid the need for strncpy, by using build_string or
11461 make_unibyte_string directly. Use dtoastr, not snprintf.
11462 * process.c (Fmake_network_process): Diagnose service names that
11463 are too long, rather than silently truncating them or creating
11464 non-null-terminated names.
11465 (Fnetwork_interface_info): Likewise, for interface names.
11466 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11467 Prefer sprintf to strncat.
11468 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11469 Prefer vsnprintf to vsprintf + strncpy.
11470
114712012-07-10 Glenn Morris <rgm@gnu.org>
11472
11473 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11474 Clarify fallback case.
11475
114762012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11477
11478 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11479 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11480 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
11481 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
11482 where argument type is known to be a Lisp_Cons.
11483
114842012-07-10 Tom Tromey <tromey@redhat.com>
11485
11486 * bytecode.c (BYTE_CODE_THREADED): New macro.
11487 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11488 (enum byte_code_op): New type.
11489 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11490 (exec_byte_code): Use them. Use token threading when applicable.
11491
114922012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11493
11494 Optimize pure C strings initialization.
11495 * lisp.h (make_pure_string): Fix prototype.
11496 (build_pure_c_string): New function, defined as static inline. This
11497 provides a better opportunity to optimize away calls to strlen when
11498 the function is called with compile-time constant argument.
11499 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11500 argument, adjust users accordingly. Use build_pure_c_string where
11501 appropriate.
11502 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11503 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11504 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11505
115062012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11507
11508 Avoid calls to strlen in miscellaneous functions.
11509 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11510 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11511 * lread.c (openp): Likewise.
11512
115132012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11514
11515 Avoid calls to strlen in path processing functions.
11516 * fileio.c (file_name_as_directory): Add comment. Change to add
11517 srclen argument and return the length of result. Adjust users
11518 accordingly.
11519 (directory_file_name): Fix comment. Change to add srclen argument,
11520 swap 1st and 2nd arguments to obey the common convention.
11521 Adjust users accordingly.
11522 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11523
115242012-07-10 Glenn Morris <rgm@gnu.org>
11525
11526 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11527 Move PENDING_OUTPUT_COUNT definition to configure.
11528
11529 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11530 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11531 * s/gnu.h (DATA_START): Move definitions to configure.
11532
11533 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11534 We include usg5-4-common.h, which defines them both.
11535
11536 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11537 O_RDONLY already includes it).
11538
11539 Stop ns builds setting the EMACSLOADPATH environment variable.
11540 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11541 Now it does not set EMACSLOADPATH, just returns the load-path string.
11542 * nsterm.h: Update accordingly.
11543 * lread.c [HAVE_NS]: Include nsterm.h.
11544 (init_lread) [HAVE_NS]: Use ns_load_path.
11545 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11546
115472012-07-09 Glenn Morris <rgm@gnu.org>
11548
11549 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11550 since the included bsd-common.h does so.
11551
11552 Stop ns builds setting the EMACSPATH environment variable.
11553 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11554 (ns_init_paths): Do not set EMACSPATH.
11555 * nsterm.h (ns_exec_path): Add it.
11556 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11557 Use ns_exec_path.
11558
11559 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11560
115612012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11562
11563 * process.c (wait_reading_process_output): 'waitchannels' was unset
11564 when read_kbd || !NILP (wait_for_cell); fix this.
11565
11566 Add GCC-style 'const' attribute to functions that can use it.
11567 * character.h (char_resolve_modifier_mask):
11568 * keyboard.h (make_ctrl_char):
11569 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11570 (init_character_once, next_almost_prime, init_fns, init_image)
11571 (flush_pending_output, init_sound):
11572 * mem-limits.h (start_of_data):
11573 * menu.h (finish_menu_items):
11574 Add ATTRIBUTE_CONST.
11575 * emacs.c (DEFINE_DUMMY_FUNCTION):
11576 Declare the dummy function with ATTRIBUTE_CONST.
11577 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11578 Add decls with ATTRIBUTE_CONST.
11579
11580 Minor improvements to make_formatted_string.
11581 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11582 where int is good enough, as vsprintf returns an int.
11583 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11584
115852012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11586
11587 Use make_formatted_string to avoid double length calculation.
11588 * lisp.h (make_formatted_string): New prototype.
11589 * alloc.c (make_formatted_string): New function.
11590 * buffer.c (Fgenerate_new_buffer_name): Use it.
11591 * dbusbind.c (syms_of_dbusbind): Likewise.
11592 * editfns.c (Fcurrent_time_zone): Likewise.
11593 * filelock.c (get_boot_time): Likewise.
11594 * frame.c (make_terminal_frame, set_term_frame_name)
11595 (x_report_frame_params): Likewise.
11596 * image.c (gs_load): Likewise.
11597 * minibuf.c (get_minibuffer): Likewise.
11598 * msdos.c (dos_set_window_size): Likewise.
11599 * process.c (make_process): Likewise.
11600 * xdisp.c (ensure_echo_area_buffers): Likewise.
11601 * xsettings.c (apply_xft_settings): Likewise.
11602
116032012-07-09 Glenn Morris <rgm@gnu.org>
11604
11605 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11606 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11607 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11608 * nsterm.h (ns_etc_directory): Add it.
11609 * callproc.c [HAVE_NS]: Include nsterm.h.
11610 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11611
116122012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11613
11614 Move marker debugging code under MARKER_DEBUG.
11615 * marker.c (MARKER_DEBUG): Move marker debugging code under
11616 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11617 for bootstrap with --enable-checking (~3x slowdown reported
11618 by Juanma Barranquero <lekktu@gmail.com>).
11619 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11620
116212012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11622
11623 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11624 See <http://bugs.gnu.org/11825#29>.
11625
116262012-07-08 Eli Zaretskii <eliz@gnu.org>
11627
11628 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11629 has no font, use the frame's font. (Bug#11813)
11630 (display_line): Add commentary about displaying truncation glyphs
11631 on GUI frames.
11632 (produce_special_glyphs): Move here from term.c.
11633
11634 * term.c (produce_special_glyphs): Move to xdisp.c.
11635
11636 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11637 section.
11638
116392012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11640
11641 * xdisp.c (display_line): Avoid warning about implicit declaration
11642 of FRAME_FONT.
11643
11644 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11645
11646 * lisp.h: Remove empty conditional.
11647
116482012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11649
11650 * lread.c (load_path_check): Now static.
11651
11652 Fix some minor --with-ns problems found by static checking.
11653 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11654 (x_set_font) [!HAVE_X_WINDOWS]:
11655 * image.c (xpm_load_image) [HAVE_NS]:
11656 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11657 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11658 Remove unused local.
11659 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11660 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11661 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11662 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11663 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11664 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11665 Fix pointer signedness problem.
11666 * xfaces.c (FRAME_X_FONT_TABLE):
11667 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11668
116692012-07-07 Glenn Morris <rgm@gnu.org>
11670
11671 * lread.c (load_path_check): New function, split from init_lread.
11672 (init_lread): Reorganize. Motivation:
11673 If EMACSLOADPATH is set, check/warn about that rather than the
11674 defaults, which we are not going to use. Hence we can remove
11675 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11676 Don't warn if site-lisp directories are missing.
11677 If not installed, start from a blank load-path, since
11678 PATH_LOADSEARCH refers to the eventual installation directories.
11679
116802012-07-07 Eli Zaretskii <eliz@gnu.org>
11681
11682 Support truncation and continuation glyphs on GUI frames, when
11683 fringes are disabled. (Bug#11832)
11684 * xdisp.c (init_iterator): Get dimensions of truncation and
11685 continuation glyphs even if on GUI frames.
11686 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11687 or both, are absent.
11688 (start_display, move_it_in_display_line_to): Handle the case of a
11689 GUI frame without a fringe to display continuation or truncation
11690 glyphs.
11691 (insert_left_trunc_glyphs): Support GUI frames: make sure
11692 truncation glyphs overwrite enough glyphs from the current line to
11693 have sufficient space in pixels.
11694 (display_line): Support truncation and continuation glyphs on GUI
11695 frames. If some spare pixels are left on the line after inserting
11696 the truncation glyphs, fill that space with a stretch glyph of a
11697 suitably computed width.
11698
11699 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11700 produce_glyphs, to support GUI sessions.
11701
117022012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11703
11704 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11705
11706 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11707
11708 Do not require float-time's arg to fit in time_t (Bug#11825).
11709 This works better on hosts where time_t is unsigned, and where
11710 float-time is applied to the (negative) difference between two times.
11711 * editfns.c (decode_time_components): Last arg is now double *,
11712 not int *, and means to store all the result as a double, without
11713 worrying about whether the seconds part fits in time_t.
11714 All callers changed.
11715 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11716 All callers changed.
11717 (Ffloat_time): Do not fail merely because the specified time falls
11718 outside of time_t range.
11719
117202012-07-07 Glenn Morris <rgm@gnu.org>
11721
11722 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11723 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11724 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11725
117262012-07-07 Juanma Barranquero <lekktu@gmail.com>
11727
11728 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11729 Update dependencies.
11730
11731 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11732
117332012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11734
11735 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11736 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11737 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11738 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11739 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11740 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11741
11742 * xfont.c (compare_font_names): Redo to omit the need for casts.
11743
117442012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11745
11746 * xfns.c (Fx_change_window_property): Doc fix.
11747 * w32fns.c (Fx_change_window_property): Doc fix.
11748
11749 * w32fns.c (Fx_window_property): Accept the same arguments as the
11750 X Windows version. Doc fix.
11751 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11752
117532012-07-06 Juanma Barranquero <lekktu@gmail.com>
11754 Eli Zaretskii <eliz@gnu.org>
11755
11756 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11757 Windows-specific code from nt/config.nt moved here.
11758 Obsolete settings removed.
11759
117602012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11761
11762 * process.c: Avoid unnecessary calls to gettime.
11763 (wait_reading_process_output): Don't get the time of day
11764 when gobbling data immediately and not waiting, as there's no need
11765 for it in that case. This removes a FIXME.
11766
117672012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11768
11769 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11770 is defined (Bug#11768).
11771
117722012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11773
11774 Fix marker debugging code.
11775 * marker.c (byte_char_debug_check): Do not perform the check
11776 if buffer is not multibyte.
11777 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11778 Call byte_char_debug_check with correct arguments.
11779
117802012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11781
11782 Compile marker debugging code only if ENABLE_CHECKING is defined.
11783 * marker.c (byte_char_debug_check, count_markers):
11784 Use only if ENABLE_CHECKING is defined.
11785 (byte_debug_flag): Remove.
11786 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11787 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11788
117892012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11790
11791 Avoid code repetition in marker-related functions.
11792 * marker.c (attach_marker): New function.
11793 (Fset_marker, set_marker_restricted, set_marker_both)
11794 (set_marker_restricted_both): Use it.
11795 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11796 Consistently rename charno to charpos.
11797 (marker_position): Add eassert.
11798 (marker_byte_position): Convert to eassert.
11799
118002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11801
11802 Simplify list operations in unchain_overlay and unchain_marker.
11803 * buffer.c (unchain_overlay): Simplify. Add comment.
11804 * marker.c (unchain_marker): Simplify. Fix comments.
11805
118062012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11807
11808 Introduce fast path for the widely used marker operation.
11809 * alloc.c (build_marker): New function.
11810 * lisp.h (build_marker): New prototype.
11811 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11812 * composite.c (autocmp_chars): Likewise.
11813 * editfns.c (buildmark): Remove.
11814 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11815 (save_restriction_save): Use build_marker.
11816 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11817 * window.c (save_window_save): Likewise.
11818
118192012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11820
11821 Do not use Fdelete_overlay in delete_all_overlays
11822 to avoid redundant calls to unchain_overlay.
11823 * buffer.c (drop_overlay): New function.
11824 (delete_all_overlays, Fdelete_overlay): Use it.
11825 * minibuf.c (get_minibuffer): Fix comment.
11826
118272012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11828
11829 Port to OpenBSD 5.1 amd64.
11830 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11831 This is needed for OpenBSD, and should be harmless on all BSD systems.
11832 Also, include <sys/sysctl.h>, as it should be available on all
11833 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11834 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11835 use p_pid member, not kp_proc.pid.
11836
118372012-07-06 Glenn Morris <rgm@gnu.org>
11838
11839 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11840
118412012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11842
11843 More xmalloc and related cleanup.
11844 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11845 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11846 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11847 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11848 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11849 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11850 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11851 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11852 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11853 * xterm.c:
11854 Omit needless casts involving void * pointers and allocation.
11855 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11856 as the former is more robust if P's type is changed.
11857 Prefer xzalloc to xmalloc + memset 0.
11858 Simplify malloc-or-realloc to realloc.
11859 Don't worry about xmalloc returning a null pointer.
11860 Prefer xstrdup to xmalloc + strcpy.
11861 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11862 growing it.
11863 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11864 alloca of a constant.
11865
118662012-07-05 Eli Zaretskii <eliz@gnu.org>
11867
11868 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11869 hscroll is larger than the line width. Fixes long and futile
11870 looping inside extend_face_to_end_of_line (on a TTY) producing
11871 glyphs that are not needed and thrown away.
11872
118732012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11874
11875 * marker.c (set_marker_restricted_both): Simplify by using
11876 clip_to_bounds.
11877
118782012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11879
11880 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11881
118822012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11883
11884 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11885 not defined (Bug#11768).
11886 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11887 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11888 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11889 followed by gtk_box_set_homogeneous (Bug#11768).
11890 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11891 (update_theme_scrollbar_width, xg_create_scroll_bar):
11892 Use gtk_scrollbar_new (Bug#11768).
11893 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11894 (is_box_type): New function (Bug#11768).
11895 (xg_tool_item_stale_p): Call is_box_type.
11896 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11897 with default display (Bug#11768).
11898
118992012-07-05 Eli Zaretskii <eliz@gnu.org>
11900
11901 * xdisp.c (window_hscroll_limited): New function.
11902 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11903 coordinates when window's hscroll is set to insanely large
11904 values. (Bug#11857)
11905
119062012-07-05 Juanma Barranquero <lekktu@gmail.com>
11907
11908 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11909 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11910
119112012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11912
11913 Cleanup xmalloc.
11914 * lisp.h (xzalloc): New prototype. Omit needless casts.
11915 * alloc.c (xzalloc): New function. Omit needless casts.
11916 * charset.c: Omit needless casts. Convert all calls to
11917 xmalloc with following memset to xzalloc.
11918 * dispnew.c: Likewise.
11919 * fringe.c: Likewise.
11920 * image.c: Likewise.
11921 * sound.c: Likewise.
11922 * term.c: Likewise.
11923 * w32fns.c: Likewise.
11924 * w32font.c: Likewise.
11925 * w32term.c: Likewise.
11926 * xfaces.c: Likewise.
11927 * xfns.c: Likewise.
11928 * xterm.c: Likewise.
11929 * atimer.c: Omit needless casts.
11930 * buffer.c: Likewise.
11931 * callproc.c: Likewise.
11932 * ccl.c: Likewise.
11933 * coding.c: Likewise.
11934 * composite.c: Likewise.
11935 * doc.c: Likewise.
11936 * doprnt.c: Likewise.
11937 * editfns.c: Likewise.
11938 * emacs.c: Likewise.
11939 * eval.c: Likewise.
11940 * filelock.c: Likewise.
11941 * fns.c: Likewise.
11942 * gtkutil.c: Likewise.
11943 * keyboard.c: Likewise.
11944 * lisp.h: Likewise.
11945 * lread.c: Likewise.
11946 * minibuf.c: Likewise.
11947 * msdos.c: Likewise.
11948 * print.c: Likewise.
11949 * process.c: Likewise.
11950 * region-cache.c: Likewise.
11951 * search.c: Likewise.
11952 * sysdep.c: Likewise.
11953 * termcap.c: Likewise.
11954 * terminal.c: Likewise.
11955 * tparam.c: Likewise.
11956 * w16select.c: Likewise.
11957 * w32.c: Likewise.
11958 * w32reg.c: Likewise.
11959 * w32select.c: Likewise.
11960 * w32uniscribe.c: Likewise.
11961 * widget.c: Likewise.
11962 * xdisp.c: Likewise.
11963 * xmenu.c: Likewise.
11964 * xrdb.c: Likewise.
11965 * xselect.c: Likewise.
11966
119672012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11968
11969 * fileio.c (time_error_value): Check the right error number.
11970 Problem reported by Troels Nielsen in
11971 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11972
119732012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11974
11975 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11976 This should be fixed in a better way; see Eli Zaretskii in
11977 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11978 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11979
11980 * fileio.c (time_error_value): Rename from special_mtime.
11981 The old name's problems were noted by Eli Zaretskii in
11982 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11983
11984 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11985 This variable's comment says Emacs needs at least one GDB-visible
11986 symbol of type enum pvec_type, to work around GDB problems.
11987 The symbol's value doesn't matter.
11988
11989 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11990 that causes compilation to fail on pre-C99 compilers.
11991
119922012-07-04 Juanma Barranquero <lekktu@gmail.com>
11993
11994 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11995 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11996
119972012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11998
11999 * buffer.c (init_buffer_once): Fix initialization of
12000 headers for buffer_defaults and buffer_local_symbols.
12001 Reported by Juanma Barranquero <lekktu@gmail.com>.
12002
120032012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12004
12005 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
12006 * lisp.h (enum pvec_type): Use fewer bits.
12007 (PSEUDOVECTOR_SIZE_BITS): New constant.
12008 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
12009 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
12010 change in pvec_type.
12011 (PSEUDOVECTOR_TYPEP): New macro.
12012 (TYPED_PSEUDOVECTORP): Use it.
12013 * fns.c (internal_equal): Adapt code to extract pvectype.
12014 * emacs.c (gdb_pvec_type): Update type.
12015 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
12016 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
12017 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
12018 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
12019 (sweep_vectors): Use it. Use local var `total_bytes' instead of
12020 abusing vector->header.next.nbytes.
12021 (live_vector_p): Use PVEC_TYPE.
12022 (mark_object): Adapt code to extract pvectype. Use switch.
12023
120242012-07-04 Paul Eggert <eggert@cs.ucla.edu>
12025
12026 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
12027 Tighten new eassert a bit.
12028
120292012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
12030
12031 Fix compilation with --enable-gcc-warnings and -O1
12032 optimization level.
12033 * doprnt.c (doprnt): Change type of tem to int, initialize
12034 to avoid compiler warning. Add eassert.
12035 * search.c (simple_search): Initialize match_byte to avoid
12036 compiler warning. Add eassert.
12037
120382012-07-04 Paul Eggert <eggert@cs.ucla.edu>
12039
12040 Avoid weird behavior with large horizontal scrolls.
12041 Without this change, for example, large hscroll values would
12042 mess up Emacs's display on Fedora 15 x86, presumably due to
12043 overflows in int calculations in the display code.
12044 Also, if buffers had long lines, Emacs would freeze.
12045 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
12046 (set_window_hscroll): New function, containing the old guts of
12047 Fset_window_hscroll. Return the clipped value.
12048 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
12049 This avoids the need to check against PTRDIFF_MAX.
12050
12051 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
12052
120532012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
12054
12055 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
12056
120572012-07-04 Paul Eggert <eggert@cs.ucla.edu>
12058
12059 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
12060 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
12061 since GCC 4.4.6 issues a bogus warning for them.
12062
12063 Fix bugs in file timestamp newness comparisons.
12064 * fileio.c (Ffile_newer_than_file_p):
12065 * lread.c (Fload): Use full timestamp resolution of files,
12066 not just the 1-second resolution, so that files that are only
12067 slightly newer still count as newer.
12068 * fileio.c (Ffile_newer_than_file_p): Don't assume file
12069 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
12070
120712012-07-03 Paul Eggert <eggert@cs.ucla.edu>
12072
12073 * fileio.c: Improve handling of file time marker. (Bug#11852)
12074 (special_mtime): New function.
12075 (Finsert_file_contents, Fverify_visited_file_modtime):
12076 Use it to set special mtime values consistently.
12077
120782012-07-03 Andreas Schwab <schwab@linux-m68k.org>
12079
12080 * fileio.c (Finsert_file_contents): Properly handle st_mtime
12081 marker for non-existing file. (Bug#11852)
12082
120832012-07-03 Glenn Morris <rgm@gnu.org>
12084
12085 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
12086 and did not make it into globals.h).
12087
120882012-07-03 Tom Tromey <tromey@redhat.com>
12089
12090 * window.c (Fset_window_margins, Fset_window_fringes)
12091 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
12092 * textprop.c (Fprevious_property_change): No longer static.
12093 * syntax.c (Fsyntax_table_p): No longer static.
12094 * process.c (Fget_process, Fprocess_datagram_address): No longer
12095 static.
12096 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
12097 * keyboard.c (Fcommand_execute): No longer static.
12098 Remove EXFUN.
12099 * insdel.c (Fcombine_after_change_execute): No longer static.
12100 * image.c (Finit_image_library): No longer static.
12101 * fileio.c (Fmake_symbolic_link): No longer static.
12102 * eval.c (Ffetch_bytecode): No longer static.
12103 * editfns.c (Fuser_full_name): No longer static.
12104 * doc.c (Fdocumentation_property, Fsnarf_documentation):
12105 No longer static.
12106 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
12107 static.
12108 * dired.c (Ffile_attributes): No longer static.
12109 * composite.c (Fcomposition_get_gstring): No longer static.
12110 * callproc.c (Fgetenv_internal): No longer static.
12111
12112 * ccl.h: Remove EXFUNs.
12113 * buffer.h: Remove EXFUNs.
12114 * dispextern.h: Remove EXFUNs.
12115 * intervals.h: Remove EXFUNs.
12116 * fontset.h: Remove EXFUN.
12117 * font.h: Remove EXFUNs.
12118 * dosfns.c (system_process_attributes): Remove EXFUN.
12119 * keymap.h: Remove EXFUNs.
12120 * lisp.h: Remove EXFUNs.
12121 * w32term.h: Remove EXFUNs.
12122 * window.h: Remove EXFUNs.
12123 * xsettings.h: Remove EXFUN.
12124 * xterm.h: Remove EXFUN.
12125
121262012-07-03 Glenn Morris <rgm@gnu.org>
12127
12128 * lisp.h (Frandom): Make it visible to C.
12129 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
12130 buffer for invisible buffers. (Bug#1229)
12131
121322012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
12133
12134 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
12135 values which aren't power of 2.
12136 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
12137 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
12138 accordingly.
12139
121402012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
12141
12142 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
12143
12144 * alloc.c (mark_object): Revert part of last patch to use `switch'.
12145
121462012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
12147
12148 * alloc.c (allocate_vector_block): Remove redundant
12149 calls to mallopt if DOUG_LEA_MALLOC is defined.
12150 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
12151 avoid calls to mallopt if zero_vector is returned.
12152
121532012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
12154
12155 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
12156 is enabled, avoid dereferencing NULL current_sblock if
12157 running undumped.
12158
121592012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
12160
12161 Cleanup basic buffer management.
12162 * buffer.h (struct buffer): Change layout to use generic vector
12163 marking code. Fix some comments. Change type of 'clip_changed'
12164 to bitfield. Remove unused #ifndef old.
12165 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
12166 (GET_OVERLAYS_AT): Fix indentation.
12167 (for_each_per_buffer_object_at): New macro.
12168 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
12169 (Fbuffer_local_variables): Use it.
12170 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
12171 * alloc.c (allocate_buffer): Adjust to match new layout of
12172 struct buffer. Fix comment.
12173 (mark_overlay): New function.
12174 (mark_buffer): Use it. Use mark_vectorlike to mark normal
12175 Lisp area of struct buffer.
12176 (mark_object): Use it. Adjust marking of misc objects
12177 and related comments.
12178
121792012-07-02 Paul Eggert <eggert@cs.ucla.edu>
12180
12181 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
12182 wrapper that is not needed because the wrapped code is a no-op (zero
12183 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
12184 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
12185
121862012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
12187
12188 * alloc.c (mark_buffer): Simplify. Remove prototype.
12189 (mark_object): Add comment. Reorganize marking of vector-like
12190 objects. Use CHECK_LIVE for all vector-like objects except buffers
12191 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
12192 Avoid redundant calls to mark_vectorlike for bool vectors.
12193
121942012-06-30 Glenn Morris <rgm@gnu.org>
12195
12196 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
12197
12198 * epaths.in (PATH_SITELOADSEARCH): New.
12199 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
12200 This is rather than relying on --enable-locallisppath elements
12201 having "site-lisp" in their names. (Bug#10208#25, 11658)
12202
122032012-06-30 Eli Zaretskii <eliz@gnu.org>
12204
12205 * w32proc.c (sys_select): Accept and ignore one more argument.
12206
12207 * w32.c (emacs_gnutls_pull): Call select with one more argument.
12208
12209 * sysselect.h [DOS_NT]: Don't include sys/select.h.
12210 (pselect) [!MS_DOS]: Redirect to sys_select.
12211
12212 * sysdep.c: Don't include dos.h and dosfns.h.
12213
12214 * process.c (sys_select):
12215 * msdos.c (sys_select): Accept one more argument and ignore it.
12216
12217 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
12218 adapt data types and code to that.
12219
12220 * dosfns.c:
12221 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
12222 which clashes with the gnulib function of the same name.
12223
122242012-06-30 Andreas Schwab <schwab@linux-m68k.org>
12225
12226 * font.c (font_style_to_value, font_style_symbolic)
12227 (font_prop_validate_style): Add type checks for values in
12228 font_style_table.
12229
12230 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
12231 argument.
12232 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
12233 uses.
12234
122352012-06-29 Eli Zaretskii <eliz@gnu.org>
12236
12237 * xdisp.c (try_window_id): Undo last change.
12238
12239 * w32.c (getwd): Adjust commentary about startup_dir.
12240 (init_environment): Always call sys_access, even in non-MSVC
12241 builds. Don't chdir to the directory of the Emacs executable.
12242 This undoes code from 1997 which was justified by the need to
12243 "avoid conflicts when removing and renaming directories". But its
12244 downside was that every relative file name was being interpreted
12245 relative to the directory of the Emacs executable, which can never
12246 be TRT. In particular, it broke sys_access when called with
12247 relative file names.
12248 (sys_access): Map GetLastError to errno.
12249
122502012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12251
12252 * window.h (struct window): Change type of 'fringes_outside_margins'
12253 to bitfield. Fix comment. Adjust users accordingly.
12254 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
12255 Adjust comment.
12256 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
12257 to ptrdiff_t.
12258
122592012-06-29 Andreas Schwab <schwab@linux-m68k.org>
12260
12261 * gnutls.c (emacs_gnutls_handshake):
12262 Add QUIT to make the loop interruptible.
12263
122642012-06-29 Glenn Morris <rgm@gnu.org>
12265
12266 * charset.c (init_charset): Make lack of etc/charsets fatal.
12267
122682012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12269
12270 * editfns.c (region_limit): Fix type mismatch.
12271
122722012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
12273
12274 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
12275 undefined. Convert from xassert to eassert.
12276 * nsmenu.m: Convert from xassert to eassert.
12277 * nsterm.m: Likewise.
12278
122792012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
12280
12281 * editfns.c (region_limit): Clip to narrowing (bug#11770).
12282
122832012-06-28 Paul Eggert <eggert@cs.ucla.edu>
12284
12285 Avoid integer overflow on scroll-left and scroll-right.
12286 * window.c (HSCROLL_MAX): New macro.
12287 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
12288 overflow when requested scroll falls outside ptrdiff_t range.
12289
122902012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12291
12292 * window.h (struct window): Change type of 'hscroll',
12293 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
12294 'last_modified' and 'last_overlay_modified' to EMACS_INT.
12295 Adjust users accordingly.
12296 * xdisp.c (try_cursor_movement): Replace type check with eassert.
12297 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
12298 from EMACS_INT to ptrdiff_t.
12299 (make_window): Omit redundant initialization.
12300
123012012-06-28 Juanma Barranquero <lekktu@gmail.com>
12302
12303 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
12304
123052012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12306
12307 * window.h (struct window): Change type of 'use_time' and
12308 'sequence_number' from Lisp_Object to int.
12309 * frame.c (make_frame): Adjust users accordingly.
12310 * print.c (print_object): Likewise.
12311 * window.c (select_window, Fwindow_use_time, make_parent_window)
12312 (make_window): Likewise.
12313
123142012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12315
12316 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
12317 enabled with --enable-checking=[all,glyphs] configure option.
12318 Fix GLYPH_DEBUG usage assuming that it may be undefined,
12319 adjust comments accordingly.
12320 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
12321 undefined, adjust comments accordingly.
12322 * image.c: Likewise.
12323 * scroll.c: Likewise.
12324 * w32fns.c: Likewise.
12325 * w32term.c: Likewise.
12326 * xdisp.c: Likewise.
12327 * xfaces.c: Likewise.
12328 * xfns.c: Likewise.
12329 * xterm.c: Likewise.
12330
123312012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
12332
12333 Generalize run-time debugging checks.
12334 * dispextern.h (XASSERTS): Remove.
12335 * fontset.c (xassert): Remove.
12336 Convert from xassert to eassert.
12337 * alloc.c: Convert from xassert to eassert.
12338 * bidi.c: Likewise.
12339 * dispnew.c: Likewise.
12340 * fns.c: Likewise.
12341 * fringe.c: Likewise.
12342 * ftfont.c: Likewise.
12343 * gtkutil.c: Likewise.
12344 * image.c: Likewise.
12345 * keyboard.c: Likewise.
12346 * menu.c: Likewise.
12347 * process.c: Likewise.
12348 * scroll.c: Likewise.
12349 * sound.c: Likewise.
12350 * term.c: Likewise.
12351 * w32console.c: Likewise.
12352 * w32fns.c: Likewise.
12353 * w32term.c: Likewise.
12354 * window.c: Likewise.
12355 * xdisp.c: Likewise.
12356 * xfaces.c: Likewise.
12357 * xfns.c: Likewise.
12358 * xselect.c: Likewise.
12359 * xterm.c: Likewise.
12360
123612012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
12362
12363 * fns.c (maybe_resize_hash_table): Output message when growing the
12364 purify-hashtable.
12365
123662012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12367
12368 * alloc.c (allocate_string_data): Remove dead code.
12369 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
12370 avoid GCC warning about unused macro.
12371
123722012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12373
12374 * alloc.c (allocate_string): Omit intervals initialization.
12375 * alloc.c (make_uninit_multibyte_string): Initialize intervals
12376 as in make_pure_string and make_pure_c_string.
12377
123782012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12379
12380 * alloc.c (allocate_string): Fix last change.
12381
123822012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12383
12384 * alloc.c (allocate_string): Remove two redundant calls
12385 to memset, add explicit initialization where appropriate.
12386
123872012-06-27 Glenn Morris <rgm@gnu.org>
12388
12389 * lisp.mk (lisp): Remove paths.elc.
12390
123912012-06-27 Chong Yidong <cyd@gnu.org>
12392
12393 * doc.c (Fsubstitute_command_keys): Fix punctuation.
12394
123952012-06-26 John Wiegley <johnw@newartisans.com>
12396
12397 * unexmacosx.c (copy_data_segment): Add two section names used
12398 on Mac OS X Lion: __mod_init_func and __mod_term_func.
12399
12400 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
12401 when building with Clang.
12402
124032012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12404
12405 * eval.c (Fapply): Allow calling it with a single argument.
12406
124072012-06-26 Eli Zaretskii <eliz@gnu.org>
12408
12409 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12410 _stricmp and _strnicmp.
12411 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12412
124132012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12414
12415 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12416 allocated window.
12417 (allocate_process): Likewise for new process.
12418 (allocate_terminal): Change to use offsetof.
12419 (allocate_frame): Likewise.
12420 * frame.c (make_frame): Omit redundant initialization.
12421 * window.c (make_parent_window): Use memset.
12422 (make_window): Omit redundant initialization.
12423 * process.c (make_process): Omit redundant initialization.
12424 * terminal.c (create_terminal): Likewise.
12425
124262012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12427
12428 * term.c (delete_tty): Remove redundant call to memset.
12429
124302012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12431
12432 * alloc.c: Remove build_string.
12433 * lisp.h: Define build_string as static inline. This provides
12434 a better opportunity to optimize away calls to strlen when the
12435 function is called with compile-time constant argument.
12436 * image.c (imagemagick_error): Convert to build_string.
12437 * w32proc.c (sys_spawnve): Likewise.
12438 * xterm.c (x_term_init): Likewise.
12439
124402012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12441
12442 Use sprintf return value instead of invoking strlen on result.
12443 In the old days this wasn't portable, since some sprintf
12444 implementations returned char *. But they died out years ago and
12445 Emacs already assumes sprintf returns int.
12446 Similarly for float_to_string.
12447 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12448 * ccl.c (ccl_driver):
12449 * character.c (string_escape_byte8):
12450 * data.c (Fnumber_to_string):
12451 * doprnt.c (doprnt):
12452 * print.c (print_object):
12453 * xdisp.c (message_dolog):
12454 * xfns.c (syms_of_xfns):
12455 Use sprintf or float_to_string result to avoid need to call strlen.
12456 * data.c (Fnumber_to_string):
12457 Use make_unibyte_string, since the string must be ASCII.
12458 * lisp.h, print.c (float_to_string): Now returns int length.
12459 * term.c (produce_glyphless_glyph):
12460 Use sprintf result rather than recomputing it.
12461
12462 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12463 * Makefile.in (ALL_CFLAGS):
12464 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12465 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12466
124672012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12468
12469 * dispextern.h (xstrcasecmp): Define to library function
12470 strcasecmp if available.
12471 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12472
124732012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12474
12475 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12476 Avoid comma operator.
12477 * menu.c (push_submenu_start, push_submenu_end)
12478 (push_left_right_boundary, push_menu_pane): Likewise.
12479 * msdos.c (dos_rawgetc): Likewise.
12480
124812012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12482
12483 * xfns.c (xic_create_fontsetname): Remove redundant calls
12484 to memset.
12485
124862012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12487
12488 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12489 sprintf already null-terminates its output.
12490
12491 * xfns.c (x_window): Remove redundant cast.
12492
124932012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12494
12495 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12496 `const char *' to `char *' to avoid compiler warning.
12497
124982012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12499
12500 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12501 instead of truncating it to 63 (admittedly a generous limit).
12502
12503 * process.c: Fix spelling and caps in comments.
12504
125052012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12506
12507 * emacs.c (setpgrp): Remove definition, unused.
12508 * sysdep.c (setpgrp): Remove definition, not used in this file.
12509
125102012-06-24 Juanma Barranquero <lekktu@gmail.com>
12511
12512 * makefile.w32-in: Update dependencies.
12513
125142012-06-24 Eli Zaretskii <eliz@gnu.org>
12515
12516 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12517 (SYSTIME_H): Add nt/inc/sys/time.h.
12518
12519 * systime.h [WINDOWSNT]: Include sys/time.h.
12520
12521 * s/ms-w32.h (struct timespec): Definition moved from
12522 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12523
125242012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12525
12526 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12527 * buffer.h (buffer_slot_type_mismatch):
12528 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12529 * eval.c (unwind_to_catch):
12530 * image.c (my_png_error, my_error_exit):
12531 * keyboard.c (quit_throw_to_read_char, user_error)
12532 (Fexit_recursive_edit, Fabort_recursive_edit):
12533 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12534 (wrong_type_argument, buffer_overflow, __executable_start)
12535 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12536 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12537 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12538 (fatal):
12539 (child_setup) [!DOS_NT]:
12540 * lread.c (end_of_file_error, invalid_syntax):
12541 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12542 * puresize.h (pure_write_error):
12543 * search.c (matcher_overflow):
12544 * sound.c (sound_perror, alsa_sound_perror):
12545 * sysdep.c, syssignal.h (croak):
12546 * term.c (maybe_fatal, vfatal):
12547 * textprop.c (text_read_only):
12548 * undo.c (user_error):
12549 * unexmacosx.c (unexec_error):
12550 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12551 Use _Noreturn rather than NO_RETURN.
12552 No need for separate decl merely because of _Noreturn.
12553 * sound.c (sound_warning, parse_sound):
12554 Remove unnecessary forward decls.
12555
125562012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12557
12558 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12559 * lisp.h (WAIT_READING_MAX): New macro.
12560 * dispnew.c (Fsleep_for, sit_for):
12561 * keyboard.c (kbd_buffer_get_event):
12562 * process.c (Faccept_process_output):
12563 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12564 This improves on the previous patch, which introduced a bug
12565 when time_t is unsigned and as wide as intmax_t.
12566 See <http://bugs.gnu.org/9000#51>.
12567
125682012-06-23 Eli Zaretskii <eliz@gnu.org>
12569
12570 * dispnew.c (sit_for, Fsleep_for):
12571 * keyboard.c (kbd_buffer_get_event):
12572 * process.c (Faccept_process_output): Avoid compiler warnings when
12573 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12574
125752012-06-23 Juanma Barranquero <lekktu@gmail.com>
12576
12577 * makefile.w32-in: Update dependencies.
12578
12579 * w32.c (ltime): Add return type and declare static.
12580 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12581
125822012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12583
12584 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12585 Privately reported by Herbert J. Skuhra.
12586 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12587 All uses changed.
12588 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12589 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12590
125912012-06-23 Eli Zaretskii <eliz@gnu.org>
12592
12593 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12594 last argument of make_unibyte_string.
12595
12596 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12597 language ID in the event parameters.
12598
12599 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12600 event.code, not the obscure "character set ID".
12601
126022012-06-23 Chong Yidong <cyd@gnu.org>
12603
12604 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12605
126062012-06-23 Eli Zaretskii <eliz@gnu.org>
12607
12608 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12609 * w32.c (fdutimens): New function.
12610
12611 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12612
12613 * s/ms-w32.h (pselect): Redirect to sys_select.
12614
12615 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12616
12617 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12618 in the logic of incrementing and decrementing the value of
12619 use_relocatable_buffers.
12620
126212012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12622
12623 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12624 Privately reported by Herbert J. Skuhra.
12625 [__FreeBSD__]: Remove "*/" typo after "#include".
12626 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12627 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12628 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12629 Don't assume EMACS_TIME and struct timeval are the same type.
12630
126312012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12632
12633 Support higher-resolution time stamps (Bug#9000).
12634 The time stamps are only nanosecond-resolution at the C level,
12635 since that's the best that any real-world system supports now.
12636 But they are picosecond-resolution at the Lisp level, as that's
12637 easy, and leaves room for future OS improvements.
12638
12639 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12640 (LIBES): Use it.
12641
12642 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12643 Don't get current time unless it's needed.
12644
12645 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12646 now provides it if it's absent.
12647 (start_atimer): Port to higher-res time stamps.
12648 Check for time stamp overflow. Don't get current time more
12649 often than is needed.
12650
12651 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12652 Include systime.h, not time.h.
12653 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12654
12655 * dired.c: Include stat-time.h.
12656 (Ffile-attributes): File times now have higher resolution.
12657
12658 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12659 (struct image): Timestamp now has higher resolution.
12660
12661 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12662 has at least microseconds now. All uses removed.
12663 (update_frame, update_single_window, update_window, update_frame_1)
12664 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12665 (duration_to_sec_usec): Remove; no longer needed.
12666
12667 * editfns.c (time_overflow): Now extern.
12668 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12669 (float-time, Fformat_time_string, Fcurrent_time_string)
12670 (Fcurrent_time_zone): Accept and generate higher-resolution
12671 time stamps.
12672 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12673 (decode_time_components, lisp_seconds_argument): New functions.
12674 (make_time): Now static.
12675 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12676 Report an error if the time is invalid, rather than having the caller
12677 do that.
12678
12679 * fileio.c: Include <stat-time.h>
12680 (Fcopy_file): Copy higher-resolution time stamps.
12681 Prefer to set the time stamp via a file descriptor if that works.
12682 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12683 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12684 (Fvisited_file_modtime, Fset_visited_file_modtime):
12685 Support higher-resolution time stamps.
12686
12687 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12688
12689 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12690
12691 * image.c (prepare_image_for_display, clear_image_cache)
12692 (lookup_image): Port to higer-resolution time stamps.
12693
12694 * keyboard.c (start_polling, bind_polling_period):
12695 Check for time stamp overflow.
12696 (read_char, kbd_buffer_get_event, timer_start_idle)
12697 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12698 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12699 Port to higher-resolution time stamps. Do not assume time_t is signed.
12700 (decode_timer): New function. Timers are now vectors of length 9,
12701 not 8, to accommodate the picosecond component.
12702 (timer_check_2): Use it.
12703
12704 * nsterm.m (select_timeout, timeval_subtract): Remove.
12705 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12706 as they're a bit more accurate and handle overflow better.
12707 (ns_select): Change prototype to be compatible with pselect.
12708 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12709 * nsterm.h (ns_select): Adjust prototype.
12710
12711 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12712 us-resolution time stamps.
12713 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12714
12715 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12716
12717 * lisp.h (time_overflow): New decl.
12718 (wait_reading_process_output): First arg is now intmax_t, not int,
12719 to accommodate larger waits.
12720
12721 * process.h (struct Lisp_Process.read_output_delay):
12722 Now counts nanoseconds, not microseconds.
12723 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12724 EMACS_HAS_USECS.
12725 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12726 (wait_reading_process_output):
12727 Port to ns-resolution time stamps.
12728 (Faccept_process_output, wait_reading_process_output):
12729 Check for time stamp overflow. Do not assume time_t is signed.
12730 (select_wrapper): Remove; we now use pselect.
12731 (Fprocess_attributes): Now generates ns-resolution time stamps.
12732
12733 * sysdep.c: Include utimens.h. Don't include utime.h
12734 or worry about struct utimbuf; gnulib does that for us now.
12735 (gettimeofday): Remove; gnulib provides a substitute.
12736 (make_timeval): New function.
12737 (set_file_times): Now sets ns-resolution time stamps.
12738 New arg FD; all uses changed.
12739 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12740 (system_process_attributes):
12741 Now returns ns-resolution time stamp. All uses changed.
12742 Check for time stamp overflow.
12743
12744 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12745 provides a substitute now.
12746
12747 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12748 since it guarantees struct timespec.
12749 (EMACS_TIME): Now struct timespec, so that we can support
12750 ns-resolution time stamps.
12751 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12752 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12753 (EMACS_USECS): Remove.
12754 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12755 so multiply the arg by 1000 before storing it.
12756 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12757 New macros.
12758 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12759 Port to ns-resolution time stamps.
12760 (EMACS_TIME_NEG_P): Remove; replaced by....
12761 (EMACS_TIME_SIGN): New macro.
12762 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12763 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12764 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12765 (make_timeval, make_lisp_time, decode_time_components): New decls.
12766 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12767 that it mishandled time_t overflow. You can't compare by subtracting!
12768 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12769 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12770
12771 * term.c: Include <sys/time.h>.
12772 (timeval_to_Time): New function, for proper overflow wraparound.
12773 (term_mouse_position, term_mouse_click): Use it.
12774
12775 * undo.c (record_first_change): Support higher-resolution time stamps
12776 in the undo buffer.
12777 (Fprimitive_undo): Use them when restoring time stamps.
12778
12779 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12780 (w32_get_internal_run_time):
12781 Port to higher-resolution Emacs time stamps.
12782 (ltime): Now accepts single 64-bit integer, as that's more convenient
12783 for callers.
12784
12785 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12786
12787 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12788 for compatibility with pselect. Support ns-resolution time stamps.
12789
12790 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12791
12792 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12793 Check for time stamp overflow, and support ns-resolution time stamps.
12794
12795 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12796 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12797 (timeval_subtract): Remove; no longer needed.
12798 (XTflash, XTring_bell, x_wait_for_event):
12799 Port to ns-resolution time stamps. Don't assume time_t is signed.
12800
128012012-06-22 Chong Yidong <cyd@gnu.org>
12802
12803 * xdisp.c (x_consider_frame_title): Revert last change.
12804
128052012-06-22 Eli Zaretskii <eliz@gnu.org>
12806
12807 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12808 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12809 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12810 staticidx goes up to 1597 out of 1600 = 0x640.)
12811
128122012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12813
12814 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12815 Otherwise, the umask might be mistakenly 0 while handling input signals.
12816
128172012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12818
12819 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12820
128212012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12822
12823 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12824 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12825 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12826 access to `contents' member of Lisp_Vector objects with AREF and ASET
12827 where appropriate.
12828
128292012-06-19 Chong Yidong <cyd@gnu.org>
12830
12831 * frame.c (delete_frame): When selecting a frame on a different
12832 text terminal, do not alter the terminal's top-frame.
12833
12834 * xdisp.c (format_mode_line_unwind_data): Record the target
12835 frame's selected window and its terminal's top-frame.
12836 (unwind_format_mode_line): Restore them.
12837 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12838 Callers changed.
12839 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12840 since tty frames can be explicitly named.
12841 (prepare_menu_bars): Likewise.
12842
12843 * term.c (Ftty_top_frame): New function.
12844
128452012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12846
12847 Port byte-code-meter to modern targets.
12848 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12849 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12850 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12851 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12852 (METER_1, METER_2): Simplify.
12853
128542012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12855
12856 * data.c (Fdefalias): Return `symbol' (bug#11686).
12857
128582012-06-18 Martin Rudalics <rudalics@gmx.at>
12859
12860 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12861 gets killed during executing of this function (Bug#11665).
12862 Try to always return Qt when the buffer has been actually killed.
12863 (Vkill_buffer_query_functions): In doc-string say that functions
12864 run by this hook should not change the current buffer.
12865
128662012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12867
12868 Fix recently-introduced process.c problems found by static checking.
12869 * process.c (write_queue_push, write_queue_pop, send_process):
12870 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12871 (write_queue_pop): Fix pointer signedness problem.
12872 (send_process): Remove unused local.
12873
128742012-06-17 Chong Yidong <cyd@gnu.org>
12875
12876 * xdisp.c (redisplay_internal): No need to redisplay terminal
12877 frames that are not on top.
12878
128792012-06-17 Troels Nielsen <bn.troels@gmail.com>
12880
12881 * process.c (make_process): Initialize write_queue.
12882 (write_queue_push, write_queue_pop): New functions.
12883 (send_process): Use them to maintain correct ordering of process
12884 writes (Bug#10815).
12885
128862012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12887
12888 * lisp.h (eassert): Assume C89 or later.
12889 This removes the need for CHECK.
12890 (CHECK): Remove. Its comments about always evaluating its
12891 argument were confusing, as 'eassert' typically does not evaluate
12892 its argument.
12893
12894 * coding.c (produce_chars): Use ptrdiff_t, not int.
12895
12896 * xterm.c (x_draw_underwave): Check for integer overflow.
12897 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12898
128992012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12900
12901 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12902 referenced (Bug#11583).
12903
129042012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12905
12906 Implement wave-style variant of underlining.
12907 * dispextern.h (face_underline_type): New enum.
12908 (face): Add field for underline type.
12909 * nsterm.m (ns_draw_underwave): New function.
12910 (ns_draw_text_decoration): Use it.
12911 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12912 New functions.
12913 (x_draw_glyph_string): Use them.
12914 * xfaces.c (Qline, Qwave): New Lisp objects.
12915 (check_lface_attrs, merge_face_ref)
12916 (Finternal_set_lisp_face_attribute, realize_x_face):
12917 Handle wave-style underline face attributes.
12918 * xterm.c (x_draw_underwave): New function.
12919 (x_draw_glyph_string): Use it.
12920
129212012-06-16 Juanma Barranquero <lekktu@gmail.com>
12922
12923 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12924 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12925 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12926 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12927 ($(BLD)/w32select.$(O)): Update dependencies.
12928
129292012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12930
12931 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12932 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12933 * character.c (_fetch_multibyte_char_p): Remove.
12934 * alloc.c: Include "character.h" before "buffer.h".
12935 * bidi.c: Likewise.
12936 * buffer.c: Likewise.
12937 * bytecode.c: Likewise.
12938 * callint.c: Likewise.
12939 * callproc.c: Likewise.
12940 * casefiddle.c: Likewise.
12941 * casetab.c: Likewise.
12942 * category.c: Likewise.
12943 * cmds.c: Likewise.
12944 * coding.c: Likewise.
12945 * composite.c: Likewise.
12946 * dired.c: Likewise.
12947 * dispnew.c: Likewise.
12948 * doc.c: Likewise.
12949 * dosfns.c: Likewise.
12950 * editfns.c: Likewise.
12951 * emacs.c: Likewise.
12952 * fileio.c: Likewise.
12953 * filelock.c: Likewise.
12954 * font.c: Likewise.
12955 * fontset.c: Likewise.
12956 * fringe.c: Likewise.
12957 * indent.c: Likewise.
12958 * insdel.c: Likewise.
12959 * intervals.c: Likewise.
12960 * keyboard.c: Likewise.
12961 * keymap.c: Likewise.
12962 * lread.c: Likewise.
12963 * macros.c: Likewise.
12964 * marker.c: Likewise.
12965 * minibuf.c: Likewise.
12966 * nsfns.m: Likewise.
12967 * nsmenu.m: Likewise.
12968 * print.c: Likewise.
12969 * process.c: Likewise.
12970 * regex.c: Likewise.
12971 * region-cache.c: Likewise.
12972 * search.c: Likewise.
12973 * syntax.c: Likewise.
12974 * term.c: Likewise.
12975 * textprop.c: Likewise.
12976 * undo.c: Likewise.
12977 * unexsol.c: Likewise.
12978 * w16select.c: Likewise.
12979 * w32fns.c: Likewise.
12980 * w32menu.c: Likewise.
12981 * window.c: Likewise.
12982 * xdisp.c: Likewise.
12983 * xfns.c: Likewise.
12984 * xmenu.c: Likewise.
12985 * xml.c: Likewise.
12986 * xselect.c: Likewise.
12987
129882012-06-16 Eli Zaretskii <eliz@gnu.org>
12989
12990 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12991 If all the glyphs of the glyph row came from strings, and we have no
12992 cursor positioning clues, put the cursor on the first glyph of the
12993 row.
12994 (handle_face_prop): Use chunk-relative overlay string index when
12995 indexing into it->string_overlays array. (Bug#11653)
12996 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12997 the rightmost. (Bug#11720)
12998
129992012-06-16 Andreas Schwab <schwab@linux-m68k.org>
13000
13001 * category.h (CHAR_HAS_CATEGORY): Define as inline.
13002 (CATEGORY_MEMBER): Enforce 1/0 value.
13003 * category.c (_temp_category_set): Remove.
13004
130052012-06-16 Eli Zaretskii <eliz@gnu.org>
13006
13007 * window.c (Fdelete_other_windows_internal)
13008 (Fdelete_window_internal): Don't access frame's mouse highlight
13009 info of the initial frame. (Bug#11677)
13010
130112012-06-14 Paul Eggert <eggert@cs.ucla.edu>
13012
13013 * .gdbinit (xgetint): Fix recently-introduced paren typo.
13014 Assume USE_2_TAGS_FOR_INTS.
13015 (xreload): Adjust $tagmask width to match recent lisp.h change.
13016
13017 Simplify lisp.h in minor ways that should not affect code.
13018 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
13019 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
13020 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
13021 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
13022 (INTTYPEBITS): New macro, for clarity.
13023 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
13024 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
13025 Simplify now that USE_LSB_TAG is always defined.
13026 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
13027 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
13028
130292012-06-13 Juanma Barranquero <lekktu@gmail.com>
13030
13031 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
13032
130332012-06-13 Glenn Morris <rgm@gnu.org>
13034
13035 * s/bsd-common.h (BSD4_3):
13036 * s/usg5-4-common.h (USG5_4): No longer define; unused.
13037
130382012-06-13 Andreas Schwab <schwab@linux-m68k.org>
13039
13040 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
13041 instead of union.
13042 (XLI, XIL): Define.
13043 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
13044 Use them.
13045 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
13046 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
13047 * alloc.c (widen_to_Lisp_Object): Remove.
13048 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
13049 * frame.c (delete_frame): Remove outdated comment.
13050 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
13051 USE_LISP_UNION_TYPE.
13052 (Fw32_unregister_hot_key): Likewise.
13053 (Fw32_toggle_lock_key): Likewise.
13054 * w32menu.c (add_menu_item): Likewise.
13055 (w32_menu_display_help): Use XIL instead of checking
13056 USE_LISP_UNION_TYPE.
13057 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
13058 (init_heap): Likewise.
13059 * w32term.c (w32_read_socket): Update comment.
13060
130612012-06-13 Glenn Morris <rgm@gnu.org>
13062
13063 * s/usg5-4-common.h, src/s/unixware.h:
13064 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
13065
13066 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
13067
130682012-06-13 Paul Eggert <eggert@cs.ucla.edu>
13069
13070 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
13071 * alloc.c (make_number) [!defined make_number]:
13072 Remove, as lisp.h always defines this now.
13073 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
13074 (roundup_size): Verify that it is a power of 2.
13075 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
13076 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
13077 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
13078 -DUSE_LSB_TAG=0, to override the automatically-selected default.
13079 USE_LSB_TAG now is always defined to be either 0 or 1.
13080 All uses changed.
13081 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
13082 code works fine either way, and efficiency is not a concern here,
13083 as the union type is for debugging, not for production.
13084 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
13085 Use an inline function on all platforms when using the union type,
13086 since this is simpler and 'static inline' can be used portably
13087 within Emacs now.
13088 (LISP_INITIALLY_ZERO): New macro.
13089 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
13090 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
13091
130922012-06-12 Glenn Morris <rgm@gnu.org>
13093
13094 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
13095
13096 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
13097
13098 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
13099 Move BROKEN_SIGIO to configure.
13100
13101 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
13102 Move NO_TERMIO to configure.
13103
131042012-06-12 Chong Yidong <cyd@gnu.org>
13105
13106 * image.c (imagemagick_load_image): Use MagickFlattenImage if
13107 MagickMergeImageLayers is undefined. Use pixel pusher loop if
13108 MagickExportImagePixels is undefined.
13109
131102012-06-12 Paul Eggert <eggert@cs.ucla.edu>
13111
13112 * image.c (imagemagick_load_image): Remove unused label.
13113
131142012-06-11 Glenn Morris <rgm@gnu.org>
13115
13116 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
13117 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
13118 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
13119 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
13120
131212012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
13122
13123 * alloc.c (make_byte_code): New function.
13124 (Fmake_byte_code): Use it. Don't purify here.
13125 * lread.c (read1): Use it as well to avoid extra allocation.
13126
131272012-06-11 Chong Yidong <cyd@gnu.org>
13128
13129 * image.c (imagemagick_load_image): Implement transparency.
13130
131312012-06-10 Andreas Schwab <schwab@linux-m68k.org>
13132
13133 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
13134 account for preceding backslashes. (Bug#11663)
13135
131362012-06-09 Chong Yidong <cyd@gnu.org>
13137
13138 * term.c: Support italics in capable terminals (Bug#9652).
13139 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
13140 (turn_on_face): Output using TS_enter_italic_mode if available.
13141 Don't handle unused blinking and alt-charset cases.
13142 (turn_off_face): Handle italic case; discard unused tty_blinking_p
13143 and tty_alt_charset_p cases.
13144 (tty_capable_p, init_tty): Support italics.
13145
13146 * termchar.h (struct tty_display_info): Add field for italics.
13147 Remove unused blink field.
13148
13149 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
13150 Handle slant.
13151
13152 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
13153 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
13154 tty_alt_charset_p. Add tty_italic_p.
13155
131562012-06-09 Michael Albinus <michael.albinus@gmx.de>
13157
13158 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
13159 dbus_type_is_basic if available.
13160 (xd_extract_signed, xd_extract_unsigned): Rename from
13161 extract_signed and extract_unsigned, respectively. Adapt callers.
13162
131632012-06-09 Chong Yidong <cyd@gnu.org>
13164
13165 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
13166
13167 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
13168 case (Bug#9752).
13169
131702012-06-08 Paul Eggert <eggert@cs.ucla.edu>
13171
13172 * xdisp.c (vmessage): Treat frame message as multibyte.
13173 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
13174 would generate the diagnostic "Making \302\247 buffer-local while
13175 let-bound!".
13176
131772012-06-08 Eli Zaretskii <eliz@gnu.org>
13178
13179 * dispnew.c (showing_window_margins_p): Undo last change, which
13180 was done due to an inadvertent commit.
13181 (adjust_frame_glyphs_for_frame_redisplay): Do call
13182 showing_window_margins_p.
13183
131842012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
13185
13186 * eval.c (Fmake_var_non_special): New primitive.
13187 (syms_of_eval): Defsubr it.
13188 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
13189
131902012-06-08 Juanma Barranquero <lekktu@gmail.com>
13191
13192 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
13193 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
13194
131952012-06-08 Eli Zaretskii <eliz@gnu.org>
13196
13197 * alloc.c (allocate_vectorlike): Fix last change.
13198
131992012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
13200
13201 Block-based vector allocation of small vectors.
13202 * lisp.h (struct vectorlike_header): New field `nbytes',
13203 adjust comment accordingly.
13204 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
13205 to denote vector blocks. Adjust users (live_vector_p,
13206 mark_maybe_pointer, valid_lisp_object_p) accordingly.
13207 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
13208 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
13209 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
13210 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
13211 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
13212 (roundup_size): New constant.
13213 (struct vector_block): New data type.
13214 (vector_blocks, vector_free_lists, zero_vector): New variables.
13215 (all_vectors): Rename to `large_vectors'.
13216 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
13217 (sweep_vectors): New functions.
13218 (allocate_vectorlike): Return `zero_vector' as the only vector of
13219 0 items. Allocate new vector from block if vector size is less than
13220 or equal to VBLOCK_BYTES_MAX.
13221 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
13222 (init_alloc_once): Add call to init_vectors.
13223
132242012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
13225
13226 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
13227
132282012-06-07 Paul Eggert <eggert@cs.ucla.edu>
13229
13230 * doprnt.c (doprnt): Truncate multibyte char correctly.
13231 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
13232 would mishandle a string argument "Xc" if X was a multibyte
13233 character of length 2: it would truncate after X's first byte
13234 rather than including all of X.
13235
132362012-06-06 Chong Yidong <cyd@gnu.org>
13237
13238 * buffer.c (word_wrap): Doc fix.
13239
132402012-06-04 Paul Eggert <eggert@cs.ucla.edu>
13241
13242 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
13243
132442012-06-03 Glenn Morris <rgm@gnu.org>
13245
13246 * xdisp.c (tool-bar-style): Doc fix.
13247
132482012-06-03 Ulrich Müller <ulm@gentoo.org>
13249
13250 * Makefile.in (PAXCTL): Define.
13251 (temacs$(EXEEXT)): Disable memory randomization for the temacs
13252 binary via PaX flags if the paxctl utility is available.
13253 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
13254 Restore PaX flags to their default. (Bug#11398)
13255
132562012-06-03 Chong Yidong <cyd@gnu.org>
13257
13258 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
13259 buffer (Bug#11226).
13260
132612012-06-03 Chong Yidong <cyd@gnu.org>
13262
13263 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
13264 (note_mode_line_or_margin_highlight): If there is no help echo,
13265 use mode-line-default-help-echo. Handle the case where the mouse
13266 position is past the end of the mode line string.
13267
13268 * buffer.c (buffer_local_value_1): New function, split from
13269 Fbuffer_local_value; can return Qunbound.
13270 (Fbuffer_local_value): Use it.
13271 (Vmode_line_format): Docstring tweaks.
13272
132732012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13274
13275 * sysdep.c (system_process_attributes): Improve comment.
13276
132772012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
13278
13279 * keyboard.c: Export real-this-command to Elisp.
13280 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
13281 and DEFVAR it. Update all users.
13282
132832012-06-02 Paul Eggert <eggert@cs.ucla.edu>
13284
13285 * minibuf.c (Fassoc_string): Remove duplicate declaration.
13286
13287 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
13288 Convert pctcpu and pctmem to Lisp float properly.
13289 Let the compiler fold better, as 100.0/0x8000 is exact.
13290
132912012-06-02 Andreas Schwab <schwab@linux-m68k.org>
13292
13293 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
13294 cons_block.
13295
132962012-06-01 Paul Eggert <eggert@cs.ucla.edu>
13297
13298 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
13299
133002012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
13301
13302 For a 'struct window', replace some Lisp_Object fields to
13303 bitfields where appropriate, remove unused fields.
13304 * window.h (struct window): Remove unused 'last_mark_x' and
13305 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
13306 change its type from Lisp_Object to bitfield.
13307 Change type of 'force_start', 'optional_new_start',
13308 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
13309 fields from Lisp_Object to bitfield. Adjust users accordingly.
13310
133112012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13312
13313 Pacify gcc -Wdouble-precision when using Xaw.
13314 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
13315 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
13316 Use 'float' consistently, rather than 'float' in most places
13317 and 'double' in a couple of places.
13318
133192012-05-31 Eli Zaretskii <eliz@gnu.org>
13320
13321 * xdisp.c (handle_stop): Detect whether we have overlay strings
13322 loaded by testing it->current.overlay_string_index to be
13323 non-negative, instead of checking whether n_overlay_strings is
13324 positive. (Bug#11587)
13325
133262012-05-31 Chong Yidong <cyd@gnu.org>
13327
13328 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
13329
13330 * doc.c (Fsubstitute_command_keys): Doc fix.
13331
133322012-05-31 Eli Zaretskii <eliz@gnu.org>
13333
13334 * search.c (search_buffer): Remove calls to
13335 r_alloc_inhibit_buffer_relocation, as it is now called by
13336 maybe_unify_char, which was the cause of relocation of buffer text
13337 in bug#11519.
13338
133392012-05-31 Eli Zaretskii <eliz@gnu.org>
13340
13341 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
13342 for the duration of call to load_charset, to avoid problems with
13343 callers of maybe_unify_char that access buffer text through C
13344 pointers.
13345
13346 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
13347 decrement the inhibition flag, instead of just setting or
13348 resetting it.
13349
133502012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13351
13352 Remove obsolete '#define static' cruft.
13353 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
13354 This #undef was "temporary" in 2000; it is no longer needed
13355 now that '#define static' has gone away.
13356 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
13357 (gray_bitmap_bits): Remove; no longer needed.
13358 All uses replaced with definiens.
13359 * xterm.c: Include "bitmaps/gray.xbm".
13360
133612012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13362
13363 Clean up __executable_start, monstartup when --enable-profiling.
13364 The following changes affect the code only when profiling.
13365 * dispnew.c (__executable_start): Rename from safe_bcopy.
13366 Define only on platforms that need it.
13367 * emacs.c: Include <sys/gmon.h> when profiling.
13368 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
13369 (__executable_start): Remove decl, since lisp.h does it now.
13370 (safe_bcopy): Remove decl; no longer has that name.
13371 (main): Coalesce #if into single bit of code, for simplicity.
13372 Cast pointers to uintptr_t, since standard libraries want integers
13373 and not pointers.
13374 * lisp.h (__executable_start): New decl.
13375
133762012-05-31 Glenn Morris <rgm@gnu.org>
13377
13378 * image.c (Fimagemagick_types): Doc fix.
13379
133802012-05-30 Jim Meyering <meyering@redhat.com>
13381
13382 * callproc.c (Fcall_process_region): Include directory component
13383 in mkstemp error message (Bug#11586).
13384
133852012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13386
13387 * alloc.c, lisp.h (make_pure_vector): Now static.
13388
133892012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
13390
13391 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
13392 Move to byte-run.el.
13393 (Fautoload): Do the hash-doc more carefully.
13394 * data.c (Fdefalias): Purify definition, except for keymaps.
13395 (Qdefun): Move from eval.c.
13396 * lisp.h (Qdefun): Remove.
13397 * lread.c (read1): Tiny simplification.
13398
133992012-05-29 Troels Nielsen <bn.troels@gmail.com>
13400
13401 Do not create empty overlays with the evaporate property (Bug#9642).
13402 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13403 Bug#9642, but explicitly check that the buffer the overlay would
13404 be moved to is live and rearrange lines to make sure that errors
13405 will not put the overlay in an inconsistent state.
13406 (Fdelete_overlay): Cosmetics.
13407
134082012-05-28 Eli Zaretskii <eliz@gnu.org>
13409
13410 * w32term.c (my_bring_window_to_top): New function.
13411 (x_raise_frame): Use handle returned by DeferWindowPos, which
13412 could be different from the original one.
13413 Call my_bring_window_to_top instead of my_set_foreground_window.
13414 (Bug#11513)
13415
13416 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13417 by calling BringWindowToTop.
13418
13419 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13420 (WM_EMACS_END): Increase by one.
13421
134222012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13423
13424 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13425 This avoids undefined behavior that might cause the eassert
13426 to not catch an out-of-range value.
13427
134282012-05-28 Juanma Barranquero <lekktu@gmail.com>
13429
13430 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13431 Update dependencies.
13432
134332012-05-27 Eli Zaretskii <eliz@gnu.org>
13434
13435 * bidi.c (bidi_mirror_char): Fix last change.
13436
134372012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13438
13439 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13440 when referring to sectname field in printf format.
13441
134422012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13443
13444 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13445 Only r_alloc_inhibit_buffer_relocation needed to be added;
13446 the others were already declared.
13447
13448 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13449 before checking whether it's out of range. Put the check inside
13450 eassert. See
13451 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13452
134532012-05-27 Ken Brown <kbrown@cornell.edu>
13454
13455 * callproc.c (Fcall_process): Restore a line that was accidentally
13456 commented out in the 2011-02-13 change (bug#11547).
13457
134582012-05-27 Eli Zaretskii <eliz@gnu.org>
13459
13460 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13461 defined on ralloc.c.
13462
13463 * buffer.c [REL_ALLOC]: Remove prototypes of
13464 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13465 they are now on lisp.h.
13466
13467 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13468
13469 * search.c (search_buffer): Use it to inhibit relocation of buffer
13470 text while re_search_2 is doing its job, because re_search_2 is
13471 passed C pointers to buffer text. (Bug#11519)
13472
13473 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13474 Update value to 24.
13475
13476 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13477 state after an additional call to move_it_in_display_line_to, keep
13478 the values of it->max_ascent and it->max_descent found for the
13479 entire line.
13480 (pos_visible_p): Revert the comparison against bottom_y to what it
13481 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13482 (Bug#11464)
13483
134842012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13485
13486 Fix coding-related core dumps with gcc -ftrapv.
13487 The code was computing A - B, where A and B are pointers, and B is
13488 random garbage. This can lead to core dumps on platforms that
13489 have special pointer registers, and it also leads to core dumps on
13490 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13491 A - B only when B is initialized properly.
13492 * coding.c (coding_set_source, coding_set_destination): Return void.
13493 (coding_change_source, coding_change_destinations): New functions,
13494 with the old behaviors of coding_set_source and coding_set_destination.
13495 All callers that need an offset changed to use these new functions.
13496
134972012-05-26 Glenn Morris <rgm@gnu.org>
13498
13499 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13500
135012012-05-26 Eli Zaretskii <eliz@gnu.org>
13502
13503 Extend mouse support on W32 text-mode console.
13504 * xdisp.c (draw_row_with_mouse_face):
13505 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
13506
13507 * w32console.c: Include window.h.
13508 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13509 New functions.
13510 (initialize_w32_display): Initialize mouse-highlight data.
13511
13512 * w32inevt.c: Include termchar.h and window.h.
13513 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13514 moves, call note_mouse_highlight. If help_echo changed, call
13515 gen_help_event to produce help-echo message in the echo area.
13516 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13517 highlight info.
13518
135192012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13520
13521 * lread.c (read1): Simplify slightly to avoid an overflow warning
13522 with GCC 4.7.0 on x86-64.
13523
135242012-05-26 Eli Zaretskii <eliz@gnu.org>
13525
13526 * bidi.c (bidi_mirror_char): Revert last change: an int is
13527 definitely wide enough here.
13528
135292012-05-25 Paul Eggert <eggert@cs.ucla.edu>
13530
13531 Fix integer width and related bugs (Bug#9874).
13532 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
13533 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13534 (string_bytes, check_sblock, allocate_string_data):
13535 (compact_small_strings, Fmake_bool_vector, make_string)
13536 (make_unibyte_string, make_multibyte_string)
13537 (make_string_from_bytes, make_specified_string)
13538 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13539 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13540 (mark_vectorlike):
13541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13542 (allocate_pseudovector):
13543 Use int, not EMACS_INT, where int is wide enough.
13544 (inhibit_garbage_collection, Fgarbage_collect):
13545 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13546 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13547 int might not be wide enough.
13548 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13549 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13550 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13551 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13552 (bidi_level_of_next_char, bidi_move_to_visually_next):
13553 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13554 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13555 (Fkill_buffer, Fset_buffer_major_mode)
13556 (advance_to_char_boundary, Fbuffer_swap_text)
13557 (Fset_buffer_multibyte, overlays_at, overlays_in)
13558 (overlay_touches_p, struct sortvec, record_overlay_string)
13559 (overlay_strings, recenter_overlay_lists)
13560 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13561 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13562 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13563 (Foverlay_recenter, last_overlay_modification_hooks_used)
13564 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13565 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13566 (validate_region): Omit unnecessary test for b <= e,
13567 since that's guaranteed by the previous test.
13568 (adjust_overlays_for_delete): Avoid pos + length overflow.
13569 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13570 (report_overlay_modification):
13571 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13572 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13573 Omit pointer cast, which isn't needed anyway, and doesn't work
13574 after the EMACS_INT -> ptrdiff_t change.
13575 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
13576 * buffer.h: Adjust decls to match defn changes elsewhere.
13577 (struct buffer_text, struct buffer):
13578 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13579 Use EMACS_INT, not int, where int might not be wide enough.
13580 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13581 not int, to avoid needless 32-bit limit on 64-bit hosts.
13582 (exec_byte_code): Use tighter memory-full test, one that checks
13583 for alloca overflow. Don't compute the address of the object just
13584 before an array, as that's not portable. Use EMACS_INT, not
13585 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
13586 * callint.c (Fcall_interactively):
13587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13588 * callproc.c (call_process_kill, Fcall_process):
13589 Don't assume pid_t fits into an Emacs fixnum.
13590 (call_process_cleanup, Fcall_process, child_setup):
13591 Don't assume pid_t fits into int.
13592 (call_process_cleanup, Fcall_process, delete_temp_file)
13593 (Fcall_process_region):
13594 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13595 (Fcall_process): Simplify handling of volatile integers.
13596 Use int, not EMACS_INT, where int will do.
13597 * casefiddle.c (casify_object, casify_region, operate_on_word)
13598 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13600 (casify_object): Avoid integer overflow when overallocating buffer.
13601 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
13602 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
13603 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13604 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13605 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13606 integers are now checked earlier. All uses replaced with XINT.
13607 (ccl_driver):
13608 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13609 For CCL_MapSingle, check that content and value are in int range.
13610 (ccl_driver, Fregister_code_conversion_map):
13611 Check that Vcode_version_map_vector is a vector.
13612 (resolve_symbol_ccl_program): Check that vector header is in range.
13613 Always copy the vector, so that we can check its contents reliably
13614 now rather than having to recheck each instruction as it's being
13615 executed. Check that vector words fit in 'int'.
13616 (ccl_get_compiled_code, Fregister_ccl_program)
13617 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13618 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13619 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13620 contents are in range.
13621 (Fccl_execute_on_string): Check that status is in range.
13622 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13623 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13624 Accept and return EMACS_INT, not int, because callers can pass values
13625 out of 'int' range.
13626 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13627 (multibyte_chars_in_text, parse_str_as_multibyte)
13628 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13629 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13630 (string_escape_byte8, Fget_byte):
13631 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13632 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13633 avoid mishandling large integers.
13634 * character.h: Adjust decls to match defn changes elsewhere.
13635 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13636 (Ffind_charset_region):
13637 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13638 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13639 (load_charset_map_from_vector, Fdefine_charset_internal):
13640 Don't assume fixnum fits in int.
13641 (load_charset_map_from_vector, Fmap_charset_chars):
13642 Remove now-unnecessary CHECK_NATNUMs.
13643 (Fdefine_charset_internal): Check ranges here, more carefully.
13644 Don't rely on undefined behavior with signed left shift overflow.
13645 Don't assume unsigned int fits into fixnum, or that fixnum fits
13646 into unsigned int. Don't require max_code to be a valid fixnum;
13647 that's not true for gb10830 4-byte on a 32-bit host. Allow
13648 invalid_code to be a cons, for the same reason. Require code_offset
13649 to be a character. Avoid int overflow if max_char is close
13650 to INT_MAX.
13651 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13652 this is intended anyway and avoids some undefined behavior.
13653 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13654 INDEX_TO_CODE_POINT, as that's what it expects.
13655 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13656 * charset.h (DECODE_CHAR): Return int, not unsigned;
13657 this is what was intended anyway, and it avoids undefined behavior.
13658 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13659 integer-overflow issues.
13660 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13661 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13662 where the argument is EMACS_INT, and this behavior is not intended.
13663 * chartab.c (Fmake_char_table, Fset_char_table_range)
13664 (uniprop_get_decoder, uniprop_get_encoder):
13665 Don't assume fixnum fits in int.
13666 * cmds.c (move_point): New function, that does the gist of
13667 Fforward_char and Fbackward_char, but does so while checking
13668 for integer overflow more accurately.
13669 (Fforward_char, Fbackward_char): Use it.
13670 (Fforward_line, Fend_of_line, internal_self_insert)
13671 (internal_self_insert):
13672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13673 Fix a FIXME, by checking for integer overflow when calculating
13674 target_clm and actual_clm.
13675 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13676 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13677 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13678 (coding_alloc_by_making_gap, alloc_destination)
13679 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13680 (encode_coding_utf_16, detect_coding_emacs_mule)
13681 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13682 (detect_coding_iso_2022, decode_coding_iso_2022)
13683 (encode_invocation_designation, encode_designation_at_bol)
13684 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13685 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13686 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13687 (encode_coding_ccl, encode_coding_raw_text)
13688 (detect_coding_charset, decode_coding_charset)
13689 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13690 (produce_composition, produce_charset, produce_annotation)
13691 (decode_coding, handle_composition_annotation)
13692 (handle_charset_annotation, consume_chars, decode_coding_gap)
13693 (decode_coding_object, encode_coding_object, detect_coding_system)
13694 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13695 (code_convert_region, code_convert_string)
13696 (Fdefine_coding_system_internal)
13697 (coding_set_source, coding_set_destination):
13698 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13699 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13700 (Fdefine_coding_system_internal):
13701 Don't assume fixnums fit in int.
13702 (decode_coding_gap, decode_coding_object, encode_coding_object)
13703 (Fread_coding_system, Fdetect_coding_region)
13704 (Funencodable_char_position, Fcheck_coding_systems_region)
13705 (get_translation, handle_composition_annotation, consume_chars):
13706 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13707 (consume_chars): Rewrite to not calculate an address outside buffer.
13708 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13709 Don't access memory outside of the args array.
13710 (Fdefine_coding_system_internal): Check for charset-id overflow.
13711 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13712 result of ENCODE_CHAR.
13713 * coding.h: Adjust decls to match defn changes elsewhere.
13714 (struct coding_system):
13715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13716 * composite.c (get_composition_id, find_composition)
13717 (run_composition_function, update_compositions)
13718 (compose_text, composition_gstring_put_cache)
13719 (composition_gstring_p, composition_gstring_width)
13720 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13721 (composition_compute_stop_pos, composition_reseat_it)
13722 (composition_update_it, struct position_record)
13723 (find_automatic_composition, composition_adjust_point)
13724 (Fcomposition_get_gstring, Ffind_composition_internal):
13725 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13726 (update_compositions):
13727 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13728 * composite.h: Adjust decls to match defn changes elsewhere.
13729 (struct composition):
13730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13731 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13732 Do not attempt to compute the address of the object just before a
13733 buffer; this is not portable.
13734 (Faref, Faset):
13735 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13736 (Faset): Use int, not EMACS_INT, where int is wide enough.
13737 (Fstring_to_number): Don't assume fixnums fit in int.
13738 (Frem): Don't assume arg is nonnegative.
13739 * dbusbind.c (xd_append_arg): Check for integers out of range.
13740 (Fdbus_call_method): Don't overflow the timeout int.
13741 (extract_signed, extract_unsigned): New functions.
13742 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13743 (xd_get_connection_references): Return ptrdiff_t, not int.
13744 All uses changed.
13745 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13746 (xd_read_message_1):
13747 Use int, not unsigned, where the dbus API uses int.
13748 (Fdbus_message_internal): Don't overflow mtype.
13749 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13750 * dired.c (directory_files_internal, file_name_completion, scmp)
13751 (file_name_completion_stat):
13752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13753 (file_name_completion): Don't overflow matchcount.
13754 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13755 * dispextern.h: Adjust decls to match defn changes elsewhere.
13756 (struct text_pos, struct glyph, struct bidi_saved_info)
13757 (struct bidi_string_data, struct bidi_it, struct composition_it)
13758 (struct it):
13759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13760 (struct display_pos, struct composition_it, struct it):
13761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13762 * dispnew.c (increment_matrix_positions)
13763 (increment_row_positions, mode_line_string)
13764 (marginal_area_string):
13765 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13766 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13767 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13768 (duration_to_sec_usec): New function, to check for overflow better.
13769 (Fsleep_for, sit_for): Use it.
13770 * doc.c (get_doc_string, store_function_docstring):
13771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13772 (get_doc_string, Fsnarf_documentation):
13773 Use int, not EMACS_INT, where int is wide enough.
13774 (get_doc_string):
13775 Use SAFE_ALLOCA, not alloca.
13776 Check for overflow when converting EMACS_INT to off_t.
13777 * doprnt.c (doprnt):
13778 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13779 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13780 Don't assume uid_t fits into fixnum.
13781 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13782 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13783 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13784 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13785 (general_insert_function)
13786 (Finsert_char, make_buffer_string, make_buffer_string_both)
13787 (update_buffer_properties, Fbuffer_substring)
13788 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13789 (Fsubst_char_in_region, check_translation)
13790 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13791 (transpose_markers, Ftranspose_regions):
13792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13793 (clip_to_bounds): Move to lisp.h as an inline function).
13794 (Fconstrain_to_field): Don't assume integers are nonnegative.
13795 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13796 (Fsubst_char_in_region, Fsave_restriction):
13797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13798 (Femacs_pid): Don't assume pid_t fits into fixnum.
13799 (lo_time): Use int, not EMACS_INT, when int suffices.
13800 (lisp_time_argument): Check for usec out of range.
13801 (Fencode_time): Don't assume fixnum fits in int.
13802 (Fuser_login_name, Fuser_full_name): Signal an error
13803 if a uid argument is out of range, rather than relying on
13804 undefined behavior.
13805 (Fformat_time_string): Remove now-unnecessary check.
13806 lisp_time_argument checks for out-of-range usec now.
13807 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13808 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13809 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13810 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13811 (init_cmdargs, Fdump_emacs):
13812 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13813 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13814 the bottom (typically) 32 bits of the fixnum.
13815 * eval.c (specpdl_size, call_debugger):
13816 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13817 (when_entered_debugger, Fbacktrace_debug):
13818 Don't assume fixnum can fit in int.
13819 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13820 the object just before a buffer; this is not portable.
13821 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13822 (grow_specpdl, unbind_to):
13823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13824 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13825 (grow_specpdl): Simplify allocation by using xpalloc.
13826 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13827 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13828 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13829 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13830 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13831 (a_write, e_write):
13832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13833 (Fcopy_file, non_regular_nbytes, read_non_regular)
13834 (Finsert_file_contents):
13835 Use int, not EMACS_INT, where int is wide enough.
13836 (READ_BUF_SIZE): Verify that it fits in int.
13837 (Finsert_file_contents): Check that counts are in proper range,
13838 rather than assuming fixnums fit into ptrdiff_t etc.
13839 Don't assume fixnums fit into int.
13840 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13841 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13842 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13843 (string_char_to_byte, string_byte_to_char)
13844 (string_make_multibyte, string_to_multibyte)
13845 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13846 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13847 (substring_both, Fdelete, internal_equal, Ffillarray)
13848 (Fclear_string, mapcar1)
13849 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13850 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13851 (larger_vector, make_hash_table, maybe_resize_hash_table)
13852 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13853 (Fmaphash, secure_hash):
13854 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13855 (concat): Check for string index and length overflow.
13856 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13857 (Frequire):
13858 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13859 (larger_vector): New API (vec, incr_min, size_max) replaces old
13860 one (vec, new_size, init). This catches size overflow.
13861 INIT was removed because it was always Qnil.
13862 All callers changed.
13863 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13864 the upper bound on a hash table index size.
13865 (make_hash_table, maybe_resize_hash_table): Use it.
13866 (secure_hash): Computer start_byte and end_byte only after
13867 they're known to be in ptrdiff_t range.
13868 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13869 (Ffont_get_glyphs, Ffont_at):
13870 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13871 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13872 (Flist_fonts, Fopen_font):
13873 Don't assume fixnum can fit in int.
13874 (check_gstring): Don't assume index can fit in int.
13875 (font_match_p): Check that fixnum is a character, not a nonnegative
13876 fixnum, since the later code needs to stuff it into an int.
13877 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13878 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13879 conversion overflow issues.
13880 (Fopen_font): Check for integer out of range.
13881 (Ffont_get_glyphs): Don't assume index can fit in int.
13882 * font.h: Adjust decls to match defn changes elsewhere.
13883 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13884 integer overflow.
13885 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13886 printmax_t, where ptrdiff_t is wide enough.
13887 (Finternal_char_font):
13888 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13889 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13890 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13891 (Fset_frame_position, x_set_frame_parameters)
13892 (x_set_line_spacing, x_set_border_width)
13893 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13894 Check that fixnums are in proper range for system types.
13895 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13897 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13898 Use SAFE_ALLOCA_LISP, not alloca.
13899 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13900 intptr_t is wide enough.
13901 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13902 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13903 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13904 Check for fixnum out of range.
13905 * ftfont.c (ftfont_list): Don't assume index fits in int.
13906 Check that fixnums are in proper range for system types.
13907 (ftfont_shape_by_flt):
13908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13909 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13910 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13911 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13912 Check that fixnums are in proper range for system types.
13913 * gnutls.h: Adjust decls to match defn changes elsewhere.
13914 * gtkutil.c (xg_dialog_run):
13915 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13916 (update_frame_tool_bar):
13917 Check that fixnums are in proper range for system types.
13918 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13919 (lookup_image): Check that fixnums are in range for system types.
13920 * indent.c (last_known_column, last_known_column_point):
13921 (current_column_bol_cache):
13922 (skip_invisible, current_column, check_display_width):
13923 (check_display_width, scan_for_column, current_column_1)
13924 (Findent_to, Fcurrent_indentation, position_indentation)
13925 (indented_beyond_p, Fmove_to_column, compute_motion):
13926 (Fcompute_motion, Fvertical_motion):
13927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13928 (last_known_column_modified): Use EMACS_INT, not int.
13929 (check_display_width):
13930 (Fcompute_motion):
13931 Check that fixnums and floats are in proper range for system types.
13932 (compute_motion): Don't assume index or fixnum fits in int.
13933 (compute_motion, Fcompute_motion):
13934 Use int, not EMACS_INT, when it is wide enough.
13935 (vmotion): Omit local var start_hpos that is always 0; that way
13936 we don't need to worry about overflow in expressions involving it.
13937 * indent.h: Adjust decls to match defn changes elsewhere.
13938 (struct position):
13939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13940 Use int, not EMACS_INT, where int is wide enough.
13941 Remove unused members ovstring_chars_done and tab_offset;
13942 all uses removed.
13943 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13944 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13945 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13946 (make_gap, copy_text, insert, insert_and_inherit)
13947 (insert_before_markers, insert_before_markers_and_inherit)
13948 (insert_1, count_combining_before, count_combining_after)
13949 (insert_1_both, insert_from_string)
13950 (insert_from_string_before_markers, insert_from_string_1)
13951 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13952 (adjust_after_replace, adjust_after_insert, replace_range)
13953 (replace_range_2, del_range, del_range_1, del_range_byte)
13954 (del_range_both, del_range_2, modify_region)
13955 (prepare_to_modify_buffer, signal_before_change)
13956 (signal_after_change, Fcombine_after_change_execute):
13957 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13958 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13959 (balance_an_interval, split_interval_right, split_interval_left)
13960 (find_interval, next_interval, update_interval)
13961 (adjust_intervals_for_insertion, delete_node, delete_interval)
13962 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13963 (static_offset_intervals, offset_intervals)
13964 (merge_interval_right, merge_interval_left, make_new_interval)
13965 (graft_intervals_into_buffer, temp_set_point_both)
13966 (temp_set_point, set_point, adjust_for_invis_intang)
13967 (set_point_both, move_if_not_intangible, get_property_and_range)
13968 (get_local_map, copy_intervals, copy_intervals_to_string)
13969 (compare_string_intervals, set_intervals_multibyte_1):
13970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13971 * intervals.h: Adjust decls to match defn changes elsewhere.
13972 (struct interval):
13973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13974 * keyboard.c (this_command_key_count, this_single_command_key_start)
13975 (before_command_key_count, before_command_echo_length, echo_now)
13976 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13977 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13978 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13979 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13980 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13981 (last_non_minibuf_size, last_point_position, echo_truncate)
13982 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13983 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13984 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13985 (stuff_buffered_input):
13986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13987 (last_auto_save, command_loop_1, read_char):
13988 Use EMACS_INT, not int, to avoid integer overflow.
13989 (record_char): Avoid overflow in total_keys computation.
13990 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13991 * keyboard.h: Adjust decls to match defn changes elsewhere.
13992 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13993 (Fkey_description, Fdescribe_vector, Flookup_key):
13994 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13995 (click_position): New function, to check that positions are in range.
13996 (Fcurrent_active_maps):
13997 (describe_command):
13998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13999 (Faccessible_keymaps, Fkey_description):
14000 (preferred_sequence_p):
14001 Don't assume fixnum can fit into int.
14002 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
14003 Check for integer overflow in size calculations.
14004 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
14005 avoid mishandling large integers.
14006 * lisp.h: Adjust decls to match defn changes elsewhere.
14007 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
14008 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
14009 (struct Lisp_Marker):
14010 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14011 (clip_to_bounds): Now an inline function, moved here from editfns.c.
14012 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
14013 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
14014 All callers changed.
14015 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
14016 Assume the arg has valid form, since it always does.
14017 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
14018 unsigned integer system type.
14019 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
14020 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
14021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14022 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
14023 (duration_to_sec_usec): New decl.
14024 * lread.c (read_from_string_index, read_from_string_index_byte)
14025 (read_from_string_limit, readchar, unreadchar, openp)
14026 (read_internal_start, read1, oblookup):
14027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14028 (Fload, readevalloop, Feval_buffer, Feval_region):
14029 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14030 (openp): Check for out-of-range argument to 'access'.
14031 (read1): Use int, not EMACS_INT, where int is wide enough.
14032 Don't assume fixnum fits into int.
14033 Fix off-by-one error that can read outside a buffer.
14034 (read_filtered_event): Use duration_to_sec_usec
14035 to do proper overflow checking on durations.
14036 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
14037 in size calculation.
14038 (Fexecute_kbd_macro):
14039 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14040 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
14041 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
14042 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
14043 (set_marker_both, set_marker_restricted_both, marker_position)
14044 (marker_byte_position, Fbuffer_has_markers_at):
14045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14046 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
14047 * menu.c (ensure_menu_items): Rename from grow_menu_items.
14048 It now merely ensures that the menu is large enough, without
14049 necessarily growing it, as this avoids some integer overflow issues.
14050 All callers changed.
14051 (keymap_panes, parse_single_submenu, Fx_popup_menu):
14052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14053 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
14054 Use SAFE_ALLOCA_LISP, not alloca.
14055 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
14056 to EMACS_INT. Check that fixnums are in proper range for system types.
14057 * minibuf.c (minibuf_prompt_width, string_to_object)
14058 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
14059 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
14060 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14061 (get_minibuffer, read_minibuf_unwind):
14062 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14063 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
14064 this simplifies overflow checking. All callers changed.
14065 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
14066 (Ftest_completion):
14067 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14068 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
14069 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
14070 Check that fixnums are in proper range for system types.
14071 (Fx_create_frame, Fx_show_tip):
14072 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14073 * nsfont.m (ns_findfonts, nsfont_list_family):
14074 Don't assume fixnum fits in long.
14075 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
14076 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14077 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
14078 wide enough.
14079 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
14080 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14081 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
14082 (PRINTDECLARE, PRINTPREPARE):
14083 (strout, print_string):
14084 (print, print_preprocess, print_check_string_charset_prop)
14085 (print_object):
14086 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14087 (PRINTDECLARE):
14088 (temp_output_buffer_setup, Fprin1_to_string, print_object):
14089 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14090 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
14091 (printchar, strout): Use xpalloc to catch size calculation overflow.
14092 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
14093 (print_error_message): Use SAFE_ALLOCA, not alloca.
14094 (print_object): Use int, not EMACS_INT, where int is wide enough.
14095 (print_depth, new_backquote_output, print_number_index):
14096 Use ptrdiff_t, not int, where int might not be wide enough.
14097 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
14098 (Fset_process_window_size, Fformat_network_address)
14099 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
14100 (sigchld_handler):
14101 Check that fixnums are in proper range for system types.
14102 (Fsignal_process): Simplify by avoiding a goto.
14103 Check for process-ids out of pid_t range rather than relying on
14104 undefined behavior.
14105 (process_tick, update_tick): Use EMACS_INT, not int.
14106 (Fformat_network_address, read_process_output, send_process)
14107 (Fprocess_send_region, status_notify):
14108 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14109 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
14110 (wait_reading_process_output, read_process_output, exec_sentinel):
14111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14112 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
14113 (Faccept_process_output): Use duration_to_sec_usec to do proper
14114 overflow checking on durations.
14115 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
14116 Don't assume pid_t fits in int.
14117 * process.h (struct Lisp_Process): Members tick and update_tick
14118 are now of type EMACS_INT, not int.
14119 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
14120 configured --with-wide-int.
14121 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
14122 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
14123 * search.c (looking_at_1, string_match_1):
14124 (fast_string_match, fast_c_string_match_ignore_case)
14125 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
14126 (scan_newline, find_before_next_newline, search_command)
14127 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
14128 (set_search_regs, wordify):
14129 (Freplace_match):
14130 (Fmatch_data):
14131 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14132 (string_match_1, search_buffer, set_search_regs):
14133 (Fmatch_data):
14134 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14135 (wordify): Check for overflow in size calculation.
14136 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
14137 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
14138 Check that fixnums are in proper range for system types.
14139 * sound.c (struct sound_device)
14140 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
14141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14142 (Fplay_sound_internal):
14143 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14144 * syntax.c (struct lisp_parse_state, find_start_modiff)
14145 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
14146 (Fparse_partial_sexp):
14147 Don't assume fixnums can fit in int.
14148 (struct lisp_parse_state, find_start_pos, find_start_value)
14149 (find_start_value_byte, find_start_begv)
14150 (update_syntax_table, char_quoted, dec_bytepos)
14151 (find_defun_start, prev_char_comend_first, back_comment):
14152 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
14153 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
14154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14155 (Finternal_describe_syntax_value): Check that match_lisp is a
14156 character, not an integer, since the code stuffs it into int.
14157 (scan_words, scan_sexps_forward):
14158 Check that fixnums are in proper range for system types.
14159 (Fforward_word):
14160 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14161 (scan_sexps_forward):
14162 Use CHARACTERP, not INTEGERP, since the value must fit into int.
14163 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
14164 * syntax.h: Adjust decls to match defn changes elsewhere.
14165 (struct gl_state_s):
14166 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14167 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
14168 MOST_POSITIVE_FIXNUM.
14169 * sysdep.c (wait_for_termination_1, wait_for_termination)
14170 (interruptible_wait_for_termination, mkdir):
14171 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
14172 (emacs_read, emacs_write):
14173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14174 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
14175 and double all fit in int.
14176 * term.c (set_tty_color_mode):
14177 Check that fixnums are in proper range for system types.
14178 * termhooks.h (struct input_event):
14179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14180 * textprop.c (validate_interval_range, interval_of)
14181 (Fadd_text_properties, set_text_properties_1)
14182 (Fremove_text_properties, Fremove_list_of_text_properties)
14183 (Ftext_property_any, Ftext_property_not_all)
14184 (copy_text_properties, text_property_list, extend_property_ranges)
14185 (verify_interval_modification):
14186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14187 (Fnext_single_char_property_change)
14188 (Fprevious_single_char_property_change):
14189 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14190 (copy_text_properties):
14191 Check for integer overflow in index calculation.
14192 * undo.c (last_boundary_position, record_point, record_insert)
14193 (record_delete, record_marker_adjustment, record_change)
14194 (record_property_change):
14195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14196 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
14197 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14198 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
14199 (Fx_hide_tip, Fx_file_dialog):
14200 * w32menu.c (set_frame_menubar):
14201 Use ptrdiff_t, not int, for consistency with rest of code.
14202 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
14203 (select_window, Fdelete_other_windows_internal)
14204 (window_scroll_pixel_based, window_scroll_line_based)
14205 (Frecenter, Fset_window_configuration):
14206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14207 (Fset_window_hscroll, run_window_configuration_change_hook)
14208 (set_window_buffer, temp_output_buffer_show, scroll_command)
14209 (Fscroll_other_window, Frecenter):
14210 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14211 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
14212 Don't assume fixnum fits in int.
14213 (Fset_window_scroll_bars):
14214 Check that fixnums are in proper range for system types.
14215 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
14216 (string_pos, c_string_pos, number_of_chars, init_iterator)
14217 (in_ellipses_for_invisible_text_p, init_from_display_pos)
14218 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
14219 (compute_display_string_end, handle_face_prop)
14220 (face_before_or_after_it_pos, handle_invisible_prop)
14221 (handle_display_prop, handle_display_spec, handle_single_display_spec)
14222 (display_prop_intangible_p, string_buffer_position_lim)
14223 (string_buffer_position, handle_composition_prop, load_overlay_strings)
14224 (get_overlay_strings_1, get_overlay_strings)
14225 (iterate_out_of_display_property, forward_to_next_line_start)
14226 (back_to_previous_visible_line_start, reseat, reseat_to_string)
14227 (get_next_display_element, set_iterator_to_next)
14228 (get_visually_first_element, compute_stop_pos_backwards)
14229 (handle_stop_backwards, next_element_from_buffer)
14230 (move_it_in_display_line_to, move_it_in_display_line)
14231 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14232 (add_to_log, message_dolog, message_log_check_duplicate)
14233 (message2, message2_nolog, message3, message3_nolog
14234 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
14235 (current_message_1, truncate_echo_area, truncate_message_1)
14236 (set_message, set_message_1, store_mode_line_noprop)
14237 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
14238 (text_outside_line_unchanged_p, check_point_in_composition)
14239 (reconsider_clip_changes)
14240 (redisplay_internal, set_cursor_from_row, try_scrolling)
14241 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
14242 (redisplay_window, find_last_unchanged_at_beg_row)
14243 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
14244 (trailing_whitespace_p, find_row_edges, display_line)
14245 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
14246 (display_mode_element, store_mode_line_string)
14247 (pint2str, pint2hrstr, decode_mode_spec)
14248 (display_count_lines, display_string, draw_glyphs)
14249 (x_produce_glyphs, x_insert_glyphs)
14250 (rows_from_pos_range, mouse_face_from_buffer_pos)
14251 (fast_find_string_pos, mouse_face_from_string_pos)
14252 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14253 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14254 (safe_call, init_from_display_pos, handle_fontified_prop)
14255 (handle_single_display_spec, load_overlay_strings)
14256 (with_echo_area_buffer, setup_echo_area_for_printing)
14257 (display_echo_area, echo_area_display)
14258 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
14259 (update_tool_bar, hscroll_window_tree, redisplay_internal)
14260 (redisplay_window, dump_glyph_row, display_mode_line)
14261 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
14262 (handle_display_spec, display_prop_string_p):
14263 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14264 (handle_single_display_spec, build_desired_tool_bar_string)
14265 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
14266 (get_specified_cursor_type):
14267 Check that fixnums are in proper range for system types.
14268 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
14269 (Flookup_image_map):
14270 Don't assume fixnums fit in int.
14271 (compare_overlay_entries):
14272 Avoid mishandling comparisons due to subtraction overflow.
14273 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
14274 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
14275 (handle_tool_bar_click):
14276 Use int, not unsigned, since we prefer signed and the signedness
14277 doesn't matter here.
14278 (get_next_display_element, next_element_from_display_vector):
14279 Use int, not EMACS_INT, when int is wide enough.
14280 (start_hourglass): Use duration_to_sec_usec to do proper
14281 overflow checking on durations.
14282 * xfaces.c (Fbitmap_spec_p):
14283 Check that fixnums are in proper range for system types.
14284 (compare_fonts_by_sort_order):
14285 Avoid mishandling comparisons due to subtraction overflow.
14286 (Fx_family_fonts, realize_basic_faces):
14287 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14288 (Fx_family_fonts):
14289 Don't assume fixnum fits in int.
14290 Use SAFE_ALLOCA_LISP, not alloca.
14291 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
14292 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
14293 (face_at_buffer_position, face_for_overlay_string)
14294 (face_at_string_position):
14295 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14296 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
14297 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
14298 (Fx_show_tip):
14299 Check that fixnums are in proper range for system types.
14300 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
14301 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
14302 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14303 (Fx_change_window_property): Don't assume fixnums fit in int.
14304 * xfont.c (xfont_chars_supported):
14305 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14306 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
14307 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
14308 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14309 * xml.c (parse_region):
14310 * xrdb.c (magic_file_p):
14311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
14312 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
14313 (x_get_local_selection, x_reply_selection_request)
14314 (x_handle_selection_request, wait_for_property_change):
14315 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14316 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
14317 short is wide enough.
14318 (x_send_client_event): Don't assume fixnum fits in int.
14319 * xterm.c (x_x_to_emacs_modifiers):
14320 Don't assume EMACS_INT overflows nicely into int.
14321 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
14322 may come from Lisp.
14323 (handle_one_xevent): NATNUMP can eval its arg twice.
14324 (x_connection_closed):
14325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
14326 * xterm.h: Adjust decls to match defn changes elsewhere.
14327 (struct scroll_bar): Use struct vectorlike_header
14328 rather than rolling our own approximation.
14329 (SCROLL_BAR_VEC_SIZE): Remove; not used.
14330
143312012-05-25 Glenn Morris <rgm@gnu.org>
14332
14333 * lisp.mk (lisp): Update for more files being compiled now.
14334
143352012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
14336
14337 * lread.c: Remove `read_pure' which makes no difference.
14338 (read_pure): Remove var.
14339 (unreadpure): Remove function.
14340 (readevalloop): Don't call read_list with -1 flag.
14341 (read1, read_vector): Don't test read_pure any more.
14342 (read_list): Simplify.
14343
14344 * fileio.c, character.h: Minor style tweaks.
14345
143462012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
14347
14348 * window.h (clip_changed): Remove useless declaration.
14349
143502012-05-22 Juanma Barranquero <lekktu@gmail.com>
14351
14352 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
14353 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
14354
143552012-05-22 Paul Eggert <eggert@cs.ucla.edu>
14356
14357 Remove src/m/*.
14358 This directory predates autoconf and is no longer needed nowadays.
14359 Move its few remaining bits of functionality to where they're needed.
14360 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
14361 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
14362 * m/template.h: Remove.
14363 * Makefile.in (M_FILE): Remove. All uses removed.
14364 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
14365 * lisp.h (USE_LSB_TAG):
14366 * mem-limits.h (EXCEEDS_LISP_PTR):
14367 Use VAL_MAX, not VALBITS, in #if.
14368 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
14369 (EMACS_UINT): Define unconditionally now.
14370 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
14371 (BITS_PER_EMACS_INT): New constants, replacing
14372 what used to be in config.h, but not useful in #if.
14373 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
14374 define them any more.
14375 (VAL_MAX): New macro.
14376 (VALMASK): Use it.
14377 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
14378 BITS_PER_EMACS_INT, in #if.
14379 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
14380 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
14381 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
14382 * s/ms-w32.h (DATA_START):
14383 Move here from removed file m/intel386.h.
14384 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
14385 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
14386
143872012-05-21 Paul Eggert <eggert@cs.ucla.edu>
14388
14389 Assume C89 or later.
14390 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
14391 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
14392 (xrealloc):
14393 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
14394 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
14395 * textprop.c, tparam.c (NULL): Remove.
14396 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
14397 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
14398 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
14399 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14400 * xterm.c (input_signal_count): Assume volatile works.
14401
144022012-05-21 Ken Brown <kbrown@cornell.edu>
14403
14404 * xgselect.c (xg_select): Fix first argument in call to 'select'
14405 (bug#11508).
14406
144072012-05-20 Ken Brown <kbrown@cornell.edu>
14408
14409 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
14410 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
14411
144122012-05-19 Ken Brown <kbrown@cornell.edu>
14413
14414 * xfns.c (x_in_use): Remove `static' qualifier.
14415 * xterm.h (x_in_use): Declare.
14416 * xgselect.c: Include xterm.h.
14417 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14418 and `display_arg' (bug#9754).
14419
144202012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14421
14422 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14423
14424 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14425 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14426
144272012-05-18 Eli Zaretskii <eliz@gnu.org>
14428
14429 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14430
14431 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
14432 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
14433
14434 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14435 reference to image_cache->refcount.
14436 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14437
144382012-05-17 Juri Linkov <juri@jurta.org>
14439
14440 * search.c (Fword_search_regexp, Fword_search_backward)
14441 (Fword_search_forward, Fword_search_backward_lax)
14442 (Fword_search_forward_lax): Move functions to isearch.el
14443 (bug#10145, bug#11381).
14444
144452012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14446
14447 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14448
144492012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14450
14451 * lread.c (init_obarray): Declare Qt and Qnil as special.
14452
144532012-05-14 Glenn Morris <rgm@gnu.org>
14454
14455 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
14456 Put "libexec" before "bin", for the sake of init_callproc_1.
14457
144582012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14459
14460 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14461
14462 * unexaix.c: Port to more-recent AIX compilers.
14463 (report_error, report_error_1, make_hdr, copy_sym)
14464 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14465 Make arguments const char *, not char *, to avoid violations of C
14466 standard and to fix some AIX warnings reported by Gilles Pion.
14467
144682012-05-14 Eli Zaretskii <eliz@gnu.org>
14469
14470 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14471 already have overlays loaded.
14472 (handle_single_display_spec): Before returning without displaying
14473 fringe bitmap, synchronize the bidi iterator with the main display
14474 iterator, by calling iterate_out_of_display_property.
14475 (iterate_out_of_display_property): Detect buffer iteration by
14476 testing that it->string is a Lisp string.
14477 (get_next_display_element): When the current object is exhausted,
14478 and there's something on it->stack, call set_iterator_to_next to
14479 proceed with what's on the stack, instead of returning zero.
14480 (set_iterator_to_next): If called at the end of a Lisp string,
14481 proceed to consider_string_end without incrementing string
14482 position. Don't increment display vector index past the end of
14483 the display vector. (Bug#11417)
14484 (pos_visible_p): Don't report a position visible when move_it_to
14485 stopped at the last line of window, which happens to be scanned
14486 backwards by the bidi iteration. (Bug#11464)
14487
144882012-05-14 Eli Zaretskii <eliz@gnu.org>
14489
14490 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14491 and right-margin display specs even if the spec is invalid or we
14492 are on a TTY, and thus unable to display on the fringes.
14493 That's because the text with the property will not be displayed anyway,
14494 so we need to signal to the caller that this is a "replacing"
14495 display spec. This fixes display when the spec is invalid or we
14496 are on a TTY.
14497
144982012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14499
14500 * unexaix.c (make_hdr): Fix typo in prototype.
14501 This bug broke the build on AIX. Problem reported by Gilles Pion.
14502
145032012-05-14 Michael Albinus <michael.albinus@gmx.de>
14504
14505 * keyboard.c (kbd_buffer_get_event): Read special events also in
14506 batch mode. (Bug#11415)
14507
145082012-05-12 Glenn Morris <rgm@gnu.org>
14509
14510 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14511
145122012-05-12 Eli Zaretskii <eliz@gnu.org>
14513
14514 * lisp.mk (lisp): Add newcomment.elc.
14515
145162012-05-12 Glenn Morris <rgm@gnu.org>
14517
14518 * Makefile.in (MKDIR_P): New, set by configure.
14519 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14520
145212012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14522
14523 Remove unused function hourglass_started.
14524 * dispextern.h (hourglass_started):
14525 * w32fns.c (hourglass_started):
14526 * xdisp.c (hourglass_started): Remove.
14527
145282012-05-10 Juanma Barranquero <lekktu@gmail.com>
14529
14530 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14531 Update dependencies.
14532
145332012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14534
14535 * xgselect.c (xg_select): Put maxfds+1 into a var.
14536 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14537
14538 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14539
145402012-05-10 Dave Abrahams <dave@boostpro.com>
14541
14542 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14543 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14544
145452012-05-09 Michael Albinus <michael.albinus@gmx.de>
14546
14547 * dbusbind.c (xd_registered_buses): New internal Lisp object.
14548 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
14549 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14550 Initialize xd_registered_buses.
14551
145522012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14553
14554 Untag more efficiently if USE_LSB_TAG.
14555 This is based on a proposal by YAMAMOTO Mitsuharu in
14556 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14557 For an admittedly artificial (nth 8000 longlist) benchmark on
14558 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14559 Emacs's overall text size by 1%.
14560 * lisp.h (XUNTAG): New macro.
14561 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14562 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14563 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14564 * eval.c (Fautoload):
14565 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14566 * frame.h (XFRAME): Use XUNTAG.
14567
14568 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14569 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14570 Remove unportable assumptions about print widths of types like
14571 dbus_uint32_t.
14572 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14573 intptr_t when converting between pointer and integer, to avoid GCC
14574 warnings about wrong width.
14575
145762012-05-09 Eli Zaretskii <eliz@gnu.org>
14577
14578 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14579 stack for each reader_thread, instead of defaulting to 8MB
14580 determined by the linker. This avoids failures in creating
14581 subprocesses on Windows 7, see the discussion in this thread:
14582 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14583
145842012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14585
14586 Fix up display of the *Minibuf-0* buffer in the mini window.
14587 * keyboard.c (read_char): Don't clear the echo area if there's no
14588 message to clear.
14589 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
14590 contents of *Minibuf-0*) if there's no message displayed in its stead.
14591
145922012-05-07 Michael Albinus <michael.albinus@gmx.de>
14593
14594 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14595 batch mode.
14596
145972012-05-06 Chong Yidong <cyd@gnu.org>
14598
14599 * lisp.mk (lisp): Update.
14600
146012012-05-05 Jim Meyering <meyering@redhat.com>
14602
14603 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14604
146052012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14606
14607 * data.c (PUT_ERROR): New macro.
14608 (syms_of_data): Use it. Add new error type `user-error'.
14609 * undo.c (user_error): New function.
14610 (Fprimitive_undo): Use it.
14611 * print.c (print_error_message): Adjust print style for `user-error'.
14612 * keyboard.c (user_error): New function.
14613 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14614
146152012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14616
14617 Do not limit current-time-string to years 1000..9999.
14618 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14619 (Fcurrent_time_string): Support any year that is supported by the
14620 underlying localtime representation. Don't use asctime, as it
14621 has undefined behavior for years outside the range -999..9999.
14622
146232012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14624
14625 Fix race conditions involving setenv, gmtime, localtime, asctime.
14626 Without this fix, interrupts could mess up code that uses these
14627 nonreentrant functions, since setting TZ invalidates existing
14628 tm_zone or tzname values, and since most of these functions return
14629 pointers to static storage.
14630 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14631 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14632 Grow the critical sections to include not just invoking
14633 localtime/gmtime, but also accessing these functions' results
14634 including their tm_zone values if any, and any related TZ setting.
14635 (format_time_string): Last arg is now struct tm *, not struct tm **,
14636 so that the struct tm is saved in the critical section.
14637 All callers changed. Simplify allocation of initial buffer, partly
14638 motivated by the fact that memory allocation needs to be outside
14639 the critical section.
14640
146412012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14642
14643 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14644 with RESET_INTERVAL.
14645
14646 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14647 Remove duplicated buffer name initialization.
14648
146492012-05-02 Jim Meyering <jim@meyering.net>
14650
14651 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14652
14653 * xfns.c (x_window): Use xstrdup (Bug#11375).
14654
146552012-05-02 Eli Zaretskii <eliz@gnu.org>
14656
14657 * xdisp.c (pos_visible_p): If already at a newline from the
14658 display string before the 'while' loop, don't walk back the glyphs
14659 from it3.glyph_row. Solves assertion violation when the display
14660 string begins with a newline (egg.el). (Bug#11367)
14661
146622012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14663
14664 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14665 Move to simple.el.
14666
146672012-05-01 Glenn Morris <rgm@gnu.org>
14668
14669 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14670 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14671 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14672 All were removed before 23.1.
14673
14674 * dispnew.c: Remove HAVE_LIBNCURSES test;
14675 it is always true on relevant platforms.
14676
14677 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14678 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14679
14680 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14681
146822012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14683
14684 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14685 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14686 Remove.
14687
146882012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14689
14690 Do not avoid creating empty evaporating overlays (Bug#9642).
14691 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14692 That is, do not delete an evaporating overlay if it becomes
14693 empty after its bounds are adjusted to fit within its buffer.
14694 This fix caused other problems, and I'm reverting it until we get
14695 to the bottom of them.
14696
146972012-04-27 Chong Yidong <cyd@gnu.org>
14698
14699 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14700
147012012-04-27 Eli Zaretskii <eliz@gnu.org>
14702
14703 * xdisp.c (pos_visible_p): If the window start position is beyond
14704 ZV, start the display from buffer beginning. Prevents assertion
14705 violation in init_iterator when the minibuffer window is scrolled
14706 via the scroll bar.
14707
14708 * window.c (window_scroll_pixel_based): Likewise.
14709
147102012-04-27 Chong Yidong <cyd@gnu.org>
14711
14712 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14713
147142012-04-27 Glenn Morris <rgm@gnu.org>
14715
14716 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14717 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14718
147192012-04-27 Eli Zaretskii <eliz@gnu.org>
14720
14721 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14722 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14723
147242012-04-26 Eli Zaretskii <eliz@gnu.org>
14725
14726 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14727 display element, check also the underlying string or buffer
14728 character. (Bug#11341)
14729
14730 * w32menu.c: Include w32heap.h.
14731 (add_menu_item): If the call to AppendMenuW (via
14732 unicode_append_menu) fails, disable Unicode menus only if we are
14733 running on Windows 9X/Me.
14734
147352012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14736
14737 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14738 (xgetint): Add missing shift for LSB tags.
14739
147402012-04-24 Martin Rudalics <rudalics@gmx.at>
14741
14742 * keyboard.c (read_char): Don't wipe echo area for select window
14743 events: These might get delayed via `mouse-autoselect-window'
14744 (Bug#11304).
14745
147462012-04-24 Juanma Barranquero <lekktu@gmail.com>
14747
14748 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14749 manipulation of :loaded-from data.
14750
147512012-04-23 Juanma Barranquero <lekktu@gmail.com>
14752
14753 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14754 now a cons (bug#11311).
14755
147562012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14757
14758 Do not create empty overlays with the evaporate property (Bug#9642).
14759 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14760 if it becomes empty after its bounds are adjusted to fit within
14761 its buffer. Without this fix, in a nonempty buffer (let ((o
14762 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14763 yields an empty overlay that has the evaporate property, which is
14764 not supposed to happen.
14765
14766 Fix minor GTK3 problems found by static checking.
14767 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14768 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14769 (struct _EmacsFixedClass, emacs_fixed_get_type):
14770 Move decls here from emacsgtkfixed.h, since they needn't be public.
14771 (emacs_fixed_get_type): Now static.
14772 (emacs_fixed_class_init): Omit unused local.
14773 (emacs_fixed_child_type): Remove; unused.
14774 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14775 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14776 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14777 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14778 (EMACS_FIXED_GET_CLASS): Remove; unused.
14779 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14780
14781 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14782 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14783
147842012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14785
14786 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14787 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14788 (__malloc_size_t, __malloc_ptrdiff_t):
14789 Remove. All uses removed, replaced by the definiens if needed,
14790 since we can assume C89 or better now.
14791 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14792 (protect_malloc_state, align, get_contiguous_space)
14793 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14794 (malloc_atfork_handler_child, malloc_enable_thread)
14795 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14796 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14797 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14798 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14799 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14800 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14801 Define using prototypes, not old style.
14802 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14803 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14804 (align): Don't assume that signed integer overflow wraps around.
14805 Omit unused local var.
14806 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14807 (_free_internal_nolock, memalign, mallochook, reallochook):
14808 Omit no-longer-needed casts.
14809 (valloc): Use getpagesize, not __getpagesize.
14810 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14811 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14812
14813 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14814
148152012-04-22 Michael Albinus <michael.albinus@gmx.de>
14816
14817 Move functions from C to Lisp. Make non-blocking method calls
14818 the default. Implement further D-Bus standard interfaces.
14819
14820 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14821 (QCdbus_request_name_allow_replacement)
14822 (QCdbus_request_name_replace_existing)
14823 (QCdbus_request_name_do_not_queue)
14824 (QCdbus_request_name_reply_primary_owner)
14825 (QCdbus_request_name_reply_in_queue)
14826 (QCdbus_request_name_reply_exists)
14827 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14828 (QCdbus_registered_serial, QCdbus_registered_method)
14829 (QCdbus_registered_signal): New Lisp objects.
14830 (XD_DEBUG_MESSAGE): Use sizeof.
14831 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14832 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14833 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14834 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14835 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14836 (xd_signature, xd_append_arg): Allow float for integer types.
14837 (xd_get_connection_references): New function.
14838 (xd_get_connection_address): Rename from xd_initialize.
14839 Return cached address.
14840 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14841 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14842 level.
14843 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14844 Return number of refcounts.
14845 (Fdbus_get_unique_name): Make stronger parameter check.
14846 (Fdbus_message_internal): New defun.
14847 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14848 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14849 (Fdbus_send_signal, Fdbus_register_service)
14850 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14851 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14852 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14853 (Vdbus_compiled_version, Vdbus_runtime_version)
14854 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14855 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14856 (Vdbus_message_type_signal): New defvars.
14857 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14858 Adapt docstring.
14859
148602012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14861
14862 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14863 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14864 Do not assume ptrdiff_t is the same width as 'int'.
14865
14866 * alloc.c: Handle unusual debugging option combinations.
14867 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14868 since the two debugging options are incompatible.
14869 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14870 is defined.
14871 (mem_init, mem_insert, mem_insert_fixup):
14872 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14873 (NEED_MEM_INSERT): Remove; no longer needed.
14874
148752012-04-22 Leo Liu <sdl.web@gmail.com>
14876
14877 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14878
148792012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14880
14881 * sysdep.c [__FreeBSD__]: Minor cleanups.
14882 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14883 Use Emacs indenting style more consistently. Avoid some casts.
14884 Use 'double' consistently rather than mixing 'float' and 'double'.
14885
148862012-04-21 Eduard Wiebe <usenet@pusto.de>
14887
14888 * sysdep.c (list_system_processes, system_process_attributes):
14889 Add implementation for FreeBSD (Bug#5243).
14890
148912012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14892
14893 * lisp.mk (lisp): Update.
14894
148952012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14896
14897 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14898 It is never used otherwise.
14899
149002012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14901
14902 * print.c (print_preprocess): Only check print_depth if print-circle
14903 is nil.
14904 (print_object): Check for cycles even when print-circle is nil and
14905 print-gensym is t, but only check print_depth if print-circle is nil.
14906
149072012-04-20 Chong Yidong <cyd@gnu.org>
14908
14909 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14910 set the status to "failed" and ensure that sentinel is run.
14911
149122012-04-20 Glenn Morris <rgm@gnu.org>
14913
14914 * process.c (Fset_process_inherit_coding_system_flag)
14915 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14916 (Fmake_network_process, Fmake_serial_process): Doc fix.
14917
149182012-04-20 Eli Zaretskii <eliz@gnu.org>
14919
14920 * xdisp.c (string_buffer_position_lim): Limit starting position to
14921 BEGV.
14922 (set_cursor_from_row): If called for a mode-line or header-line
14923 row, return zero immediately.
14924 (try_cursor_movement): If inside continuation line, don't back up
14925 farther than the first row after the header line, if any.
14926 Don't consider the header-line row as "partially visible", even if
14927 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14928
149292012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14930
14931 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14932 (bug#11238).
14933
149342012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
149352012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14936
14937 configure: new option --enable-gcc-warnings (Bug#11207)
14938 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14939 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14940 (ALL_CFLAGS): Use new macros rather than old.
14941 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14942 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14943 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14944 -Wunused-result, -Wunused-variable. This should go away once
14945 the Emacs and Gnulib regex code is merged.
14946 (xmalloc, xrealloc): Now static.
14947
149482012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14949
14950 * dired.c (Fsystem_groups): Remove unused local.
14951
149522012-04-17 Glenn Morris <rgm@gnu.org>
14953
14954 * dired.c (Fsystem_users): Doc fix.
14955
149562012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14957
14958 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14959 (syms_of_dired): Add them.
14960
149612012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14962
14963 Fix minor alloc.c problems found by static checking.
14964 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14965 New extern decls, to avoid calling undeclared functions.
14966 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14967 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14968 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14969 (NEED_MEM_INSERT): New macro.
14970 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14971 Remove one incorrect comment and fix another.
14972
14973 Fix minor ralloc.c problems found by static checking.
14974 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14975 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14976 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14977 (r_alloc_sbrk): Now static.
14978
14979 Improve ralloc.c interface checking.
14980 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14981 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14982 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14983 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14984 [REL_ALLOC]: ... to here, to check interface.
14985 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14986 Remove decls. This fixes an "It stinks!".
14987
14988 * alloc.c (which_symbols): Fix alignment issue / type clash.
14989
149902012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14991
14992 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14993 (struct Lisp_Misc_Any): Likewise.
14994 (struct Lisp_Free): Likewise.
14995 * alloc.c (union aligned_Lisp_Symbol): Define.
14996 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14997 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14998 (union aligned_Lisp_Misc): Define.
14999 (MARKER_BLOCK_SIZE, struct marker_block): Use union
15000 aligned_Lisp_Misc instead of union Lisp_Misc.
15001 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
15002
150032012-04-14 Paul Eggert <eggert@cs.ucla.edu>
15004
15005 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
15006 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
15007 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
15008 * s/netbsd.h, s/sol2-6.h:
15009 Remove definition of GC_MARK_STACK, since the default now works.
15010 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
15011 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
15012 no longer the default.
15013 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
15014
150152012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
15016
15017 * lread.c (lisp_file_lexically_bound_p):
15018 Fix hang at ";-*-\n" (bug#11238).
15019
150202012-04-14 Eli Zaretskii <eliz@gnu.org>
15021
15022 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
15023 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
15024
150252012-04-14 Jan Djärv <jan.h.d@swipnet.se>
15026
15027 * nsterm.m (constrainFrameRect): Always constrain when there is only
15028 one screen (Bug#10962).
15029
150302012-04-13 Ken Brown <kbrown@cornell.edu>
15031
15032 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
15033
150342012-04-13 Reuben Thomas <rrt@sc3d.org>
15035
15036 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
15037
150382012-04-11 Daniel Colascione <dancol@dancol.org>
15039
15040 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
15041 against is gone. It's better to use vfork now so that when Cygwin
15042 gains a new, working vfork, we use it automatically (bug#10398).
15043
150442012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
15045
15046 * window.c (save_window_save): Obey window-point-insertion-type.
15047
150482012-04-11 Glenn Morris <rgm@gnu.org>
15049
15050 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
15051
150522012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
15053
15054 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
15055
150562012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
15057
15058 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
15059 (force_quit_count): New var.
15060 (handle_interrupt): Use it.
15061
150622012-04-10 Juanma Barranquero <lekktu@gmail.com>
15063
15064 * w32.c (w32_delayed_load): Record the full path of the library
15065 being loaded (bug#10424).
15066
150672012-04-09 Glenn Morris <rgm@gnu.org>
15068
15069 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
15070 not just in the obarray, before snarfing them. (Bug#11036)
15071
15072 * Makefile.in ($(leimdir)/leim-list.el):
15073 Pass EMACS rather than BUILT_EMACS.
15074
150752012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
15076
15077 * process.c (make_process):
15078 * process.h: Add integer `gnutls_handshakes_tried' member to
15079 process struct.
15080
15081 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
15082 Add convenience `GNUTLS_LOG2i' macro.
15083
15084 * gnutls.c (gnutls_log_function2i): Convenience log function.
15085 (emacs_gnutls_read): Use new log functions,
15086 `gnutls_handshakes_tried' process member, and
15087 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
15088 attempts per process (connection).
15089
150902012-04-09 Chong Yidong <cyd@gnu.org>
15091
15092 * eval.c (Fuser_variable_p, user_variable_p_eh)
15093 (lisp_indirect_variable): Functions deleted.
15094 (Fdefvar): Caller changed.
15095
15096 * callint.c (Finteractive, Fcall_interactively):
15097 * minibuf.c (Fread_variable): Callers changed.
15098
150992012-04-09 Eli Zaretskii <eliz@gnu.org>
15100
15101 * xdisp.c (set_cursor_from_row): If the display string appears in
15102 the buffer at position that is closer to point than the position
15103 after the display string, display the cursor on the first glyph of
15104 the display string. Fixes cursor display when a 'display' text
15105 property immediately follows invisible text. (Bug#11094)
15106
151072012-04-09 Paul Eggert <eggert@cs.ucla.edu>
15108
15109 composite.c: use 'double' consistently
15110 * composite.c (get_composition_id): Use 'double' consistently
15111 instead of converting 'float' to 'double' and vice versa; this is
15112 easier to understand and avoids a GCC warning.
15113
151142012-04-09 Glenn Morris <rgm@gnu.org>
15115
15116 * Makefile.in: Generate leim-list with bootstrap-emacs, in
15117 preparation for dumping it with emacs. (Bug#4789)
15118 (leimdir): New variable.
15119 ($(leimdir)/leim-list.el): New rule.
15120 (emacs$(EXEEXT)): Depend on leim-list.el.
15121
15122 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
15123 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
15124 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
15125
151262012-04-08 Andreas Schwab <schwab@linux-m68k.org>
15127
15128 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
15129 proper alignment.
15130
151312012-04-07 Juanma Barranquero <lekktu@gmail.com>
15132
15133 * xml.c (init_libxml2_functions) [WINDOWSNT]:
15134 Remove unused local variable.
15135
151362012-04-07 Paul Eggert <eggert@cs.ucla.edu>
15137
15138 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
15139 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
15140 (mark_memory): Mark Lisp_Objects only if pointers might hide in
15141 objects, as mark_maybe_pointer will catch them otherwise.
15142 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
15143 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
15144
151452012-04-07 Paul Eggert <eggert@cs.ucla.edu>
15146
15147 Fix typo that broke non-Windows builds.
15148 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
15149
151502012-04-07 Eli Zaretskii <eliz@gnu.org>
15151
15152 Support building on MS-Windows with libxml2.
15153
15154 * makefile.w32-in (OBJ2): Add xml.$(O).
15155 (GLOBAL_SOURCES): Add xml.c.
15156 ($(BLD)/xml.$(O)): New dependency list.
15157
15158 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
15159 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
15160 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
15161 [!WINDOWSNT]: New macros.
15162 (init_libxml2_functions, libxml2_loaded_p): New functions.
15163 (parse_region): Call fn_xmlCheckVersion instead of using the macro
15164 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
15165 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
15166 Calls xmlCleanupParser only if libxml2 was loaded (or statically
15167 linked in).
15168 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
15169 Call init_libxml2_functions before calling libxml2 functions.
15170 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
15171
15172 * emacs.c: Don't include libxml/parser.h.
15173 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
15174 xmlCleanupParser directly.
15175
15176 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
15177
151782012-04-07 Eli Zaretskii <eliz@gnu.org>
15179
15180 * indent.c (Fvertical_motion): If there is a display string at
15181 point, use it.vpos to compute how many lines to backtrack after
15182 move_it_to point. (Bug#11133)
15183
151842012-04-06 Eli Zaretskii <eliz@gnu.org>
15185
15186 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
15187 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
15188 about subtle differences between FETCH_CHAR* and STRING_CHAR*
15189 macros related to unification of CJK characters. For the details,
15190 see the discussion following the message here:
15191 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
15192
151932012-04-04 Chong Yidong <cyd@gnu.org>
15194
15195 * keyboard.c (Vdelayed_warnings_list): Doc fix.
15196
151972012-04-01 Eli Zaretskii <eliz@gnu.org>
15198
15199 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
15200 instead of alloca. (Bug#11138)
15201
152022012-04-01 Andreas Schwab <schwab@linux-m68k.org>
15203
15204 * w32menu.c (is_simple_dialog): Properly check lisp types.
15205 (Bug#11141)
15206
152072012-03-31 Eli Zaretskii <eliz@gnu.org>
15208
15209 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
15210 position we get to after a call to move_it_to fails the
15211 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
15212 only if we wind up in a string from display property. (Bug#11063)
15213
15214 * window.c (Fdelete_other_windows_internal): Invalidate the row
15215 and column information about mouse highlight, so that redisplay
15216 restores it after reallocating the glyph matrices. (Bug#7464)
15217
15218 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
15219 string comes from a `display' text property, use the buffer
15220 position of that property as if we actually saw that position in
15221 the row's glyphs.
15222 (move_it_by_lines): Remove the assertion that
15223 "it->current_x == 0 && it->hpos == 0" which can be legitimately
15224 violated when there's a before-string at the beginning of a line.
15225 (Bug#11063)
15226
152272012-03-30 Eli Zaretskii <eliz@gnu.org>
15228
15229 * xdisp.c (append_space_for_newline): If the default face was
15230 remapped, use the remapped face for the appended newline.
15231 (extend_face_to_end_of_line): Use the remapped default face for
15232 extending the face to the end of the line.
15233 (display_line): Call extend_face_to_end_of_line when the default
15234 face was remapped. (Bug#11068)
15235
152362012-03-29 Eli Zaretskii <eliz@gnu.org>
15237
15238 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
15239
152402012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15241
15242 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
15243
152442012-03-27 Glenn Morris <rgm@gnu.org>
15245
15246 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
15247 Doc fixes.
15248
152492012-03-26 Kenichi Handa <handa@m17n.org>
15250
15251 * dispextern.h (struct glyph): Fix previous change. Change the
15252 bit length of glyphless.ch to 25 (Bug#11082).
15253
152542012-03-26 Chong Yidong <cyd@gnu.org>
15255
15256 * keyboard.c (Vselection_inhibit_update_commands): New variable.
15257 (command_loop_1): Use it; inhibit selection update for
15258 handle-select-window too (Bug#8996).
15259
152602012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
15261
15262 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
15263
152642012-03-25 Kenichi Handa <handa@m17n.org>
15265
15266 * dispextern.h (struct glyph): Change the bit length of
15267 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
15268
152692012-03-24 Eli Zaretskii <eliz@gnu.org>
15270
15271 * s/ms-w32.h (tzname): Include time.h before redirecting to
15272 _tzname. Fixes the MSVC build. (Bug#9960)
15273
152742012-03-24 Andreas Schwab <schwab@linux-m68k.org>
15275
15276 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
15277 characters.
15278
15279 * xterm.c (XTread_socket): Only modify handling_signal if
15280 !SYNC_INPUT. (Bug#11080)
15281
152822012-03-23 Eli Zaretskii <eliz@gnu.org>
15283
15284 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
15285 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
15286 when fetching a multibyte character consumes more bytes than
15287 CHAR_BYTES returns, due to unification of CJK characters in
15288 string_char. (Bug#11073)
15289
152902012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
15291
15292 * process.c (wait_reading_process_output): Handle pty disconnect
15293 by refraining from sending oneself a SIGCHLD (bug#10933).
15294
152952012-03-22 Chong Yidong <cyd@gnu.org>
15296
15297 * dispextern.h (struct it): New member string_from_prefix_prop_p.
15298
15299 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
15300 Mark string as coming from a prefix property.
15301 (handle_face_prop): Use default face for prefix strings (Bug#4281).
15302 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
15303
153042012-03-21 Chong Yidong <cyd@gnu.org>
15305
15306 * xfaces.c (Vface_remapping_alist): Doc fix.
15307
153082012-03-20 Eli Zaretskii <eliz@gnu.org>
15309
15310 * w32proc.c (Fw32_set_console_codepage)
15311 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
15312 Doc fixes.
15313
153142012-03-20 Chong Yidong <cyd@gnu.org>
15315
15316 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
15317 to reflect default non-nil value of redisplay-dont-pause.
15318
153192012-03-19 Kenichi Handa <handa@m17n.org>
15320
15321 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
15322 it fit in a valid range (Bug#11003).
15323
153242012-03-18 Eli Zaretskii <eliz@gnu.org>
15325
15326 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
15327 that is not from display property, accept the row as a "cursor
15328 row" if one of the string's character has a non-nil `cursor'
15329 property. Fixes cursor positioning when there are newlines in
15330 overlay strings, e.g. in icomplete.el. (Bug#11035)
15331
153322012-03-12 Paul Eggert <eggert@cs.ucla.edu>
15333
15334 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
15335
153362012-03-12 Chong Yidong <cyd@gnu.org>
15337
15338 * eval.c (inhibit_lisp_code): Rename from
15339 inhibit_window_configuration_change_hook; move from window.c.
15340
15341 * xfns.c (unwind_create_frame_1, Fx_create_frame):
15342 * window.c (run_window_configuration_change_hook)
15343 (syms_of_window): Callers changed.
15344
153452012-03-11 Chong Yidong <cyd@gnu.org>
15346
15347 * keymap.c (Fkey_description): Doc fix (Bug#9700).
15348
15349 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
15350
153512012-03-10 Chong Yidong <cyd@gnu.org>
15352
15353 * frame.c (other_visible_frames): Don't assume the selected frame
15354 is visible (Bug#10955).
15355
153562012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
15357
15358 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
15359
153602012-03-08 Jan Djärv <jan.h.d@swipnet.se>
15361
15362 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
15363 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
15364 zero (Bug#10954).
15365
153662012-03-03 Glenn Morris <rgm@gnu.org>
15367
15368 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
15369
153702012-03-02 Eli Zaretskii <eliz@gnu.org>
15371
15372 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
15373 position past the first glyph_row that ends at ZV. (Bug#10902)
15374 (redisplay_window, next_element_from_string): Fix typos in
15375 comments.
15376 (redisplay_window): Pass to move_it_vertically the margin in
15377 pixels, not in screen lines.
15378
153792012-03-02 Glenn Morris <rgm@gnu.org>
15380
15381 * buffer.c (buffer-list-update-hook): Doc fix.
15382
153832012-02-29 Eli Zaretskii <eliz@gnu.org>
15384
15385 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
15386 push_it before setting up the iterator for the first overlay
15387 string, even if we have an empty string loaded.
15388 (next_overlay_string): If there's an empty string on the iterator
15389 stack, pop the stack. (Bug#10903)
15390
153912012-02-25 Paul Eggert <eggert@cs.ucla.edu>
15392
15393 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
15394 Suggested by Stefan Monnier in
15395 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
15396 * alloc.c (widen_to_Lisp_Object): New static function.
15397 (mark_memory): Also mark Lisp_Objects by fetching pointer words
15398 and widening them to Lisp_Objects. This would work even if
15399 USE_LSB_TAG is defined and wide integers are used, which might
15400 happen in a future version of Emacs.
15401
154022012-02-25 Chong Yidong <cyd@gnu.org>
15403
15404 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15405 Doc fix.
15406
15407 * xselect.c (Fx_selection_exists_p): Doc fix.
15408 (x_clipboard_manager_save_all): Print an informative message
15409 before saving to clipboard manager.
15410
154112012-02-24 Chong Yidong <cyd@gnu.org>
15412
15413 * keyboard.c (process_special_events): Handle all X selection
15414 requests in kbd_buffer, not just the next one (Bug#8869).
15415
154162012-02-23 Chong Yidong <cyd@gnu.org>
15417
15418 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15419 call when setting menu-bar-lines and tool-bar-lines parameters.
15420 (unwind_create_frame_1): New helper function.
15421
15422 * window.c (inhibit_window_configuration_change_hook): New var.
15423 (run_window_configuration_change_hook): Obey it.
15424 (syms_of_window): Initialize it.
15425
154262012-02-22 Chong Yidong <cyd@gnu.org>
15427
15428 * xterm.c (x_draw_image_relief): Add missing type check for
15429 Vtool_bar_button_margin (Bug#10743).
15430
154312012-02-21 Chong Yidong <cyd@gnu.org>
15432
15433 * fileio.c (Vfile_name_handler_alist): Doc fix.
15434
15435 * buffer.c (Fget_file_buffer): Protect against invalid file
15436 handler return value.
15437
154382012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15439
15440 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15441 when computing $valmask.
15442
15443 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15444 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15445 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15446 It's useless in that case, and it can cause problems on hosts
15447 that allocate halves of EMACS_INT values separately.
15448 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15449 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15450 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15451 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15452 it avoids undefined behavior on hosts where shifting right by more
15453 than the word width has undefined behavior.
15454
154552012-02-19 Chong Yidong <cyd@gnu.org>
15456
15457 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15458 (Funhandled_file_name_directory, Ffile_name_as_directory)
15459 (Fdirectory_file_name, Fexpand_file_name)
15460 (Fsubstitute_in_file_name): Protect against invalid file handler
15461 return values (Bug#10845).
15462
154632012-02-18 Eli Zaretskii <eliz@gnu.org>
15464
15465 * .gdbinit (pitx): Fix incorrect references to fields of the
15466 iterator stack.
15467
154682012-02-17 Chong Yidong <cyd@gnu.org>
15469
15470 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15471
154722012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15473
15474 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15475 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15476
154772012-02-15 Chong Yidong <cyd@gnu.org>
15478
15479 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15480 marked as special. Also, starting docstrings with * is obsolete.
15481
154822012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15483
15484 * gnutls.c (emacs_gnutls_write): Fix last change.
15485
154862012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15487
15488 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15489 send_process.
15490
154912012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15492
15493 * keymap.c (Fsingle_key_description): Handle char ranges.
15494
154952012-02-12 Chong Yidong <cyd@gnu.org>
15496
15497 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15498 as that creates a dangerous corner case.
15499
15500 * window.c (Fdelete_window_internal): Invalidate the mouse
15501 highlight (Bug#9904).
15502
155032012-02-12 Glenn Morris <rgm@gnu.org>
15504
15505 * xselect.c (Fx_own_selection_internal)
15506 (Fx_get_selection_internal, Fx_disown_selection_internal)
15507 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15508 * nsselect.m (Fx_own_selection_internal)
15509 (Fx_disown_selection_internal, Fx_selection_exists_p)
15510 (Fx_selection_owner_p, Fx_get_selection_internal):
15511 Sync docs and argument specs with the xselect.c versions.
15512
155132012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15514
15515 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15516
155172012-02-11 Eli Zaretskii <eliz@gnu.org>
15518
15519 * w32select.c (Fx_selection_exists_p): Sync doc string and
15520 argument list with xselect.c. (Bug#10783)
15521
15522 * w16select.c (Fx_selection_exists_p): Sync doc string and
15523 argument list with xselect.c. (Bug#10783)
15524
155252012-02-10 Glenn Morris <rgm@gnu.org>
15526
15527 * fns.c (Fsecure_hash): Doc fix.
15528
155292012-02-09 Kenichi Handa <handa@m17n.org>
15530
15531 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15532
155332012-02-07 Chong Yidong <cyd@gnu.org>
15534
15535 * buffer.c (Fbuffer_local_variables)
15536 (buffer_lisp_local_variables): Handle unbound vars correctly;
15537 don't let Qunbound leak into Lisp.
15538
155392012-02-07 Glenn Morris <rgm@gnu.org>
15540
15541 * image.c (Fimagemagick_types): Doc fix.
15542
15543 * image.c (imagemagick-render-type): Change it from a lisp object
15544 to an integer. Move the doc here from the lisp manual.
15545 Treat all values not equal to 0 the same.
15546
155472012-02-06 Chong Yidong <cyd@gnu.org>
15548
15549 * doc.c (store_function_docstring): Avoid applying docstring of
15550 alias to base function (Bug#2603).
15551
155522012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15553
15554 * .gdbinit (pp1, pv1): Remove redundant defines.
15555 (pr): Use pp.
15556
155572012-02-04 Chong Yidong <cyd@gnu.org>
15558
15559 * nsterm.m: Declare a global (Bug#10694).
15560
155612012-02-04 Eli Zaretskii <eliz@gnu.org>
15562
15563 * w32.c (get_emacs_configuration_options):
15564 Include --enable-checking, if specified, in the return value.
15565
155662012-02-04 Martin Rudalics <rudalics@gmx.at>
15567
15568 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15569 after rounding frame sizes. (Bug#9723)
15570
155712012-02-04 Eli Zaretskii <eliz@gnu.org>
15572
15573 * keyboard.c (adjust_point_for_property): Don't position point
15574 before BEGV. (Bug#10696)
15575
155762012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15577
15578 Handle overflow when computing char display width (Bug#9496).
15579 * character.c (char_width): Return EMACS_INT, not int.
15580 (char_width, c_string_width): Check for overflow when
15581 computing the width; this is possible now that individual
15582 characters can have unbounded width. Problem introduced
15583 by merge from Emacs 23 on 2012-01-19.
15584
155852012-02-02 Michael Albinus <michael.albinus@gmx.de>
15586
15587 * dbusbind.c (Fdbus_register_method): Mention the return value
15588 :ignore in the docstring.
15589
155902012-02-02 Glenn Morris <rgm@gnu.org>
15591
15592 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15593
15594 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15595 Unconditionally set to t. (Bug#10673)
15596 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15597 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15598 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15599
156002012-02-02 Kenichi Handa <handa@m17n.org>
15601
15602 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15603 0, do not call append_composite_glyph.
15604
156052012-02-02 Kenichi Handa <handa@m17n.org>
15606
15607 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15608 NULL (Bug#6988).
15609 (x_produce_glyphs): If the component of a composition is a null
15610 string, set it->pixel_width to 1 to avoid zero-width glyph.
15611
156122012-02-01 Eli Zaretskii <eliz@gnu.org>
15613
15614 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15615 first 2 arguments are identical. This makes inserting large
15616 output from a subprocess an order of magnitude faster on
15617 MS-Windows, where all sbrk'ed memory is always contiguous.
15618
156192012-01-31 Glenn Morris <rgm@gnu.org>
15620
15621 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15622 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15623 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15624
156252012-01-29 Glenn Morris <rgm@gnu.org>
15626
15627 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15628
156292012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15630
15631 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15632
156332012-01-28 Chong Yidong <cyd@gnu.org>
15634
15635 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15636
156372012-01-26 Chong Yidong <cyd@gnu.org>
15638
15639 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15640
15641 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15642 repeat counts (Bug#10507).
15643
156442012-01-26 Glenn Morris <rgm@gnu.org>
15645
15646 * lread.c (syms_of_lread): Doc fix.
15647
156482012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15649
15650 * coding.c (encode_designation_at_bol): Change return value to
15651 EMACS_INT.
15652
156532012-01-25 Chong Yidong <cyd@gnu.org>
15654
15655 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15656
156572012-01-21 Chong Yidong <cyd@gnu.org>
15658
15659 * floatfns.c (Fcopysign): Make the second argument non-optional,
15660 since nil is not allowed anyway.
15661
156622012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15663
15664 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15665 (send_process): Likewise.
15666
156672012-01-19 Martin Rudalics <rudalics@gmx.at>
15668
15669 * window.c (save_window_save, Fcurrent_window_configuration)
15670 (Vwindow_persistent_parameters): Do not use Qstate.
15671 Rewrite doc-strings.
15672
156732012-01-19 Kenichi Handa <handa@m17n.org>
15674
15675 * character.c (char_width): New function.
15676 (Fchar_width, c_string_width, lisp_string_width):
15677 Use char_width (Bug#9496).
15678
156792012-01-16 Martin Rudalics <rudalics@gmx.at>
15680
15681 * window.c (Vwindow_persistent_parameters): New variable.
15682 (Fset_window_configuration, save_window_save): Handle persistent
15683 window parameters.
15684
156852012-01-14 Eli Zaretskii <eliz@gnu.org>
15686
15687 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15688 thrashing the stack of the thread. (Bug#9087)
15689
156902012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15691
15692 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15693
156942012-01-11 Eli Zaretskii <eliz@gnu.org>
15695
15696 * xdisp.c (rows_from_pos_range): Handle the case where the
15697 highlight ends on a newline. (Bug#10464)
15698 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15699 he end column for display of highlight that ends on a newline
15700 before a R2L line.
15701
157022012-01-11 Glenn Morris <rgm@gnu.org>
15703
15704 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15705 from load-path also when installation-directory is nil. (Bug#10208)
15706
157072012-01-10 Glenn Morris <rgm@gnu.org>
15708
15709 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15710
15711 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15712 Update template values to be closer to their typical values these days.
15713
157142012-01-09 Eli Zaretskii <eliz@gnu.org>
15715
15716 * xdisp.c (rows_from_pos_range): Accept additional argument
15717 DISP_STRING, and accept any glyph in a row whose object is that
15718 string as eligible for mouse highlight. Fixes mouse highlight of
15719 display strings from overlays. (Bug#10464)
15720
157212012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15722
15723 emacs: fix an auto-save permissions race condition (Bug#10400)
15724 * fileio.c (auto_saving_dir_umask): New static var.
15725 (Fmake_directory_internal): Use it.
15726 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15727 creating the directory. The old code temporarily assigns
15728 too-generous permissions to the directory.
15729 (do_auto_save_eh): Clear it.
15730 (Fdo_auto_save): Catch all errors, not just file errors, so
15731 that the var is always cleared.
15732
157332012-01-07 Eli Zaretskii <eliz@gnu.org>
15734
15735 * search.c (scan_buffer): Pass character positions to
15736 know_region_cache, not byte positions. (Bug#6540)
15737
157382012-01-07 LynX <_LynX@bk.ru> (tiny change)
15739
15740 * w32.c (sys_rename): Report EXDEV when rename of a directory
15741 fails because the target is on another logical disk. (Bug#10284)
15742
157432012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15744
15745 * xterm.c (x_embed_request_focus): New function.
15746
15747 * xterm.h: Add prototype.
15748
15749 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15750
157512012-01-05 Glenn Morris <rgm@gnu.org>
15752
15753 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15754
157552012-01-01 Eli Zaretskii <eliz@gnu.org>
15756
15757 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15758 Load gnutls_transport_set_lowat only if GnuTLS version is below
15759 2.11.1.
15760 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15761 GnuTLS versions below 2.11.1.
15762
157632011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15764
15765 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15766 to the doc string advising against its use for altering the way
15767 windows are scrolled.
15768
157692011-12-28 Kenichi Handa <handa@m17n.org>
15770
15771 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15772 coding-system ASCII compatible only when it does not produce BOM
15773 on encoding (Bug#10383).
15774
157752011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15776
15777 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15778 can scroll.
15779 (create_and_show_popup_menu): Always use menu_position_func for
15780 Gtk3 (Bug#10361).
15781
157822011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15783
15784 * callint.c (Fcall_interactively): Don't truncate prompt string.
15785
157862011-12-23 Eli Zaretskii <eliz@gnu.org>
15787
15788 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15789 property that ends at ZV, so that the bidi iteration could be
15790 resumed from there (after widening). (Bug#10360)
15791
157922011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15793
15794 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15795
157962011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15797
15798 * nsterm.m (x_free_frame_resources):
15799 Release f->output_data.ns->miniimage.
15800 (ns_index_color): Fix indentation. Do not retain
15801 color_table->colors[i].
15802
15803 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15804 before returning.
15805
15806 * nsfns.m (x_set_background_color): Assign return value from
15807 ns_index_color to face-background instead of NSColor*.
15808 (ns_implicitly_set_icon_type): Fix indentation.
15809 Change assignment in for loop to comparison.
15810
15811 * emacs.c (ns_pool): New variable.
15812 (main): Assign ns_pool.
15813 (Fkill_emacs): Call ns_release_autorelease_pool.
15814
15815 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15816 autorelease fdesc, release fdAttrs and tdict.
15817 (ns_get_covering_families): Release charset.
15818 (ns_findfonts): Release NSFontDescriptor created with new.
15819 (ns_uni_to_glyphs): Fix indentation.
15820 (setString): Release attrStr before assigning new value.
15821
158222011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15823
15824 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15825 and NS_IMPL_COCOA.
15826 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15827 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15828
158292011-12-18 David Reitter <reitter@cmu.edu>
15830
15831 * nsterm.m (ns_term_init): Subscribe for notifications
15832 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15833 to method trackingNotification in EmacsMenu.
15834
15835 * nsmenu.m (trackingMenu): New variable.
15836 (trackingNotification): New method (from Aquamacs).
15837 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15838 from Aquamacs (Bug#7030).
15839
158402011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15841
15842 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15843 (symbol_to_nsstring): Fix indentation.
15844 (ns_symbol_to_pb): New function.
15845 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15846 (Fns_rotate_cut_buffers_internal): Remove.
15847 (Fns_store_selection_internal): Rename from
15848 Fns_store_cut_buffer_internal.
15849 (ns_get_foreign_selection, Fx_own_selection_internal)
15850 (Fx_disown_selection_internal, Fx_selection_exists_p)
15851 (Fns_get_selection_internal, Fns_store_selection_internal):
15852 Use ns_symbol_to_pb and check if return value is nil.
15853 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15854 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15855 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15856 renamed to Sns_store_selection_internal.
15857 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15858 and remove this function.
15859 (ns_handle_selection_clear): Remove, never used.
15860 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15861 here.
15862
158632011-12-17 Ken Brown <kbrown@cornell.edu>
15864
15865 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15866 GID is unknown (Bug#10257).
15867
158682011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15869
15870 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15871 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15872 which caused a build failure on GNU/Linux IA-64. This problem was
15873 introduced by my 2011-10-07 patch.
15874
158752011-12-15 Juri Linkov <juri@jurta.org>
15876
15877 * image.c (imagemagick_error): New function. (Bug#10112)
15878 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15879 Use `imagemagick_error' where ImageMagick functions return
15880 `MagickFalse'.
15881 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15882 proper order.
15883
158842011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15885
15886 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15887 fill background (Bug#8992).
15888
158892011-12-13 Martin Rudalics <rudalics@gmx.at>
15890
15891 * window.c (Vwindow_combination_resize)
15892 (Vwindow_combination_limit): Use t instead of non-nil in
15893 doc-strings.
15894 (Vrecenter_redisplay): Add first sentence of doc-string on
15895 separate line.
15896 (Frecenter): Fix doc-string typo.
15897
158982011-12-11 Kenichi Handa <handa@m17n.org>
15899
15900 * coding.c (Funencodable_char_position): Pay attention to the
15901 buffer text relocation (Bug#9389).
15902
159032011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15904
15905 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15906 gtk_init (Bug#10100).
15907
159082011-12-10 Eli Zaretskii <eliz@gnu.org>
15909
15910 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15911 IT->string is nil. (Bug#10263)
15912
159132011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15914
15915 * nsterm.h (x_free_frame_resources): Declare.
15916
15917 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15918 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15919
15920 * nsterm.h (ns_get_defaults_value): Declare.
15921
15922 * nsterm.m (ns_default): Call ns_get_defaults_value.
15923
159242011-12-09 Eli Zaretskii <eliz@gnu.org>
15925
15926 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15927 (Bug#10170)
15928
159292011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15930
15931 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15932 that where the value of an _OBJC_* symbol points to is in the .bss
15933 section (Bug#10240).
15934
159352011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15936
15937 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15938 after the loop to call ccl_driver at least once (Bug#8619).
15939
159402011-12-08 Kenichi Handa <handa@m17n.org>
15941
15942 * ftfont.c (get_adstyle_property): Fix previous change
15943 (Bug#10233).
15944
159452011-12-07 Juanma Barranquero <lekktu@gmail.com>
15946
15947 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15948 dirs from the default value of EMACSLOADPATH (bug#10208).
15949
159502011-12-07 Glenn Morris <rgm@gnu.org>
15951
15952 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15953 installation and source directories as well. (Bug#10208)
15954
159552011-12-06 Chong Yidong <cyd@gnu.org>
15956
15957 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15958
159592011-12-06 Glenn Morris <rgm@gnu.org>
15960
15961 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15962 as an error, not just -1. (Bug#10217)
15963
159642011-12-05 Chong Yidong <cyd@gnu.org>
15965
15966 * keyboard.c (process_special_events): New function.
15967 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15968
159692011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15970
15971 * coding.c (encode_designation_at_bol): Don't use uninitialized
15972 local variable (Bug#9318).
15973
159742011-12-05 Kenichi Handa <handa@m17n.org>
15975
15976 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15977 return Qnil (Bug#8046, Bug#10193).
15978
159792011-12-05 Kenichi Handa <handa@m17n.org>
15980
15981 * coding.c (encode_designation_at_bol): New args charbuf_end and
15982 dst. Return the number of produced bytes. Callers changed.
15983 (coding_set_source): Return how many bytes coding->source was
15984 relocated.
15985 (coding_set_destination): Return how many bytes
15986 coding->destination was relocated.
15987 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15988 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15989
159902011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15991
15992 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15993 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15994 macro (Bug#9318).
15995
159962011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15997
15998 The following changes are to fix Bug#9318.
15999
16000 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
16001 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
16002 (encode_coding_iso_2022, encode_coding_sjis)
16003 (encode_coding_big5, encode_coding_charset): Use the above macros.
16004
160052011-12-05 Juanma Barranquero <lekktu@gmail.com>
16006
16007 * lisp.h (process_quit_flag): Fix external declaration.
16008
160092011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
16010
16011 Don't macro-inline non-performance-critical code.
16012 * eval.c (process_quit_flag): New function.
16013 * lisp.h (QUIT): Use it.
16014
160152011-12-04 Jan Djärv <jan.h.d@swipnet.se>
16016
16017 * nsfns.m (get_geometry_from_preferences): New function.
16018 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
16019
160202011-12-04 Andreas Schwab <schwab@linux-m68k.org>
16021
16022 * emacs.c (Qkill_emacs): Define.
16023 (syms_of_emacs): Initialize it.
16024 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
16025 Qquit_flag to `kill-emacs' instead.
16026 (quit_throw_to_read_char): Add parameter `from_signal'.
16027 All callers changed. Call Fkill_emacs if requested and safe.
16028 * lisp.h (QUIT): Call Fkill_emacs if requested.
16029
160302011-12-03 Jan Djärv <jan.h.d@swipnet.se>
16031
16032 * widget.c (update_wm_hints): Return if wmshell is null.
16033 (widget_update_wm_size_hints): New function.
16034
16035 * widget.h (widget_update_wm_size_hints): Declare.
16036
16037 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
16038 widget_update_wm_size_hints (Bug#10104).
16039
160402011-12-03 Eli Zaretskii <eliz@gnu.org>
16041
16042 * xdisp.c (handle_invisible_prop): If the invisible text ends just
16043 before a newline, prepare the bidi iterator for consuming the
16044 newline, and keep the current paragraph direction. (Bug#10183)
16045 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
16046
160472011-12-02 Juri Linkov <juri@jurta.org>
16048
16049 * search.c (Fword_search_regexp): New Lisp function created from
16050 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
16051 (Fword_search_backward, Fword_search_forward)
16052 (Fword_search_backward_lax, Fword_search_forward_lax):
16053 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
16054 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
16055
160562011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
16057
16058 * fileio.c (Finsert_file_contents): Move after-change-function call
16059 to before the "handled:" label, since all "goto handled" appear in
16060 cases where the *-change-functions have already been properly called
16061 (bug#10117).
16062
160632011-12-01 Andreas Schwab <schwab@linux-m68k.org>
16064
16065 * keyboard.c (interrupt_signal): Don't call kill-emacs when
16066 waiting for input. (Bug#10169)
16067
160682011-11-30 Eli Zaretskii <eliz@gnu.org>
16069
16070 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
16071 verifies glyph row's hash code--we have just reallocated the
16072 glyphs, so their contents can be complete garbage. (Bug#10164)
16073
160742011-11-30 Juanma Barranquero <lekktu@gmail.com>
16075
16076 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
16077
160782011-11-30 Eli Zaretskii <eliz@gnu.org>
16079
16080 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
16081 attributes are tested _before_ calling verify_row_hash, to protect
16082 against GCC re-ordering of the tests. (Bug#10164)
16083
160842011-11-29 Jan Djärv <jan.h.d@swipnet.se>
16085
16086 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
16087
16088 * xterm.c (handle_one_xevent): Only set async_visible and friends
16089 if net_wm_state_hidden_seen is non-zero (Bug#10002)
16090 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
16091 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
16092
160932011-11-28 Paul Eggert <eggert@cs.ucla.edu>
16094
16095 Remove GCPRO-related macros that exist only to avoid shadowing locals.
16096 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
16097 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
16098 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
16099 All uses changed to use GCPRO1 etc.
16100 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
16101 Revert to old implementation (i.e., before 2011-03-11).
16102
161032011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16104
16105 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
16106 of scroll runs so as to avoid assigning disabled bogus rows and
16107 unnecessary graphics copy operations.
16108
161092011-11-27 Eli Zaretskii <eliz@gnu.org>
16110
16111 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
16112 (snprintf) [_MSC_VER]: Redirect to _snprintf.
16113 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
16114 (malloc, free, realloc, calloc): Redirect to e_* only when
16115 compiling Emacs.
16116
16117 * lisp.h (GCTYPEBITS): Move before first use.
16118 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
16119 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
16120 this macro definition.
16121
16122 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
16123 _MSC_VER.
16124
161252011-11-27 Jan Djärv <jan.h.d@swipnet.se>
16126
16127 * gtkutil.c (xg_create_frame_widgets):
16128 Call gtk_window_set_has_resize_grip (FALSE) if that function is
16129 present with Gtk+ 2.0.
16130
161312011-11-26 Paul Eggert <eggert@cs.ucla.edu>
16132
16133 * fileio.c (Finsert_file_contents): Undo previous change; see
16134 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
16135
161362011-11-26 Paul Eggert <eggert@cs.ucla.edu>
16137
16138 Rename locals to avoid shadowing.
16139 * fileio.c (Finsert_file_contents):
16140 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
16141 * process.c (wait_reading_process_output):
16142 Rename inner 'proc' to 'p' to avoid shadowing.
16143 Indent for consistency with usual Emacs style.
16144
161452011-11-25 Eli Zaretskii <eliz@gnu.org>
16146
16147 * xdisp.c (redisplay_window): If cursor row is not fully visible
16148 after recentering, and scroll-conservatively is set to a large
16149 number, scroll window by a few more lines to make the cursor fully
16150 visible and out of scroll-margin. (Bug#10105)
16151 (start_display): Don't move to the next line if the display should
16152 start at a newline that is part of a display vector or an overlay
16153 string. (Bug#10119)
16154
161552011-11-24 Juri Linkov <juri@jurta.org>
16156
16157 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
16158 after the `MagickPingImage' call. (Bug#10112)
16159
161602011-11-23 Chong Yidong <cyd@gnu.org>
16161
16162 * window.c (Fcoordinates_in_window_p): Accept only live windows.
16163
161642011-11-23 Martin Rudalics <rudalics@gmx.at>
16165
16166 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
16167 making another buffer current. (Bug#10114)
16168
161692011-11-23 Glenn Morris <rgm@gnu.org>
16170
16171 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
16172
161732011-11-23 Chong Yidong <cyd@gnu.org>
16174
16175 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
16176 using it (Bug#5984).
16177
161782011-11-22 Eli Zaretskii <eliz@gnu.org>
16179
16180 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
16181 and header-lines, as they don't have one computed for them.
16182 (Bug#10098)
16183
16184 * .gdbinit (prow): Make displayed values more self-explaining.
16185 Add row's hash code.
16186
161872011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
16188
16189 * process.c (wait_reading_process_output): Fix asynchrounous
16190 GnuTLS socket handling on some versions of the GnuTLS library.
16191 (wait_reading_process_output): Add comment and URL.
16192
161932011-11-21 Jan Djärv <jan.h.d@swipnet.se>
16194
16195 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
16196
161972011-11-21 Chong Yidong <cyd@gnu.org>
16198
16199 * window.c (Fnext_window, Fprevious_window): Doc fix.
16200
162012011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
16202
16203 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
16204
162052011-11-20 Juanma Barranquero <lekktu@gmail.com>
16206
16207 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
16208
162092011-11-20 Martin Rudalics <rudalics@gmx.at>
16210
16211 * window.c (Fset_window_combination_limit): Rename argument
16212 STATUS to LIMIT.
16213 (Vwindow_combination_limit): Remove "status" from doc-string.
16214
162152011-11-20 Andreas Schwab <schwab@linux-m68k.org>
16216
16217 * m/ibms390.h: Remove.
16218 * m/ibms390x.h: Don't include "ibms390.h".
16219
162202011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
16221
16222 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
16223 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
16224
162252011-11-20 Juanma Barranquero <lekktu@gmail.com>
16226
16227 * casetab.c (Fset_case_table):
16228 * charset.c (Fcharset_after): Fix typos.
16229
162302011-11-20 Paul Eggert <eggert@cs.ucla.edu>
16231
16232 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
16233 Otherwise, valgrind does not work on some platforms.
16234 Problem reported by Andreas Schwab in
16235 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
16236 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
16237 is set, removing the need for VIRT_ADDRESS_VARIES.
16238 (PURE_P): Use a more-efficient implementation that needs just one
16239 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
16240 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
16241 to 4 (xorl, subq, cmpq, setbe).
16242 * alloc.c (pure): Always extern now, since that's the
16243 VIRT_ADDR_VARIES behavior.
16244 (PURE_POINTER_P): Use a single comparison, not two, for
16245 consistency with the new puresize.h.
16246 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
16247 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
16248 Remove VIRT_ADDR_VARIES no longer needed.
16249
162502011-11-19 Eli Zaretskii <eliz@gnu.org>
16251
16252 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
16253 (erase_phys_cursor, update_window_cursor, show_mouse_face)
16254 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
16255 behave as if the cursor position were at the window margin.
16256
16257 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
16258 and the cursor position is out of bounds, behave as if the cursor
16259 position were at the window margin. (Bug#10075)
16260
162612011-11-18 Chong Yidong <cyd@gnu.org>
16262
16263 * window.c (Fwindow_combination_limit): Make first argument
16264 non-optional, since it is meaningless for live windows like the
16265 selected window.
16266
162672011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
16268
16269 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
16270
162712011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
16272
16273 * intervals.c: Fix grafting over the whole buffer (bug#10071).
16274 (graft_intervals_into_buffer): Simplify.
16275
162762011-11-18 Eli Zaretskii <eliz@gnu.org>
16277
16278 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
16279 hash values of the two rows.
16280 (copy_row_except_pointers): Preserve the used[] arrays and the
16281 hash values of the two rows. (Bug#10035)
16282 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
16283
16284 * xdisp.c (row_hash): New function, body extracted from
16285 compute_line_metrics.
16286 (compute_line_metrics): Call row_hash, instead of computing the
16287 hash code inline.
16288
16289 * dispnew.c (verify_row_hash): Call row_hash for computing the
16290 hash code of a row, instead of duplicating code from xdisp.c.
16291
16292 * dispextern.h (row_hash): Add prototype.
16293
162942011-11-18 Tassilo Horn <tassilo@member.fsf.org>
16295
16296 * frame.c (delete_frame): Don't delete the terminal when the last
16297 X frame is closed if emacs is built with GTK toolkit.
16298
162992011-11-17 Juanma Barranquero <lekktu@gmail.com>
16300
16301 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
16302
163032011-11-17 Martin Rudalics <rudalics@gmx.at>
16304
16305 * window.c (Vwindow_splits): Rename to
16306 Vwindow_combination_resize. Suggested by Juri Linkov.
16307 (Fsplit_window_internal): Use Vwindow_combination_resize instead
16308 of Vwindow_splits.
16309
163102011-11-16 Juanma Barranquero <lekktu@gmail.com>
16311
16312 * nsfns.m (Fns_font_name):
16313 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
16314
163152011-11-16 Martin Rudalics <rudalics@gmx.at>
16316
16317 * window.h (window): Rename slot "nest" to "combination_limit".
16318 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
16319 (Fset_window_nest): Rename to Fset_window_combination_limit.
16320 (Vwindow_nest): Rename to Vwindow_combination_limit.
16321 (recombine_windows, make_parent_window, make_window)
16322 (Fsplit_window_internal, saved_window)
16323 (Fset_window_configuration, save_window_save): Rename all
16324 occurrences of window_nest to window_combination_limit.
16325
163262011-11-15 Juanma Barranquero <lekktu@gmail.com>
16327
16328 * image.c (imagemagick_load_image): Fix typo.
16329
163302011-11-14 Eli Zaretskii <eliz@gnu.org>
16331
16332 * xdisp.c (display_line): Move the call to
16333 highlight_trailing_whitespace before the call to
16334 compute_line_metrics, since the latter needs to see the final
16335 faces of all the glyphs to compute ROW's hash value.
16336 Fixes assertion violations in row_equal_p. (Bug#10035)
16337
163382011-11-14 Juanma Barranquero <lekktu@gmail.com>
16339
16340 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
16341 just return (bug#10044).
16342
163432011-11-12 Eli Zaretskii <eliz@gnu.org>
16344
16345 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
16346 with user-defined heap size. Bump the default size of the temacs
16347 heap to 27MB, to avoid memory warning when running temacs.
16348 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
16349
16350 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
16351 current_matrix and desired_matrix. (Bug#9990)
16352 (verify_row_hash) [XASSERTS]: New function.
16353 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
16354 that the hash value of glyph rows is correct.
16355
163562011-11-12 Martin Rudalics <rudalics@gmx.at>
16357
16358 * window.h (window): Remove splits slot.
16359 * window.c (Fwindow_splits, Fset_window_splits): Remove.
16360 (Fdelete_other_windows_internal, make_parent_window)
16361 (make_window, Fsplit_window_internal, Fdelete_window_internal)
16362 (Fset_window_configuration, save_window_save): Don't deal with
16363 split status of windows.
16364 (saved_window): Remove splits slot.
16365 (Vwindow_splits): Rewrite doc-string.
16366
163672011-11-11 Jan Djärv <jan.h.d@swipnet.se>
16368
16369 * xfns.c (unwind_create_frame):
16370 * nsfns.m (unwind_create_frame):
16371 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
16372 Vframe_list (Bug#9999).
16373
163742011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
16375
16376 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
16377
163782011-11-11 Kenichi Handa <handa@m17n.org>
16379
16380 * callproc.c (Fcall_process): Set the member dst_multibyte of
16381 process_coding.
16382
163832011-11-11 Johan Bockgård <bojohan@gnu.org>
16384
16385 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
16386 avoid a crash (bug#9496).
16387
163882011-11-09 Chong Yidong <cyd@gnu.org>
16389
16390 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
16391 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
16392
163932011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16394
16395 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
16396
163972011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16398
16399 Avoid some portability problems by eschewing 'extern inline' functions.
16400 The trivial performance wins aren't worth the portability hassles; see
16401 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16402 et seq.
16403 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16404 (window_box_width, window_box_left, window_box_left_offset)
16405 (window_box_right, window_box_right_offset): Undo previous change,
16406 by removing the "extern"s.
16407 * intervals.c (adjust_intervals_for_insertion)
16408 (adjust_intervals_for_deletion): Undo previous change,
16409 making these static again.
16410 (offset_intervals, temp_set_point_both, temp_set_point)
16411 (copy_intervals_to_string): No longer inline.
16412 * xdisp.c (window_text_bottom_y, window_box_width)
16413 (window_box_height, window_box_left_offset)
16414 (window_box_right_offset, window_box_left, window_box_right)
16415 (window_box): No longer inline.
16416
164172011-11-08 Chong Yidong <cyd@gnu.org>
16418
16419 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
16420 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16421 Signal an error if not a live window.
16422 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16423 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16424
164252011-11-07 Juanma Barranquero <lekktu@gmail.com>
16426
16427 * lisp.h (syms_of_abbrev): Remove declaration.
16428 Reported by CHENG Gao <chenggao@royau.me>.
16429
164302011-11-07 Eli Zaretskii <eliz@gnu.org>
16431
16432 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16433 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16434 of temacs in GUI mode.
16435
164362011-11-07 Martin Rudalics <rudalics@gmx.at>
16437
16438 * window.h: Declare delete_all_child_windows instead of
16439 delete_all_subwindows.
16440 * window.c (Fwindow_nest, Fset_window_nest)
16441 (Fset_window_new_total, Fset_window_new_normal)
16442 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16443 (delete_all_subwindows): Rename to delete_all_child_windows.
16444 (Fdelete_other_windows_internal, Fset_window_configuration):
16445 Call delete_all_child_windows instead of delete_all_subwindows.
16446 * frame.c (delete_frame): Call delete_all_child_windows instead
16447 of delete_all_subwindows.
16448
164492011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16450
16451 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16452 This is also needed for porting to any host where GC_MARK_STACK is
16453 not GC_MAKE_GCPROS_NOOPS.
16454 (which_symbols): Use it.
16455
164562011-11-07 Kenichi Handa <handa@m17n.org>
16457
16458 * coding.c (coding_set_destination): Check coding->src_pos only
16459 when coding->src_object is a buffer (bug#9910).
16460
16461 * process.c (send_process): Set the member src_multibyte of coding
16462 to 0 (bug#9911) when sending a unibyte text.
16463
16464 * callproc.c (Fcall_process): Set the member src_multibyte of
16465 process_coding to 0 (bug#9912).
16466
164672011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16468
16469 * xmenu.c (cleanup_widget_value_tree): New function.
16470 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16471 calling free_menubar_widget_value_tree directly (Bug#9830).
16472
164732011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16474
16475 Fix some portability problems with 'inline'.
16476 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16477 (window_box_width, window_box_left, window_box_left_offset)
16478 (window_box_right, window_box_right_offset): Declare extern.
16479 Otherwise, these inline functions do not conform to C99 and
16480 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16481 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16482 * intervals.c (adjust_intervals_for_insertion)
16483 (adjust_intervals_for_deletion): Now extern, because otherwise the
16484 extern inline functions 'offset_intervals' couldn't refer to it.
16485 (static_offset_intervals): Remove.
16486 (offset_intervals): Rewrite using the old contents of
16487 static_offset_intervals. The old version didn't conform to C99
16488 because an extern inline function contained a reference to an
16489 identifier with static linkage.
16490
164912011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16492
16493 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16494 GC.
16495
164962011-11-06 Eli Zaretskii <eliz@gnu.org>
16497
16498 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16499 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16500 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16501 return Qleft_to_right.
16502
165032011-11-06 Chong Yidong <cyd@gnu.org>
16504
16505 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16506 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16507 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16508 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16509 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16510 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16511 (Fwindow_vscroll): Doc fix.
16512 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16513 argument, since it makes no sense to pass a live window and for
16514 consistency with window-child.
16515
165162011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16517
16518 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16519 support MSVC.
16520
165212011-11-05 Jason Rumney <jasonr@gnu.org>
16522
16523 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16524 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16525 fonts (Bug#6029).
16526 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16527 bitwise arithmetic preventing use of unicode-sip and non-truetype
16528 opentype fonts.
16529
165302011-11-05 Eli Zaretskii <eliz@gnu.org>
16531
16532 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16533 "emacs"-only part.
16534
16535 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16536 initialization code to keep similarity to xfns.c after changes
16537 from 2011-11-05.
16538
165392011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16540
16541 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16542 (unwind_create_frame): New function (Bug#9943).
16543 (Fx_create_frame): Restructure code to be more similar to the one in
16544 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16545 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16546 Move terminal->reference_count++ just before making the frame official
16547 (Bug#9943).
16548
16549 * nsterm.m (x_free_frame_resources): New function.
16550 (x_destroy_window): Move code to x_free_frame_resources.
16551
16552 * xfns.c (unwind_create_frame): Fix comment.
16553 (Fx_create_frame, x_create_tip_frame):
16554 Move terminal->reference_count++ just before making the frame
16555 official. Move initialization of image_cache_refcount and
16556 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16557
165582011-11-05 Eli Zaretskii <eliz@gnu.org>
16559
16560 Support MSVC build with newer versions of Visual Studio.
16561 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16562 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16563 nt/gmake.defs.
16564
16565 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16566 which are not supported by MSVC.
16567 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16568 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16569 bitfields.
16570 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16571 types in bitfields.
16572 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16573
16574 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16575
165762011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
16577
16578 Support MSVC build with newer versions of Visual Studio.
16579 * w32.c: Don't include w32api.h for MSVC.
16580 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16581
16582 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16583 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16584 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16585 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16586 e_* cousins.
16587 (alloca) [_MSC_VER]: Define to _alloca.
16588
16589 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16590
16591 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16592
165932011-11-04 Eli Zaretskii <eliz@gnu.org>
16594
16595 * xdisp.c (note_mouse_highlight): If either of
16596 previous/next-single-property-change returns nil, treat that as
16597 the beginning or the end of the buffer. (Bug#9955)
16598
165992011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16600
16601 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
16602 label is not null (Bug#9951).
16603 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16604 may be NULL.
16605
166062011-11-04 Eli Zaretskii <eliz@gnu.org>
16607
16608 * window.c (Fwindow_body_size): Mention in the doc string that the
16609 return value is in frame's canonical units. (Bug#9949)
16610
166112011-11-03 Eli Zaretskii <eliz@gnu.org>
16612
16613 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16614
16615 * w32fns.c (unwind_create_frame): If needed, free the glyph
16616 matrices of the partially constructed frame. (Bug#9943)
16617 * xfns.c (unwind_create_frame): Likewise.
16618
166192011-11-01 Eli Zaretskii <eliz@gnu.org>
16620
16621 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16622 Don't stop backward scan on the continuation glyph, even though
16623 its CHARPOS is positive.
16624 (mouse_face_from_buffer_pos, note_mouse_highlight):
16625 Rename cover_string to disp_string.
16626
166272011-11-01 Martin Rudalics <rudalics@gmx.at>
16628
16629 * window.c (temp_output_buffer_show): Don't use
16630 Vtemp_buffer_show_specifiers.
16631 (Vtemp_buffer_show_specifiers): Remove unused variable.
16632
166332011-10-30 Eli Zaretskii <eliz@gnu.org>
16634
16635 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16636 past the beginning of the current glyph matrix.
16637
166382011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16639
16640 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16641 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16642 HAVE_GTK3 (Bug#9869).
16643
16644 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16645 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16646
16647 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16648
16649 * xterm.c: Declare x_handle_net_wm_state to return int.
16650 (handle_one_xevent): Check if we are iconified but don't have
16651 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16652 (get_current_wm_state): Return non-zero if not hidden,
16653 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16654 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16655 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16656 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16657
166582011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16659
16660 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16661 so that this new function doesn't get optimized away by a
16662 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16663
166642011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16665
16666 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16667
166682011-10-29 Eli Zaretskii <eliz@gnu.org>
16669
16670 Fix the `xbytecode' command.
16671 * .gdbinit (xprintbytestr): New command.
16672 (xwhichsymbols): Rename from `which'; all callers changed.
16673 (xbytecode): Print the byte-code string as well.
16674
166752011-10-29 Kim Storm <storm@cua.dk>
16676
16677 * alloc.c (which_symbols): New function.
16678
166792011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16680
16681 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16682 line. (Bug#9903)
16683
166842011-10-29 Glenn Morris <rgm@gnu.org>
16685
16686 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16687 Not clear what it was for, and it causes various bugs. (Bug#9839)
16688
166892011-10-28 Eli Zaretskii <eliz@gnu.org>
16690
16691 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16692 possible random value that matches one of those tested as
16693 condition to clear the mouse face.
16694
166952011-10-28 Chong Yidong <cyd@gnu.org>
16696
16697 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16698
166992011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16700
16701 * window.c (make_window): Initialize phys_cursor_on_p.
16702
167032011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16704
16705 * lisp.h (struct Lisp_Symbol): Update comments.
16706
167072011-10-28 Juanma Barranquero <lekktu@gmail.com>
16708
16709 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16710
167112011-10-28 Eli Zaretskii <eliz@gnu.org>
16712
16713 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16714 <oslsachem@gmail.com> for helping to debug this.
16715
16716 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16717 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16718 (g_b_init_get_glyph_outline_w): New static variables.
16719 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16720 (GetGlyphOutlineW_Proc): New typedefs.
16721 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16722 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16723 New functions.
16724 (w32font_open_internal, compute_metrics):
16725 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16726 instead of calling the "wide" APIs directly.
16727
16728 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16729
16730 * w32.h (syms_of_w32font): Add prototype.
16731
167322011-10-27 Juanma Barranquero <lekktu@gmail.com>
16733
16734 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16735 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16736 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16737 (Fmove_to_window_line): Doc fix.
16738
167392011-10-27 Chong Yidong <cyd@gnu.org>
16740
16741 * process.c (make_process): Set gnutls_state to NULL.
16742
16743 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16744 non-NULL, regardless of GNUTLS_INITSTAGE.
16745 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16746 an error. Set process slots as soon as we allocate them.
16747
16748 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16749
167502011-10-27 Chong Yidong <cyd@gnu.org>
16751
16752 * gnutls.c (emacs_gnutls_deinit): New function.
16753 Deallocate credentials structures as well as calling gnutls_deinit.
16754 (Fgnutls_deinit, Fgnutls_boot): Use it.
16755
16756 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16757 (deactivate_process): Call emacs_gnutls_deinit.
16758
167592011-10-27 Juanma Barranquero <lekktu@gmail.com>
16760
16761 * image.c (x_create_x_image_and_pixmap):
16762 * w32.c (sys_rename, w32_delayed_load):
16763 * w32font.c (fill_in_logfont):
16764 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16765
167662011-10-26 Juanma Barranquero <lekktu@gmail.com>
16767
16768 * w32fns.c (w32_default_color_map): New function,
16769 extracted from Fw32_default_color_map.
16770 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16771
167722011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16773
16774 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16775
167762011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16777
16778 * keyboard.c (test_undefined): New function (bug#9751).
16779 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16780
167812011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16782
16783 * sysdep.c (init_sys_modes): Fix the check for the controlling
16784 terminal (Bug#6649).
16785
167862011-10-20 Eli Zaretskii <eliz@gnu.org>
16787
16788 * dispextern.h (struct bidi_it): New member next_en_type.
16789
16790 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16791 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16792 current character, check also for next_en_type being WEAK_EN.
16793 (bidi_resolve_weak): Don't enter the expensive loop if the current
16794 position is before next_en_pos. Record the bidi type of the first
16795 non-ET, non-BN character we find, in addition to its position.
16796 (bidi_level_of_next_char): Invalidate next_en_type when
16797 next_en_pos is over-stepped.
16798
167992011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16800
16801 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16802 * editfns.c: Rewrite current-time-zone so that it invokes
16803 the equivalent of (format-time-string "%Z") to get the time zone name.
16804 This fixes a bug when the time zone name contains characters that
16805 need converting from the system time locale to Emacs internal format.
16806 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16807 that patch fixed format-time-string to do the conversion, but
16808 I forgot to fix current-time-zone.
16809 (format_time_string): New function, containing most of
16810 what Fformat_time_string used to contain.
16811 (Fformat_time_string): Rewrite in terms of format_time_string.
16812 This doesn't change this function's behavior.
16813 (current-time-zone): Rewrite to use format_time_string.
16814 This fixes the bug reported by Michael Schierl in
16815 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16816 Jason Rumney's 2007-06-07 change worked around this bug, but
16817 didn't fix it.
16818 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16819
168202011-10-19 Eli Zaretskii <eliz@gnu.org>
16821
16822 * xdisp.c (start_display): If the character at POS is displayed
16823 via a display vector, reset IT->current.dpvec_index to zero.
16824 (try_window_reusing_current_matrix): If a line ends in a display
16825 vector or the next line starts in a display vector, continue
16826 redrawing the window even though the character position of
16827 start_row was reached.
16828 (Bug#9771, part 2)
16829
168302011-10-18 Chong Yidong <cyd@gnu.org>
16831
16832 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16833 with nobreak-char-display too.
16834
168352011-10-18 Eli Zaretskii <eliz@gnu.org>
16836
16837 Fix part 3 of bug#9771.
16838 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16839 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16840 non-neutral characters if the current character is a paragraph
16841 separator (a.k.a. Newline). This avoids running the same
16842 expensive loop twice, once when we consume the preceding newline
16843 and the other time when the line actually needs to be displayed.
16844 Avoid the loop when we see neutrals on the base embedding level
16845 following a character whose directionality is the same as the
16846 paragraph's. This avoids running the expensive loop when a line
16847 ends in a long sequence of neutrals, like control characters.
16848 Add assertion against STRONG_AL type. Slightly rearrange code
16849 that determines the type of a neutral given the first non-neutral
16850 that follows it.
16851 (bidi_level_of_next_char): Set next_en_pos to zero when
16852 invalidating its info.
16853
168542011-10-17 Eli Zaretskii <eliz@gnu.org>
16855
16856 * xdisp.c (push_display_prop): Determine whether to record string
16857 or buffer position by IT->string, not by IT->method. Allow
16858 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16859 (move_it_vertically_backward): Don't look for character position
16860 immediately after the newline when in a continuation line.
16861 (Bug#9771, part 1)
16862
168632011-10-15 Martin Rudalics <rudalics@gmx.at>
16864
16865 * window.c (coordinates_in_window): Rewrite and delabelize
16866 vertical border check. (Bug#5357) (Bug#9618)
16867
168682011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16869
16870 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16871 errors in XSetWindowBorder (bug#9310).
16872
168732011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16874
16875 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16876 avoid crash when xmalloc overrun checking is enabled.
16877
168782011-10-13 Eli Zaretskii <eliz@gnu.org>
16879
16880 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16881 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16882 cursor motion with <left> and <right> arrow keys.
16883
16884 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16885 some callers set that themselves.
16886
168872011-10-12 Eli Zaretskii <eliz@gnu.org>
16888
16889 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16890 display string and the previous row comes from the same string and
16891 is empty. (Bug#9739) (Bug#9738)
16892
168932011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16894
16895 * doc.c (get_doc_string): Encode file name (bug#9735).
16896
168972011-10-12 Eli Zaretskii <eliz@gnu.org>
16898
16899 * bidi.c (bidi_level_of_next_char):
16900 * xdisp.c (get_visually_first_element): Remove old incorrect
16901 comments regarding the Unicode Line Separator character.
16902
16903 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16904
169052011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16906
16907 * alloc.c (Fgc_status): Do not access beyond zombies array
16908 boundary if nzombies > MAX_ZOMBIES.
16909 * alloc.c (dump_zombies): Add missing format specifier.
16910
169112011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16912
16913 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16914 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16915
16916 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16917 Some packages use them to denote characters with modifiers.
16918
169192011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16920
16921 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16922 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16923 matching a pp-number. Rename parameter var to var1.
16924
169252011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16926
16927 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16928
169292011-10-08 Glenn Morris <rgm@gnu.org>
16930
16931 * callint.c (Fcall_interactively): Give a more explicit error for the
16932 'c' case with a non-character input. (Bug#8479)
16933
169342011-10-08 Eli Zaretskii <eliz@gnu.org>
16935
16936 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16937 lines.
16938 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16939 lines that are hscrolled on the left.
16940
16941 * dispnew.c (buffer_posn_from_coords): Account for a possible
16942 presence of header-line. (Bug#4426)
16943
169442011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16945
16946 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16947 Don't advertise functionality which we discourage or doesn't work.
16948
169492011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16950
16951 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16952 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16953 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16954 this makes Emacs dump core during garbage collection on rare
16955 occasions. sizeof is obviously inferior to offsetof here, so
16956 stick with offsetof.
16957 (GC_POINTER_ALIGNMENT): New macro.
16958 (mark_memory): Omit 3rd (offset) arg; caller changed.
16959 Don't assume EMACS_INT alignment is the same as pointer alignment.
16960
169612011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16962
16963 * keyboard.c (read_key_sequence_remapped): New var.
16964 (read_key_sequence): Compute remapping in the right buffer.
16965 (command_loop_1): Use read_key_sequence's remapping directly.
16966
169672011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16968
16969 * dired.c (file_name_completion): Don't expand file name.
16970 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16971 before checking file name handler.
16972
16973 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16974 they've been requested explicitly (bug#9591).
16975
169762011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16977
16978 * keymap.c (Fsingle_key_description): Use make_specified_string
16979 instead of build_string to build string from push_key_description.
16980 (Bug#5193)
16981
169822011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16983
16984 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16985 This fixes a Y2038 bug on 64-bit hosts.
16986 * buffer.c (reset_buffer):
16987 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16988 (Fclear_buffer_auto_save_failure):
16989 Use 0, not -1, to represent an unset failure time, since time_t
16990 might not be signed.
16991
16992 Remove dependency on glibc malloc internals.
16993 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16994 Move back here from lisp.h, but with their new implementations.
16995 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16996 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16997 * charset.c (charset_table_init): New static var.
16998 (syms_of_charset): Use it instead of xmalloc. This removes a
16999 dependency on glibc malloc internals. See Eli Zaretskii's comment in
17000 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
17001 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
17002 Move back to alloc.c.
17003 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
17004 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
17005
170062011-09-30 Jan Djärv <jan.h.d@swipnet.se>
17007
17008 * nsterm.m (windowDidResize): Call x_set_window_size only when
17009 ns_in_resize is true. Otherwise set pixelwidth/height and
17010 call change_frame_size (Bug#9628).
17011
170122011-09-30 Paul Eggert <eggert@cs.ucla.edu>
17013
17014 Port --enable-checking=all to Fedora 14 x86-64.
17015 * charset.c (syms_of_charset): Also account for glibc malloc's
17016 internal overhead when calculating the initial malloc maximum.
17017
17018 Port --enable-checking=all to Fedora 14 x86.
17019 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
17020 Move to lisp.h.
17021 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
17022 (overrun_check_realloc, overrun_check_free):
17023 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
17024 That way, xmalloc returns a properly-aligned pointer even if
17025 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
17026 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
17027 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
17028 into account when calculating the initial malloc maximum.
17029 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
17030 Move here from alloc.c, so that charset.c can use it too.
17031 Properly align; the old code wasn't right for common 32-bit hosts
17032 when configured with --enable-checking=all.
17033 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
17034 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
17035
170362011-09-29 Eli Zaretskii <eliz@gnu.org>
17037
17038 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
17039 use EDOM.
17040
170412011-09-28 Eli Zaretskii <eliz@gnu.org>
17042
17043 * xdisp.c (compute_display_string_end): If there's no display
17044 string at CHARPOS, return -1.
17045
17046 * bidi.c (bidi_fetch_char): When compute_display_string_end
17047 returns a negative value, treat the character as a normal
17048 character not covered by a display string. (Bug#9624)
17049
170502011-09-28 Juanma Barranquero <lekktu@gmail.com>
17051
17052 * lread.c (Fread_from_string): Fix typo in docstring.
17053
170542011-09-27 Eli Zaretskii <eliz@gnu.org>
17055
17056 * xdisp.c (handle_invisible_prop): If invisible text ends on a
17057 newline, reseat the iterator instead of bidi-iterating there one
17058 character at a time. (Bug#9610)
17059 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
17060 TO_CHARPOS if the bidi iterator is at base embedding level.
17061
170622011-09-27 Andreas Schwab <schwab@linux-m68k.org>
17063
17064 * lread.c (readevalloop): Use correct code for NBSP.
17065 (read1): Likewise. (Bug#9608)
17066
170672011-09-25 Michael Albinus <michael.albinus@gmx.de>
17068
17069 * dbusbind.c (Fdbus_register_signal): When service is not
17070 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
17071
170722011-09-25 Glenn Morris <rgm@gnu.org>
17073
17074 * buffer.c (truncate-lines): Doc fix.
17075
170762011-09-24 Chong Yidong <cyd@stupidchicken.com>
17077
17078 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
17079 (Fset_window_next_buffers): Doc fix.
17080
170812011-09-24 Glenn Morris <rgm@gnu.org>
17082
17083 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
17084
170852011-09-24 Paul Eggert <eggert@cs.ucla.edu>
17086
17087 Fix minor problems found by static checking.
17088 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
17089 * indent.c (Fvertical_motion): Fix == vs = typo.
17090
170912011-09-24 Eli Zaretskii <eliz@gnu.org>
17092
17093 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
17094 Default value is now t. Doc fix.
17095
17096 * indent.c (Fvertical_motion): Compute and apply the overshoot
17097 logic when moving up, not only when moving down. Fix the
17098 confusing name and values of the it_overshoot_expected variable;
17099 logic changes accordingly. (Bug#9254) (Bug#9549)
17100
17101 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
17102 CHARPOS is covered by a display string which includes newlines.
17103 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
17104 is covered by a display string with embedded newlines.
17105
171062011-09-24 Michael Albinus <michael.albinus@gmx.de>
17107
17108 * dbusbind.c (Fdbus_register_signal): Add match rule to
17109 Vdbus_registered_objects_table. (Bug#9581)
17110 (Fdbus_register_method, Vdbus_registered_objects_table):
17111 Fix docstring.
17112
171132011-09-24 Jim Meyering <meyering@redhat.com>
17114
17115 do not ignore write error for any output size
17116 The previous change was incomplete.
17117 While it makes emacs --batch detect the vast majority of stdout
17118 write failures, errors were still ignored whenever the output size is
17119 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
17120 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
17121 && echo FAIL: ignored write error
17122 FAIL: ignored write error
17123 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
17124 && echo FAIL: ignored write error
17125 FAIL: ignored write error
17126 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
17127
171282011-09-23 Andreas Schwab <schwab@linux-m68k.org>
17129
17130 * emacs.c (Fkill_emacs): In noninteractive mode exit
17131 non-successfully if a write error occurred on stdout. (Bug#9574)
17132
171332011-09-21 Eli Zaretskii <eliz@gnu.org>
17134
17135 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
17136 the xassert test.
17137
17138 * dispextern.h (struct it): Update the comment documenting what
17139 can it->OBJECT be.
17140
171412011-09-20 Eli Zaretskii <eliz@gnu.org>
17142
17143 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
17144 a display string, extend search for cursor position to end of row.
17145 (find_row_edges): If the row ends in a newline from a display
17146 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
17147 Handle the case of a display string with multiple newlines.
17148 (Fcurrent_bidi_paragraph_direction): Fix search for previous
17149 non-empty line. Fixes confusing cursor motion with arrow keys at
17150 the beginning of a line that starts with whitespace.
17151
171522011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17153
17154 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
17155 (bug#9493).
17156
171572011-09-18 Chong Yidong <cyd@stupidchicken.com>
17158
17159 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
17160 boolean (Bug#9154).
17161
171622011-09-18 Eli Zaretskii <eliz@gnu.org>
17163
17164 * xdisp.c (display_line): Record maximum and minimum buffer
17165 positions even if no glyphs were produced (e.g., by a zero-width
17166 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
17167 buffer positions that will be removed from the glyph row because
17168 they don't fit.
17169 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
17170 column is beyond frame width: don't subtract 1 "pixel" when
17171 computing width of the stretch.
17172 (reseat_at_next_visible_line_start): Undo the change made on
17173 2011-09-17 that saved paragraph information and restored it after
17174 the call to `reseat'. (Bug#9545)
17175
171762011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17177
17178 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
17179 and turn window cursor on if cleared (Bug#9415).
17180
171812011-09-18 Andreas Schwab <schwab@linux-m68k.org>
17182
17183 * search.c (boyer_moore): Take unibyte characters from pattern
17184 literally. (Bug#9458)
17185
171862011-09-18 Eli Zaretskii <eliz@gnu.org>
17187
17188 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
17189
171902011-09-18 Paul Eggert <eggert@cs.ucla.edu>
17191
17192 Fix minor problem found by static checking.
17193 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
17194 initialized, to pacify gcc -Wuninitialized.
17195
17196 * fileio.c: Report proper errno when syscall falls.
17197 (Finsert_file_contents): Save and restore errno,
17198 so that report_file_error outputs the correct diagnostic.
17199 (Fwrite_region) [CLASH_DETECTION]: Likewise.
17200
172012011-09-18 Eli Zaretskii <eliz@gnu.org>
17202
17203 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
17204
172052011-09-17 Eli Zaretskii <eliz@gnu.org>
17206
17207 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
17208 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
17209
172102011-09-17 Eli Zaretskii <eliz@gnu.org>
17211
17212 * xdisp.c (reseat_at_next_visible_line_start): Keep information
17213 about the current paragraph and restore it after the call to reseat.
17214
17215 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
17216 (bidi_find_paragraph_start): Search back for paragraph beginning
17217 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
17218 (bidi_move_to_visually_next): Only trigger paragraph-related
17219 computations when the last character is a newline or at EOB, not
17220 just any NEUTRAL_B. (Bug#9470)
17221
17222 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
17223 truncated lines if point is covered by a display string. (Bug#9524)
17224
172252011-09-16 Paul Eggert <eggert@cs.ucla.edu>
17226
17227 * xselect.c: Relax test for outgoing X longs (Bug#9498).
17228 (cons_to_x_long): New function.
17229 (lisp_data_to_selection_data): Use it. Correct the test for
17230 short-versus-long data; it was negated. Break out of vector
17231 loop, for efficiency, when a long datum is discovered.
17232
172332011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
17234
17235 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
17236
172372011-09-16 Eli Zaretskii <eliz@gnu.org>
17238
17239 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
17240 GCC PR/17406) by declaring this function with external scope.
17241
172422011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17243
17244 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
17245 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
17246
172472011-09-15 Andreas Schwab <schwab@linux-m68k.org>
17248
17249 * editfns.c (Fformat): Correctly handle text properties on "%%".
17250
172512011-09-15 Eli Zaretskii <eliz@gnu.org>
17252
17253 * xterm.c (x_draw_composite_glyph_string_foreground):
17254 * w32term.c (x_draw_composite_glyph_string_foreground):
17255 * term.c (encode_terminal_code):
17256 * composite.c (composition_update_it, get_composition_id):
17257 * xdisp.c (get_next_display_element)
17258 (fill_composite_glyph_string): Add comments about special meaning
17259 of TAB characters in a composition.
17260
172612011-09-15 Paul Eggert <eggert@cs.ucla.edu>
17262
17263 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
17264 This occurs when processing a multibyte format.
17265 Problem reported by Wolfgang Jenker.
17266
172672011-09-15 Johan Bockgård <bojohan@gnu.org>
17268
17269 * xdisp.c (try_cursor_movement): Only check for exact match if
17270 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
17271
172722011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17273
17274 Remove unused external symbols.
17275 * dispextern.h (calc_pixel_width_or_height): Remove decl.
17276 * xdisp.c (calc_pixel_width_or_height): Now static.
17277 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
17278 * indent.c (check_display_width):
17279 * w32term.c: Fix comment to match code.
17280 * xterm.c, xterm.h (x_catching_errors): Remove.
17281
172822011-09-14 Paul Eggert <eggert@cs.ucla.edu>
17283
17284 * xselect.c: Use signed conversions more consistently (Bug#9498).
17285 (selection_data_to_lisp_data): Assume incoming selection data are
17286 signed integers, not unsigned. This is to be consistent with
17287 outgoing selection data, which was modified to use signed integers
17288 in as part of the fix to Bug#9196 in response to Jan D.'s comment
17289 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
17290 expects long, not unsigned long.
17291
172922011-09-14 Eli Zaretskii <eliz@gnu.org>
17293
17294 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
17295 computation of loop end. Reported by Johan Bockgård
17296 <bojohan@gnu.org>.
17297
172982011-09-13 Chong Yidong <cyd@stupidchicken.com>
17299
17300 * frame.c (Fother_visible_frames_p): Function deleted.
17301
173022011-09-12 Eli Zaretskii <eliz@gnu.org>
17303
17304 * indent.c (compute_motion): Process display vector front to back
17305 rather than the other way around. (Bug#2496)
17306
173072011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
17308
17309 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
17310
173112011-09-11 Chong Yidong <cyd@stupidchicken.com>
17312
17313 * minibuf.c (Fread_from_minibuffer): Doc fix.
17314
173152011-09-11 Eli Zaretskii <eliz@gnu.org>
17316
17317 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
17318 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
17319
173202011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17321
17322 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
17323 value for non-existent files.
17324
173252011-09-11 Eli Zaretskii <eliz@gnu.org>
17326
17327 * fileio.c (Finsert_file_contents): If the file cannot be opened,
17328 set its "size" to -1. This will set the modtime_size field of
17329 the corresponding buffer to -1, which is what
17330 verify-visited-file-modtime expects for files that do not exist.
17331 (Bug#9139)
17332
173332011-09-11 Paul Eggert <eggert@cs.ucla.edu>
17334
17335 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
17336 here ...
17337 * lisp.h: ... from here. push_key_description is no longer
17338 defined in keyboard.c, so its declaration should not be in
17339 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
17340 logically belongs with push_key_description.
17341
173422011-09-10 Paul Eggert <eggert@cs.ucla.edu>
17343
17344 * buffer.h: Include <sys/types.h> instead of <time.h>.
17345 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
17346 Problem reported by Herbert J. Skuhra.
17347
173482011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
17349
17350 * xml.c (parse_region): Make the parsing work for
17351 non-comment-starting XML files again (bug#9144).
17352
173532011-09-10 Andreas Schwab <schwab@linux-m68k.org>
17354
17355 * image.c (gif_load): Fix calculation of bottom and right corner.
17356 (Bug#9468)
17357
173582011-09-10 Eli Zaretskii <eliz@gnu.org>
17359
17360 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
17361 redisplay in small windows.
17362
173632011-09-09 Eli Zaretskii <eliz@gnu.org>
17364
17365 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
17366
173672011-09-08 Martin Rudalics <rudalics@gmx.at>
17368
17369 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
17370 Operate on live windows only.
17371
173722011-09-08 Juanma Barranquero <lekktu@gmail.com>
17373
17374 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
17375
173762011-09-07 Eli Zaretskii <eliz@gnu.org>
17377
17378 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
17379 only under bidi iteration.
17380
173812011-09-07 Jan Djärv <jan.h.d@swipnet.se>
17382
17383 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
17384
173852011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17386
17387 isnan: Fix porting problem to Solaris 10 with bundled gcc.
17388 Without this fix, the command to link temacs failed due to an
17389 undefined symbol __builtin_isnan. This is because
17390 /usr/include/iso/math_c99.h #defines isnan(x) to
17391 __builtin_isnan(x), but the bundled gcc, which identifies itself
17392 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
17393 a __builtin_isnan.
17394 * floatfns.c (isnan): #undef, and then #define to a clone of
17395 what's in data.c.
17396 (Fisnan): Always define, since it's always available now.
17397 (syms_of_floatfns): Always define isnan at the Lisp level.
17398
173992011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17400
17401 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17402
174032011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17404
17405 * fileio.c: Fix bugs with large file offsets (Bug#9428).
17406 The previous code assumed that file offsets (off_t values) fit in
17407 EMACS_INT variables, which is not true on typical 32-bit hosts.
17408 The code messed up by falsely reporting buffer overflow in cases
17409 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17410 when "big" contains more than 2**29 bytes, even though this
17411 inserts just one byte and does not overflow the buffer.
17412 (Finsert_file_contents): Store file offsets as off_t
17413 values, not as EMACS_INT values. Check for overflow when
17414 converting between EMACS_INT and off_t. When checking for
17415 buffer overflow or for overlap, take the offsets into account.
17416 Don't use EMACS_INT for small values where int suffices.
17417 When checking for overlap, fix a typo: ZV was used where
17418 ZV_BYTE was intended.
17419 (Fwrite_region): Don't assume off_t fits into 'long'.
17420 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17421
174222011-09-05 Michael Albinus <michael.albinus@gmx.de>
17423
17424 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17425
174262011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17427
17428 sprintf-related integer and memory overflow issues (Bug#9412).
17429
17430 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
17431 (esprintf, exprintf, evxprintf): New functions.
17432 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
17433 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
17434 (modify_event_symbol): Do not assume that the length of
17435 name_alist_or_stem is safe to alloca and fits in int.
17436 (Fexecute_extended_command): Likewise for function name and binding.
17437 (Frecursion_depth): Wrap around reliably on integer overflow.
17438 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17439 since some callers pass EMACS_INT values.
17440 (Fsingle_key_description): Don't crash if symbol name contains more
17441 than MAX_ALLOCA bytes.
17442 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17443 (get_minibuffer): Arg is now EMACS_INT, not int.
17444 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
17445 (esprintf, exprintf, evxprintf): New decls.
17446 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17447
17448 * dbusbind.c (signature_cat): New function.
17449 (xd_signature, Fdbus_register_signal):
17450 Do not overrun buffer; instead, report string overflow.
17451
17452 * dispnew.c (add_window_display_history): Don't overrun buffer.
17453 Truncate instead; this is OK since it's just a log.
17454
17455 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17456 even if the time zone offset is outlandishly large.
17457 Don't mishandle offset == INT_MIN.
17458
17459 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17460 when creating daemon; the previous buffer-overflow check was incorrect.
17461
17462 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17463 which has the guts of the old verror function.
17464
17465 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17466 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17467
17468 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17469 (font_unparse_xlfd): Don't blindly alloca long strings.
17470 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
17471 fits in int, when using sprintf. Use single snprintf to count
17472 length of string rather than counting it via multiple sprintfs;
17473 that's simpler and more reliable.
17474 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17475 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17476 sprintf, in case result does not fit in int.
17477
17478 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17479 (fontset_from_font): Print it.
17480
17481 * frame.c (tty_frame_count): Now printmax_t, not int.
17482 (make_terminal_frame, set_term_frame_name): Print it.
17483 (x_report_frame_params): In X, window IDs are unsigned long,
17484 not signed long, so print them as unsigned.
17485 (validate_x_resource_name): Check for implausibly long names,
17486 and don't assume name length fits in 'int'.
17487 (x_get_resource_string): Don't blindly alloca invocation name;
17488 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17489 not fit in int.
17490
17491 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17492 (xg_check_special_colors, xg_set_geometry):
17493 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17494
17495 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17496 Use esprintf, not sprintf, in case result does not fit in int.
17497
17498 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17499 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17500 it as a large positive number.
17501 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17502 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17503
17504 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17505 in case result does not fit in int.
17506
17507 * print.c (float_to_string): Detect width overflow more reliably.
17508 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17509 buffer overrun. Don't assume list length fits in 'int'. Treat
17510 print length of 0 as 0, not as infinity; to be consistent with other
17511 uses of print length in this function. Don't overflow print length
17512 index. Don't assume hash table size fits in 'long', or that
17513 vectorlike size fits in 'unsigned long'.
17514
17515 * process.c (make_process): Use printmax_t, not int, to format
17516 process-name gensyms.
17517
17518 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17519
17520 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17521 to avoid potential buffer overrun.
17522
17523 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17524 if X resource line is longer than 512 bytes.
17525
17526 * xfns.c (x_window): Make sprintf buffer a bit bigger
17527 to avoid potential buffer overrun.
17528
17529 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17530
17531 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17532
175332011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17534
17535 Integer overflow fixes for scrolling, etc.
17536 Without these, Emacs silently mishandles large integers sometimes.
17537 For example, "C-u 4294967297 M-x recenter" was treated as if
17538 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17539
17540 * xdisp.c (try_window_id): Check Emacs fixnum range before
17541 converting to 'int'.
17542
17543 * window.c (window_scroll_line_based, Frecenter):
17544 Check that an Emacs fixnum is in range before assigning it to 'int'.
17545 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17546 values converted from Emacs fixnums.
17547 (Frecenter): Don't wrap around a line count if it is out of 'int'
17548 range; instead, treat it as an extreme value.
17549 (Fset_window_configuration, compare_window_configurations):
17550 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17551
17552 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17553 that can exceed INT_MAX. Check that EMACS_INT value is in range
17554 before assigning it to the (possibly-narrower) index.
17555 (match_limit): Don't assume that a fixnum can fit in 'int'.
17556
17557 * print.c (print_object): Use ptrdiff_t, not int, for index that can
17558 exceed INT_MAX.
17559
17560 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
17561 (Fvertical_motion): Don't wrap around LINES values that don't fit
17562 in 'int'. Instead, treat them as extreme values. This is good
17563 enough for windows, which can't have more than INT_MAX lines anyway.
17564
175652011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17566
17567 * Require libxml/parser.h to avoid compilation warning.
17568
17569 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17570
17571 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17572 since this reportedly can destroy thread storage.
17573
175742011-08-30 Chong Yidong <cyd@stupidchicken.com>
17575
17576 * syntax.c (find_defun_start): Update all cache variables if
17577 exiting early (Bug#9401).
17578
175792011-08-30 Eli Zaretskii <eliz@gnu.org>
17580
17581 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17582
17583 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17584 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17585 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17586
17587 * term.c (tty_append_glyph): New function.
17588 (produce_stretch_glyph): Static function and its prototype deleted.
17589
17590 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17591 Add prototypes.
17592
175932011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17594
17595 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17596 when checking :margin (Bug#9390).
17597 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
17598 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
17599 so that the name doesn't mislead. All uses changed.
17600
176012011-08-28 Johan Bockgård <bojohan@gnu.org>
17602
17603 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17604 set_tty_hooks.
17605
176062011-08-27 Eli Zaretskii <eliz@gnu.org>
17607
17608 * xdisp.c (move_it_to): Don't bail out early when reaching
17609 position beyond to_charpos, if we are scanning backwards.
17610 (move_it_vertically_backward): When DY == 0, make sure we get to
17611 the first character in the line after the newline.
17612
176132011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17614
17615 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17616 (ccl_driver): Do not generate an out-of-range pointer.
17617 (Fccl_execute_on_string): Remove unnecessary check for
17618 integer overflow, noted by Stefan Monnier in
17619 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17620 Remove a FIXME that didn't need fixing.
17621 Simplify the newly-introduced buffer reallocation code.
17622
176232011-08-27 Juanma Barranquero <lekktu@gmail.com>
17624
17625 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17626
176272011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17628
17629 Integer and memory overflow issues (Bug#9196).
17630
17631 * doc.c (get_doc_string): Rework so that
17632 get_doc_string_buffer_size is the actual buffer size, rather than
17633 being 1 less than the actual buffer size; this makes xpalloc more
17634 convenient.
17635
17636 * image.c (x_allocate_bitmap_record, cache_image):
17637 * xselect.c (Fx_register_dnd_atom):
17638 Simplify previous changes by using xpalloc.
17639
17640 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17641 since either will do and ptrdiff_t is convenient with xpalloc.
17642
17643 * charset.c (charset_table_size)
17644 (struct charset_sort_data.priority): Now ptrdiff_t.
17645 (charset_compare): Don't overflow if priorities differ greatly.
17646 (Fsort_charsets): Don't assume list length fits in int.
17647 Check for size-calculation overflow when allocating sort data.
17648 (syms_of_charset): Allocate an initial charset table that is
17649 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17650
17651 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17652
17653 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17654 The actual value is always <= INT_MAX, and leaving it unsigned made
17655 overflow checking harder.
17656
17657 * dispextern.h (struct glyph_matrix.rows_allocated)
17658 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17659 with xpalloc. The values are still always <= INT_MAX.
17660
17661 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17662
17663 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17664 (SAFE_NALLOCA): New macro.
17665
17666 * region-cache.c (struct boundary.pos, find_cache_boundary)
17667 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17668 (set_cache_region, invalidate_region_cache)
17669 (revalidate_region_cache, know_region_cache, region_cache_forward)
17670 (region_cache_backward, pp_cache):
17671 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17672 so that ptrdiff_t * can be passed to xpalloc.
17673 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17674 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17675 (pp_cache): Don't assume cache_len fits in int.
17676 * region-cache.h: Adjust extern decls to match.
17677
17678 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17679 EMACS_INT, since either will do, for xpalloc.
17680
17681 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17682 (xnmalloc, xnrealloc, xpalloc): New functions.
17683
17684 * bidi.c (bidi_shelve_header_size): New constant.
17685 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17686 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17687
17688 * bidi.c (bidi_cache_shrink):
17689 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17690 (overlay_strings):
17691 Don't update size of array until after memory allocation succeeds,
17692 because xmalloc/xrealloc may not return.
17693 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17694 now that we have proper integer overflow checking.
17695 (record_overlay_string, overlay_strings): Catch overflows when
17696 calculating size of overlay_str_buf.
17697
17698 * callproc.c (Fcall_process): Check for size overflow when
17699 calculating size of args2.
17700 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17701 Normally we prefer signed values, but sticking with ptrdiff_t would
17702 require adding more-complicated checks.
17703
17704 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17705 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17706 Redo buffer-overflow calculations to avoid integer overflow.
17707 Add a FIXME comment where memory seems to be over-allocated.
17708
17709 * character.c (Fstring): Check for size-calculation overflow.
17710
17711 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17712 unnecessary integer overflow. Check for size overflow.
17713 (encode_coding_object): Don't update size until xmalloc succeeds.
17714
17715 * composite.c (get_composition_id): Check for overflow in glyph
17716 length calculations.
17717
17718 Integer and memory overflow fixes for display code.
17719 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17720 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17721 (scrolling_window): Check for overflow in size calculations.
17722 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17723 Don't assume glyph table len fits in int.
17724 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17725 (row_table_size): Now ptrdiff_t, not int.
17726 (scrolling_window): Avoid overflow in size calculations.
17727 Don't update size until allocation succeeds.
17728 * fns.c (concat): Check for overflow in size calculations.
17729 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17730 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17731 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17732
17733 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17734 (get_doc_string): Check for size calculation overflow.
17735 Don't update size until allocation succeeds.
17736 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17737 EMACS_INT, where ptrdiff_t will do.
17738 (Fsubstitute_command_keys): Check for string overflow.
17739
17740 * editfns.c (set_time_zone_rule): Don't assume environment length
17741 fits in int.
17742 (message_length): Now ptrdiff_t, not int.
17743 (Fmessage_box): Don't update size until allocation succeeds.
17744 Don't assume message length fits in int.
17745 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17746
17747 * emacs.c (main): Do not reallocate argv, since there is a null at
17748 the end that can be overwritten, and this way there's no need to
17749 worry about size-calculation overflow.
17750 (sort_args): Check for size-calculation overflow.
17751
17752 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17753 alloc succeeds.
17754 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17755
17756 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17757 (x_set_scroll_bar_width, x_figure_window_size):
17758 Check for integer overflow.
17759 (x_set_alpha): Do not assume XINT fits in int.
17760
17761 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17762 This is for the members text_lines, text_cols, total_lines, total_cols,
17763 where the system imposes an 'int' limit.
17764
17765 * fringe.c (Fdefine_fringe_bitmap):
17766 Don't update size until alloc works.
17767
17768 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17769 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17770
17771 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17772 Check for size-calculation overflow.
17773 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17774 do, as we prefer signed integers.
17775 (id_to_widget.max_size, id_to_widget.used)
17776 (xg_store_widget_in_map, xg_remove_widget_from_map)
17777 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17778 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17779 Use and return ptrdiff_t, not int.
17780 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17781 * gtkutil.h: Change prototypes to match the above.
17782
17783 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17784 are duplicate now that they've been promoted to lisp.h.
17785 (x_allocate_bitmap_record, x_alloc_image_color)
17786 (make_image_cache, cache_image, xpm_load):
17787 Don't update size until alloc is done.
17788 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17789 (x_detect_edges):
17790 Check for size calculation overflow.
17791 (ct_colors_allocated_max): New constant.
17792 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17793 overflow.
17794
17795 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17796 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17797 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17798 Use ptrdiff_t, not int, to count maps.
17799 (read_char_minibuf_menu_prompt): Check for overflow in size
17800 calculations. Don't update size until allocation succeeds.
17801 Redo calculations to avoid overflow.
17802 * keyboard.h: Change prototypes to match the above.
17803
17804 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17805 to count maps.
17806 (current_minor_maps): Check for size calculation overflow.
17807 * keymap.h: Change prototypes to match the above.
17808
17809 * lread.c (read1, init_obarray): Don't update size until alloc done.
17810
17811 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17812 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17813
17814 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17815 Now ptrdiff_t, not int.
17816 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17817 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17818
17819 * process.c (Fnetwork_interface_list): Check for overflow
17820 in size calculation.
17821
17822 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17823
17824 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17825 overflow. Don't bother calling xmalloc when xrealloc will do.
17826
17827 * search.c (Freplace_match): Check for size calculation overflow.
17828 (Fset_match_data): Don't assume list lengths fit in 'int'.
17829
17830 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17831 for command line length. Do not attempt to address one before the
17832 beginning of an array, as that's not portable.
17833
17834 * term.c (max_frame_lines): Remove; unused.
17835 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17836 not int.
17837 (encode_terminal_code, calculate_costs): Check for size
17838 calculation overflow.
17839 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17840 table lengths and related sizes. Don't update size until alloc
17841 done. Redo calculations to avoid overflow.
17842 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17843
17844 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17845 subtracting pointers.
17846 (gobble_line): Check for overflow more carefully. Don't update size
17847 until alloc done.
17848
17849 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17850 Don't update size until alloc done.
17851 Redo size calculations to avoid overflow.
17852 Check for size calculation overflow.
17853 (main) [DEBUG]: Fix typo in invoking tparam1.
17854
17855 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17856 Use ptrdiff_t, not int, for sizes.
17857 (store_mode_line_noprop_char): Don't update size until alloc done.
17858
17859 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17860 Use ptrdiff_t, not int, for sizes.
17861 (Finternal_make_lisp_face, cache_face):
17862 Check for size calculation overflow.
17863 (cache_face): Treat size calculation overflows as if they were
17864 memory exhaustion (the usual treatment), rather than aborting.
17865
17866 * xfns.c (x_encode_text, x_set_name_internal)
17867 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17868 sizes, since they can exceed INT_MAX in size. Check for size
17869 calculation overflow.
17870
17871 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17872 (xg_select): Check for size calculation overflow.
17873 Don't update size until alloc done.
17874
17875 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17876 as sprintf is limited to int lengths.
17877
17878 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17879 (X_LONG_MIN): New macros.
17880 Use them to make the following changes clearer.
17881 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17882 This change doesn't affect the value now, but it may help remind
17883 future maintainers not to raise the value too much later.
17884 (SELECTION_QUANTUM): Remove, replacing with ...
17885 (selection_quantum): ... new function, which avoids overflow.
17886 All uses changed.
17887 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17888 assumption that selection length fits in 'int'.
17889 (x_reply_selection_request, x_handle_selection_request)
17890 (x_get_window_property, receive_incremental_selection)
17891 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17892 (lisp_data_to_selection_data, clean_local_selection_data):
17893 Use ptrdiff_t, not int, to record length of selection.
17894 (x_reply_selection_request, x_get_window_property)
17895 (receive_incremental_selection, x_property_data_to_lisp):
17896 Redo calculations to avoid overflow.
17897 (x_reply_selection_request): When sending hint, ceiling it at
17898 X_LONG_MAX rather than relying on wraparound overflow to send
17899 something.
17900 (x_get_window_property, receive_incremental_selection)
17901 (lisp_data_to_selection_data, x_property_data_to_lisp):
17902 Check for size-calculation overflow.
17903 (x_get_window_property, receive_incremental_selection)
17904 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17905 Don't store size until memory allocation succeeds.
17906 (x_get_window_property): Plug memory leak on memory exhaustion.
17907 Don't double-block input; malloc is safe here. Don't assume 2**34
17908 - 4 fits in unsigned long. Add an xassert to check
17909 XGetWindowProperty overflow. Be more careful about overflow
17910 calculations, and distinguish size from memory overflow better.
17911 (receive_incremental_selection): When tracing, don't assume
17912 unsigned int is less than INT_MAX.
17913 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17914 harmful) conversions of unsigned short to int.
17915 (lisp_data_to_selection_data): Don't assume that integers
17916 in the range -65535 through -1 fit in an X unsigned short.
17917 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17918 result parameters unless successful. Rely on cons_to_unsigned
17919 to report problems with elements; the old code wasn't right anyway.
17920 (x_check_property_data): Check for int overflow; we cannot use
17921 a wider type due to X limits.
17922 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17923
17924 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17925
17926 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17927 (x_term_init): Check for size calculation overflow.
17928 (x_color_cells): Don't store size until memory allocation succeeds.
17929 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17930 Don't assume alloca size is less than MAX_ALLOCA.
17931 (x_term_init): Don't assume length fits in int (sprintf is limited
17932 to int size).
17933
17934 Use ptrdiff_t for composition IDs.
17935 * character.c (lisp_string_width):
17936 * composite.c (composition_table_size, n_compositions)
17937 (get_composition_id, composition_gstring_from_id):
17938 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17939 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17940 * window.c (Frecenter):
17941 Use ptrdiff_t, not int, for composition IDs.
17942 * composite.c (get_composition_id): Check for integer overflow.
17943 * composite.h: Adjust prototypes to match the above changes.
17944
17945 Use ptrdiff_t for hash table indexes.
17946 * category.c (hash_get_category_set):
17947 * ccl.c (ccl_driver):
17948 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17949 * coding.c (coding_system_charset_list, detect_coding_system):
17950 * coding.h (struct coding_system.id):
17951 * composite.c (get_composition_id, gstring_lookup_cache):
17952 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17953 * image.c (xpm_get_color_table_h):
17954 * lisp.h (hash_lookup, hash_put):
17955 * minibuf.c (Ftest_completion):
17956 Use ptrdiff_t for hash table indexes, not int (which is too
17957 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17958 32-bit --with-wide-int hosts).
17959
17960 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17961 Add a FIXME comment about memory leaks.
17962 (syms_of_charset): Don't assume xmalloc returns.
17963
17964 Don't assume that stated character widths fit in int.
17965 * character.c (Fchar_width, c_string_width, lisp_string_width):
17966 * character.h (CHAR_WIDTH):
17967 * indent.c (MULTIBYTE_BYTES_WIDTH):
17968 Use sanitize_char_width to avoid undefined and/or bad behavior
17969 with outlandish widths.
17970 * character.h (sanitize_tab_width): Rename from sanitize_width,
17971 now that we have two such functions. All uses changed.
17972 (sanitize_char_width): New inline function.
17973
17974 Don't assume that tab-width fits in int.
17975 * character.h (sanitize_width): New inline function.
17976 (SANE_TAB_WIDTH): New macro.
17977 (ASCII_CHAR_WIDTH): Use it.
17978 * indent.c (sane_tab_width): Remove. All uses replaced by
17979 SANE_TAB_WIDTH (current_buffer).
17980 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17981
17982 * fileio.c: Integer overflow issues with file modes.
17983 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17984
17985 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17986 Remove unreachable code.
17987 (read_hex, load_charset_map_from_file): Check for integer overflow.
17988
17989 * xterm.c: Don't go over XClientMessageEvent limit.
17990 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17991 (x_send_scroll_bar_event): Likewise. Check that the size does not
17992 exceed limits imposed by XClientMessageEvent, as well as the usual
17993 ptrdiff_t and size_t limits.
17994
17995 * keyboard.c: Overflow, signedness and related fixes.
17996 (make_lispy_movement): Use same integer type in forward decl
17997 that is used in the definition.
17998 (read_key_sequence, keyremap_step):
17999 Change bufsize argument back to int, undoing my 2011-03-30 change.
18000 We prefer signed types, and int is wide enough here.
18001 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
18002 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
18003 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
18004 length, not size_t. Use ptrdiff_t for index, not int.
18005 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
18006 possibility of integer overflow.
18007
18008 Overflow, signedness and related fixes for images.
18009
18010 * dispextern.h (struct it.stack[0].u.image.image_id)
18011 (struct_it.image_id, struct image.id, struct image_cache.size)
18012 (struct image_cache.used, struct image_cache.ref_count):
18013 * gtkutil.c (update_frame_tool_bar):
18014 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
18015 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
18016 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
18017 * nsmenu.m (update_frame_tool_bar):
18018 * xdisp.c (calc_pixel_width_or_height):
18019 * xfns.c (image_cache_refcount):
18020 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
18021 on typical 64-bit hosts.
18022
18023 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
18024 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
18025 Omit unnecessary casts to int.
18026 (parse_image_spec): Check that integers fall into 'int' range
18027 when the callers expect that.
18028 (image_ascent): Redo ascent calculation to avoid int overflow.
18029 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
18030 (lookup_image): Remove unnecessary tests.
18031 (xbm_image_p): Locals are now of int, not EMACS_INT,
18032 since parse_image_check makes sure they fit into int.
18033 (png_load, gif_load, svg_load_image):
18034 Prefer int to unsigned where either will do.
18035 (tiff_handler): New function, combining the cores of the
18036 old tiff_error_handler and tiff_warning_handler.
18037 This function is rewritten to use vsnprintf and thereby avoid
18038 stack buffer overflows. It uses only the features of vsnprintf
18039 that are common to both POSIX and native Microsoft.
18040 (tiff_error_handler, tiff_warning_handler): Use it.
18041 (tiff_load, gif_load, imagemagick_load_image):
18042 Don't assume :index value fits in 'int'.
18043 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
18044 (imagemagick_load_image): Check that crop parameters fit into
18045 the integer types that MagickCropImage accepts. Don't assume
18046 Vimagemagick_render_type has a nonnegative value. Don't assume
18047 size_t fits in 'long'.
18048 (gs_load): Use printmax_t to print the widest integers possible.
18049 Check for integer overflow when computing image height and width.
18050
180512011-08-26 Eli Zaretskii <eliz@gnu.org>
18052
18053 * xdisp.c (redisplay_window): Don't force window start if point
18054 will be invisible in the resulting window. (Bug#9324)
18055
180562011-08-25 Eli Zaretskii <eliz@gnu.org>
18057
18058 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
18059 the display spec is of the form `(space ...)'.
18060 (handle_display_spec): Return the value returned by
18061 handle_single_display_spec, not just 1 or zero.
18062 (handle_single_display_spec): If the display spec is of the form
18063 `(space ...)', and specifies display in the text area, return 2
18064 rather than 1.
18065 (try_cursor_movement): Check for the need to scroll more
18066 accurately, and prefer exact match for point under bidi.
18067 Don't advance `row' beyond the last row of the window.
18068
18069 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
18070 into disp_prop; all users changed.
18071
18072 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
18073 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
18074 for the text covered by the display property.
18075
180762011-08-25 Chong Yidong <cyd@stupidchicken.com>
18077
18078 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
18079 Change return value to nil.
18080 (Frecord_buffer): Delete unused function.
18081
180822011-08-24 Eli Zaretskii <eliz@gnu.org>
18083
18084 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
18085 buffers, return left-to-right.
18086 (set_cursor_from_row): Consider candidate row a win if its glyph
18087 represents a newline and point is on that newline. Fixes cursor
18088 positioning on the newline at EOL of R2L text within L2R
18089 paragraph, and vice versa.
18090 (try_cursor_movement): Check continued rows, in addition to
18091 continuation rows. Fixes unwarranted scroll when point enters a
18092 continued line of R2L text within an L2R paragraph, or vice versa.
18093 (cursor_row_p): Consider the case of point being equal to
18094 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
18095 from the end of a short line to the beginning of a continued line
18096 of R2L text within L2R paragraph.
18097 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
18098 composed characters.
18099
18100 * bidi.c (bidi_check_type): Use xassert.
18101 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
18102 members.
18103
181042011-08-23 Eli Zaretskii <eliz@gnu.org>
18105
18106 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
18107 a character.
18108
181092011-08-23 Chong Yidong <cyd@stupidchicken.com>
18110
18111 * nsfont.m (ns_otf_to_script): Fix typo.
18112
181132011-08-22 Kenichi Handa <handa@m17n.org>
18114
18115 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
18116 extra slot even if the purpose is char-code-property-table.
18117
181182011-08-23 Eli Zaretskii <eliz@gnu.org>
18119
18120 * xdisp.c (redisplay_window): When computing centering_position,
18121 account for the height of the header line. (Bug#8874)
18122
18123 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
18124 instead of CHAR_TO_BYTE. Fixes a crash when a completion
18125 candidate is selected by the mouse, and that candidate has a
18126 composed character under the mouse.
18127
18128 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
18129 coordinates reported by pos-visible-in-window-p for a composed
18130 character in column zero.
18131
181322011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
18133
18134 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
18135
181362011-08-22 Eli Zaretskii <eliz@gnu.org>
18137
18138 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
18139 consider it a hit if to_charpos is anywhere in the range of the
18140 composed buffer positions.
18141
181422011-08-22 Chong Yidong <cyd@stupidchicken.com>
18143
18144 * image.c (gif_load): Don't assume that each subimage has the same
18145 dimensions as the base image. Handle disposal method that is
18146 "undefined" by the gif spec (Bug#9335).
18147
181482011-08-20 Chong Yidong <cyd@stupidchicken.com>
18149
18150 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
18151 (Fcondition_case): Document `debug' symbol in error handler.
18152
181532011-08-19 Eli Zaretskii <eliz@gnu.org>
18154
18155 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
18156 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
18157 from an Org mode buffer to a Speedbar frame.
18158
18159 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
18160 a composition, take its buffer position from IT->cmp_it.charpos.
18161 Fixes cursor positioning at the beginning of a line that begins
18162 with a composed character.
18163
181642011-08-18 Eli Zaretskii <eliz@gnu.org>
18165
18166 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
18167 character bidirectional type, use STRONG_L instead. Fixes crashes
18168 in a buffer produced by `describe-categories'.
18169
18170 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
18171 members before the level stack, so they would be saved and
18172 restored when copying iterator state. Fixes incorrect reordering
18173 around TABs covered by display properties.
18174
181752011-08-18 Andreas Schwab <schwab@linux-m68k.org>
18176
18177 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
18178
181792011-08-17 Chong Yidong <cyd@stupidchicken.com>
18180
18181 * eval.c (internal_condition_case, internal_condition_case_1)
18182 (internal_condition_case_2, internal_condition_case_n):
18183 Remove unnecessary aborts (Bug#9081).
18184
181852011-08-17 Eli Zaretskii <eliz@gnu.org>
18186
18187 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
18188 has no `load' handler, try opening the file locally. (Bug#9311)
18189
181902011-08-16 Ken Brown <kbrown@cornell.edu>
18191
18192 * gmalloc.c: Expand comment.
18193
181942011-08-16 Eli Zaretskii <eliz@gnu.org>
18195
18196 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
18197 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
18198
181992011-08-16 Ken Brown <kbrown@cornell.edu>
18200
18201 Fix memory allocation problems in Cygwin build (Bug#9273).
18202
18203 * unexcw.c (__malloc_initialized): Declare external variable.
18204 (fixup_executable): Force the dumped emacs to reinitialize malloc.
18205
18206 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
18207 New variables.
18208 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
18209 dumped emacs.
18210 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
18211 in the static heap.
18212 [CYGWIN] (special_realloc): New function.
18213 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
18214 requests to realloc storage in the static heap.
18215
182162011-08-15 Paul Eggert <eggert@cs.ucla.edu>
18217
18218 * bidi.c (bidi_initialize): Remove unused local.
18219
182202011-08-15 Eli Zaretskii <eliz@gnu.org>
18221
18222 * bidimirror.h:
18223 * biditype.h: Remove file.
18224 * makefile.w32-in ($(BLD)/bidi.$(O)):
18225 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
18226
18227 * dispextern.h: Fix a typo in the comment to bidi_type_t.
18228
18229 * chartab.c: Improve commentary for the uniprop_table API.
18230
18231 * bidi.c (bidi_paragraph_init): Support zero value of
18232 bidi_ignore_explicit_marks_for_paragraph_level.
18233 (bidi_initialize): Use uniprop_table instead of including
18234 biditype.h and bidimirror.h.
18235
18236 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
18237 coordinates of the iterator when restoring from ppos_it.
18238 (Bug#9296)
18239
182402011-08-14 Kenichi Handa <handa@m17n.org>
18241
18242 * process.c (create_process): Call setup_process_coding_systems
18243 after the pid of the process is set to -1 (Bug#8162).
18244
182452011-08-14 Eli Zaretskii <eliz@gnu.org>
18246
18247 * xdisp.c (move_it_in_display_line_to): Don't invoke
18248 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
18249 ppos_it. Fixes vertical cursor motion when line beginning is
18250 covered by an image. (Bug#9296)
18251
182522011-08-14 Jan Djärv <jan.h.d@swipnet.se>
18253
18254 * nsterm.h (ns_run_ascript): Declare.
18255 (NSAPP_DATA2_RUNASSCRIPT): Define.
18256
18257 * nsfns.m (as_script, as_result, as_status): New static variables.
18258 (ns_run_ascript): New function.
18259 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
18260 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
18261 the event loop. Get status from as_status (Bug#7276).
18262
18263 * nsterm.m (sendEvent): If event is NSApplicationDefined and
18264 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
18265 the event loop (Bug#7276).
18266
182672011-08-14 Andreas Schwab <schwab@linux-m68k.org>
18268
18269 * gnutls.c (QCgnutls_bootprop_priority)
18270 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
18271 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
18272 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
18273 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
18274 (QCgnutls_bootprop_verify_hostname_error)
18275 (QCgnutls_bootprop_callbacks_verify): Rename from
18276 Qgnutls_bootprop_..., all uses changed.
18277
18278 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
18279 uses changed.
18280
182812011-08-14 Paul Eggert <eggert@cs.ucla.edu>
18282
18283 * xfaces.c (Qframe_set_background_mode): Now static.
18284 * dispextern.h (Qframe_set_background_mode): Remove decl.
18285
18286 * process.c (Fnetwork_interface_info): Declare local only if needed.
18287
182882011-08-13 Jan Djärv <jan.h.d@swipnet.se>
18289
18290 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
18291 (Fnetwork_interface_list): Allocate in increments of bytes instead
18292 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
18293 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
18294 sockaddr.
18295 (struct ifflag_def): notrailers is smart on OSX.
18296 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
18297 Get hardware address with getifaddrs if available.
18298
182992011-08-12 Eli Zaretskii <eliz@gnu.org>
18300
18301 * xdisp.c (iterate_out_of_display_property): xassert that
18302 IT->position is set to within IT->object's boundaries. Break from
18303 the loop as soon as EOB is reached; avoids infloops in redisplay
18304 when IT->position is set up wrongly due to some bug.
18305 Set IT->current to match the bidi iterator unconditionally.
18306 (push_display_prop): Allow GET_FROM_STRING as IT->method on
18307 entry. Force push_it to save on the stack the current
18308 buffer/string position, to be restored by pop_it. Fix flags in
18309 the iterator structure wrt the object coming from a display
18310 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
18311 properties. (Bug#9284)
18312
183132011-08-09 Andreas Schwab <schwab@linux-m68k.org>
18314
18315 * fontset.c (fontset_get_font_group): Add proper type checks.
18316 (Bug#9172)
18317
183182011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18319
18320 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
18321 and LC_VERSION_MIN_MACOSX.
18322 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
18323 (dump_it) [LC_FUNCTION_STARTS]: Use it.
18324
183252011-08-08 Eli Zaretskii <eliz@gnu.org>
18326
18327 * xdisp.c (forward_to_next_line_start): Allow to use the
18328 no-display-properties-and-no-overlays under bidi display.
18329 Set disp_pos in the bidi iterator to avoid searches for display
18330 properties and overlays.
18331
183322011-08-08 Chong Yidong <cyd@stupidchicken.com>
18333
18334 * editfns.c (Fset_time_zone_rule): Document relationship with the
18335 setenv function.
18336
18337 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
18338 the font entity extracted from the cache (Bug#8109).
18339
183402011-08-07 Chong Yidong <cyd@stupidchicken.com>
18341
18342 * composite.c (autocmp_chars): Don't reset point. That is done by
18343 restore_point_unwind (Bug#5984).
18344
183452011-08-07 Juri Linkov <juri@jurta.org>
18346
18347 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
18348 to show the arg `TIME' instead of `TIMEVAL'.
18349
183502011-08-06 Eli Zaretskii <eliz@gnu.org>
18351
18352 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
18353 display property strides EOL and includes a newline, as in
18354 longlines-mode. (Bug#9254)
18355 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
18356 word-wrap under bidirectional display. (Bug#9224)
18357
18358 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
18359 is non-zero, even if the data buffer is NULL. Fixes a crash in
18360 vertical-motion with longlines-mode. (Bug#9254)
18361
183622011-08-05 Eli Zaretskii <eliz@gnu.org>
18363
18364 * bidi.c <bidi_cache_total_alloc>: Now static.
18365 (bidi_initialize): Initialize bidi_cache_total_alloc.
18366
18367 * xdisp.c (display_line): Release buffer allocated for shelved bidi
18368 cache. (Bug#9221)
18369
18370 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
18371 amount allocated this far in `bidi_cache_total_alloc'.
18372 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
18373 non-zero, only free the data buffer without restoring the cache
18374 contents. All callers changed.
18375
18376 * dispextern.h (bidi_unshelve_cache): Update prototype.
18377
18378 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
18379 (move_it_in_display_line, move_it_to)
18380 (move_it_vertically_backward, move_it_by_lines): Replace the call
18381 to xfree to an equivalent call to bidi_unshelve_cache.
18382 (move_it_in_display_line_to): Fix logic of returning
18383 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
18384
183852011-08-05 Eli Zaretskii <eliz@gnu.org>
18386
18387 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
18388 came from a string character with a `cursor' property. (Bug#9229)
18389
183902011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18391
18392 * Makefile.in (LIB_PTHREAD): New variable.
18393 (LIBES): Add LIB_PTHREAD (Bug#9216).
18394
18395 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
18396 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
18397
183982011-08-04 Andreas Schwab <schwab@linux-m68k.org>
18399
18400 * regex.c (re_iswctype): Remove some redundant boolean conversions.
18401
184022011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18403
18404 * xterm.c (x_find_topmost_parent): New function.
18405 (x_set_frame_alpha): Find topmost parent window with
18406 x_find_topmost_parent and set the property there also (bug#9181).
18407 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18408
184092011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18410
18411 * callproc.c (Fcall_process): Avoid vfork clobbering
18412 the local vars buffer, coding_systems, current_dir.
18413
184142011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18415
18416 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18417
184182011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18419
18420 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18421 so that it is not optimized away.
18422
18423 * xdisp.c (compute_display_string_pos): Remove unused local.
18424
184252011-08-02 Eli Zaretskii <eliz@gnu.org>
18426
18427 Fix slow cursor motion and scrolling in large buffers with
18428 selective display, like Org Mode buffers. (Bug#9218)
18429
18430 * dispextern.h (struct bidi_it): New member disp_prop_p.
18431
18432 * xdisp.c: Remove one-slot cache of display string positions.
18433 (compute_display_string_pos): Accept an additional argument
18434 DISP_PROP_P; callers changed. Scan at most 5K characters forward
18435 for a display string or property. If found, set DISP_PROP_P
18436 non-zero.
18437
18438 * bidi.c (bidi_fetch_char): Accept an additional argument
18439 DISP_PROP_P, and pass it to compute_display_string_pos.
18440 Only handle text covered by a display string if DISP_PROP_P is returned
18441 non-zero. All callers of bidi_fetch_char changed.
18442
184432011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18444
18445 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18446
184472010-12-03 Don March <don@ohspite.net>
18448
18449 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18450 last character M-[char] is translated to ESC [char] (bug#7541).
18451
184522011-08-02 Kenichi Handa <handa@m17n.org>
18453
18454 * lisp.h (uniprop_table): Extern it.
18455
18456 * chartab.c (uniprop_table): Make it non-static.
18457
184582011-08-01 Eli Zaretskii <eliz@gnu.org>
18459
18460 * xdisp.c (forward_to_next_line_start): Accept additional argument
18461 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18462 on the newline.
18463 (reseat_at_next_visible_line_start): Use the bidi iterator state
18464 returned by forward_to_next_line_start to restore the state of
18465 it->bidi_it after backing up to previous newline. (Bug#9212)
18466
184672011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18468
18469 * regex.c (re_comp): Protoize.
18470 (re_exec): Fix return type.
18471 (regexec): Fix type of `ret'. (Bug#9203)
18472
184732011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18474
18475 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18476 This is needed if max-image-size is a floating-point number.
18477
184782011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18479
18480 * print.c (print_object): Print empty symbol as ##.
18481
18482 * lread.c (read1): Read ## as empty symbol.
18483
184842011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18485
18486 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18487 setting frame foreground color (Bug#9175).
18488 (x_set_background_color): Likewise.
18489
18490 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18491 contents (Bug#9176).
18492 (EmacsTooltip -init): Remove bezels and add shadows to
18493 tooltip windows.
18494
18495 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18496 or scroll bar (Bug#8470).
18497
18498 * nsfont.m (nsfont_open): Remove assignment to voffset and
18499 unnecessary vars hshink, expand, hd, full_height, min_height.
18500 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18501
18502 * nsterm.h (nsfont_info): Remove voffset field.
18503
185042011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18505
18506 Implement strike-through and overline on NextStep (Bug#8863).
18507
18508 * nsfont.m (nsfont_open): Use underline position provided by font,
18509 instead of hard-coded value of 2.
18510 (nsfont_draw): Call ns_draw_text_decoration instead.
18511
18512 * nsterm.h: Add declaration for ns_draw_text_decoration.
18513
18514 * nsterm.m (ns_draw_text_decoration): New function for drawing
18515 underline, overline, and strike-through.
18516 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18517 ns_draw_text_decoration. Change treatment of cursor drawing to
18518 accommodate underlining, etc.
18519
185202011-07-28 Eli Zaretskii <eliz@gnu.org>
18521
18522 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18523 default.
18524
185252011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18526
18527 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18528 Without this fix, if a signal arrives just after memory fills up,
18529 'malloc' might be invoked reentrantly.
18530
18531 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18532 In other words, assume that every image size is allowed, on non-X
18533 hosts. This assumption is probably wrong, but it lets Emacs compile.
18534
185352011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18536
18537 * regex.c (re_iswctype): Convert return values to boolean.
18538
185392011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18540
18541 * xdisp.c (compute_display_string_pos): Don't use cached display
18542 string position if the buffer had its restriction changed.
18543 (Bug#9184)
18544
185452011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18546
18547 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18548
185492011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18550
18551 Integer signedness and overflow and related fixes. (Bug#9079)
18552
18553 * bidi.c: Integer size and overflow fixes.
18554 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18555 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18556 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18557 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18558 (bidi_find_other_level_edge):
18559 Use ptrdiff_t instead of EMACS_INT where either will do.
18560 This works better on 32-bit hosts configured --with-wide-int.
18561 (bidi_cache_ensure_space): Check for size-calculation overflow.
18562 Use % rather than repeated addition, for better worst-case speed.
18563 Don't set bidi_cache_size until after xrealloc returns, because it
18564 might not return.
18565 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
18566 (bidi_cache_ensure_space): Also check that the bidi cache size
18567 does not exceed that of the largest Lisp string or buffer. See Eli
18568 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
18569
18570 * alloc.c (__malloc_size_t): Remove.
18571 All uses replaced by size_t. See Andreas Schwab's note
18572 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18573
18574 * image.c: Improve checking for integer overflow.
18575 (check_image_size): Assume that f is nonnull, since
18576 it is always nonnull in practice. This is one less thing to
18577 worry about when checking for integer overflow later.
18578 (x_check_image_size): New function, which checks for integer
18579 overflow issues inside X.
18580 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18581 This removes the need for a memory_full check.
18582 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18583 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18584 (xbm_read_bitmap_data): Change locals back to 'int', since
18585 their values must fit in 'int'.
18586 (xpm_load_image, png_load, tiff_load):
18587 Invoke x_create_x_image_and_pixmap earlier,
18588 to avoid much needless work if the image is too large.
18589 (tiff_load): Treat overly large images as if
18590 x_create_x_image_and_pixmap failed, not as malloc failures.
18591 (gs_load): Use x_check_image_size.
18592
18593 * gtkutil.c: Omit integer casts.
18594 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18595 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18596
18597 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18598
18599 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18600 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18601 would wrongly return t on a 64-bit host.
18602
18603 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18604 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18605 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18606 and therefore cause GCC to emit a bogus diagnostic in some cases.
18607
18608 * image.c: Integer signedness and overflow and related fixes.
18609 This is not an exhaustive set of fixes, but it's time to
18610 record what I've got.
18611 (lookup_pixel_color, check_image_size): Remove redundant decls.
18612 (check_image_size): Don't assume that arbitrary EMACS_INT values
18613 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18614 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18615 (tiff_load, imagemagick_load_image):
18616 Check for overflow in size calculations.
18617 (x_create_x_image_and_pixmap): Remove unnecessary test for
18618 xmalloc returning NULL; that can't happen.
18619 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18620 (xpm_color_bucket): Use better integer hashing function.
18621 (xpm_cache_color): Don't possibly over-allocate memory.
18622 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18623 (gif_memory_source):
18624 Use ptrdiff_t, not int or size_t, to record sizes.
18625 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18626 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18627 either works, as we prefer signed integers.
18628 (tiff_read_from_memory, tiff_write_from_memory):
18629 Return tsize_t, not size_t, since that's what the TIFF API wants.
18630 (tiff_read_from_memory): Don't fail simply because the read would
18631 go past EOF; instead, return a short read.
18632 (tiff_load): Omit no-longer-needed casts.
18633 (Fimagemagick_types): Don't assume size fits into 'int'.
18634
18635 Improve hashing quality when configured --with-wide-int.
18636 * fns.c (hash_string): New function, taken from sxhash_string.
18637 Do not discard information about ASCII character case; this
18638 discarding is no longer needed.
18639 (sxhash-string): Use it. Change sig to match it. Caller changed.
18640 * lisp.h: Declare it.
18641 * lread.c (hash_string): Remove, since we now use fns.c's version.
18642 The fns.c version returns a wider integer if --with-wide-int is
18643 specified, so this should help the quality of the hashing a bit.
18644
18645 * emacs.c: Integer overflow minor fix.
18646 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18647 Define only if GNU_LINUX.
18648 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18649
18650 * dispnew.c: Integer signedness and overflow fixes.
18651 Remove unnecessary forward decls, that were a maintenance hassle.
18652 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18653 All uses changed.
18654 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18655 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18656 (prepare_desired_row, line_draw_cost):
18657 Use int, not unsigned, where either works.
18658 (save_current_matrix, restore_current_matrix):
18659 Use ptrdiff_t, not size_t, where either works.
18660 (init_display): Check for overflow more accurately, and without
18661 relying on undefined behavior.
18662
18663 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18664 Remove, replacing with the new symbols in lisp.h. All uses changed.
18665 * fileio.c (make_temp_name):
18666 * filelock.c (lock_file_1, lock_file):
18667 * xdisp.c (message_dolog):
18668 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18669 Use pMd etc. instead.
18670 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18671 replacing the pWIDE etc. symbols removed from editfns.c.
18672
18673 * keyboard.h (num_input_events): Now uintmax_t.
18674 This is (very slightly) less likely to mess up due to wraparound.
18675 All uses changed.
18676
18677 * buffer.c: Integer signedness fixes.
18678 (alloc_buffer_text, enlarge_buffer_text):
18679 Use ptrdiff_t rather than size_t when either will do, as we prefer
18680 signed integers.
18681
18682 * alloc.c: Integer signedness and overflow fixes.
18683 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18684 (__malloc_size_t): Default to size_t, not to int.
18685 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18686 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18687 Prefer ptrdiff_t to size_t when either would do, as we prefer
18688 signed integers.
18689 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18690 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18691 Now const. Initialize with values that are in range even if char
18692 is signed.
18693 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18694 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18695 These functions do the right thing with sizes > 2**32.
18696 (check_depth): Now ptrdiff_t, not int.
18697 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18698 Adjust to new way of storing sizes. Check for size overflow bugs
18699 in rest of code.
18700 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18701 slightly wrong anyway, as it missed one instance of
18702 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18703 (refill_memory_reserve): Omit needless cast to size_t.
18704 (mark_object_loop_halt): Mark as externally visible.
18705
18706 * xselect.c: Integer signedness and overflow fixes.
18707 (Fx_register_dnd_atom, x_handle_dnd_message):
18708 Use ptrdiff_t, not size_t, since we prefer signed.
18709 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18710 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18711 x_dnd_atoms_size and x_dnd_atoms_length.
18712
18713 * doprnt.c: Prefer signed to unsigned when either works.
18714 * eval.c (verror):
18715 * doprnt.c (doprnt):
18716 * lisp.h (doprnt):
18717 * xdisp.c (vmessage):
18718 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18719 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18720 prefer signed arithmetic to avoid comparison confusion.
18721 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18722 but is a bit tricky.
18723
18724 Assume freestanding C89 headers, string.h, stdlib.h.
18725 * data.c, doprnt.c, floatfns.c, print.c:
18726 Include float.h unconditionally.
18727 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18728 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18729 * regex.c: Likewise for stddef.h, string.h.
18730 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18731 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18732 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18733 (STDC_HEADERS): Remove obsolete defines.
18734 * sysdep.c: Include limits.h unconditionally.
18735
18736 Assume support for memcmp, memcpy, memmove, memset.
18737 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18738 * regex.c (memcmp, memcpy):
18739 Remove; we assume C89 now.
18740
18741 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18742 (__malloc_safe_bcopy): Remove; no longer needed.
18743
18744 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18745 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18746 well either way, and we prefer signed to unsigned.
18747
187482011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18749
18750 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18751 closes the connection while we're reading (bug#9182).
18752
187532011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18754
18755 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18756 are specified (Bug#9168).
18757
187582011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18759
18760 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18761 Found by GCC static checking and --with-wide-int on a 32-bit host.
18762
187632011-07-25 Eli Zaretskii <eliz@gnu.org>
18764
18765 * xdisp.c (compute_display_string_pos): Fix logic of caching
18766 previous display string position. Initialize cached_prev_pos to
18767 -1. Fixes slow-down at the beginning of a buffer.
18768
187692011-07-24 Eli Zaretskii <eliz@gnu.org>
18770
18771 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18772 for attrs[LFACE_FONTSET_INDEX].
18773
187742011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18775
18776 * xml.c (parse_region): Remove unused local
18777 that was recently introduced.
18778
187792011-07-23 Eli Zaretskii <eliz@gnu.org>
18780
18781 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18782 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18783
18784 * xdisp.c (move_it_in_display_line_to): Record the best matching
18785 position for TO_CHARPOS while scanning the line, and restore it on
18786 exit if none of the characters scanned was an exact match.
18787 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18788 when exact match is impossible due to invisible text, and the
18789 lines are truncated.
18790
187912011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18792
18793 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18794 for OSX >= 10.7.
18795
187962011-07-22 Eli Zaretskii <eliz@gnu.org>
18797
18798 Fix a significant slow-down of cursor motion with C-n, C-p,
18799 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18800 auto-repeat under bidi redisplay in fontified buffers.
18801 * xdisp.c (compute_stop_pos_backwards): New function.
18802 (next_element_from_buffer): Call compute_stop_pos_backwards to
18803 find a suitable prev_stop when we find ourselves before
18804 base_level_stop.
18805 (reseat): Don't look for prev_stop, as that could mean a very long
18806 run.
18807 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18808 <cached_disp_overlay_modiff>: Cache for last found display string
18809 position.
18810 (compute_display_string_pos): Return the cached position if asked
18811 about the same buffer in the same area of character positions, and
18812 the buffer wasn't changed since the time the display string
18813 position was cached.
18814
188152011-07-22 Eli Zaretskii <eliz@gnu.org>
18816
18817 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18818 is an integer, which is important for empty lines. (Bug#9149)
18819
188202011-07-22 Chong Yidong <cyd@stupidchicken.com>
18821
18822 * frame.c (Fmodify_frame_parameters): In tty case, update the
18823 default face if necessary (Bug#4238).
18824
188252011-07-21 Chong Yidong <cyd@stupidchicken.com>
18826
18827 * editfns.c (Fstring_to_char): No need to explain what a character
18828 is in the docstring (Bug#6576).
18829
188302011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18831
18832 * xml.c (parse_region): Make sure we always return a tree.
18833
188342011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18835
18836 * xml.c (parse_region): If a document contains only comments,
18837 return that, too.
18838
188392011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18840
18841 * xml.c (make_dom): Return comments, too.
18842
188432011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18844
18845 Port to OpenBSD.
18846 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18847 and the surrounding thread.
18848 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18849 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18850 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18851 timer goes off.
18852 * s/openbsd.h (BROKEN_SIGIO): Define.
18853 * unexelf.c (unexec) [__OpenBSD__]:
18854 Don't update the .mdebug section of the Alpha COFF symbol table.
18855
188562011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18857
18858 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18859 (bug#8460).
18860
188612011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18862
18863 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18864 This fixes some race conditions on the permissions of any newly
18865 created file.
18866
18867 * alloc.c (valid_pointer_p): Use pipe, not open.
18868 This fixes some permissions issues when debugging.
18869
18870 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18871 If fchown fails to set both uid and gid, try to set just gid,
18872 as that is sometimes allowed. Adjust the file's mode to eliminate
18873 setuid or setgid bits that are inappropriate if fchown fails.
18874
188752011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18876
18877 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18878 to compare Lisp_Objects.
18879 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18880 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18881 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18882
188832011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18884
18885 * lread.c (read_integer): Unread even EOF character.
18886 (read1): Likewise. Properly record start position of symbol.
18887
18888 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18889 symbol character follows.
18890
188912011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18892
18893 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18894 This works around a problem with the previous change to Fcopy_file.
18895 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18896 and without this change, GCC might complain about discarding
18897 fchown's return value.
18898
188992011-07-16 Juanma Barranquero <lekktu@gmail.com>
18900
18901 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18902
189032011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18904
18905 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18906
189072011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18908
18909 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18910 it's used from the C level.
18911
18912 * process.c: Use the same condition for POLL_FOR_INPUT in both
18913 keyboard.c and process.c (bug#1858).
18914
189152011-07-09 Lawrence Mitchell <wence@gmx.li>
18916
18917 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18918 (Fgnutls_boot): Use it.
18919
189202011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18921
18922 * doc.c (Fsubstitute_command_keys): Revert last change.
18923
189242011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18925
18926 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18927 quotes the next character, and doesn't affect other longer
18928 sequences (bug#8935).
18929
18930 * lread.c (syms_of_lread): Clarify that is isn't only
18931 `eval-buffer' and `eval-defun' that's affected by
18932 `lexical-binding' (bug#8460).
18933
189342011-07-15 Eli Zaretskii <eliz@gnu.org>
18935
18936 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18937 bidi redisplay when a line includes both an image and is truncated.
18938
189392011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18940
18941 Fix minor problems found by static checking.
18942 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18943 (elsz): Now a signed constant, not a size_t var. We prefer signed
18944 types to unsigned, to avoid integer comparison confusion. Without
18945 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18946 "cannot optimize loop, the loop counter may overflow", a symptom
18947 of the confusion.
18948 * indent.c (Fvertical_motion): Mark locals as initialized.
18949 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18950
189512011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18952
18953 * search.c (Fre_search_backward): Mention `case-fold-search' in
18954 all the re_search_* functions (bug#8138).
18955
18956 * keyboard.c (Fopen_dribble_file): Document when the file is
18957 closed (bug#8056).
18958
189592011-07-14 Eli Zaretskii <eliz@gnu.org>
18960
18961 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18962 bidi_cache_idx.
18963
18964 Support bidi reordering of display and overlay strings.
18965 * xdisp.c (compute_display_string_pos)
18966 (compute_display_string_end): Accept additional argument STRING.
18967 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18968 (reseat_to_string): Initialize bidi_it->string.s and
18969 bidi_it->string.schars.
18970 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18971 NULL (avoids a crash in bidi_paragraph_init).
18972 Initialize itb.string.lstring.
18973 (init_iterator): Call bidi_init_it only of a valid
18974 buffer position was specified. Initialize paragraph_embedding to
18975 L2R.
18976 (reseat_to_string): Initialize the bidi iterator.
18977 (display_string): If we need to ignore text properties of
18978 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18979 original value of -1 will not work with bidi.)
18980 (compute_display_string_pos): First arg is now struct
18981 `text_pos *'; all callers changed. Support display properties on
18982 Lisp strings.
18983 (compute_display_string_end): Support display properties on Lisp
18984 strings.
18985 (init_iterator, reseat_1, reseat_to_string): Initialize the
18986 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18987 when iterating on a string not from display properties).
18988 (compute_display_string_pos, compute_display_string_end):
18989 Fix calculation of the object to scan. Fixes an error when using
18990 arrow keys.
18991 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18992 base_level_stop; instead, set base_level_stop to BEGV.
18993 Fixes crashes in vertical-motion.
18994 (next_element_from_buffer): Improve commentary for when
18995 the iterator is before prev_stop.
18996 (init_iterator): Initialize bidi_p from the default value of
18997 bidi-display-reordering, not from buffer-local value. Use the
18998 buffer-local value only if initializing for buffer iteration.
18999 (handle_invisible_prop): Support invisible properties on strings
19000 that are being bidi-reordered.
19001 (set_iterator_to_next): Support bidi reordering of C strings and
19002 Lisp strings.
19003 (next_element_from_string): Support bidi reordering of Lisp
19004 strings.
19005 (handle_stop_backwards): Support Lisp strings as well.
19006 (display_string): Support display of R2L glyph rows.
19007 Use IT_STRING_CHARPOS when displaying from a Lisp string.
19008 (init_iterator): Don't initialize it->bidi_p for strings
19009 here.
19010 (reseat_to_string): Initialize it->bidi_p for strings here.
19011 (next_element_from_string, next_element_from_c_string)
19012 (next_element_from_buffer): Add xassert's for correspondence
19013 between IT's object being iterated and it->bidi_it.string
19014 structure.
19015 (face_before_or_after_it_pos): Support bidi iteration.
19016 (next_element_from_c_string): Handle the case of the first string
19017 character that is not the first one in the visual order.
19018 (get_visually_first_element): New function, refactored from common
19019 parts of next_element_from_buffer, next_element_from_string, and
19020 next_element_from_c_string.
19021 (tool_bar_lines_needed, redisplay_tool_bar)
19022 (display_menu_bar): Force left-to-right direction. Add a FIXME
19023 comment for making that be controlled by a user option.
19024 (push_it, pop_it): Save and restore the state of the
19025 bidi iterator. Save and restore the bidi_p flag.
19026 (pop_it): Iterate out of display property for string iteration as
19027 well.
19028 (iterate_out_of_display_property): Support iteration over strings.
19029 (handle_single_display_spec): Set up it->bidi_it for iteration
19030 over a display string, and call bidi_init_it.
19031 (handle_single_display_spec, next_overlay_string)
19032 (get_overlay_strings_1, push_display_prop): Set up the bidi
19033 iterator for displaying display or overlay strings.
19034 (forward_to_next_line_start): Don't use the shortcut if
19035 bidi-iterating.
19036 (back_to_previous_visible_line_start): If handle_display_prop
19037 pushed the iterator stack, restore the internal state of the bidi
19038 iterator by calling bidi_pop_it same number of times.
19039 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
19040 and we are bidi-iterating, don't decrement the iterator position;
19041 instead, set the first_elt flag in the bidi iterator, to produce
19042 the same effect.
19043 (reseat_1): Remove redundant setting of string_from_display_prop_p.
19044 (push_display_prop): xassert that we are iterating a buffer.
19045 (push_it, pop_it): Save and restore paragraph_embedding member.
19046 (handle_single_display_spec, next_overlay_string)
19047 (get_overlay_strings_1, reseat_1, reseat_to_string)
19048 (push_display_prop): Set up the `unibyte' member of bidi_it.string
19049 correctly. Don't assume unibyte strings are not bidi-reordered.
19050 (compute_display_string_pos)
19051 (compute_display_string_end): Fix handling the case of C string.
19052 (push_it, pop_it): Save and restore from_disp_prop_p.
19053 (handle_single_display_spec, push_display_prop): Set the
19054 from_disp_prop_p flag.
19055 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
19056 (pop_it): Call iterate_out_of_display_property only if we are
19057 popping after iteration over a string that came from a display
19058 property. Fix a typo in popping stretch info. Add an assertion
19059 for verifying that the iterator position is in sync with the bidi
19060 iterator.
19061 (handle_single_display_spec, get_overlay_strings_1)
19062 (push_display_prop): Fix initialization of paragraph direction for
19063 string when that of the parent object is not yet determined.
19064 (reseat_1): Call bidi_init_it to resync the bidi
19065 iterator with IT's position. (Bug#7616)
19066 (find_row_edges): If ROW->start.pos gives position
19067 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
19068 (handle_stop, back_to_previous_visible_line_start, reseat_1):
19069 Reset the from_disp_prop_p flag.
19070 (SAVE_IT, RESTORE_IT): New macros.
19071 (pos_visible_p, face_before_or_after_it_pos)
19072 (back_to_previous_visible_line_start)
19073 (move_it_in_display_line_to, move_it_in_display_line)
19074 (move_it_to, move_it_vertically_backward, move_it_by_lines)
19075 (try_scrolling, redisplay_window, display_line): Use them when
19076 saving a temporary copy of the iterator and restoring it back.
19077 (back_to_previous_visible_line_start, reseat_1)
19078 (init_iterator): Empty the bidi cache "stack".
19079 (move_it_in_display_line_to): If iterator ended up at
19080 EOL, but we never saw any buffer positions smaller than
19081 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
19082 motion in bidi-reordered lines.
19083 (move_it_in_display_line_to): Record prev_method and prev_pos
19084 immediately before the call to set_iterator_to_next. Fixes cursor
19085 motion in bidi-reordered lines with stretch glyphs and strings
19086 displayed in margins. (Bug#8133) (Bug#8867)
19087 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
19088 TO_CHARPOS.
19089 (pos_visible_p): Support positions in bidi-reordered lines.
19090 Save and restore bidi cache.
19091
19092 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
19093 (bidi_paragraph_info): Delete unused struct.
19094 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
19095 (bidi_cache_start): New variable.
19096 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
19097 to zero.
19098 (bidi_cache_fetch_state, bidi_cache_search)
19099 (bidi_cache_find_level_change, bidi_cache_iterator_state)
19100 (bidi_cache_find, bidi_peek_at_next_level)
19101 (bidi_level_of_next_char, bidi_find_other_level_edge)
19102 (bidi_move_to_visually_next): Compare cache index with
19103 bidi_cache_start rather than with zero.
19104 (bidi_fetch_char): Accept new argument STRING; all callers
19105 changed. Support iteration over a string. Support strings with
19106 display properties. Support unibyte strings. Fix the type of
19107 `len' according to what STRING_CHAR_AND_LENGTH expects.
19108 (bidi_paragraph_init, bidi_resolve_explicit_1)
19109 (bidi_resolve_explicit, bidi_resolve_weak)
19110 (bidi_level_of_next_char, bidi_move_to_visually_next):
19111 Support iteration over a string.
19112 (bidi_set_sor_type, bidi_resolve_explicit_1)
19113 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
19114 can now be zero (for strings); special values 0 and -1 were
19115 changed to -1 and -2, respectively.
19116 (bidi_char_at_pos): New function.
19117 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
19118 Call it instead of FETCH_MULTIBYTE_CHAR.
19119 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
19120 initialized to valid values.
19121 (bidi_init_it): Don't initialize charpos and bytepos with invalid
19122 values.
19123 (bidi_level_of_next_char): Allow the sentinel "position" to pass
19124 the test for valid cached positions. Fix the logic for looking up
19125 the sentinel state in the cache. GCPRO the Lisp string we are
19126 iterating.
19127 (bidi_push_it, bidi_pop_it): New functions.
19128 (bidi_initialize): Initialize the bidi cache start stack pointer.
19129 (bidi_cache_ensure_space): New function, refactored from part of
19130 bidi_cache_iterator_state. Don't assume the required size is just
19131 one BIDI_CACHE_CHUNK away.
19132 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
19133 (bidi_count_bytes, bidi_char_at_pos): New functions.
19134 (bidi_cache_search): Don't assume bidi_cache_last_idx is
19135 always valid if bidi_cache_idx is valid.
19136 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
19137 is valid if it's going to be used.
19138 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
19139 (bidi_cache_fetch_state, bidi_cache_search)
19140 (bidi_cache_find_level_change, bidi_cache_ensure_space)
19141 (bidi_cache_iterator_state, bidi_cache_find)
19142 (bidi_find_other_level_edge, bidi_cache_start_stack):
19143 All variables related to cache indices are now EMACS_INT.
19144
19145 * dispextern.h (struct bidi_string_data): New structure.
19146 (struct bidi_it): New member `string'. Make flag members be 1-bit
19147 fields, and put them last in the struct.
19148 (compute_display_string_pos, compute_display_string_end):
19149 Update prototypes.
19150 (bidi_push_it, bidi_pop_it): Add prototypes.
19151 (struct iterator_stack_entry): New members bidi_p,
19152 paragraph_embedding, and from_disp_prop_p.
19153 (struct it): Member bidi_p is now a bit field 1 bit wide.
19154 (bidi_shelve_cache, bidi_unshelve_cache):
19155 Declare prototypes.
19156
19157 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
19158 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
19159 and vector-like objects.
19160
19161 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
19162 cache around display iteration.
19163
19164 * window.c (Fwindow_end, window_scroll_pixel_based)
19165 (displayed_window_lines, Frecenter): Save and restore the bidi
19166 cache around display iteration.
19167
191682011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
19169
19170 * editfns.c (Fdelete_region): Clarify the use of the named
19171 parameters (bug#6788).
19172
191732011-07-14 Martin Rudalics <rudalics@gmx.at>
19174
19175 * indent.c (Fvertical_motion): Set and restore w->pointm when
19176 saving and restoring the window's buffer (Bug#9006).
19177
191782011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
19179
19180 * editfns.c (Fstring_to_char): Clarify just what is returned
19181 (bug#6576). Text by Eli Zaretskii.
19182
191832011-07-13 Juanma Barranquero <lekktu@gmail.com>
19184
19185 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
19186
191872011-07-13 Eli Zaretskii <eliz@gnu.org>
19188
19189 * buffer.c (mmap_find): Fix a typo.
19190
191912011-07-13 Johan Bockgård <bojohan@gnu.org>
19192
19193 Fix execution of x selection hooks.
19194 * xselect.c (Qx_lost_selection_functions)
19195 (Qx_sent_selection_functions): New vars.
19196 (syms_of_xselect): DEFSYM them.
19197 (x_handle_selection_request): Pass Qx_sent_selection_functions
19198 rather than Vx_sent_selection_functions to Frun_hook_with_args.
19199 (x_handle_selection_clear,x_clear_frame_selections):
19200 Pass Qx_lost_selection_functions rather than
19201 Vx_lost_selection_functions to Frun_hook_with_args.
19202
192032011-07-13 Paul Eggert <eggert@cs.ucla.edu>
19204
19205 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
19206 The old code sometimes used this field without initializing it.
19207
19208 * alloc.c (gc_sweep): Don't read past end of array.
19209 In theory, the old code could also have corrupted Emacs internals,
19210 though it'd be very unlikely.
19211
192122011-07-12 Andreas Schwab <schwab@linux-m68k.org>
19213
19214 * character.c (Fcharacterp): Don't advertise optional ignored
19215 argument. (Bug#4026)
19216
192172011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
19218
19219 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
19220 key" (bug#4257).
19221
19222 * window.c (Fset_window_start): Doc fix (bug#4199).
19223 (Fset_window_hscroll): Ditto.
19224
192252011-07-12 Paul Eggert <eggert@cs.ucla.edu>
19226
19227 Fix minor new problems caught by GCC 4.6.1.
19228 * term.c (init_tty): Remove unused local.
19229 * xsettings.c (store_monospaced_changed): Define this function only
19230 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
19231 not used otherwise.
19232
192332011-07-12 Chong Yidong <cyd@stupidchicken.com>
19234
19235 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
19236
192372011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
19238
19239 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
19240 are the mini-buffer and the echo area (bug#3320).
19241
19242 * term.c (init_tty): Remove support for supdup, c10 and perq
19243 terminals, which are no longer supported (bug#1482).
19244
192452011-07-10 Johan Bockgård <bojohan@gnu.org>
19246
19247 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
19248
192492011-07-10 Jan Djärv <jan.h.d@swipnet.se>
19250
19251 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
19252 for non-popups (Bug#3642).
19253
192542011-07-10 Andreas Schwab <schwab@linux-m68k.org>
19255
19256 * alloc.c (reset_malloc_hooks): Protoize.
19257 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
19258 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
19259 * cm.c (losecursor): Likewise.
19260 * data.c (fmod): Likewise.
19261 * dispnew.c (swap_glyphs_in_rows): Likewise.
19262 * emacs.c (memory_warning_signal): Likewise.
19263 * floatfns.c (float_error): Likewise.
19264 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
19265 (otf_open, font_otf_capability, generate_otf_features)
19266 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
19267 Likewise.
19268 * image.c (pbm_read_file): Likewise.
19269 * indent.c (string_display_width): Likewise.
19270 * intervals.c (check_for_interval, search_for_interval)
19271 (inc_interval_count, count_intervals, root_interval)
19272 (adjust_intervals_for_insertion, make_new_interval): Likewise.
19273 * lread.c (defalias): Likewise.
19274 * ralloc.c (r_alloc_check): Likewise.
19275 * regex.c (set_image_of_range_1, set_image_of_range)
19276 (regex_grow_registers): Likewise.
19277 * sysdep.c (strerror): Likewise.
19278 * termcap.c (valid_filename_p, tprint, main): Likewise.
19279 * tparam.c (main): Likewise.
19280 * unexhp9k800.c (run_time_remap, save_data_space)
19281 (update_file_ptrs, read_header, write_header, calculate_checksum)
19282 (copy_file, copy_rest, display_header): Likewise.
19283 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
19284 Likewise.
19285 * xdisp.c (check_it): Likewise.
19286 * xfaces.c (register_color, unregister_color, unregister_colors):
19287 Likewise.
19288 * xfns.c (print_fontset_result): Likewise.
19289 * xrdb.c (member, fatal, main): Likewise.
19290
192912011-07-10 Paul Eggert <eggert@cs.ucla.edu>
19292
19293 Fix minor problems found by static checking (Bug#9031).
19294 * chartab.c (char_table_set_range, map_sub_char_table):
19295 Remove unused locals.
19296 (uniprop_table): Now static.
19297 * composite.c (_work_char): Remove unused static var.
19298
192992011-07-09 Juanma Barranquero <lekktu@gmail.com>
19300
19301 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
19302
193032011-07-09 Jan Djärv <jan.h.d@swipnet.se>
19304
19305 * gtkutil.c (qttip_cb): Remove code without function.
19306
193072011-07-09 Eli Zaretskii <eliz@gnu.org>
19308
19309 * w32.c (pthread_sigmask): New stub.
19310
193112011-07-08 Paul Eggert <eggert@cs.ucla.edu>
19312
19313 Use pthread_sigmask, not sigprocmask (Bug#9010).
19314 sigprocmask is portable only for single-threaded applications, and
19315 Emacs can be multi-threaded when it uses GTK.
19316 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
19317 (LIBES): Use it.
19318 * callproc.c (Fcall_process):
19319 * process.c (create_process):
19320 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
19321 Use pthread_sigmask, not sigprocmask.
19322
193232011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19324
19325 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
19326 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
19327 wrong (Bug#8591).
19328
193292011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19330
19331 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
19332 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
19333 (xg_hide_tooltip): Fix comment.
19334
19335 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
19336 in registerServicesMenuSendTypes.
19337 (validRequestorForSendType): Don't check ns_return_types.
19338
19339 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
19340 ns_return_type.
19341
193422011-07-08 Jason Rumney <jasonr@gnu.org>
19343
19344 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
19345 SH_SHOW for hidden windows (Bug#5482).
19346
19347 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
19348 frame struct members of non-existent frames (Bug#6284).
19349
193502011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19351
19352 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
19353 variable firstTime not needed on OSX >= 10.6.
19354 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
19355 >= 10.5. Use setKnobProportion, setDoubleValue.
19356
19357 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
19358 (MAC_OS_X_VERSION_10_5): Define if not defined.
19359 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
19360 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
19361 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
19362
19363 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
19364 cString and lossyCString on OSX >= 10.4.
19365
19366 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
19367 sizeToFit on OSX >= 10.2.
19368
19369 * nsimage.m (allocInitFromFile): Don't use deprecated method
19370 bestRepresentationForDevice on OSX >= 10.6.
19371
19372 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
19373 to avoid warning.
19374
19375 * emacs.c: Declare unexec_init_emacs_zone.
19376
19377 * nsgui.h: Fix compiler warning about gnulib redefining verify.
19378
19379 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
19380
19381 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
19382 on svcsMenu (Bug#8842).
19383
19384 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
19385 ns_return_types.
19386 (Fns_list_services): Just return Qnil on 10.6, code not working there.
19387
19388 * nsterm.m (QUTF8_STRING): Declare.
19389 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
19390 (validRequestorForSendType): Return type is (id).
19391 Change indexOfObjectIdenticalTo to indexOfObject.
19392 Check if we have local selection before returning self (Bug#8842).
19393 (writeSelectionToPasteboard): Put local selection into paste board
19394 if we have a local selection (Bug#8842).
19395 (syms_of_nsterm): DEFSYM QUTF8_STRING.
19396
19397 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
19398 (ns_get_local_selection): Declare.
19399
194002011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
19401
19402 * keymap.c (describe_map_tree): Don't insert a double newline at
19403 the end of the buffer (bug#1169) and return whether we inserted
19404 something.
19405
19406 * callint.c (Fcall_interactively): Change "reading args" to
19407 "providing args" to try to clarify what it does (bug#1010).
19408
194092011-07-07 Kenichi Handa <handa@m17n.org>
19410
19411 * composite.c (composition_compute_stop_pos): Ignore a static
19412 composition starting before CHARPOS (Bug#8915).
19413
19414 * xdisp.c (handle_composition_prop): Likewise.
19415
194162011-07-07 Eli Zaretskii <eliz@gnu.org>
19417
19418 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19419 (Bug#9015)
19420
194212011-07-07 Kenichi Handa <handa@m17n.org>
19422
19423 * character.h (unicode_category_t): New enum type.
19424
19425 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19426 (Qchar_code_property_table): New variable.
19427 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19428 (UNIPROP_COMPRESSED_FORM_P): New macros.
19429 (char_table_ascii): Uncompress the compressed values.
19430 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19431 Uncompress the compressed values.
19432 (sub_char_table_ref_and_range): Likewise.
19433 (char_table_ref_and_range): Uncompress the compressed values.
19434 (sub_char_table_set): New arg is_uniprop. Callers changed.
19435 Uncompress the compressed values.
19436 (sub_char_table_set_range): Args changed. Callers changed.
19437 (char_table_set_range): Adjuted for the above change.
19438 (map_sub_char_table): Delete args default_val and parent. Add arg
19439 top. Give decoded values to a Lisp function.
19440 (map_char_table): Adjust for the above change. Give decoded
19441 values to a Lisp function. Gcpro more variables.
19442 (uniprop_table_uncompress)
19443 (uniprop_decode_value_run_length): New functions.
19444 (uniprop_decoder, uniprop_decoder_count): New variables.
19445 (uniprop_get_decoder, uniprop_encode_value_character)
19446 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19447 New functions.
19448 (uniprop_encoder, uniprop_encoder_count): New variables.
19449 (uniprop_get_encoder, uniprop_table)
19450 (Funicode_property_table_internal, Fget_unicode_property_internal)
19451 (Fput_unicode_property_internal): New functions.
19452 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19453 Sunicode_property_table_internal, Sget_unicode_property_internal,
19454 and Sput_unicode_property_internal. Defvar_lisp
19455 char-code-property-alist.
19456
19457 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
19458 Vunicode_category_table.
19459
19460 * font.c (font_range): Adjust for the change of
19461 Vunicode_category_table.
19462
194632011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19464
19465 * m/iris4d.h: Remove file, move contents ...
19466 * s/irix6-5.h: ... here.
19467
194682011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19469
19470 Remove unportable assumption about struct layout (Bug#8884).
19471 * alloc.c (mark_buffer):
19472 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19473 (clone_per_buffer_values): Don't assume that
19474 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19475 This isn't true in general, and it's particularly not true
19476 if Emacs is configured with --with-wide-int.
19477 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19478 New macros, used in the buffer.c change.
19479
194802011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19481
19482 * xsettings.c: Use both GConf and GSettings if both are available.
19483 (store_config_changed_event): Add comment.
19484 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19485 (store_tool_bar_style_changed): New functions.
19486 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
19487 (struct xsettings): Move font inside HAVE_XFT.
19488 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
19489 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
19490 Move inside HAVE_XFT.
19491 (something_changed_gsettingsCB): Rename from something_changedCB.
19492 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19493 also.
19494 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
19495 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
19496 (something_changed_gconfCB): Rename from something_changedCB.
19497 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19498 (parse_settings): Move check for font inside HAVE_XFT.
19499 (read_settings, apply_xft_settings): Add comment.
19500 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19501 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19502 call store_font_name_changed.
19503 (xft_settings_event): Add comment.
19504 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19505 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19506 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19507 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19508 (xsettings_initialize): Call init_gsettings last.
19509 (xsettings_get_system_font, xsettings_get_system_normal_font):
19510 Add comment.
19511
195122011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19513
19514 Random fixes. E.g., (random) never returned negative values.
19515 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19516 subseconds part to the entropy, as that's a bit more random.
19517 Prefer signed to unsigned, since the signedness doesn't matter and
19518 in general we prefer signed. When given a limit, use a
19519 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19520 latter isn't right if USE_2_TAGS_FOR_INTS.
19521 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19522 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19523
195242011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19525
19526 * textprop.c (text_property_stickiness):
19527 Obey Vtext_property_default_nonsticky.
19528 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19529 * w32fns.c (syms_of_w32fns):
19530 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19531
195322011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19533
19534 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19535 This is more efficient than Ffile_directory_p and avoids a minor race.
19536
195372011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19538
19539 * buffer.c (Foverlay_put): Say what the return value is
19540 (bug#7835).
19541
19542 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19543 is a directory before asking whether to use the file name
19544 (bug#7564).
19545 (barf_or_query_if_file_exists): Make the "File is a directory"
19546 error be more correct.
19547
19548 * fns.c (Frequire): Remove the mention of the .gz files, since
19549 that's installation-specific, but keep the mention of
19550 `get-load-suffixes'.
19551
195522011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19553
19554 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19555 Report string overflow if the output is too long.
19556
195572011-07-04 Juanma Barranquero <lekktu@gmail.com>
19558
19559 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19560 (syms_of_gnutls): Remove duplicate DEFSYM for
19561 Qgnutls_bootprop_verify_hostname_error, an error for
19562 Qgnutls_bootprop_verify_error (which is no longer used).
19563
19564 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19565 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19566 Also (re)move comments that are misplaced or no longer relevant.
19567
195682011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19569
19570 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19571
195722011-07-03 Chong Yidong <cyd@stupidchicken.com>
19573
19574 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19575 and background color parameters if they have been changed.
19576
195772011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19578
19579 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19580
195812011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19582
19583 * xsettings.c (SYSTEM_FONT): Define only when used.
19584 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19585
19586 * keymap.c (access_keymap_1): Now static.
19587
195882011-07-02 Chong Yidong <cyd@stupidchicken.com>
19589
19590 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19591 leave any prefix arg for the up event (Bug#1586).
19592
195932011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19594
19595 * lread.c (syms_of_lread): Mention single symbols defined by
19596 `defvar' or `defconst' (bug#7154).
19597
19598 * fns.c (Frequire): Mention .el.gz files (bug#7314).
19599 (Frequire): Mention get-load-suffixes.
19600
196012011-07-02 Martin Rudalics <rudalics@gmx.at>
19602
19603 * window.h (window): Remove clone_number slot.
19604 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19605 Remove.
19606 (make_parent_window, make_window, saved_window)
19607 (Fset_window_configuration, save_window_save): Don't deal with
19608 clone numbers.
19609 * buffer.c (Qclone_number): Remove declaration.
19610 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19611
196122011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19613
19614 Add multiple inheritance to keymaps.
19615 * keymap.c (Fmake_composed_keymap): New function.
19616 (Fset_keymap_parent): Simplify.
19617 (fix_submap_inheritance): Remove.
19618 (access_keymap_1): New function extracted from access_keymap to handle
19619 embedded parents and handle lists of maps.
19620 (access_keymap): Use it.
19621 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19622 (Fcopy_keymap): Handle embedded parents.
19623 (Fcommand_remapping, define_as_prefix): Simplify.
19624 (Fkey_binding): Simplify.
19625 (syms_of_keymap): Move minibuffer-local-completion-map,
19626 minibuffer-local-filename-completion-map,
19627 minibuffer-local-must-match-map, and
19628 minibuffer-local-filename-must-match-map to Elisp.
19629 (syms_of_keymap): Defsubr make-composed-keymap.
19630 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19631 (parse_menu_item): Trivial simplification.
19632
196332011-07-01 Glenn Morris <rgm@gnu.org>
19634
19635 * Makefile.in (SETTINGS_LIBS): Fix typo.
19636
196372011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19638
19639 * coding.c (Fencode_coding_string): Record the last coding system
19640 used, as the function doc string says (bug#8738).
19641
196422011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19643
19644 * xsettings.c (store_monospaced_changed): Take new font as arg and
19645 check for change against current_mono_font.
19646 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19647 (emacs_settings_constructor, emacs_settings_get_property)
19648 (emacs_settings_set_property, emacs_settings_class_init)
19649 (emacs_settings_init, gsettings_obj): Remove.
19650 (something_changedCB): New function for HAVE_GSETTINGS.
19651 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19652 with value as argument.
19653 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19654 g_settings_new (Bug#8967). Do not create gsettings_obj.
19655 Remove calls to g_settings_bind. Connect something_changedCB to
19656 "changed".
19657
19658 * xgselect.c: Add defined (HAVE_GSETTINGS).
19659 (xgselect_initialize): Ditto.
19660
19661 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19662 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19663 xg_select.
19664
196652011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19666
19667 * eval.c (struct backtrace): Simplify and port the data structure.
19668 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19669 signed bit field, as this assumption is not portable and it makes
19670 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19671 "char debug_on_exit : 1" as this is not portable either; instead,
19672 use the portable "unsigned int debug_on_exit : 1". Remove unused
19673 member evalargs. Remove obsolete comments about cc bombing out.
19674
196752011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19676
19677 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19678 Let HAVE_GSETTINGS override HAVE_GCONF.
19679 (store_monospaced_changed): New function.
19680 (EMACS_SETTINGS): A new type derived from GObject to handle
19681 GSettings notifications.
19682 (emacs_settings_constructor, emacs_settings_get_property)
19683 (emacs_settings_set_property, emacs_settings_class_init):
19684 New functions.
19685 (gsettings_client, gsettings_obj): New variables.
19686 (GSETTINGS_SCHEMA): New define.
19687 (something_changedCB): Call store_monospaced_changed.
19688 (init_gsettings): New function.
19689 (xsettings_initialize): Call init_gsettings.
19690 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19691 to NULL.
19692
19693 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19694 GCONF_CFLAGS/LIBS.
19695
196962011-06-29 Martin Rudalics <rudalics@gmx.at>
19697
19698 * window.c (resize_root_window, grow_mini_window)
19699 (shrink_mini_window): Rename Qresize_root_window to
19700 Qwindow_resize_root_window and Qresize_root_window_vertically to
19701 Qwindow_resize_root_window_vertically.
19702
197032011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19704
19705 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19706
197072011-06-27 Juanma Barranquero <lekktu@gmail.com>
19708
19709 * makefile.w32-in: Redesign dependencies so they reflect more
19710 clearly which files are directly included by each source file,
19711 and not through other includes.
19712
197132011-06-27 Martin Rudalics <rudalics@gmx.at>
19714
19715 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19716 (sort_overlays, overlay_strings): When an overlay's clone number
19717 matches the window's clone number process the overlay even if
19718 the overlay's window property doesn't match the current window.
19719
19720 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19721 (Fwindow_hchild): Rename to Fwindow_left_child.
19722 (Fwindow_next): Rename to Fwindow_next_sibling.
19723 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19724 (resize_window_check): Rename to window_resize_check.
19725 (resize_window_apply): Rename to window_resize_apply.
19726 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19727 (Fdelete_other_windows_internal, resize_frame_windows)
19728 (Fsplit_window_internal, Fdelete_window_internal)
19729 (grow_mini_window, shrink_mini_window)
19730 (Fresize_mini_window_internal): Fix callers accordingly.
19731
197322011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19733
19734 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19735 (emacs_fixed_set_min_size): Remove.
19736 (emacs_fixed_new): Take frame as argument.
19737
19738 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19739 (_EmacsFixedPrivate): Remove minwidth/height.
19740 Add struct frame *f.
19741 (emacs_fixed_init): Initialize priv->f.
19742 (get_parent_class, emacs_fixed_set_min_size): Remove.
19743 (emacs_fixed_new): Set priv->f to argument.
19744 (emacs_fixed_get_preferred_width)
19745 (emacs_fixed_get_preferred_height): Use min_width/height from
19746 frames size_hint to set minimum and natural (Bug#8919).
19747 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19748 and use min_width/height from frames size_hint to set
19749 min_width/height (Bug#8919).
19750
19751 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19752 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19753 Fix indentation.
19754
197552011-06-26 Eli Zaretskii <eliz@gnu.org>
19756
19757 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19758 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19759 called at ZV.
19760
197612011-06-26 Chong Yidong <cyd@stupidchicken.com>
19762
19763 * process.c (wait_reading_process_output): Bypass select if
19764 waiting for a cell while ignoring keyboard input, and input is
19765 pending. Suggested by Jan Djärv (Bug#8869).
19766
197672011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19768
19769 Use gnulib's dup2 module instead of rolling our own.
19770 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19771
197722011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19773
19774 * dispnew.c (scrolling_window): Before scrolling, turn off a
19775 mouse-highlight in the window being scrolled.
19776
197772011-06-24 Juanma Barranquero <lekktu@gmail.com>
19778
19779 Move DEFSYM to lisp.h and use everywhere.
19780
19781 * character.h (DEFSYM): Move declaration...
19782 * lisp.h (DEFSYM): ...here.
19783
19784 * gnutls.c:
19785 * minibuf.c:
19786 * w32menu.c:
19787 * w32proc.c:
19788 * w32select.c: Don't include character.h.
19789
19790 * alloc.c (syms_of_alloc):
19791 * buffer.c (syms_of_buffer):
19792 * bytecode.c (syms_of_bytecode):
19793 * callint.c (syms_of_callint):
19794 * casefiddle.c (syms_of_casefiddle):
19795 * casetab.c (init_casetab_once):
19796 * category.c (init_category_once, syms_of_category):
19797 * ccl.c (syms_of_ccl):
19798 * cmds.c (syms_of_cmds):
19799 * composite.c (syms_of_composite):
19800 * dbusbind.c (syms_of_dbusbind):
19801 * dired.c (syms_of_dired):
19802 * dispnew.c (syms_of_display):
19803 * doc.c (syms_of_doc):
19804 * editfns.c (syms_of_editfns):
19805 * emacs.c (syms_of_emacs):
19806 * eval.c (syms_of_eval):
19807 * fileio.c (syms_of_fileio):
19808 * fns.c (syms_of_fns):
19809 * frame.c (syms_of_frame):
19810 * fringe.c (syms_of_fringe):
19811 * insdel.c (syms_of_insdel):
19812 * keymap.c (syms_of_keymap):
19813 * lread.c (init_obarray, syms_of_lread):
19814 * macros.c (syms_of_macros):
19815 * msdos.c (syms_of_msdos):
19816 * print.c (syms_of_print):
19817 * process.c (syms_of_process):
19818 * search.c (syms_of_search):
19819 * sound.c (syms_of_sound):
19820 * syntax.c (init_syntax_once, syms_of_syntax):
19821 * terminal.c (syms_of_terminal):
19822 * textprop.c (syms_of_textprop):
19823 * undo.c (syms_of_undo):
19824 * w32.c (globals_of_w32):
19825 * window.c (syms_of_window):
19826 * xdisp.c (syms_of_xdisp):
19827 * xfaces.c (syms_of_xfaces):
19828 * xfns.c (syms_of_xfns):
19829 * xmenu.c (syms_of_xmenu):
19830 * xsettings.c (syms_of_xsettings):
19831 * xterm.c (syms_of_xterm): Use DEFSYM.
19832
198332011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19834
19835 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19836
198372011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19838
19839 Integer and buffer overflow fixes (Bug#8873).
19840
19841 * print.c (printchar, strout): Check for string overflow.
19842 (PRINTPREPARE, printchar, strout):
19843 Don't set size unless allocation succeeds.
19844
19845 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19846 for sizes. Check for string overflow more accurately.
19847 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19848
19849 * macros.c: Integer and buffer overflow fixes.
19850 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19851 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19852 Use ptrdiff_t, not int, for sizes.
19853 Don't increment bufsize until after realloc succeeds.
19854 Check for size-calculation overflow.
19855 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19856
19857 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19858
19859 * lread.c: Integer overflow fixes.
19860 (read_integer): Radix is now EMACS_INT, not int,
19861 to improve quality of diagnostics for out-of-range radices.
19862 Calculate buffer size correctly for out-of-range radices.
19863 (read1): Check for integer overflow in radices, and in
19864 read-circle numbers.
19865 (read_escape): Avoid int overflow.
19866 (Fload, openp, read_buffer_size, read1)
19867 (substitute_object_recurse, read_vector, read_list, map_obarray):
19868 Use ptrdiff_t, not int, for sizes.
19869 (read1): Use EMACS_INT, not int, for sizes.
19870 Check for size overflow.
19871
19872 * image.c (cache_image): Check for size arithmetic overflow.
19873
19874 * lread.c: Integer overflow issues.
19875 (saved_doc_string_size, saved_doc_string_length)
19876 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19877 Now ptrdiff_t, not int.
19878 (read1): Don't assume doc string length fits in int. Check for
19879 out-of-range doc string lengths.
19880 (read_list): Don't assume file position fits in int.
19881 (read_escape): Check for hex character overflow.
19882
198832011-06-22 Leo Liu <sdl.web@gmail.com>
19884
19885 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19886 Move to minibuffer.el.
19887
198882011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19889
19890 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19891 The following patches are for when GLYPH_DEBUG && !XASSERT.
19892 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19893 * dispnew.c (flush_stdout):
19894 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19895 Mark as externally visible.
19896 * dispnew.c (check_window_matrix_pointers): Now static.
19897 * dispnew.c (window_to_frame_vpos):
19898 * xfns.c (unwind_create_frame):
19899 * xterm.c (x_check_font): Remove unused local.
19900 * scroll.c (CHECK_BOUNDS):
19901 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19902 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19903 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19904 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19905 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19906 Now static.
19907 (debug_method_add): Use va_list and vsprintf rather than relying
19908 on undefined behavior with wrong number of arguments.
19909 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19910 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19911 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19912 since we're not interested in debugging glyphs with old libraries.
19913 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19914 GCC 4.6.0's static checking.
19915
199162011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19917
19918 Integer overflow and signedness fixes (Bug#8873).
19919 A few related buffer overrun fixes, too.
19920
19921 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19922
19923 * dispextern.h (struct face.stipple):
19924 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19925 (x_bitmap_mask, x_allocate_bitmap_record)
19926 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19927 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19928 (x_create_bitmap_from_xpm_data):
19929 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19930 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19931 (.bitmaps_last):
19932 * xfaces.c (load_pixmap):
19933 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19934 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19935 (.bitmaps_last, struct x_output.icon_bitmap):
19936 Use ptrdiff_t, not int, for bitmap indexes.
19937 (x_allocate_bitmap_record): Check for size overflow.
19938 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19939
19940 Use ptrdiff_t, not int, for overlay counts.
19941 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19942 * editfns.c (overlays_around, get_pos_property):
19943 * textprop.c (get_char_property_and_overlay):
19944 * xdisp.c (next_overlay_change, note_mouse_highlight):
19945 * xfaces.c (face_at_buffer_position):
19946 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19947 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19948 (Fnext_overlay_change, Fprevious_overlay_change)
19949 (mouse_face_overlay_overlaps, Foverlays_in):
19950 Use ptrdiff_t, not int, for sizes.
19951 (overlays_at, overlays_in): Check for size-calculation overflow.
19952
19953 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19954
19955 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19956 (x_session_initialize): Do not assume string length fits in int.
19957
19958 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19959 This is unlikely, but can occur if DPI is outlandish.
19960
19961 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19962 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19963
19964 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19965 * xrdb.c (magic_file_p, search_magic_path):
19966 Omit last arg SUFFIX; it was always 0. All callers changed.
19967 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19968
19969 * xfont.c (xfont_match): Avoid need for strlen.
19970
19971 * xfns.c: Don't assume strlen fits in int.
19972 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19973
19974 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19975 not unsigned long, as we prefer signed integers. All callers changed.
19976 Detect integer overflow in repeat count.
19977 (message_dolog): Don't assume print length fits in 39 bytes.
19978 (display_mode_element): Don't assume strlen fits in int.
19979
19980 * termcap.c: Don't assume sizes fit in int and never overflow.
19981 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19982 (gobble_line): Check for size-calculation overflow.
19983
19984 * minibuf.c (Fread_buffer):
19985 * lread.c (intern, intern_c_string):
19986 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19987 Don't assume string length fits in int.
19988
19989 * keyboard.c (parse_tool_bar_item):
19990 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19991
19992 * font.c: Don't assume string length fits in int.
19993 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19994 Use ptrdiff_t, not int.
19995 (font_intern_prop): Don't assume string length fits in int.
19996 Don't assume integer property fits in fixnum.
19997 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19998
19999 * filelock.c: Fix some buffer overrun and integer overflow issues.
20000 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
20001 Reformulate so as not to need the command string.
20002 Invoke gzip -cd rather than gunzip, as it's more portable.
20003 (lock_info_type, lock_file_1, lock_file):
20004 Don't assume pid_t and time_t fit in unsigned long.
20005 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
20006 (current_lock_owner): Prefer signed type for sizes.
20007 Use memcpy, not strncpy, where memcpy is what is really wanted.
20008 Don't assume (via atoi) that time_t and pid_t fit in int.
20009 Check for time_t and/or pid_t out of range, e.g., via a network share.
20010 Don't alloca where an auto var works fine.
20011
20012 * fileio.c: Fix some integer overflow issues.
20013 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
20014 Don't assume string length fits in int.
20015 (directory_file_name): Don't assume string length fits in long.
20016 (make_temp_name): Don't assume pid fits in int, or that its print
20017 length is less than 20.
20018
20019 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
20020
20021 * coding.c (make_subsidiaries): Don't assume string length fits in int.
20022
20023 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
20024
20025 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
20026 We prefer signed integers, even for size calculations.
20027
20028 * emacs.c: Don't assume string length fits in 'int'.
20029 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
20030 (main): Don't invoke strlen when not needed.
20031
20032 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
20033 (XD_DEBUG_MESSAGE): Don't waste a byte.
20034
20035 * callproc.c (getenv_internal_1, getenv_internal)
20036 (Fgetenv_internal):
20037 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
20038
20039 * lread.c (invalid_syntax): Omit length argument.
20040 All uses changed. This doesn't fix a bug, but it simplifies the
20041 code away from its former Hollerith-constant appearance, and it's
20042 one less 'int' to worry about when looking at integer-overflow issues.
20043 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
20044
20045 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
20046 This didn't break anything, but it didn't help either.
20047 It's confusing to put a bogus integer in a place where the actual
20048 value does not matter.
20049 (LIST_END_P): Remove unused macro and its bogus comment.
20050 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
20051
20052 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
20053 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
20054 implementation.
20055 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
20056 We prefer signed types, and the value cannot exceed the EMACS_INT
20057 range anyway (because otherwise the length would not be representable).
20058 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
20059 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
20060 This avoids a GCC warning when WIDE_EMACS_INT.
20061
20062 * indent.c (sane_tab_width): New function.
20063 (current_column, scan_for_column, Findent_to, position_indentation)
20064 (compute_motion): Use it. This is just for clarity.
20065 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
20066
20067 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
20068
20069 * lisp.h (lint_assume): New macro.
20070 * composite.c (composition_gstring_put_cache):
20071 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
20072
20073 * editfns.c, insdel.c:
20074 Omit unnecessary forward decls, to simplify future changes.
20075
20076 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
20077
20078 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
20079
20080 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
20081 Use much-faster test for byte-length change.
20082 Don't assume string byte-length fits in 'int'.
20083 Check that character arg fits in 'int'.
20084 (mapcar1): Declare byte as byte, for clarity.
20085
20086 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
20087
20088 * fns.c (concat): Catch string overflow earlier.
20089 Do not rely on integer wraparound.
20090
20091 * dispextern.h (struct it.overlay_strings_charpos)
20092 (struct it.selective): Now EMACS_INT, not int.
20093 * xdisp.c (forward_to_next_line_start)
20094 (back_to_previous_visible_line_start)
20095 (reseat_at_next_visible_line_start, next_element_from_buffer):
20096 Don't arbitrarily truncate the value of 'selective' to int.
20097
20098 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
20099
20100 * composite.c: Don't truncate sizes to 'int'.
20101 (composition_gstring_p, composition_reseat_it)
20102 (composition_adjust_point): Use EMACS_INT, not int.
20103 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
20104 not EMACS_UINT, for indexes.
20105
20106 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
20107
20108 * buffer.c: Include <verify.h>.
20109 (struct sortvec.priority, struct sortstr.priority):
20110 Now EMACS_INT, not int.
20111 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
20112 (struct sortstr.size, record_overlay_string)
20113 (struct sortstrlist.size, struct sortlist.used):
20114 Don't truncate size to int.
20115 (record_overlay_string): Check for size-calculation overflow.
20116 (init_buffer_once): Check at compile-time, not run-time.
20117
201182011-06-22 Jim Meyering <meyering@redhat.com>
20119
20120 Don't leak an XBM-image-sized buffer
20121 * image.c (xbm_load): Free the image buffer after using it.
20122
201232011-06-21 Paul Eggert <eggert@cs.ucla.edu>
20124
20125 Port to Sun C.
20126 * composite.c (find_automatic_composition): Omit needless 'return 0;'
20127 that Sun C diagnosed.
20128 * fns.c (secure_hash): Fix pointer signedness issue.
20129 * intervals.c (static_offset_intervals): New function.
20130 (offset_intervals): Use it.
20131
201322011-06-21 Leo Liu <sdl.web@gmail.com>
20133
20134 * deps.mk (fns.o):
20135 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
20136 sha512.h.
20137
20138 * fns.c (secure_hash): Rename from crypto_hash_function and change
20139 the first arg to accept symbols.
20140 (Fsecure_hash): New primitive.
20141 (syms_of_fns): New symbols.
20142
201432011-06-20 Deniz Dogan <deniz@dogan.se>
20144
20145 * process.c (Fset_process_buffer): Clarify return value in
20146 docstring.
20147
201482011-06-18 Chong Yidong <cyd@stupidchicken.com>
20149
20150 * dispnew.c (add_window_display_history): Use BVAR.
20151
20152 * xdisp.c (debug_method_add): Use BVAR.
20153 (check_window_end, dump_glyph_matrix, dump_glyph)
20154 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
20155
20156 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
20157 Likewise.
20158
20159 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
20160 check till after the cache is created in init_frame_faces.
20161
201622011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
20163
20164 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
20165
201662011-06-16 Paul Eggert <eggert@cs.ucla.edu>
20167
20168 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
20169 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
20170 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
20171
20172 Improve buffer-overflow checking (Bug#8873).
20173 * fileio.c (Finsert_file_contents):
20174 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
20175 Remove the old (too-loose) buffer overflow checks.
20176 They weren't needed, since make_gap checks for buffer overflow.
20177 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
20178 The old code merely checked for Emacs fixnum overflow, and relied
20179 on undefined (wraparound) behavior. The new code avoids undefined
20180 behavior, and also checks for ptrdiff_t and/or size_t overflow.
20181
20182 * editfns.c (Finsert_char): Don't dump core with very negative counts.
20183 Tune. Don't use wider integers than needed. Don't use alloca.
20184 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
20185
20186 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
20187
20188 * insdel.c, lisp.h (buffer_overflow): New function.
20189 (insert_from_buffer_1, replace_range, replace_range_2):
20190 * insdel.c (make_gap_larger):
20191 * editfns.c (Finsert_char):
20192 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
20193
20194 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
20195
201962011-06-15 Paul Eggert <eggert@cs.ucla.edu>
20197
20198 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
20199
20200 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
20201 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
20202
20203 * fileio.c: Don't assume EMACS_INT fits in off_t.
20204 (emacs_lseek): New static function.
20205 (Finsert_file_contents, Fwrite_region): Use it.
20206 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
20207
20208 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
20209
20210 * fns.c: Don't overflow int when computing a list length.
20211 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
20212 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
20213 truncation on 64-bit hosts. Check for QUIT every
20214 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
20215 faster and is responsive enough.
20216 (Flength): Report an error instead of overflowing an integer.
20217 (Fsafe_length): Return a float if the value is not representable
20218 as a fixnum. This shouldn't happen except in contrived situations.
20219 (Fnthcdr, Fsort): Don't assume list length fits in int.
20220 (Fcopy_sequence): Don't assume vector length fits in int.
20221
20222 * alloc.c: Check that resized vectors' lengths fit in fixnums.
20223 (header_size, word_size): New constants.
20224 (allocate_vectorlike): Don't check size overflow here.
20225 (allocate_vector): Check it here instead, since this is the only
20226 caller of allocate_vectorlike that could cause overflow.
20227 Check that the new vector's length is representable as a fixnum.
20228
20229 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
20230 The previous code was bogus. For example, next_almost_prime (32)
20231 returned 39, which is undesirable as it is a multiple of 3; and
20232 next_almost_prime (24) returned 25, which is a multiple of 5 so
20233 why was the code bothering to check for multiples of 7?
20234
20235 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
20236
20237 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
20238
20239 Variadic C functions now count arguments with ptrdiff_t.
20240 This partly undoes my 2011-03-30 change, which replaced int with size_t.
20241 Back then I didn't know that the Emacs coding style prefers signed int.
20242 Also, in the meantime I found a few more instances where arguments
20243 were being counted with int, which may truncate counts on 64-bit
20244 machines, or EMACS_INT, which may be unnecessarily wide.
20245 * lisp.h (struct Lisp_Subr.function.aMANY)
20246 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
20247 Arg counts are now ptrdiff_t, not size_t.
20248 All variadic functions and their callers changed accordingly.
20249 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
20250 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
20251 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
20252 * callint.c (Fcall_interactively): Check arg count for overflow,
20253 to avoid potential buffer overrun. Use signed char, not 'int',
20254 for 'varies' array, so that we needn't bother to check its size
20255 calculation for overflow.
20256 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
20257 * eval.c (apply_lambda):
20258 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
20259 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
20260 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
20261
20262 * callint.c (Fcall_interactively): Don't use index var as event count.
20263
20264 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
20265 * mem-limits.h (SIZE): Remove; no longer used.
20266
20267 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
20268
20269 Remove unnecessary casts.
20270 * xterm.c (x_term_init):
20271 * xfns.c (x_set_border_pixel):
20272 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
20273 These aren't needed now that we assume ANSI C.
20274
20275 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
20276 It's more likely to cause problems (due to unsigned overflow)
20277 than to cure them.
20278
20279 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
20280
20281 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
20282
20283 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
20284
20285 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
20286
20287 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
20288
20289 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
20290
20291 GLYPH_CODE_FACE returns EMACS_INT, not int.
20292 * dispextern.h (merge_faces):
20293 * xfaces.c (merge_faces):
20294 * xdisp.c (get_next_display_element, next_element_from_display_vector):
20295 Don't assume EMACS_INT fits in int.
20296
20297 * character.h (CHAR_VALID_P): Remove unused parameter.
20298 * fontset.c, lisp.h, xdisp.c: All uses changed.
20299
20300 * editfns.c (Ftranslate_region_internal): Omit redundant test.
20301
20302 * fns.c (concat): Minor tuning based on overflow analysis.
20303 This doesn't fix any bugs. Use int to hold character, instead
20304 of constantly refetching from Emacs object. Use XFASTINT, not
20305 XINT, for value known to be a character. Don't bother comparing
20306 a single byte to 0400, as it's always less.
20307
20308 * floatfns.c (Fexpt):
20309 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
20310
20311 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
20312 for characters.
20313
20314 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
20315
20316 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
20317 Without this fix, on a 64-bit host (aset S 0 4294967386) would
20318 incorrectly succeed when S was a string, because 4294967386 was
20319 truncated before it was used.
20320
20321 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
20322 Otherwise, an out-of-range integer could cause undefined behavior
20323 on a 64-bit host.
20324
20325 * composite.c: Use int, not EMACS_INT, for characters.
20326 (fill_gstring_body, composition_compute_stop_pos): Use int, not
20327 EMACS_INT, for values that are known to be in character range.
20328 This doesn't fix any bugs but is the usual style inside Emacs and
20329 may generate better code on 32-bit machines.
20330
20331 Make sure a 64-bit char is never passed to ENCODE_CHAR.
20332 This is for reasons similar to the recent CHAR_STRING fix.
20333 * charset.c (Fencode_char): Check that character arg is actually
20334 a character. Pass an int to ENCODE_CHAR.
20335 * charset.h (ENCODE_CHAR): Verify that the character argument is no
20336 wider than 'int', as a compile-time check to prevent future regressions
20337 in this area.
20338
20339 * character.c (char_string): Remove unnecessary casts.
20340
20341 Make sure a 64-bit char is never passed to CHAR_STRING.
20342 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
20343 by silently ignoring the top 32 bits, allowing some values
20344 that were far too large to be valid characters.
20345 * character.h: Include <verify.h>.
20346 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
20347 arguments are no wider than unsigned, as a compile-time check
20348 to prevent future regressions in this area.
20349 * data.c (Faset):
20350 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
20351 (Fsubst_char_in_region):
20352 * fns.c (concat):
20353 * xdisp.c (decode_mode_spec_coding):
20354 Adjust to CHAR_STRING's new requirement.
20355 * editfns.c (Finsert_char, Fsubst_char_in_region):
20356 * fns.c (concat): Check that character args are actually
20357 characters. Without this test, these functions did the wrong
20358 thing with wildly out-of-range values on 64-bit hosts.
20359
20360 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
20361 These casts should not be needed on 32-bit hosts, either.
20362 * keyboard.c (read_char):
20363 * lread.c (Fload): Remove casts to unsigned.
20364
20365 * lisp.h (UNSIGNED_CMP): New macro.
20366 This fixes comparison bugs on 64-bit hosts.
20367 (ASCII_CHAR_P): Use it.
20368 * casefiddle.c (casify_object):
20369 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
20370 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
20371 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
20372 * dispextern.h (FACE_FROM_ID):
20373 * keyboard.c (read_char): Use UNSIGNED_CMP.
20374
20375 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
20376 not to EMACS_INT, to avoid GCC warning.
20377
20378 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
20379
20380 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
20381 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
20382 isn't needed on 32-bit machines.
20383
20384 * buffer.c (Fgenerate_new_buffer_name):
20385 Use EMACS_INT for count, not int.
20386 (advance_to_char_boundary): Return EMACS_INT, not int.
20387
20388 * data.c (Qcompiled_function): Now static.
20389
20390 * window.c (window_body_lines): Now static.
20391
20392 * image.c (gif_load): Rename local to avoid shadowing.
20393
20394 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
20395 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
20396 * alloc.c (make_save_value): Integer argument is now of type
20397 ptrdiff_t, not int.
20398 (mark_object): Use ptrdiff_t, not int.
20399 * lisp.h (pD): New macro.
20400 * print.c (print_object): Use it.
20401
20402 * alloc.c: Use EMACS_INT, not int, to count objects.
20403 (total_conses, total_markers, total_symbols, total_vector_size)
20404 (total_free_conses, total_free_markers, total_free_symbols)
20405 (total_free_floats, total_floats, total_free_intervals)
20406 (total_intervals, total_strings, total_free_strings):
20407 Now EMACS_INT, not int. All uses changed.
20408 (Fgarbage_collect): Compute overall total using a double, so that
20409 integer overflow is less likely to be a problem. Check for overflow
20410 when converting back to an integer.
20411 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20412 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20413 These were 'int' variables that could overflow on 64-bit hosts;
20414 they were never used, so remove them instead of repairing them.
20415 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
20416 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20417 Previously, this ceilinged at INT_MAX, but that doesn't work on
20418 64-bit machines.
20419 (allocate_pseudovector): Don't use EMACS_INT when int would do.
20420
20421 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
20422 (allocate_vectorlike): Check for ptrdiff_t overflow.
20423 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20424 when a (possibly-narrower) signed value would do just as well.
20425 We prefer using signed arithmetic, to avoid comparison confusion.
20426
20427 * alloc.c: Catch some string size overflows that we were missing.
20428 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20429 for convenience in STRING_BYTES_MAX.
20430 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20431 The definition here is exact; the one in lisp.h was approximate.
20432 (allocate_string_data): Check for string overflow. This catches
20433 some instances we weren't catching before. Also, it catches
20434 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20435 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20436 and ptrdiff_t and EMACS_INT are both 64 bits.
20437
20438 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20439 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
20440 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
20441
20442 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20443
20444 * alloc.c (Fmake_string): Check for out-of-range init.
20445
204462011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20447
20448 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20449
204502011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20451
20452 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20453 xg_get_default_scrollbar_width.
20454
20455 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20456 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20457 (style_changed_cb): Call update_theme_scrollbar_width and call
20458 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20459 all frames (Bug#8505).
20460 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20461 Call gtk_window_set_resizable if HAVE_GTK3.
20462 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20463 and height if HAVE_GTK3 (Bug#8505).
20464 (scroll_bar_width_for_theme): New variable.
20465 (update_theme_scrollbar_width): New function.
20466 (xg_get_default_scrollbar_width): Move code to
20467 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20468 (xg_initialize): Call update_theme_scrollbar_width.
20469
20470 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20471
20472 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20473
204742011-06-12 Martin Rudalics <rudalics@gmx.at>
20475
20476 * frame.c (make_frame): Call other_buffer_safely instead of
20477 other_buffer.
20478
20479 * window.c (temp_output_buffer_show): Call display_buffer with
20480 second argument Vtemp_buffer_show_specifiers and reset latter
20481 immediately after the call.
20482 (Vtemp_buffer_show_specifiers): New variable.
20483 (auto_window_vscroll_p, next_screen_context_lines)
20484 (Vscroll_preserve_screen_position): Remove leading asterisks from
20485 doc-strings.
20486
204872011-06-12 Paul Eggert <eggert@cs.ucla.edu>
20488
20489 Fix minor problems found by GCC 4.6.0 static checking.
20490 * buffer.c (Qclone_number): Remove for now, as it's unused.
20491 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20492 (record_buffer): Remove unused local.
20493 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20494 (set_frame_buffer_list): Remove; unused.
20495 * frame.h (other_visible_frames): Remove decl.
20496 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20497 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20498 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20499 if HAVE_GPM.
20500 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20501 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20502 Define only if HAVE_GPM.
20503 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20504 (update_hints_inhibit): Remove; never set. All uses removed.
20505 * widgetprv.h (emacsFrameClassRec): Remove decl.
20506 * window.c (delete_deletable_window): Now returns void, since it
20507 wasn't returning anything.
20508 (compare_window_configurations): Remove unused locals.
20509 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20510 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
20511 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20512 the same widths as pointers. This follows up on the 2011-05-06 patch.
20513 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20514 * xterm.h: Likewise.
20515 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20516
205172011-06-12 Juanma Barranquero <lekktu@gmail.com>
20518
20519 * makefile.w32-in: Update dependencies.
20520 (LISP_H): Add lib/intprops.h.
20521
205222011-06-11 Chong Yidong <cyd@stupidchicken.com>
20523
20524 * image.c (gif_load): Add animation frame delay to the metadata.
20525 (syms_of_image): Use DEFSYM. New symbol `delay'.
20526
205272011-06-11 Martin Rudalics <rudalics@gmx.at>
20528
20529 * window.c (delete_deletable_window): Re-add.
20530 (Fset_window_configuration): Rewrite to handle dead buffers and
20531 consequently deletable windows.
20532 (window_tree, Fwindow_tree): Remove. Supply functionality in
20533 window.el.
20534 (compare_window_configurations): Simplify code.
20535
205362011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20537
20538 * image.c (imagemagick_load_image): Fix type mismatch.
20539 (Fimagemagick_types): Likewise.
20540
20541 * window.h (replace_buffer_in_windows): Declare.
20542
205432011-06-11 Martin Rudalics <rudalics@gmx.at>
20544
20545 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20546 Qclone_number. Remove external declaration of Qdelete_window.
20547 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20548 code.
20549 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20550 Run Qbuffer_list_update_hook if allowed.
20551 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20552 buffer list implementation.
20553 (other_buffer_safely): New function.
20554 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20555 calls to replace_buffer_in_windows and
20556 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20557 if allowed.
20558 (record_buffer): Inhibit quitting and rewrite using quittable
20559 functions. Run Qbuffer_list_update_hook if allowed.
20560 (Frecord_buffer, Funrecord_buffer): New functions.
20561 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20562 Move switch-to-buffer to window.el.
20563 (bury-buffer): Move to window.el.
20564 (Vbuffer_list_update_hook): New variable.
20565
20566 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20567 section.
20568
20569 * window.h (resize_frame_windows): Move up in code.
20570 (Fwindow_frame): Remove EXFUN.
20571 (replace_buffer_in_all_windows): Remove prototype.
20572 (replace_buffer_in_windows_safely): Add prototype.
20573
20574 * window.c: Declare Qdelete_window static again. Move down
20575 declaration of select_count.
20576 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20577 (Fother_window): Move to window.el.
20578 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20579 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20580 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20581 window.el.
20582 (replace_buffer_in_windows): Implement by calling
20583 Qreplace_buffer_in_windows.
20584 (replace_buffer_in_all_windows): Remove with some functionality
20585 moved into replace_buffer_in_windows_safely.
20586 (replace_buffer_in_windows_safely): New function.
20587 (select_window_norecord, select_frame_norecord): Move in front
20588 of run_window_configuration_change_hook. Remove now obsolete
20589 declarations.
20590 (Fset_window_buffer): Rewrite doc-string.
20591 Call Qrecord_window_buffer.
20592 (keys_of_window): Move binding for other-window to window.el.
20593
205942011-06-11 Chong Yidong <cyd@stupidchicken.com>
20595
20596 * dispextern.h (struct image): Replace data member, whose int_val
20597 and ptr_val fields were not used by anything, with a single
20598 lisp_val object.
20599
20600 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20601 (gif_clear_image, gif_load, imagemagick_load_image)
20602 (gs_clear_image, gs_load): Callers changed.
20603
206042011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20605
20606 * buffer.h: Include <time.h>, for time_t.
20607 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20608
20609 Fix minor problems found by static checking.
20610
20611 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20612
20613 Make identifiers static if they are not used in other modules.
20614 * data.c (Qcompiled_function, Qframe, Qvector):
20615 * image.c (QimageMagick, Qsvg):
20616 * minibuf.c (Qmetadata):
20617 * window.c (resize_window_check, resize_root_window): Now static.
20618 * window.h (resize_window_check, resize_root_window): Remove decls.
20619
20620 * window.c (window_deletion_count, delete_deletable_window):
20621 Remove; unused.
20622 (window_body_lines): Now static.
20623 (Fdelete_other_windows_internal): Mark vars as initialized.
20624 Make sure 'resize_failed' is initialized.
20625 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20626 (resize_window_apply): Remove unused local.
20627 * window.h (delete_deletable_window): Remove decl.
20628
20629 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20630 (imagemagick_load_image): Fix pointer signedness problem by changing
20631 last arg from unsigned char * to char *. All uses changed.
20632 Also, fix a local for similar reasons.
20633 Remove unused locals. Remove locals to avoid shadowing.
20634 (fn_rsvg_handle_free): Remove; unused.
20635 (svg_load, svg_load_image): Fix pointer signedness problem.
20636 (imagemagick_load_image): Don't use garbage pointer image_wand.
20637
20638 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20639
206402011-06-10 Chong Yidong <cyd@stupidchicken.com>
20641
20642 * image.c (gif_load): Fix omitted cast error introduced by
20643 2011-06-06 change.
20644
206452011-06-10 Martin Rudalics <rudalics@gmx.at>
20646
20647 * window.h (resize_proportionally, orig_total_lines)
20648 (orig_top_line): Remove from window structure.
20649 (set_window_height, set_window_width, change_window_heights)
20650 (Fdelete_window): Remove prototypes.
20651 (resize_frame_windows): Remove duplicate declaration.
20652
206532011-06-10 Eli Zaretskii <eliz@gnu.org>
20654
20655 * window.h (resize_frame_windows, resize_window_check)
20656 (delete_deletable_window, resize_root_window)
20657 (resize_frame_windows): Declare prototypes.
20658
20659 * window.c (resize_window_apply): Make definition be "static" to
20660 match the prototype.
20661
206622011-06-10 Martin Rudalics <rudalics@gmx.at>
20663
20664 * window.c: Remove declarations of Qwindow_size_fixed,
20665 window_min_size_1, window_min_size_2, window_min_size,
20666 size_window, window_fixed_size_p, enlarge_window, delete_window.
20667 Remove static from declaration of Qdelete_window, it's
20668 temporarily needed by Fbury_buffer.
20669 (replace_window): Don't assign orig_top_line and
20670 orig_total_lines.
20671 (Fdelete_window, delete_window): Remove. Window deletion is
20672 handled by window.el.
20673 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20674 Replace Fdelete_window calls with calls to Qdelete_window.
20675 (Fdelete_other_windows): Remove. Deleting other windows is
20676 handled by window.el.
20677 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20678 handled in window.el.
20679 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20680 Window minimum sizes are handled in window.el.
20681 (shrink_windows, size_window, set_window_height)
20682 (set_window_width, change_window_heights, window_height)
20683 (window_width, CURBEG, CURSIZE, enlarge_window)
20684 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20685 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20686 handled in window.el.
20687 (make_dummy_parent): Rename to make_parent_window and give it a
20688 second argument horflag.
20689 (make_window): Don't set resize_proportionally any more.
20690 (Fsplit_window): Remove. Windows are split in window.el.
20691 (save_restore_action, save_restore_orig_size)
20692 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20693 Resize mini windows in window.el.
20694 (grow_mini_window, shrink_mini_window): Implement by calling
20695 Qresize_root_window_vertically, resize_window_check and
20696 resize_window_apply.
20697 (saved_window, Fset_window_configuration, save_window_save):
20698 Do not handle orig_top_line, orig_total_lines, and
20699 resize_proportionally.
20700 (window_min_height, window_min_width): Move to window.el.
20701 (keys_of_window): Move bindings for delete-other-windows,
20702 split-window, delete-window and enlarge-window to window.el.
20703
20704 * buffer.c: Temporarily extern Qdelete_window.
20705 (Fbury_buffer): Temporarily call Qdelete_window instead of
20706 Fdelete_window (Fbury_buffer will move to window.el soon).
20707
20708 * frame.c (set_menu_bar_lines_1): Remove code handling
20709 orig_top_line and orig_total_lines.
20710
20711 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20712 set_window_height but set heights directly.
20713 (change_frame_size_1): Use resize_frame_windows.
20714
20715 * xdisp.c (init_xdisp): Don't use set_window_height but set
20716 heights directly.
20717
20718 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20719 Use resize_frame_windows instead of change_window_heights and run
20720 run_window_configuration_change_hook.
20721
20722 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20723 instead of change_window_heights and run
20724 run_window_configuration_change_hook.
20725
207262011-06-09 Martin Rudalics <rudalics@gmx.at>
20727
20728 * window.c (replace_window): Rename second argument REPLACEMENT to
20729 NEW. New third argument SETFLAG. Rewrite.
20730 (delete_window, make_dummy_parent): Call replace_window with
20731 third argument 1.
20732 (window_list_1): Move down in code.
20733 (run_window_configuration_change_hook): Move set_buffer part
20734 before select_frame_norecord part in order to unwind correctly.
20735 Rename count1 to count.
20736 (recombine_windows, delete_deletable_window, resize_root_window)
20737 (Fdelete_other_windows_internal)
20738 (Frun_window_configuration_change_hook, make_parent_window)
20739 (resize_window_check, resize_window_apply, Fresize_window_apply)
20740 (resize_frame_windows, Fsplit_window_internal)
20741 (Fdelete_window_internal, Fresize_mini_window_internal):
20742 New functions.
20743 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20744
207452011-06-08 Martin Rudalics <rudalics@gmx.at>
20746
20747 * window.h (window): Add some new members to window structure -
20748 normal_lines, normal_cols, new_total, new_normal, clone_number,
20749 splits, nest, prev_buffers, next_buffers.
20750 (WINDOW_TOTAL_SIZE): Move here from window.c.
20751 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20752
20753 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20754 Remove.
20755 (make_dummy_parent): Set new members of windows structure.
20756 (make_window): Move down in code. Handle new members of window
20757 structure.
20758 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20759 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20760 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20761 (Fset_window_prev_buffers, Fwindow_next_buffers)
20762 (Fset_window_next_buffers, Fset_window_clone_number):
20763 New functions.
20764 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20765 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20766 Doc-string fixes.
20767 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20768 Argument WINDOW can be now internal window too.
20769 (Fwindow_use_time): Move up in code.
20770 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20771 Rewrite doc-string.
20772 (Fset_window_configuration, saved_window)
20773 (Fcurrent_window_configuration, save_window_save): Handle new
20774 members of window structure.
20775 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20776 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20777 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20778 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20779 Qget_mru_window, Qresize_root_window,
20780 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20781 Qauto_buffer_name; staticpro them.
20782
207832011-06-07 Martin Rudalics <rudalics@gmx.at>
20784
20785 * window.c (Fwindow_total_size, Fwindow_left_column)
20786 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20787 (Fwindow_list_1): New functions.
20788 (window_box_text_cols): Replace with window_body_cols.
20789 (Fwindow_width, Fscroll_left, Fscroll_right):
20790 Use window_body_cols instead of window_box_text_cols.
20791 (delete_window, Fset_window_configuration):
20792 Call delete_all_subwindows with window as argument.
20793 (delete_all_subwindows): Take a window as argument and not a
20794 structure. Rewrite.
20795 (window_loop): Remove handling of GET_LRU_WINDOW and
20796 GET_LARGEST_WINDOW.
20797 (Fget_lru_window, Fget_largest_window): Move to window.el.
20798
20799 * window.h: Extern window_body_cols instead of
20800 window_box_text_cols. delete_all_subwindows now takes a
20801 Lisp_Object as argument.
20802
20803 * indent.c (compute_motion, Fcompute_motion):
20804 Use window_body_cols instead of window_box_text_cols.
20805
20806 * frame.c (delete_frame): Call delete_all_subwindows with root
20807 window as argument.
20808
208092011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20810
20811 * fns.c (Fputhash): Document return value.
20812
208132011-06-06 Chong Yidong <cyd@stupidchicken.com>
20814
20815 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20816
208172011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20818
20819 Cons<->int and similar integer overflow fixes (Bug#8794).
20820
20821 Check for overflow when converting integer to cons and back.
20822 * charset.c (Fdefine_charset_internal, Fdecode_char):
20823 Use cons_to_unsigned to catch overflow.
20824 (Fencode_char): Use INTEGER_TO_CONS.
20825 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20826 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20827 * data.c (long_to_cons, cons_to_long): Remove.
20828 (cons_to_unsigned, cons_to_signed): New functions.
20829 These signal an error for invalid or out-of-range values.
20830 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20831 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20832 * font.c (Ffont_variation_glyphs):
20833 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20834 * lisp.h: Include <intprops.h>.
20835 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20836 (cons_to_signed, cons_to_unsigned): New decls.
20837 (long_to_cons, cons_to_long): Remove decls.
20838 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20839 (Fprimitive_undo): Use CONS_TO_INTEGER.
20840 * xfns.c (Fx_window_property): Likewise.
20841 * xselect.c: Include <limits.h>.
20842 (x_own_selection, selection_data_to_lisp_data):
20843 Use INTEGER_TO_CONS.
20844 (x_handle_selection_request, x_handle_selection_clear)
20845 (x_get_foreign_selection, Fx_disown_selection_internal)
20846 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20847 (lisp_data_to_selection_data): Use cons_to_unsigned.
20848 (x_fill_property_data): Use cons_to_signed.
20849 Report values out of range.
20850
20851 Check for buffer and string overflow more precisely.
20852 * buffer.h (BUF_BYTES_MAX): New macro.
20853 * lisp.h (STRING_BYTES_MAX): New macro.
20854 * alloc.c (Fmake_string):
20855 * character.c (string_escape_byte8):
20856 * coding.c (coding_alloc_by_realloc):
20857 * doprnt.c (doprnt):
20858 * editfns.c (Fformat):
20859 * eval.c (verror):
20860 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20861 since they may not be the same number.
20862 * editfns.c (Finsert_char):
20863 * fileio.c (Finsert_file_contents):
20864 Likewise for BUF_BYTES_MAX.
20865
20866 * image.c: Use ptrdiff_t, not int, for sizes.
20867 (slurp_file): Switch from int to ptrdiff_t.
20868 All uses changed.
20869 (slurp_file): Check that file size fits in both size_t (for
20870 malloc) and ptrdiff_t (for sanity and safety).
20871
20872 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20873 if b->modtime has its maximal value.
20874
20875 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20876
20877 Don't assume time_t can fit into int.
20878 * buffer.h (struct buffer.modtime): Now time_t, not int.
20879 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20880 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20881
20882 Minor fixes for signed vs unsigned integers.
20883 * character.h (MAYBE_UNIFY_CHAR):
20884 * charset.c (maybe_unify_char):
20885 * keyboard.c (read_char, reorder_modifiers):
20886 XINT -> XFASTINT, since the integer must be nonnegative.
20887 * ftfont.c (ftfont_spec_pattern):
20888 * keymap.c (access_keymap, silly_event_symbol_error):
20889 XUINT -> XFASTINT, since the integer must be nonnegative.
20890 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20891 since it makes no difference and we prefer signed.
20892 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20893 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20894 nonnegative.
20895
208962011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20897
20898 * window.h (Fwindow_frame): Declare.
20899
209002011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20901
20902 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20903 (SPARE_MEMORY): Always define.
20904 (LARGE_REQUEST): Remove.
20905 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20906
209072011-06-06 Martin Rudalics <rudalics@gmx.at>
20908
20909 * lisp.h: Move EXFUNS for Fframe_root_window,
20910 Fframe_first_window and Fset_frame_selected_window to window.h.
20911
20912 * window.h: Move EXFUNS for Fframe_root_window,
20913 Fframe_first_window and Fset_frame_selected_window here from
20914 lisp.h.
20915
20916 * frame.c (Fwindow_frame, Fframe_first_window)
20917 (Fframe_root_window, Fframe_selected_window)
20918 (Fset_frame_selected_window): Move to window.c.
20919 (Factive_minibuffer_window): Move to minibuf.c.
20920 (Fother_visible_frames_p): New function.
20921
20922 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20923
20924 * window.c (decode_window, decode_any_window): Move up in code.
20925 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20926 (inhibit_frame_unsplittable): Remove unused variable.
20927 (Fwindow_buffer): Move up and rewrite doc-string.
20928 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20929 (Fwindow_prev): New functions.
20930 (Fwindow_frame): Move here from frame.c. Accept any window as
20931 argument.
20932 (Fframe_root_window, Fframe_first_window)
20933 (Fframe_selected_window): Move here from frame.c. Accept frame
20934 or arbitrary window as argument. Update doc-strings.
20935 (Fminibuffer_window): Move up in code.
20936 (Fwindow_minibuffer_p): Move up in code and simplify.
20937 (Fset_frame_selected_window): Move here from frame.c.
20938 Marginal rewrite.
20939 (Fselected_window, select_window, Fselect_window): Move up in
20940 code. Minor doc-string fixes.
20941
209422011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20943
20944 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20945 Do not assume that spare memory exists; that assumption is valid
20946 only if SYSTEM_MALLOC.
20947 (LARGE_REQUEST): New macro, so that the issue of large requests
20948 is separated from the issue of spare memory.
20949
209502011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20951
20952 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20953 format. (Bug#8806)
20954
20955 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20956
20957 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20958 before statements.
20959
209602011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20961
20962 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20963
20964 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20965
20966 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20967 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20968
209692011-06-05 Juanma Barranquero <lekktu@gmail.com>
20970
20971 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20972
209732011-06-04 Chong Yidong <cyd@stupidchicken.com>
20974
20975 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20976 (x_clipboard_manager_save): Add return value.
20977 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20978 New error handlers.
20979 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20980 Obey Vx_select_enable_clipboard_manager. Catch errors in
20981 x_clipboard_manager_save (Bug#8779).
20982 (Vx_select_enable_clipboard_manager): New variable.
20983 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20984
209852011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20986
20987 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20988
209892011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20990
20991 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20992 in the current matrix if keep_current_p is non-zero.
20993
209942011-06-04 Eli Zaretskii <eliz@gnu.org>
20995
20996 * bidi.c (bidi_level_of_next_char): Fix last change.
20997
209982011-06-03 Eli Zaretskii <eliz@gnu.org>
20999
21000 Support bidi reordering of text covered by display properties.
21001
21002 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
21003 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
21004 (bidi_cache_search, bidi_cache_iterator_state)
21005 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
21006 (bidi_level_of_next_char, bidi_move_to_visually_next):
21007 Support character positions inside a run of characters covered by a
21008 display string.
21009 (bidi_paragraph_init, bidi_resolve_explicit_1)
21010 (bidi_level_of_next_char): Call bidi_fetch_char and
21011 bidi_fetch_char_advance instead of FETCH_CHAR and
21012 FETCH_CHAR_ADVANCE.
21013 (bidi_init_it): Initialize new members.
21014 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
21015 definitions.
21016 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
21017 instead of using explicit *_CHAR codes.
21018 (bidi_resolve_explicit, bidi_resolve_weak):
21019 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
21020 bidirectional text is supported only in multibyte buffers.
21021 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
21022 it to initialize the frame_window_p member of struct bidi_it.
21023 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
21024 (bidi_resolve_explicit, bidi_resolve_weak)
21025 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
21026 bidi_it->nchars is non-positive.
21027 (bidi_level_of_next_char): Don't try to lookup the cache for the
21028 next/previous character if nothing is cached there yet, or if we
21029 were just reseat()'ed to a new position.
21030
21031 * xdisp.c (set_cursor_from_row): Set start and stop points
21032 according to the row's direction when priming the loop that looks
21033 for the glyph on which to display cursor.
21034 (single_display_spec_intangible_p): Function deleted.
21035 (display_prop_intangible_p): Reimplement to call
21036 handle_display_spec instead of single_display_spec_intangible_p.
21037 Accept 3 additional arguments needed by handle_display_spec.
21038 This fixes incorrect cursor motion across display property with complex
21039 values: lists, `(when COND...)' forms, etc.
21040 (single_display_spec_string_p): Support property values that are
21041 lists with the argument STRING its top-level element.
21042 (display_prop_string_p): Fix the condition for processing a
21043 property that is a list to be consistent with handle_display_spec.
21044 (handle_display_spec): New function, refactored from the
21045 last portion of handle_display_prop.
21046 (compute_display_string_pos): Accept additional argument
21047 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
21048 value of a `display' property is a "replacing spec".
21049 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
21050 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
21051 the display property, but just return a value indicating whether
21052 the display property will replace the characters it covers.
21053 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
21054 frame_window_p members of struct bidi_it.
21055 (compute_display_string_pos, compute_display_string_end):
21056 New functions.
21057 (push_it): Accept second argument POSITION, where pop_it should
21058 jump to continue iteration.
21059 (reseat_1): Initialize bidi_it.disp_pos.
21060
21061 * keyboard.c (adjust_point_for_property): Adjust the call to
21062 display_prop_intangible_p to its new signature.
21063
21064 * dispextern.h (struct bidi_it): New member frame_window_p.
21065 (bidi_init_it): Update prototypes.
21066 (display_prop_intangible_p): Update prototype.
21067 (compute_display_string_pos, compute_display_string_end):
21068 Declare prototypes.
21069 (struct bidi_it): New members nchars and disp_pos. ch_len is now
21070 EMACS_INT.
21071
210722011-06-02 Paul Eggert <eggert@cs.ucla.edu>
21073
21074 Malloc failure behavior now depends on size of allocation.
21075 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
21076 * lisp.h: Change signatures accordingly.
21077 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
21078 All callers changed. (Bug#8762)
21079
21080 * gnutls.c: Use Emacs's memory allocators.
21081 Without this change, the gnutls library would invoke malloc etc.
21082 directly, which causes problems on non-SYNC_INPUT hosts, and which
21083 runs afoul of improving memory_full behavior. (Bug#8761)
21084 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
21085 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
21086 xfree instead of the default malloc, realloc, free.
21087 (Fgnutls_boot): No need to check for memory allocation failure,
21088 since xmalloc does that for us.
21089
21090 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
21091 * category.c (hash_get_category_set):
21092 * ccl.c (ccl_driver):
21093 * charset.c (Fdefine_charset_internal):
21094 * charset.h (struct charset.hash_index):
21095 * composite.c (get_composition_id, gstring_lookup_cache)
21096 (composition_gstring_put_cache):
21097 * composite.h (struct composition.hash_index):
21098 * dispextern.h (struct image.hash):
21099 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
21100 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
21101 (hashfn_equal, hashfn_user_defined, make_hash_table)
21102 (maybe_resize_hash_table, hash_lookup, hash_put)
21103 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
21104 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
21105 (Fsxhash, Fgethash, Fputhash, Fmaphash):
21106 * image.c (make_image, search_image_cache, lookup_image)
21107 (xpm_put_color_table_h):
21108 * lisp.h (struct Lisp_Hash_Table):
21109 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
21110 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
21111 for hashes and hash indexes, instead of 'unsigned' and 'int'.
21112 * alloc.c (allocate_vectorlike):
21113 Check for overflow in vector size calculations.
21114 * ccl.c (ccl_driver):
21115 Check for overflow when converting EMACS_INT to int.
21116 * fns.c, image.c: Remove unnecessary static decls that would otherwise
21117 need to be updated by these changes.
21118 * fns.c (make_hash_table, maybe_resize_hash_table):
21119 Check for integer overflow with large hash tables.
21120 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
21121 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
21122 (SXHASH_REDUCE): New macro.
21123 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
21124 Use it instead of discarding useful hash info with large hash values.
21125 (sxhash_float): New function.
21126 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
21127 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
21128 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
21129 Rewrite to use FIXNUM_BITS, as this simplifies things.
21130 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
21131 Adjust signatures to match updated version of code.
21132 (consing_since_gc): Now EMACS_INT, since a single hash table can
21133 use more than INT_MAX bytes.
21134
211352011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
21136
21137 Make it possible to build with GCC-4.6+ -O2 -flto.
21138
21139 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
21140
211412011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
21142
21143 * minibuf.c (get_minibuffer, read_minibuf_unwind):
21144 Call minibuffer-inactive-mode.
21145
211462011-05-31 Juanma Barranquero <lekktu@gmail.com>
21147
21148 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
21149 Update dependencies.
21150
211512011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
21152
21153 * data.c (init_data): Remove code for UTS, this system is not
21154 supported anymore.
21155
211562011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
21157
21158 Don't force ./temacs to start in terminal mode.
21159
21160 * frame.c (make_initial_frame): Initialize faces in all cases, not
21161 only when CANNOT_DUMP is defined.
21162 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
21163
211642011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
21165
21166 * dispnew.c (add_window_display_history): Use const for the string
21167 pointer. Remove declaration, not needed.
21168
211692011-05-31 Paul Eggert <eggert@cs.ucla.edu>
21170
21171 Use 'inline', not 'INLINE'.
21172 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
21173 * alloc.c, fontset.c (INLINE): Remove.
21174 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
21175 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
21176 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
21177 * gmalloc.c (register_heapinfo): Use inline unconditionally.
21178 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
21179
211802011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
21181
21182 Make it possible to run ./temacs.
21183
21184 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
21185 syms_of_callproc does the same thing. Remove test for
21186 "initialized", do it in the caller.
21187 * emacs.c (main): Avoid calling set_initial_environment when dumping.
21188
211892011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
21190
21191 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
21192 (read_minibuf): Use get_minibuffer.
21193 (syms_of_minibuf): Use DEFSYM.
21194 (Qmetadata): New var.
21195 * data.c (Qbuffer): Don't make it static.
21196 (syms_of_data): Use DEFSYM.
21197
211982011-05-31 Paul Eggert <eggert@cs.ucla.edu>
21199
21200 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
21201 (CCL_CODE_MIN): New macro.
21202
212032011-05-30 Paul Eggert <eggert@cs.ucla.edu>
21204
21205 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
21206
21207 * eval.c (Qdebug): Now static.
21208 * lisp.h (Qdebug): Remove decl. This reverts a part of the
21209 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
21210 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
21211
212122011-05-29 Chong Yidong <cyd@stupidchicken.com>
21213
21214 * image.c: Various fixes to ImageMagick code comments.
21215 (Fimagemagick_types): Doc fix.
21216
212172011-05-29 Paul Eggert <eggert@cs.ucla.edu>
21218
21219 Minor fixes prompted by GCC 4.6.0 warnings.
21220
21221 * xselect.c (converted_selections, conversion_fail_tag): Now static.
21222
21223 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
21224 (x_clipboard_manager_save_all): Move extern decl to ...
21225 * xterm.h: ... here, so that it can be checked for consistency.
21226
212272011-05-29 Chong Yidong <cyd@stupidchicken.com>
21228
21229 * xselect.c (x_clipboard_manager_save_frame)
21230 (x_clipboard_manager_save_all): New functions.
21231 (Fx_clipboard_manager_save): Lisp function deleted.
21232
21233 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
21234 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
21235
21236 * xterm.h: Update prototype.
21237
212382011-05-28 William Xu <william.xwl@gmail.com>
21239
21240 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
21241 exiting (Bug#8239).
21242
212432011-05-28 Jim Meyering <meyering@redhat.com>
21244
21245 Avoid a sign-extension bug in crypto_hash_function.
21246 * fns.c (to_uchar): Define.
21247 (crypto_hash_function): Use it to convert some newly-signed
21248 variables to unsigned, to avoid sign-extension bugs. For example,
21249 without this change, (md5 "truc") would evaluate to
21250 45723a2aff78ff4fff7fff1114760e62 rather than the expected
21251 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
21252 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
21253
212542011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21255
21256 Integer overflow fixes.
21257
21258 * dbusbind.c: Serial number integer overflow fixes.
21259 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
21260 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
21261 to hold a serial number that is too large for a fixnum.
21262 (Fdbus_method_return_internal, Fdbus_method_error_internal):
21263 Check for serial numbers out of range. Decode any serial number
21264 that was so large that it became a float. (Bug#8722)
21265
21266 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
21267 (Fdbus_call_method, Fdbus_call_method_asynchronously):
21268 Use XFASTINT rather than XUINT when numbers are nonnegative.
21269 (xd_append_arg, Fdbus_method_return_internal):
21270 (Fdbus_method_error_internal): Likewise. Also, for unsigned
21271 arguments, check that Lisp number is nonnegative, rather than
21272 silently wrapping negative numbers around. (Bug#8722)
21273 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
21274 (Bug#8722)
21275
21276 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
21277
21278 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
21279
21280 ccl: Add integer overflow checks.
21281 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
21282 (IN_INT_RANGE): New macros.
21283 (ccl_driver): Use them to check for integer overflow when
21284 decoding a CCL program. Many of the new checks are whether XINT (x)
21285 fits in int; it doesn't always, on 64-bit hosts. The new version
21286 doesn't catch all possible integer overflows, but it's an
21287 improvement. (Bug#8719)
21288
21289 * alloc.c (make_event_array): Use XINT, not XUINT.
21290 There's no need for unsigned here.
21291
21292 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
21293 This follows up to the 2011-05-06 change that substituted uintptr_t
21294 for EMACS_INT. This case wasn't caught back then.
21295
21296 Rework Fformat to avoid integer overflow issues.
21297 * editfns.c: Include <float.h> unconditionally, as it's everywhere
21298 now (part of C89). Include <verify.h>.
21299 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
21300 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
21301 (Fformat): Avoid the prepass trying to compute sizes; it was only
21302 approximate and thus did not catch overflow reliably. Instead, walk
21303 through the format just once, formatting and computing sizes as we go,
21304 checking for integer overflow at every step, and allocating a larger
21305 buffer as needed. Keep track separately whether the format is
21306 multibyte. Keep only the most-recently calculated precision, rather
21307 than them all. Record whether each argument has been converted to
21308 string. Use EMACS_INT, not int, for byte and char and arg counts.
21309 Support field widths and precisions larger than INT_MAX. Avoid
21310 sprintf's undefined behavior with conversion specifications such as %#d
21311 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
21312 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
21313 formatting out-of-range floating point numbers with int
21314 formats. (Bug#8668)
21315
21316 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
21317
21318 * data.c: Avoid integer truncation in expressions involving floats.
21319 * data.c: Include <intprops.h>.
21320 (arith_driver): When there's an integer overflow in an expression
21321 involving floating point, convert the integers to floating point
21322 so that the resulting value does not suffer from catastrophic
21323 integer truncation. For example, on a 64-bit host (* 4
21324 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
21325 Do not rely on undefined behavior after integer overflow.
21326
21327 merge count_size_as_multibyte, parse_str_to_multibyte
21328 * character.c, character.h (count_size_as_multibyte):
21329 Rename from parse_str_to_multibyte; all uses changed.
21330 Check for integer overflow.
21331 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
21332 since it's now a duplicate of the other. This is more of
21333 a character than a buffer op, so better that it's in character.c.
21334 * fns.c, print.c: Adjust to above changes.
21335
213362011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
21337
21338 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
21339
213402011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21341
21342 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21343 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
21344 (x_clipboard_manager_save): Now static.
21345 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
21346
21347 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21348 (crypto_hash_function): Now static.
21349 Fix pointer signedness problems. Avoid unnecessary initializations.
21350
213512011-05-27 Chong Yidong <cyd@stupidchicken.com>
21352
21353 * termhooks.h (Vselection_alist): Make it terminal-local.
21354
21355 * terminal.c (create_terminal): Initialize it.
21356
21357 * xselect.c: Support for clipboard managers.
21358 (Vselection_alist): Move to termhooks.h as terminal-local var.
21359 (LOCAL_SELECTION): New macro.
21360 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
21361 (symbol_to_x_atom): Remove gratuitous arg.
21362 (x_handle_selection_request, lisp_data_to_selection_data)
21363 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
21364 (x_own_selection, x_get_local_selection, x_convert_selection):
21365 New arg, specifying work frame. Use terminal-local Vselection_alist.
21366 (some_frame_on_display): Delete unused function.
21367 (Fx_own_selection_internal, Fx_get_selection_internal)
21368 (Fx_disown_selection_internal, Fx_selection_owner_p)
21369 (Fx_selection_exists_p): New optional frame arg.
21370 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
21371 (x_handle_selection_clear): Don't treat other terminals with the
21372 same keyboard specially. Use the terminal-local Vselection_alist.
21373 (x_clear_frame_selections): Use Frun_hook_with_args.
21374
21375 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
21376
21377 * xterm.h: Add support for those atoms.
21378
213792011-05-26 Chong Yidong <cyd@stupidchicken.com>
21380
21381 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
21382 (converted_selections, conversion_fail_tag): New global variables.
21383 (x_selection_request_lisp_error): Free the above.
21384 (x_get_local_selection): Remove unnecessary code.
21385 (x_reply_selection_request): Args changed; handle arbitrary array
21386 of converted selections stored in converted_selections.
21387 Separate the XChangeProperty and SelectionNotify steps.
21388 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
21389 (x_convert_selection): New function.
21390 (x_handle_selection_event): Simplify.
21391 (x_get_foreign_selection): Don't ignore incoming requests while
21392 waiting for an answer; this will fail when we implement
21393 SAVE_TARGETS, and seems unnecessary anyway.
21394 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
21395 (Vx_sent_selection_functions): Doc fix.
21396
213972011-05-26 Leo Liu <sdl.web@gmail.com>
21398
21399 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
21400
214012011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21402
21403 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21404
21405 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21406 for fringe update if it has periodic bitmap.
21407 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
21408 and fringe_bitmap_periodic_p.
21409
21410 * fringe.c (get_fringe_bitmap_data): New function.
21411 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21412 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21413 row. Mark glyph row for fringe update if periodicity changed.
21414
21415 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21416 for fringe update unless it has periodic bitmap.
21417
214182011-05-25 Kenichi Handa <handa@m17n.org>
21419
21420 * xdisp.c (get_next_display_element): Set correct it->face_id for
21421 a static composition.
21422
214232011-05-24 Leo Liu <sdl.web@gmail.com>
21424
21425 * deps.mk (fns.o):
21426 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21427
21428 * fns.c (crypto_hash_function, Fsha1): New function.
21429 (Fmd5): Use crypto_hash_function.
21430 (syms_of_fns): Add Ssha1.
21431
214322011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21433
21434 * gnutls.c: Remove unused macros.
21435 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21436 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21437 Remove macros that are defined and never used.
21438 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21439
214402011-05-22 Chong Yidong <cyd@stupidchicken.com>
21441
21442 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21443 (Fx_get_selection_internal): Minor cleanup.
21444 (Fx_own_selection_internal): Rename arguments for consistency with
21445 select.el.
21446
214472011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21448
21449 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21450
214512011-05-22 Chong Yidong <cyd@stupidchicken.com>
21452
21453 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21454
214552011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21456
21457 * dispnew.c (scrolling_window): Don't exclude the case that the
21458 last enabled row in the desired matrix touches the bottom boundary.
21459
214602011-05-21 Glenn Morris <rgm@gnu.org>
21461
21462 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
21463 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21464 and add some more files.
21465
214662011-05-20 Eli Zaretskii <eliz@gnu.org>
21467
21468 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21469 report_file_error introduced by the change from 2011-05-07.
21470
214712011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21472
21473 * systime.h (Time): Define only if emacs is defined.
21474 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21475 where the include path doesn't have X11/X.h by default. See
21476 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21477
214782011-05-20 Kenichi Handa <handa@m17n.org>
21479
21480 * composite.c (find_automatic_composition): Fix previous change.
21481
214822011-05-20 Glenn Morris <rgm@gnu.org>
21483
21484 * lisp.mk: New file, split from Makefile.in.
21485 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21486 (shortlisp): Remove.
21487 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21488
214892011-05-19 Glenn Morris <rgm@gnu.org>
21490
21491 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21492 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21493 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21494 (lisp): Set the order to that of loadup.el.
21495 (shortlisp): Make it a copy of $lisp.
21496 (SOME_MACHINE_LISP): Remove.
21497 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21498 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21499
215002011-05-18 Kenichi Handa <handa@m17n.org>
21501
21502 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21503 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21504 (find_automatic_composition): Mostly rewrite for efficiency.
21505
215062011-05-18 Juanma Barranquero <lekktu@gmail.com>
21507
21508 * makefile.w32-in: Update dependencies.
21509
215102011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21511
21512 * menu.c: Include limits.h (fixes the MS-Windows build broken by
21513 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
21514
215152011-05-18 Paul Eggert <eggert@cs.ucla.edu>
21516
21517 Fix some integer overflow issues, such as string length overflow.
21518
21519 * insdel.c (count_size_as_multibyte): Check for string overflow.
21520
21521 * character.c (lisp_string_width): Check for string overflow.
21522 Use EMACS_INT, not int, for string indexes and lengths; in
21523 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21524 the resulting string length overflows an EMACS_INT; instead,
21525 report a string overflow if no precision given. When checking for
21526 precision exhaustion, use a check that cannot possibly have
21527 integer overflow. (Bug#8675)
21528 * character.h (lisp_string_width): Adjust to new signature.
21529
21530 * alloc.c (string_overflow): New function.
21531 (Fmake_string): Use it. This doesn't change behavior, but saves
21532 a few bytes and will simplify future changes.
21533 * character.c (string_escape_byte8): Likewise.
21534 * lisp.h (string_overflow): New decl.
21535
21536 Fixups, following up to the user-interface timestamp change.
21537 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21538 for UI timestamps, instead of unsigned long.
21539 * msdos.c (mouse_get_pos): Likewise.
21540 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
21541 * w32gui.h (Time): Define by including "systime.h" rather than by
21542 declaring it ourselves. (Bug#8664)
21543
21544 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21545 * image.c (clear_image_cache): Likewise.
21546
21547 * term.c (term_mouse_position): Don't assume time_t wraparound.
21548
21549 Be more systematic about user-interface timestamps.
21550 Before, the code sometimes used 'Time', sometimes 'unsigned long',
21551 and sometimes 'EMACS_UINT', to represent these timestamps.
21552 This change causes it to use 'Time' uniformly, as that's what X uses.
21553 This makes the code easier to follow, and makes it easier to catch
21554 integer overflow bugs such as Bug#8664.
21555 * frame.c (Fmouse_position, Fmouse_pixel_position):
21556 Use Time, not unsigned long, for user-interface timestamps.
21557 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21558 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21559 * keyboard.h (last_event_timestamp): Likewise.
21560 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21561 * menu.h (xmenu_show): Likewise.
21562 * term.c (term_mouse_position): Likewise.
21563 * termhooks.h (struct input_event.timestamp): Likewise.
21564 (struct terminal.mouse_position_hook): Likewise.
21565 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21566 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21567 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21568 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21569 what it was before.
21570 * menu.h, termhooks.h: Include "systime.h", for Time.
21571
21572 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21573 Don't assume that the difference between two unsigned long values
21574 can fit into an integer. At this point, we know button_down_time
21575 <= event->timestamp, so the difference must be nonnegative, so
21576 there's no need to cast the result if double-click-time is
21577 nonnegative, as it should be; check that it's nonnegative, just in
21578 case. This bug is triggered when events are more than 2**31 ms
21579 apart (about 25 days). (Bug#8664)
21580
21581 * xselect.c (last_event_timestamp): Remove duplicate decl.
21582 (x_own_selection): Remove needless cast to unsigned long.
21583
21584 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21585 that always fit in int. Use a sentinel instead of a counter, to
21586 avoid a temp and to allay GCC's concerns about possible int overflow.
21587 * frame.h (struct frame): Use int for menu_bar_items_used
21588 instead of EMACS_INT, since it always fits in int.
21589
21590 * menu.c (grow_menu_items): Check for int overflow.
21591
21592 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21593
21594 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21595 Before, the code was not consistent. These values cannot exceed
21596 2**31 - 1 so there's no need to make them unsigned.
21597 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21598 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21599 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21600 as modifiers.
21601 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21602
21603 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21604 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21605 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21606 presumably because the widths might not match.
21607
21608 * window.c (size_window): Avoid needless test at loop start.
21609
216102011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21611
21612 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21613
216142011-05-12 Drew Adams <drew.adams@oracle.com>
21615
21616 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21617
216182011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21619
21620 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21621 `width' to `bar_area_x' and `bar_area_width', respectively.
21622 (x_scroll_run): Take account of fringe background extension.
21623
21624 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21625 Rename local vars `left' and `width' to `bar_area_x' and
21626 `bar_area_width', respectively.
21627 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21628 background extension.
21629
216302011-05-10 Jim Meyering <meyering@redhat.com>
21631
21632 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21633
216342011-05-10 Juanma Barranquero <lekktu@gmail.com>
21635
21636 * image.c (Finit_image_library): Return t for built-in image types,
21637 like pbm and xbm. (Bug#8640)
21638
216392011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21640
21641 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21642
216432011-05-07 Eli Zaretskii <eliz@gnu.org>
21644
21645 * w32console.c (Fset_screen_color): Doc fix.
21646 (Fget_screen_color): New function.
21647 (syms_of_ntterm): Defsubr it.
21648
21649 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21650 unlink the temporary file if Fcall_process didn't create it in the
21651 first place.
21652 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21653 child process will be redirected to a file specified with `:file'.
21654 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21655 cue to call_process_cleanup not to close that handle.
21656
216572011-05-07 Ben Key <bkey76@gmail.com>
21658
21659 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21660 one of two shell specific rules, either bootstrap-temacs-CMD or
21661 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21662 to the previous implementation of the bootstrap-temacs rule.
21663 The bootstrap-temacs-CMD rule is similar to the previous
21664 implementation of the bootstrap-temacs rule except that it
21665 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21666 variable.
21667
21668 These changes, along with some changes to nt/configure.bat,
21669 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21670 earlier fix to add support for --cflags and --ldflags options
21671 that include quotes so that it works whether make uses cmd or
21672 sh as the shell.
21673
216742011-05-06 Michael Albinus <michael.albinus@gmx.de>
21675
21676 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21677 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21678 is a constant.
21679 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21680 a string. Handle both cases.
21681 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21682 (Fdbus_register_method): Use Qinvalid_function.
21683
216842011-05-06 Juanma Barranquero <lekktu@gmail.com>
21685
21686 * makefile.w32-in: Update dependencies.
21687 (LISP_H): Add inttypes.h and stdin.h.
21688 (PROCESS_H): Add unistd.h.
21689
216902011-05-06 Eli Zaretskii <eliz@gnu.org>
21691
21692 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21693 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21694
216952011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21696
21697 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21698
21699 * term.c (vfatal): Remove stray call to va_end.
21700 It's not needed and the C Standard doesn't allow it here anyway.
21701
21702 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21703 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21704
21705 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21706 bytes.
21707
21708 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21709
21710 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21711
21712 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21713
21714 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21715
21716 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21717
21718 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21719 * charset.c (Fdefine_charset_internal): Don't initialize
21720 charset.code_space[15]. The value was garbage, on hosts with
21721 32-bit int (Bug#8600).
21722
21723 * lread.c (read_integer): Be more consistent with string-to-number.
21724 Use string_to_number to do the actual conversion; this avoids
21725 rounding errors and fixes some other screwups. Without this fix,
21726 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21727 (digit_to_number): Move earlier, for benefit of read_integer.
21728 Return -1 if the digit is out of range for the base, -2 if it is
21729 not a digit in any supported base. (Bug#8602)
21730
21731 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21732
21733 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21734 to match comment at start of function. This also removes a
21735 GCC warning about overflow in a 32+64-bit port.
21736
21737 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21738
21739 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21740 Reported by Stefan Monnier in
21741 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21742 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21743 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21744
21745 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21746 (EMACS_UINTPTR): Likewise, with uintptr_t.
21747
21748 * lisp.h: Prefer 64-bit EMACS_INT if available.
21749 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21750 on 32-bit hosts that have 64-bit int, so that they can access
21751 large files.
21752 However, temporarily disable this change unless the temporary
21753 symbol WIDE_EMACS_INT is defined.
21754
21755 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21756
21757 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21758 This removes an assumption that EMACS_INT and long are the same
21759 width as pointers. The assumption is true for Emacs porting targets
21760 now, but we want to make other targets possible.
21761 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21762 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21763 In the rest of the code, change types of integers that hold casted
21764 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21765 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21766 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21767 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21768 No need to cast type when ORing.
21769 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21770 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21771 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21772 assume EMACS_INT is the same width as char *.
21773 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21774 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21775 Remove no-longer-needed casts.
21776 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21777 (xg_tool_bar_help_callback, xg_make_tool_item):
21778 Use EMACS_INTPTR to hold an integer
21779 that will be cast to void *; this can avoid a GCC warning
21780 if EMACS_INT is not the same width as void *.
21781 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21782 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21783 (current_message_1, set_message_1):
21784 Use a local to convert to proper width without a cast.
21785 * xmenu.c (dialog_selection_callback): Likewise.
21786
21787 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21788 Also, don't assume VALBITS / RAND_BITS is less than 5,
21789 and don't rely on undefined behavior when shifting a 1 left into
21790 the sign bit.
21791 * lisp.h (get_random): Change signature to match.
21792
21793 * lread.c (hash_string): Use size_t, not int, for hash computation.
21794 Normally we prefer signed values; but hashing is special, because
21795 it's better to use unsigned division on hash table sizes so that
21796 the remainder is nonnegative. Also, size_t is the natural width
21797 for hashing into memory. The previous code used 'int', which doesn't
21798 retain enough info to hash well into very large tables.
21799 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21800
21801 * dbusbind.c: Don't possibly lose pointer info when converting.
21802 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21803 Use XPNTR rather than XHASH, so that the high-order bits of
21804 the pointer aren't lost when converting through void *.
21805
21806 * eval.c (Fautoload): Don't double-shift a pointer.
21807
21808 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21809
218102011-05-06 Juanma Barranquero <lekktu@gmail.com>
21811
21812 * gnutls.c (DEF_GNUTLS_FN):
21813 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21814
218152011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21816
21817 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21818 marker. (Bug#8610)
21819
218202011-05-05 Eli Zaretskii <eliz@gnu.org>
21821
21822 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21823 New version that can reserve upto 2GB of heap space.
21824
218252011-05-05 Chong Yidong <cyd@stupidchicken.com>
21826
21827 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21828
218292011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21830
21831 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21832 `gnutls_certificate_set_x509_key_file'.
21833
218342011-05-05 Juanma Barranquero <lekktu@gmail.com>
21835
21836 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21837 Update dependencies.
21838
218392011-05-04 Juanma Barranquero <lekktu@gmail.com>
21840
21841 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21842 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21843 Remove unused parameter `fildes'.
21844 * process.c (read_process_output, send_process): Don't pass it.
21845
218462011-05-04 Juanma Barranquero <lekktu@gmail.com>
21847
21848 Fix previous change: the library cache is defined in w32.c.
21849 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21850 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21851
218522011-05-04 Juanma Barranquero <lekktu@gmail.com>
21853
21854 Implement dynamic loading of GnuTLS on Windows.
21855
21856 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21857 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21858 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21859 Declare.
21860
21861 * gnutls.c (Qgnutls_dll): Define.
21862 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21863 (gnutls_*): Declare function pointers.
21864 (init_gnutls_functions): New function to initialize function pointers.
21865 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21866 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21867 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21868 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21869 (emacs_gnutls_write, emacs_gnutls_read)
21870 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21871 (Fgnutls_available_p): New function.
21872 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21873 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21874 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21875
21876 * image.c: Include w32.h.
21877 (Vimage_type_cache): Delete.
21878 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21879 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21880 (w32_delayed_load): Move to w32.c.
21881
21882 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21883
21884 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21885 (w32_delayed_load): Move from image.c. When loading a library, record
21886 its filename in the :loaded-from property of the library id.
21887 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21888 Initialize and staticpro them.
21889 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21890
21891 * process.c: Include lisp.h before w32.h, not after.
21892 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21893 instead of gnutls_record_check_pending.
21894
21895 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21896
218972011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21898
21899 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21900 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21901 as passed in.
21902
219032011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21904
21905 * xterm.c (x_set_frame_alpha): Do not set property on anything
21906 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21907
219082011-05-02 Juanma Barranquero <lekktu@gmail.com>
21909
21910 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21911
219122011-05-02 Juanma Barranquero <lekktu@gmail.com>
21913
21914 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21915 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21916 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21917 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21918 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21919 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21920 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21921 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21922 (Qgnutls_bootprop_callbacks_verify): Make static.
21923
219242011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21925
21926 * callproc.c: Indentation fixup.
21927
21928 * sysdep.c (wait_for_termination_1): Make static.
21929 (wait_for_termination, interruptible_wait_for_termination):
21930 Move after wait_for_termination_1.
21931
219322011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21933
21934 * sysdep.c (interruptible_wait_for_termination): New function
21935 which is like wait_for_termination, but allows keyboard
21936 interruptions.
21937
21938 * callproc.c (Fcall_process): Add (:file "file") as an option for
21939 the STDOUT buffer.
21940 (Fcall_process_region): Ditto.
21941
219422011-04-30 Eli Zaretskii <eliz@gnu.org>
21943
21944 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21945 rather than `XVECTOR (FOO)->size'.
21946
21947 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21948 inttypes.h, as a gnulib replacement is used if it not available in
21949 system headers.
21950
219512011-04-21 Eli Zaretskii <eliz@gnu.org>
21952
21953 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21954 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21955 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21956
21957 * coding.c (coding_alloc_by_realloc): Error out if destination
21958 will grow beyond MOST_POSITIVE_FIXNUM.
21959 (decode_coding_emacs_mule): Abort if there isn't enough place in
21960 charbuf for the composition carryover bytes. Reserve an extra
21961 space for up to 2 characters produced in a loop.
21962 (decode_coding_iso_2022): Abort if there isn't enough place in
21963 charbuf for the composition carryover bytes.
21964
219652011-04-21 Eli Zaretskii <eliz@gnu.org>
21966
21967 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21968 aborting when %lld or %lll format is passed.
21969 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21970 %llo or %llx format is passed. (Bug#8545)
21971
21972 * window.c (window_scroll_line_based): Use a marker instead of
21973 simple variables to record original value of point. (Bug#7952)
21974
21975 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21976 produced by %s or %c overflows available buffer space. (Bug#8545)
21977
219782011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21979
21980 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21981 (SIZE_MAX): Move defn after all includes, as they might #define it.
21982
219832011-04-28 Juanma Barranquero <lekktu@gmail.com>
21984
21985 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21986
219872011-04-28 Juanma Barranquero <lekktu@gmail.com>
21988
21989 * keyboard.c (Qdelayed_warnings_hook): Define.
21990 (command_loop_1): Run `delayed-warnings-hook'
21991 if Vdelayed_warnings_list is non-nil.
21992 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21993 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21994
219952011-04-28 Eli Zaretskii <eliz@gnu.org>
21996
21997 * doprnt.c (doprnt): Don't return value smaller than the buffer
21998 size if the message was truncated. (Bug#8545).
21999
220002011-04-28 Juanma Barranquero <lekktu@gmail.com>
22001
22002 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
22003 (Fx_window_property): #if-0 the whole functions, not just the bodies.
22004
220052011-04-27 Paul Eggert <eggert@cs.ucla.edu>
22006
22007 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
22008
220092011-04-27 Juanma Barranquero <lekktu@gmail.com>
22010
22011 * makefile.w32-in: Update dependencies.
22012
220132011-04-27 Eli Zaretskii <eliz@gnu.org>
22014
22015 Improve `doprnt' and its usage. (Bug#8545)
22016 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
22017 `format_end'. Remove support for %l as a conversion specifier.
22018 Don't use xrealloc. Improve diagnostics when the %l size modifier
22019 is used. Update the commentary.
22020
22021 * eval.c (verror): Simplify calculation of size_t.
22022
22023 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
22024 messages.
22025
220262011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
22027
22028 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
22029 change.
22030
220312011-04-27 Paul Eggert <eggert@cs.ucla.edu>
22032
22033 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
22034 This makes this file independent of the recent pseudovector change.
22035
220362011-04-26 Paul Eggert <eggert@cs.ucla.edu>
22037
22038 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
22039
22040 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
22041 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
22042 Remove unused local.
22043 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
22044
22045 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
22046 GCC 4.6.0 optimizes based on type-based alias analysis.
22047 For example, if b is of type struct buffer * and v of type struct
22048 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
22049 != &v->size, and therefore "v->size = 1; b->size = 2; return
22050 v->size;" must therefore return 1. This assumption is incorrect
22051 for Emacs, since it type-puns struct Lisp_Vector * with many other
22052 types. To fix this problem, this patch adds a new type struct
22053 vectorlike_header that documents the constraints on layout of vectors
22054 and pseudovectors, and helps optimizing compilers not get fooled
22055 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
22056 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
22057 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
22058 the size member.
22059 (XSETPVECTYPE): Rewrite in terms of new macro.
22060 (XSETPVECTYPESIZE): New macro, specifying both type and size.
22061 This is a bit clearer, and further avoids the possibility of
22062 undesirable aliasing.
22063 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
22064 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
22065 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
22066 since Lisp_Subr is a special case (no "next" field).
22067 (ASIZE): Now uses header.size rather than size.
22068 All previous uses of XVECTOR (foo)->size replaced to use this macro,
22069 to avoid the hassle of writing XVECTOR (foo)->header.size.
22070 (struct vectorlike_header): New type.
22071 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
22072 object, to help avoid aliasing.
22073 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
22074 (SUBRP): Likewise, since Lisp_Subr is a special case.
22075 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
22076 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
22077 (struct Lisp_Hash_Table): Combine first two members into a single
22078 struct vectorlike_header member. All uses of "size" and "next" members
22079 changed to be "header.size" and "header.next".
22080 * buffer.h (struct buffer): Likewise.
22081 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
22082 * frame.h (struct frame): Likewise.
22083 * process.h (struct Lisp_Process): Likewise.
22084 * termhooks.h (struct terminal): Likewise.
22085 * window.c (struct save_window_data, struct saved_window): Likewise.
22086 * window.h (struct window): Likewise.
22087 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
22088 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
22089 * buffer.c (init_buffer_once): Likewise.
22090 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
22091 special case.
22092 * process.c (Fformat_network_address): Use local var for size,
22093 for brevity.
22094
22095 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
22096
22097 Make the Lisp reader and string-to-float more consistent (Bug#8525)
22098 * data.c (atof): Remove decl; no longer used or needed.
22099 (digit_to_number): Move to lread.c.
22100 (Fstring_to_number): Use new string_to_number function, to be
22101 consistent with how the Lisp reader treats infinities and NaNs.
22102 Do not assume that floating-point numbers represent EMACS_INT
22103 without losing information; this is not true on most 64-bit hosts.
22104 Avoid double-rounding errors, by insisting on integers when
22105 parsing non-base-10 numbers, as the documentation specifies.
22106 * lisp.h (string_to_number): New decl, replacing ...
22107 (isfloat_string): Remove.
22108 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
22109 (read1): Do not accept +. and -. as integers; this
22110 appears to have been a coding error. Similarly, do not accept
22111 strings like +-1e0 as floating point numbers. Do not report
22112 overflow for integer overflows unless the base is not 10 which
22113 means we have no simple and reliable way to continue.
22114 Break out the floating-point parsing into a new
22115 function string_to_number, so that Fstring_to_number parses
22116 floating point numbers consistently with the Lisp reader.
22117 (digit_to_number): Move here from data.c. Make it static inline.
22118 (E_CHAR, EXP_INT): Remove, replacing with ...
22119 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
22120 (string_to_number): New function, replacing isfloat_string.
22121 This function checks for valid syntax and produces the resulting
22122 Lisp float number too. Rework it so that string-to-number
22123 no longer mishandles examples like "1.0e+". Use strtoumax,
22124 so that overflow for non-base-10 numbers is reported only when
22125 there's no portable and simple way to convert to floating point.
22126
22127 * textprop.c (set_text_properties_1): Rewrite for clarity,
22128 and to avoid GCC warning about integer overflow.
22129
22130 * intervals.h (struct interval): Use EMACS_INT for members
22131 where EMACS_UINT might cause problems. See
22132 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
22133 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
22134 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
22135 All uses changed.
22136 (offset_intervals): Tell GCC not to worry about length overflow
22137 when negating a negative length.
22138
22139 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
22140 (overrun_check_free): Likewise.
22141
22142 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
22143 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
22144 word size.
22145
22146 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
22147 (gnutls_make_error): Rename local to avoid shadowing.
22148 (gnutls_emacs_global_deinit): ifdef out; not used.
22149 (Fgnutls_boot): Use const for pointer to readonly storage.
22150 Comment out unused local. Fix pointer signedness problems.
22151
22152 * lread.c (openp): Don't stuff size_t into an 'int'.
22153 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
22154 about possible signed overflow.
22155
22156 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
22157 (GDK_KEY_g): Don't define if already defined.
22158 (xg_prepare_tooltip): Avoid pointer signedness problem.
22159 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
22160
22161 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
22162 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
22163
22164 * xfns.c (Fx_window_property): Simplify a bit,
22165 to make a bit faster and to avoid GCC 4.6.0 warning.
22166 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
22167
22168 * fns.c (internal_equal): Don't assume size_t fits in int.
22169
22170 * alloc.c (compact_small_strings): Tighten assertion a little.
22171
22172 Replace pEd with more-general pI, and fix some printf arg casts.
22173 * lisp.h (pI): New macro, generalizing old pEd macro to other
22174 conversion specifiers. For example, use "...%"pI"d..." rather
22175 than "...%"pEd"...".
22176 (pEd): Remove. All uses replaced with similar uses of pI.
22177 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
22178 * alloc.c (check_pure_size): Don't overflow by converting size to int.
22179 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
22180 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
22181 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
22182 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
22183 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
22184 64-bit hosts.
22185 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
22186 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
22187 * print.c (safe_debug_print, print_object): Likewise.
22188 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
22189 to int.
22190 Use pI instead of if-then-else-abort. Use %p to avoid casts,
22191 avoiding the 0 flag, which is not portable.
22192 * process.c (Fmake_network_process): Use pI to avoid cast.
22193 * region-cache.c (pp_cache): Likewise.
22194 * xdisp.c (decode_mode_spec): Likewise.
22195 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
22196 behavior on 64-bit hosts with printf arg.
22197 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
22198 (x_stop_queuing_selection_requests): Likewise.
22199 (x_get_window_property): Don't truncate byte count to an 'int'
22200 when tracing.
22201
22202 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
22203 here, since it parses constructs like leading '-' and spaces,
22204 which are not wanted; and it overflows with large numbers.
22205 Instead, simply match F[0-9]+, which is what is wanted anyway.
22206
22207 * alloc.c: Remove unportable assumptions about struct layout.
22208 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
22209 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
22210 (allocate_vectorlike, make_pure_vector): Use the new macros,
22211 plus offsetof, to remove unportable assumptions about struct layout.
22212 These assumptions hold on all porting targets that I know of, but
22213 they are not guaranteed, they're easy to remove, and removing them
22214 makes further changes easier.
22215
22216 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
22217 This doesn't fix a bug but makes the code clearer.
22218 (string_overrun_cookie): Now const. Use initializers that
22219 don't formally overflow signed char, to avoid warnings.
22220 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
22221 can cause Emacs to crash when string overrun checking is enabled.
22222 (allocate_buffer): Don't assume sizeof (struct buffer) is a
22223 multiple of sizeof (EMACS_INT); it need not be, if
22224 alignof(EMACS_INT) < sizeof (EMACS_INT).
22225 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
22226
222272011-04-26 Juanma Barranquero <lekktu@gmail.com>
22228
22229 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
22230
222312011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
22232
22233 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
22234 supposed to be handshaking. (Bug#8556)
22235 Reported by Paul Eggert <eggert@cs.ucla.edu>.
22236
222372011-04-26 Daniel Colascione <dan.colascione@gmail.com>
22238
22239 * lisp.h (Qdebug): List symbol.
22240 * eval.c (Qdebug): Restore global linkage.
22241 * keyboard.c (debug-on-event): New variable.
22242 (handle_user_signal): Break into debugger when debug-on-event
22243 matches the current signal symbol.
22244
222452011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
22246
22247 * alloc.c (check_sblock, check_string_bytes)
22248 (check_string_free_list): Convert to standard C.
22249
222502011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
22251
22252 * w32.c (emacs_gnutls_push): Fix typo.
22253
222542011-04-25 Eli Zaretskii <eliz@gnu.org>
22255
22256 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
22257 "cast to pointer from integer of different size".
22258
22259 Improve doprnt and its use in verror. (Bug#8545)
22260 * doprnt.c (doprnt): Document the set of format control sequences
22261 supported by the function. Use SAFE_ALLOCA instead of always
22262 using `alloca'.
22263
22264 * eval.c (verror): Don't limit the buffer size at size_max-1, that
22265 is one byte too soon. Don't use xrealloc; instead xfree and
22266 xmalloc anew.
22267
222682011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
22269
22270 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
22271 callbacks stage.
22272
22273 * gnutls.c: Renamed global_initialized to
22274 gnutls_global_initialized. Added internals for the
22275 :verify-hostname-error, :verify-error, and :verify-flags
22276 parameters of `gnutls-boot' and documented those parameters in the
22277 docstring. Start callback support.
22278 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
22279 unless a fatal error occurred. Call gnutls_alert_send_appropriate
22280 on error. Return error code.
22281 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
22282 (emacs_gnutls_read): Likewise.
22283 (Fgnutls_boot): Return handshake error code.
22284 (emacs_gnutls_handle_error): New function.
22285 (wsaerror_to_errno): Likewise.
22286
22287 * w32.h (emacs_gnutls_pull): Add prototype.
22288 (emacs_gnutls_push): Likewise.
22289
22290 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
22291 (emacs_gnutls_push): Likewise.
22292
222932011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
22294
22295 * process.c (wait_reading_process_output): Check if GnuTLS
22296 buffered some data internally if no FDs are set for TLS
22297 connections.
22298
22299 * makefile.w32-in (OBJ2): Add gnutls.$(O).
22300 (LIBS): Link to USER_LIBS.
22301 ($(BLD)/gnutls.$(0)): New target.
22302
223032011-04-24 Eli Zaretskii <eliz@gnu.org>
22304
22305 * xdisp.c (handle_single_display_spec): Rename the
22306 display_replaced_before_p argument into display_replaced_p, to
22307 make it consistent with the commentary. Fix typos in the
22308 commentary.
22309
22310 * textprop.c (syms_of_textprop): Remove dead code.
22311 (copy_text_properties): Delete obsolete commentary about an
22312 interface that was deleted long ago. Fix typos in the description
22313 of arguments.
22314
22315 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
22316 to changes in oldXMenu/XMenu.h from 2011-04-16.
22317 <menu_help_message, prev_menu_help_message>: Constify.
22318 (IT_menu_make_room): menu->help_text is now `const char **';
22319 adjust.
22320
22321 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
22322 to changes in oldXMenu/XMenu.h from 2011-04-16.
22323 (struct XMenu): Declare `help_text' `const char **'.
22324
22325 * xfaces.c <Qunspecified>: Make extern again.
22326
22327 * syntax.c: Include sys/types.h before including regex.h, as
22328 required by POSIX.
22329
22330 * doc.c (get_doc_string): Improve the format passed to `error'.
22331
22332 * doprnt.c (doprnt): Improve commentary.
22333
22334 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
22335
22336 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
22337 them with etags.
22338
22339 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
22340 changes in globals.h immediately force recompilation.
22341 (TAGS): Depend on $(CURDIR)/m/intel386.h and
22342 $(CURDIR)/s/ms-w32.h.
22343 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
22344
22345 * character.c (Fchar_direction): Function deleted.
22346 (syms_of_character): Don't defsubr it.
22347 <char-direction-table>: Deleted.
22348
223492011-04-23 Eli Zaretskii <eliz@gnu.org>
22350
22351 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
22352 * doprnt.c: Include limits.h.
22353 (SIZE_MAX): New macro.
22354 (doprnt): Return a size_t value. 2nd arg is now size_t.
22355 Many local variables are now size_t instead of int or unsigned.
22356 Improve overflow protection. Support `l' modifier for integer
22357 conversions. Support %l conversion. Don't assume an EMACS_INT
22358 argument for integer conversions and for %c.
22359
22360 * lisp.h (doprnt): Restore prototype.
22361
22362 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
22363 $(SRC)/character.h.
22364
22365 * Makefile.in (base_obj): Add back doprnt.o.
22366
22367 * deps.mk (doprnt.o): Add back prerequisites.
22368 (callint.o): Depend on character.h.
22369
22370 * eval.c (internal_lisp_condition_case): Include the handler
22371 representation in the error message.
22372 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
22373 when breaking from the loop.
22374
22375 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
22376
22377 * callint.c (Fcall_interactively): When displaying error message
22378 about invalid control letter, pass the character's codepoint, not
22379 a pointer to its multibyte form. Improve display of the character
22380 in octal and display also its hex code.
22381
22382 * character.c (char_string): Use %x to display the (unsigned)
22383 codepoint of an invalid character, to avoid displaying a bogus
22384 negative value.
22385
22386 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
22387 `error', not SYMBOL_NAME itself.
22388
22389 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
22390 character arguments to `error'.
22391
22392 * charset.c (check_iso_charset_parameter): Fix incorrect argument
22393 to `error' in error message about FINAL_CHAR argument. Make sure
22394 FINAL_CHAR is a character, and use %c when it is passed as
22395 argument to `error'.
22396
223972011-04-23 Eli Zaretskii <eliz@gnu.org>
22398
22399 * s/ms-w32.h (localtime): Redirect to sys_localtime.
22400
22401 * w32.c: Include <time.h>.
22402 (sys_localtime): New function.
22403
224042011-04-23 Chong Yidong <cyd@stupidchicken.com>
22405
22406 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22407
22408 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
22409
224102011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
22411
22412 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22413 zombies (Bug#8467).
22414
224152011-04-19 Eli Zaretskii <eliz@gnu.org>
22416
22417 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22418 gl_state.e_property when gl_state.object is Qt.
22419
22420 * insdel.c (make_gap_larger): Remove limitation of buffer size
22421 to <= INT_MAX.
22422
224232011-04-18 Chong Yidong <cyd@stupidchicken.com>
22424
22425 * xdisp.c (lookup_glyphless_char_display)
22426 (produce_glyphless_glyph): Handle cons cell entry in
22427 glyphless-char-display.
22428 (Vglyphless_char_display): Document it.
22429
22430 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22431 glyphless-char-display.
22432
224332011-04-17 Chong Yidong <cyd@stupidchicken.com>
22434
22435 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22436
22437 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22438
22439 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22440 definition for no-X builds.
22441
224422011-04-16 Paul Eggert <eggert@cs.ucla.edu>
22443
22444 Static checks with GCC 4.6.0 and non-default toolkits.
22445
22446 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22447
22448 * process.c (keyboard_bit_set): Define only if SIGIO.
22449 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22450 (send_process): Repair possible setjmp clobbering.
22451
22452 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22453
22454 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22455
22456 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22457
22458 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22459 Define only if needed.
22460
22461 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22462 by pacifying GCC about it. Maybe it's time to retire it?
22463 * xfaces.c (USG, __TIMEVAL__): Likewise.
22464
22465 * dispextern.h (struct redisplay_interface): Rename param
22466 to avoid shadowing.
22467 * termhooks.h (struct terminal): Likewise.
22468 * xterm.c (xembed_send_message): Likewise.
22469
22470 * insdel.c (make_gap_smaller): Define only if
22471 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22472
22473 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22474 it.
22475
22476 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22477 so that we aren't warned about unused symbols.
22478
22479 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22480
22481 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
22482
22483 * xfns.c (x_real_positions): Mark locals as initialized.
22484
22485 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22486
22487 * xterm.c: Fix problems found by static analysis with other toolkits.
22488 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
22489 (x_dispatch_event): Declare static if USE_GTK, and
22490 define if USE_GTK || USE_X_TOOLKIT.
22491 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
22492 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
22493 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22494 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
22495
22496 * xmenu.c (menu_help_callback): Pointer type fixes.
22497 Use const pointers when pointing at readonly data. Avoid pointer
22498 signedness clashes.
22499 (FALSE): Remove unused macro.
22500 (update_frame_menubar): Remove unused decl.
22501
22502 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22503
22504 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22505 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22506 (single_menu_item): Rename local to avoid shadowing.
22507
22508 * keyboard.c (make_lispy_event): Remove unused local var.
22509
22510 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22511 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22512
22513 * bitmaps: Change bitmaps from unsigned char back to the X11
22514 compatible char. Avoid the old compiler warnings about
22515 out-of-range initializers by using, for example, '\xab' rather
22516 than 0xab.
22517
22518 * xgselect.c (xgselect_initialize): Check vs interface
22519 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22520
22521 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22522
22523 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22524 to read-only memory.
22525
22526 * fns.c (vector): Remove; this old hack is no longer needed.
22527
22528 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
22529 Remove unused var.
22530 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
22531
22532 * xrdb.c (x_load_resources): Omit unused local.
22533
22534 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
22535 (x_window): Rename locals to avoid shadowing.
22536 (USG): Use the kludged USG macro, to pacify gcc.
22537
22538 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
22539 (x_term_init): Remove local to avoid shadowing.
22540
22541 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
22542
22543 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22544 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22545
225462011-04-16 Eli Zaretskii <eliz@gnu.org>
22547
22548 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22549
22550 Fix regex.c, syntax.c and friends for buffers > 2GB.
22551 * syntax.h (struct gl_state_s): Declare character position members
22552 EMACS_INT.
22553
22554 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22555
22556 * textprop.c (verify_interval_modification, interval_of):
22557 Declare arguments EMACS_INT.
22558
22559 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22560 EMACS_INT.
22561
22562 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22563
22564 * indent.c (Fvertical_motion): Local variable it_start is now
22565 EMACS_INT.
22566
22567 * regex.c (re_match, re_match_2, re_match_2_internal)
22568 (bcmp_translate, regcomp, regexec, print_double_string)
22569 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22570 (re_compile_pattern, re_exec): Declare arguments and local
22571 variables `size_t' and `ssize_t' and return values `regoff_t', as
22572 appropriate.
22573 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22574 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22575 <compile_stack_type>: `size' and `avail' are now `size_t'.
22576
22577 * regex.h <regoff_t>: Use ssize_t, not int.
22578 (re_search, re_search_2, re_match, re_match_2): Arguments that
22579 specify buffer/string position and length are now ssize_t and
22580 size_t. Return type is regoff_t.
22581
225822011-04-16 Ben Key <bkey76@gmail.com>
22583
22584 * nsfont.m: Fixed bugs in ns_get_family and
22585 ns_descriptor_to_entity that were caused by using free to
22586 deallocate memory blocks that were allocated by xmalloc (via
22587 xstrdup). This caused Emacs to crash when compiled with
22588 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22589 --enable-checking=xmallocoverrun). xfree is now used to
22590 deallocate these memory blocks.
22591
225922011-04-15 Paul Eggert <eggert@cs.ucla.edu>
22593
22594 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22595
22596 emacs_write: Accept and return EMACS_INT for sizes.
22597 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22598 et seq.
22599 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22600 Accept and return EMACS_INT.
22601 (emacs_gnutls_write): Return the number of bytes written on
22602 partial writes.
22603 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
22604 (emacs_read, emacs_write): Remove check for negative size, as the
22605 Emacs source code has been audited now.
22606 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22607 (emacs_read, emacs_write): Use it.
22608 * process.c (send_process): Adjust to the new signatures of
22609 emacs_write and emacs_gnutls_write. Do not attempt to store
22610 a byte offset into an 'int'; it might overflow.
22611 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
22612
22613 * sound.c: Don't assume sizes fit in 'int'.
22614 (struct sound_device.period_size, alsa_period_size):
22615 Return EMACS_INT, not int.
22616 (struct sound_device.write, vox_write, alsa_write):
22617 Accept EMACS_INT, not int.
22618 (wav_play, au_play): Use EMACS_INT to store sizes and to
22619 record read return values.
22620
226212011-04-15 Ben Key <bkey76@gmail.com>
22622
22623 * keyboard.c (Qundefined): Don't declare static since it is used
22624 in nsfns.m.
22625 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22626 static since they are used in nsfont.m.
22627
226282011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22629
22630 * process.c (Qprocessp): Don't declare static.
22631 * lisp.h (Qprocessp): Declare again.
22632
226332011-04-15 Juanma Barranquero <lekktu@gmail.com>
22634
22635 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22636
226372011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22638
22639 Improve C-level modularity by making more things 'static'.
22640
22641 Don't publish debugger-only interfaces to other modules.
22642 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22643 (verify_bytepos, count_markers): Move decls to the only modules
22644 that need them.
22645 * region-cache.h (pp_cache): Likewise.
22646 * window.h (check_all_windows): Likewise.
22647 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22648
22649 * sysdep.c (croak): Now static, if
22650 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22651 * syssignal.h (croak): Declare only if not static.
22652
22653 * alloc.c (refill_memory_reserve): Now static if
22654 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22655 * lisp.h (refill_memory_reserve): Declare only if not static.
22656
22657 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22658 Define only if USE_LUCID.
22659
22660 * xrdb.c (x_customization_string, x_rm_string): Now static.
22661
22662 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22663 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22664
22665 * xdisp.c (draw_row_with_mouse_face): Now static.
22666 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22667
22668 * window.h (check_all_windows): Mark externally visible.
22669
22670 * window.c (window_deletion_count): Now static.
22671
22672 * undo.c: Make symbols static if they're not exported.
22673 (last_undo_buffer, last_boundary_position, pending_boundary):
22674 Now static.
22675
22676 * textprop.c (interval_insert_behind_hooks): Now static.
22677 (interval_insert_in_front_hooks): Likewise.
22678
22679 * term.c: Make symbols static if they're not exported.
22680 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22681 (max_frame_lines, tty_set_terminal_modes):
22682 (tty_reset_terminal_modes, tty_turn_off_highlight):
22683 (get_tty_terminal): Now static.
22684 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22685 * termhooks.h (term_mouse_moveto): Do not declare if
22686 HAVE_WINDOW_SYSTEM.
22687 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22688 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22689
22690 * sysdep.c: Make symbols static if they're not exported.
22691 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22692 Now static.
22693 (sigprocmask_set, full_mask): Remove; unused.
22694 (wait_debugging): Mark as visible.
22695 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22696 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22697
22698 * syntax.c (syntax_temp): Define only if !__GNUC__.
22699
22700 * sound.c (current_sound_device, current_sound): Now static.
22701
22702 * search.c (searchbufs, searchbuf_head): Now static.
22703
22704 * scroll.c (scroll_cost): Remove; unused.
22705 * dispextern.h (scroll_cost): Remove decl.
22706
22707 * region-cache.h (pp_cache): Mark as externally visible.
22708
22709 * process.c: Make symbols static if they're not exported.
22710 (process_tick, update_tick, create_process, chan_process):
22711 (Vprocess_alist, proc_buffered_char, datagram_access):
22712 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22713 (deactivate_process): Mark defn as static, as well as decl.
22714 * lisp.h (create_process): Remove decl.
22715 * process.h (chan_process, Vprocess_alist): Remove decls.
22716
22717 * print.c: Make symbols static if they're not exported.
22718 (print_depth, new_backquote_output, being_printed, print_buffer):
22719 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22720 (print_interval, print_number_index, initial_stderr_stream):
22721 Now static.
22722 * lisp.h (Fprinc): Remove decl.
22723 (debug_output_compilation_hack): Mark as externally visible.
22724
22725 * sysdep.c (croak): Move decl from here to syssignal.h.
22726 * syssignal.h (croak): Put it here, so the API can be checked when
22727 'croak' is called from dissociate_if_controlling_tty.
22728
22729 * minibuf.c: Make symbols static if they're not exported.
22730 (minibuf_save_list, choose_minibuf_frame): Now static.
22731 * lisp.h (choose_minibuf_frame): Remove decl.
22732
22733 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22734
22735 * lread.c: Make symbols static if they're not exported.
22736 (read_objects, initial_obarray, oblookup_last_bucket_number):
22737 Now static.
22738 (make_symbol): Remove; unused.
22739 * lisp.h (initial_obarray, make_symbol): Remove decls.
22740
22741 * keyboard.c: Make symbols static if they're not exported.
22742 (single_kboard, recent_keys_index, total_keys, recent_keys):
22743 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22744 (this_single_command_key_start, echoing, last_auto_save):
22745 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22746 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22747 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22748 (Vlispy_mouse_stem, double_click_count):
22749 Now static.
22750 (force_auto_save_soon): Define only if SIGDANGER.
22751 (ignore_mouse_drag_p): Now static if
22752 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22753 (print_help): Remove; unused.
22754 (stop_character, last_timer_event): Mark as externally visible.
22755 * keyboard.h (ignore_mouse_drag_p): Declare only if
22756 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22757 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22758 * lisp.h (echoing): Remove decl.
22759 (force_auto_save_soon): Declare only if SIGDANGER.
22760 * xdisp.c (redisplay_window): Simplify code, to make it more
22761 obvious that ignore_mouse_drag_p is not accessed if !defined
22762 USE_GTK && !defined HAVE_NS.
22763
22764 * intervals.c: Make symbols static if they're not exported.
22765 (merge_properties_sticky, merge_interval_right, delete_interval):
22766 Now static.
22767 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22768
22769 * insdel.c: Make symbols static if they're not exported.
22770 However, leave prepare_to_modify_buffer alone. It's never
22771 called from outside this function, but that appears to be a bug.
22772 (combine_after_change_list, combine_after_change_buffer):
22773 (adjust_after_replace, signal_before_change): Now static.
22774 (adjust_after_replace_noundo): Remove; unused.
22775 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22776 (signal_before_change): Remove decls.
22777
22778 * indent.c (val_compute_motion, val_vmotion): Now static.
22779
22780 * image.c: Make symbols static if they're not exported.
22781 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22782 if USE_GTK.
22783 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22784 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22785
22786 * fringe.c (standard_bitmaps): Now static.
22787 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22788
22789 * frame.c: Make symbols static if they're not exported.
22790 (x_report_frame_params, make_terminal_frame): Now static.
22791 (get_frame_param): Now static, unless HAVE_NS.
22792 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22793 (x_get_resource_string): Remove; not used.
22794 * frame.h (make_terminal_frame, x_report_frame_params):
22795 (x_get_resource_string); Remove decls.
22796 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22797 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22798
22799 * font.c, fontset.c: Make symbols static if they're not exported.
22800 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22801 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22802 * font.c (font_close_object): Now static.
22803 * font.h (font_close_object): Remove.
22804 * fontset.c (FONTSET_OBJLIST): Remove.
22805 (free_realized_fontset) #if-0 the body, which does nothing.
22806 (face_suitable_for_char_p): #if-0, as it's never called.
22807 * fontset.h (face_suitable_for_char_p): Remove decl.
22808 * xfaces.c (face_at_string_position):
22809 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22810 since 0 is always ASCII.
22811
22812 * fns.c (weak_hash_tables): Now static.
22813
22814 * fileio.c: Make symbols static if they're not exported.
22815 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22816 (Vwrite_region_annotation_buffers): Now static.
22817
22818 * eval.c: Make symbols static if they're not exported.
22819 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22820 * lisp.h (backtrace_list): Remove decl.
22821
22822 * emacs.c: Make symbols static if they're not exported.
22823 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22824 (fatal_error_code, fatal_error_signal_hook, standard_args):
22825 Now static.
22826 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22827 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22828 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22829 * lisp.h (fatal_error_signal_hook): Remove decl.
22830 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22831
22832 * editfns.c: Move a (normally-unused) function to its only use.
22833 * editfns.c, lisp.h (get_operating_system_release): Remove.
22834 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22835 worth the hassle of breaking this out.
22836
22837 * xterm.c: Make symbols static if they're not exported.
22838 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22839 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22840 (x_destroy_window, x_delete_display):
22841 Now static.
22842 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22843 (x_mouse_leave): Remove; unused.
22844 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22845 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22846 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22847 Remove decls.
22848 (x_mouse_leave): Declare only if WINDOWSNT.
22849 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22850 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22851 USE_X_TOOLKIT.
22852
22853 * ftxfont.c: Make symbols static if they're not exported.
22854 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22855 HAVE_FREETYPE.
22856 * font.h (ftxfont_driver): Likewise.
22857
22858 * xfns.c: Make symbols static if they're not exported.
22859 (x_last_font_name, x_display_info_for_name):
22860 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22861 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22862 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22863 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22864 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22865 (last_show_tip_args): Now static.
22866 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22867 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22868 (x_screen_planes): Remove; unused.
22869 * dispextern.h (x_screen_planes): Remove decl.
22870
22871 * dispnew.c: Make symbols static if they're not exported.
22872 * dispextern.h (redraw_garbaged_frames, scrolling):
22873 (increment_row_positions): Remove.
22874 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22875 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22876 Now static.
22877 (redraw_garbaged_frames): Remove; unused.
22878
22879 * xfaces.c: Make symbols static if they're not exported.
22880 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22881 Remove decls.
22882 * xterm.h (defined_color): Remove decls.
22883 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22884 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22885 (menu_face_changed_default, defined_color, free_realized_face):
22886 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22887 (ascii_face_of_lisp_face): Remove; unused.
22888
22889 * xdisp.c: Make symbols static if they're not exported.
22890 * dispextern.h (scratch_glyph_row, window_box_edges):
22891 (glyph_to_pixel_coords, set_cursor_from_row):
22892 (get_next_display_element, set_iterator_to_next):
22893 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22894 (show_mouse_face): Remove decls
22895 * frame.h (message_buf_print): Likewise.
22896 * lisp.h (pop_message, set_message, check_point_in_composition):
22897 Likewise.
22898 * xterm.h (set_vertical_scroll_bar): Likewise.
22899 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22900 (message_buf_print, scratch_glyph_row, displayed_buffer):
22901 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22902 (get_next_display_element, show_mouse_face, window_box_edges):
22903 (frame_to_window_pixel_xy, check_point_in_composition):
22904 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22905 (glyph_to_pixel_coords): Remove; unused.
22906
22907 * dired.c (file_name_completion): Now static.
22908
22909 * dbusbind.c (xd_in_read_queued_messages): Now static.
22910
22911 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22912 * data.c (circular_list_error): Remove.
22913
22914 * commands.h (last_point_position, last_point_position_buffer):
22915 (last_point_position_window): Remove decls.
22916 * keyboard.c: Make these variables static.
22917
22918 * coding.h (coding, code_convert_region, encode_coding_gap):
22919 Remove decls.
22920 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22921 (iso_code_class, detect_coding, code_convert_region): Now static.
22922 (encode_coding_gap): Remove; unused.
22923
22924 * chartab.c (chartab_chars, chartab_bits): Now static.
22925
22926 * charset.h (charset_iso_8859_1): Remove decl.
22927 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22928 Now static.
22929
22930 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22931 * ccl.c (Vccl_program_table): Now static.
22932 (check_ccl_update): Remove; unused.
22933
22934 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22935 * category.h: ... from here.
22936 * category.c (check_category_table, set_category_set): Now static.
22937
22938 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22939 * lisp.h: Remove these decls.
22940
22941 * buffer.c (buffer_count): Remove unused var.
22942
22943 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22944 so that it's not optimized away.
22945 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22946 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22947 exported only to the debugger.
22948
22949 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22950 * atimer.h (run_all_atimers): Remove; not exported.
22951
22952 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22953 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22954 was inaccessible from Lisp.
22955 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22956 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22957
22958 alloc.c: Import and export fewer symbols, and remove unused items.
22959 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22960 is defined.
22961 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22962 it's not optimized away by whole-program optimization.
22963 (message_enable_multibyte, free_misc): Remove.
22964 (catchlist, handlerlist, mark_backtrace):
22965 Declare only if BYTE_MARK_STACK.
22966 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22967 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22968 (message_enable_multibyte): Remove decl.
22969 (free_misc, interval_free_list, float_block, float_block_index):
22970 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22971 (cons_free_list, last_marked_index):
22972 Now static.
22973 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22974 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22975 (mark_backtrace): Define only if BYTE_MARK_STACK.
22976 * xdisp.c (message_enable_multibyte): Now static.
22977
22978 Declare Lisp_Object Q* variables to be 'static' if not exported.
22979 This makes it easier for human readers (and static analyzers)
22980 to see whether these variables are used from other modules.
22981 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22982 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22983 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22984 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22985 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22986 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22987 * xmenu.c, xselect.c:
22988 Declare Q* vars static if they are not used in other modules.
22989 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22990 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22991 Remove decls of unexported vars.
22992 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22993
22994 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22995
22996 Make Emacs functions such as Fatom 'static' by default.
22997 This makes it easier for human readers (and static analyzers)
22998 to see whether these functions can be called from other modules.
22999 DEFUN now defines a static function. To make the function external
23000 so that it can be used in other C modules, use the new macro DEFUE.
23001 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
23002 (Finit_image_library):
23003 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
23004 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
23005 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
23006 Remove decls, since these functions are now static.
23007 (Funintern, Fget_internal_run_time): New decls, since these functions
23008 were already external.
23009
23010 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
23011 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
23012 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
23013 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
23014 * keyboard.c, keymap.c, lread.c:
23015 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
23016 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
23017 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
23018 Mark functions with DEFUE instead of DEFUN,
23019 if they are used in other modules.
23020 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
23021 decls for now-static functions.
23022 * buffer.h (Fdelete_overlay): Remove decl.
23023 * callproc.c (Fgetenv_internal): Mark as internal.
23024 * composite.c (Fremove_list_of_text_properties): Remove decl.
23025 (Fcomposition_get_gstring): New forward static decl.
23026 * composite.h (Fcomposite_get_gstring): Remove decl.
23027 * dired.c (Ffile_attributes): New forward static decl.
23028 * doc.c (Fdocumntation_property): New forward static decl.
23029 * eval.c (Ffetch_bytecode): New forward static decl.
23030 (Funintern): Remove extern decl; now in .h file where it belongs.
23031 * fileio.c (Fmake_symbolic_link): New forward static decl.
23032 * image.c (Finit_image_library): New forward static decl.
23033 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
23034 * intervals.h (Fprevious_property_change):
23035 (Fremove_list_of_text_properties): Remove decls.
23036 * keyboard.c (Fthis_command_keys): Remove decl.
23037 (Fcommand_execute): New forward static decl.
23038 * keymap.c (Flookup_key): New forward static decl.
23039 (Fcopy_keymap): Now static.
23040 * keymap.h (Flookup_key): Remove decl.
23041 * process.c (Fget_process): New forward static decl.
23042 (Fprocess_datagram_address): Mark as internal.
23043 * syntax.c (Fsyntax_table_p): New forward static decl.
23044 (skip_chars): Remove duplicate decl.
23045 * textprop.c (Fprevious_property_change): New forward static decl.
23046 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
23047 Now internal.
23048 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
23049 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
23050
23051 * editfns.c (Fformat): Remove unreachable code.
23052
230532011-04-14 Andreas Schwab <schwab@linux-m68k.org>
23054
23055 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
23056 change. (Bug#8496)
23057
230582011-04-13 Eli Zaretskii <eliz@gnu.org>
23059
23060 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
23061 when at ZV. (Bug#8487)
23062
230632011-04-12 Andreas Schwab <schwab@linux-m68k.org>
23064
23065 * charset.c (Fclear_charset_maps): Use xfree instead of free.
23066 (Bug#8437)
23067 * keyboard.c (parse_tool_bar_item): Likewise.
23068 * sound.c (sound_cleanup, alsa_close): Likewise.
23069 * termcap.c (tgetent): Likewise.
23070 * xfns.c (x_default_font_parameter): Likewise.
23071 * xsettings.c (read_and_apply_settings): Likewise.
23072
23073 * alloc.c (overrun_check_malloc, overrun_check_realloc)
23074 (overrun_check_free): Protoize.
23075
230762011-04-12 Paul Eggert <eggert@cs.ucla.edu>
23077
23078 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
23079 since callers should never pass a negative size.
23080 Change the signature to match that of plain 'read' and 'write'; see
23081 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
23082 * lisp.h: Update prototypes of emacs_write and emacs_read.
23083
230842011-04-11 Eli Zaretskii <eliz@gnu.org>
23085
23086 * xdisp.c (redisplay_window): Don't try to determine the character
23087 position of the scroll margin if the window start point w->startp
23088 is outside the buffer's accessible region. (Bug#8468)
23089
230902011-04-10 Eli Zaretskii <eliz@gnu.org>
23091
23092 Fix write-region and its subroutines for buffers > 2GB.
23093 * fileio.c (a_write, e_write): Modify declaration of arguments and
23094 local variables to support buffers larger than 2GB.
23095 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
23096
23097 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
23098 argument, local variables, and return value.
23099
23100 * lisp.h: Update prototypes of emacs_write and emacs_read.
23101
23102 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
23103
231042011-04-10 Paul Eggert <eggert@cs.ucla.edu>
23105
23106 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
23107
23108 Fix more problems found by GCC 4.6.0's static checks.
23109
23110 * xdisp.c (vmessage): Use a better test for character truncation.
23111
23112 * charset.c (load_charset_map): <, not <=, for optimization,
23113 and to avoid potential problems with integer overflow.
23114 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
23115 * casetab.c (set_identity, shuffle): Likewise.
23116 * editfns.c (Fformat): Likewise.
23117 * syntax.c (skip_chars): Likewise.
23118
23119 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
23120 This also lets GCC 4.6.0 generate slightly better loop code.
23121
23122 * callint.c (Fcall_interactively): <, not <=, for optimization.
23123 (Fcall_interactively): Count the number of arguments produced,
23124 not the number of arguments given. This is simpler and lets GCC
23125 4.6.0 generate slightly better code.
23126
23127 * ftfont.c: Distingish more carefully between FcChar8 and char.
23128 The previous code passed unsigned char * to a functions like
23129 strlen and xstrcasecmp that expect char *, which does not
23130 conform to the C standard.
23131 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
23132 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
23133 char * when the C standard requires it.
23134
23135 * keyboard.c (read_char): Remove unused var.
23136
23137 * eval.c: Port to Windows vsnprintf (Bug#8435).
23138 Include <limits.h>.
23139 (SIZE_MAX): Define if the headers do not.
23140 (verror): Do not give up if vsnprintf returns a negative count.
23141 Instead, grow the buffer. This ports to Windows vsnprintf, which
23142 does not conform to C99. Problem reported by Eli Zaretskii.
23143 Also, simplify the allocation scheme, by avoiding the need for
23144 calling realloc, and removing the ALLOCATED variable.
23145
23146 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
23147
23148 Remove invocations of doprnt, as Emacs now uses vsnprintf.
23149 But keep the doprint source code for now, as we might revamp it
23150 and use it again (Bug#8435).
23151 * lisp.h (doprnt): Remove.
23152 * Makefile.in (base_obj): Remove doprnt.o.
23153 * deps.mk (doprnt.o): Remove.
23154
23155 error: Print 32- and 64-bit integers portably (Bug#8435).
23156 Without this change, on typical 64-bit hosts error ("...%d...", N)
23157 was used to print both 32- and 64-bit integers N, which relied on
23158 undefined behavior.
23159 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
23160 * lisp.h (error, verror): Mark as printf-like functions.
23161 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
23162 Report overflow in size calculations when allocating printf buffer.
23163 Do not truncate output string at its first null byte.
23164 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
23165 Truncate the output at a character boundary, since vsnprintf does not
23166 do that.
23167 * charset.c (check_iso_charset_parameter): Convert internal
23168 character to string before calling 'error', since %c now has the
23169 printf meaning.
23170 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
23171 overflow when computing char to be passed to 'error'. Do not
23172 pass Lisp_Object to 'error'; pass the integer instead.
23173 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
23174 formatted with plain %d.
23175
23176 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
23177
23178 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
23179
23180 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
23181
23182 * xterm.c (x_catch_errors): Remove duplicate declaration.
23183
23184 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
23185
23186 * xdisp.c, lisp.h (message_nolog): Remove; unused.
23187
231882011-04-10 Jim Meyering <meyering@redhat.com>
23189
23190 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
23191 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
23192 return ssize_t not "int", and use size_t as the buffer length.
23193 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
23194 * gnutls.h: Update declarations.
23195 * process.c (read_process_output): Use ssize_t, to match.
23196 (send_process): Likewise.
23197
231982011-04-09 Chong Yidong <cyd@stupidchicken.com>
23199
23200 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
23201
232022011-04-09 Chong Yidong <cyd@stupidchicken.com>
23203
23204 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
23205 Use unsigned char, to match FcChar8 type definition.
23206
23207 * xterm.c (handle_one_xevent):
23208 * xmenu.c (create_and_show_popup_menu):
23209 * xselect.c (x_decline_selection_request)
23210 (x_reply_selection_request): Avoid type-punned deref of X events.
23211
232122011-04-09 Eli Zaretskii <eliz@gnu.org>
23213
23214 Fix some uses of `int' instead of EMACS_INT.
23215 * search.c (string_match_1, fast_string_match)
23216 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
23217 (scan_buffer, find_next_newline_no_quit)
23218 (find_before_next_newline, search_command, Freplace_match)
23219 (Fmatch_data): Make some `int' variables be EMACS_INT.
23220
23221 * xdisp.c (display_count_lines): 3rd argument and return value now
23222 EMACS_INT. All callers changed.
23223 (pint2hrstr): Last argument is now EMACS_INT.
23224
23225 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
23226 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
23227 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
23228 (decode_coding_utf_16, decode_coding_emacs_mule)
23229 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
23230 (decode_coding_ccl, decode_coding_charset)
23231 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
23232 (decode_coding_iso_2022, decode_coding_emacs_mule)
23233 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
23234 <char_offset, last_offset>: Declare EMACS_INT.
23235 (encode_coding_utf_8, encode_coding_utf_16)
23236 (encode_coding_emacs_mule, encode_invocation_designation)
23237 (encode_designation_at_bol, encode_coding_iso_2022)
23238 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
23239 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
23240 Declare EMACS_INT.
23241 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
23242 (encode_invocation_designation): Last argument P_NCHARS is now
23243 EMACS_INT.
23244 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
23245 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
23246
23247 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
23248 All users changed.
23249
23250 * ccl.c (Fccl_execute_on_string): Declare some variables
23251 EMACS_INT.
23252
232532011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
23254
23255 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
23256
232572011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
23258
23259 * process.c (Fformat_network_address): Doc fix.
23260
232612011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
23262
23263 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
23264
232652011-04-08 Chong Yidong <cyd@stupidchicken.com>
23266
23267 * keyboard.c (read_char): Call Lisp function help-form-show,
23268 instead of using internal_with_output_to_temp_buffer.
23269 (Qhelp_form_show): New var.
23270 (syms_of_keyboard): Use DEFSYM macro.
23271
23272 * print.c (internal_with_output_to_temp_buffer): Function deleted.
23273
23274 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
23275
232762011-04-06 Chong Yidong <cyd@stupidchicken.com>
23277
23278 * process.c (Flist_processes): Remove to Lisp.
23279 (list_processes_1): Delete.
23280
232812011-04-06 Eli Zaretskii <eliz@gnu.org>
23282
23283 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
23284
23285 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
23286
232872011-04-06 Paul Eggert <eggert@cs.ucla.edu>
23288
23289 Fix more problems found by GCC 4.6.0's static checks.
23290
23291 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
23292
23293 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
23294
23295 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
23296
23297 * xdisp.c (vmessage): Mark as a printf-like function.
23298
23299 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
23300
23301 * sound.c (sound_warning): Don't crash if arg contains a printf format.
23302
23303 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
23304 printf-like functions.
23305 (tiff_load): Add casts to remove these marks before passing them
23306 to system-supplied API.
23307
23308 * eval.c (Fsignal): Remove excess argument to 'fatal'.
23309
23310 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
23311 This avoids several warnings with gcc -Wstrict-overflow.
23312 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
23313 directly, rather than having caller test rule sign. This avoids
23314 some unnecessary tests.
23315 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
23316 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
23317 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
23318
23319 * xfont.c (xfont_text_extents): Remove var that was set but not used.
23320 (xfont_open): Avoid unnecessary tests.
23321
23322 * composite.c (composition_gstring_put_cache): Use unsigned integer.
23323
23324 * composite.h, composite.c (composition_gstring_put_cache):
23325 Use EMACS_INT, not int, for length.
23326
23327 * composite.h (COMPOSITION_DECODE_REFS): New macro,
23328 breaking out part of COMPOSITION_DECODE_RULE.
23329 (COMPOSITION_DECODE_RULE): Use it.
23330 * composite.c (get_composition_id): Remove unused local vars,
23331 by using the new macro.
23332
23333 * textprop.c (set_text_properties_1): Change while to do-while,
23334 since the condition is always true at first.
23335
23336 * intervals.c (graft_intervals_into_buffer): Mark var as used.
23337 (interval_deletion_adjustment): Return unsigned value.
23338 All uses changed.
23339
23340 * process.c (list_processes_1, create_pty, read_process_output):
23341 (exec_sentinel): Remove vars that were set but not used.
23342 (create_pty): Remove unnecessary "volatile"s.
23343 (Fnetwork_interface_info): Avoid possibility of int overflow.
23344 (read_process_output): Do adaptive read buffering even if carryover.
23345 (read_process_output): Simplify nbytes computation if buffered.
23346
23347 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
23348
23349 * syntax.c (scan_words): Remove var that was set but not used.
23350 (update_syntax_table): Use unsigned instead of int.
23351
23352 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
23353 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
23354 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
23355
23356 * print.c (print_error_message): Avoid int overflow.
23357
23358 * font.c (font_list_entities): Redo for clarity,
23359 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
23360
23361 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
23362 (font_score): Avoid potential overflow in diff calculation.
23363
23364 * fns.c (substring_both): Remove var that is set but not used.
23365 (sxhash): Redo loop for clarity and to avoid wraparound warning.
23366
23367 * eval.c (funcall_lambda): Rename local to avoid shadowing.
23368
23369 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
23370 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
23371 can always succeed if overflow has undefined behavior.
23372
23373 * search.c (boyer_moore, wordify): Remove vars set but not used.
23374 (wordify): Omit three unnecessary tests.
23375
23376 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
23377 All callers changed. This avoids the need for an unused var.
23378
23379 * casefiddle.c (casify_region): Remove var that is set but not used.
23380
23381 * dired.c (file_name_completion): Remove var that is set but not used.
23382
23383 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
23384
23385 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
23386 (Finsert_file_contents): Remove unnecessary code checking fd.
23387
23388 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
23389 Check for integer overflow on size calculations.
23390
23391 * buffer.c (Fprevious_overlay_change): Remove var that is set
23392 but not used.
23393
23394 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
23395 Remove vars that are set but not used.
23396 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
23397 (timer_check_2): Mark vars as initialized.
23398
23399 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
23400
23401 * image.c (lookup_image): Remove var that is set but not used.
23402 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
23403
23404 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23405 that are set but not used.
23406
23407 * xfns.c (make_invisible_cursor): Don't return garbage
23408 if XCreateBitmapFromData fails (Bug#8410).
23409
23410 * xselect.c (x_get_local_selection, x_handle_property_notify):
23411 Remove vars that are set but not used.
23412
23413 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
23414 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
23415
23416 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23417 Remove var that is set but not used.
23418 (scroll_bar_windows_size): Now size_t, not int.
23419 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23420 Check for overflow.
23421
23422 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23423 (map_tty_color) [!defined MSDOS]: Likewise.
23424
23425 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23426
23427 * coding.c: Remove vars that are set but not used.
23428 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23429 All callers changed.
23430 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23431 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23432 (decode_coding_charset): Remove vars that are set but not used.
23433
23434 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23435 that is set but not used.
23436
23437 * print.c (print_object): Remove var that is set but not used.
23438
23439 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
23440 The gnulib version avoids calling malloc in the usual case,
23441 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23442 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23443 * filelock.c (current_lock_owner): Likewise.
23444 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23445 * sysdep.c: Include allocator.h, careadlinkat.h.
23446 (emacs_no_realloc_allocator): New static constant.
23447 (emacs_readlink): New function.
23448 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23449 ../lib/careadlinkat.h.
23450
234512011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23452
23453 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23454 first non-nil return value).
23455
234562011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23457
23458 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23459 if not defined (Bug#8403).
23460
234612011-04-02 Juanma Barranquero <lekktu@gmail.com>
23462
23463 * xdisp.c (display_count_lines): Remove parameter `start',
23464 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23465 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23466 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23467 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23468 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23469 and thereabouts. All callers changed.
23470 (get_per_char_metric): Remove parameter `f', unused since
23471 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23472
234732011-04-02 Jim Meyering <meyering@redhat.com>
23474
23475 do not dereference NULL upon failed strdup
23476 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23477 (ns_get_family): Likewise.
23478
234792011-04-02 Juanma Barranquero <lekktu@gmail.com>
23480
23481 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23482
234832011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23484
23485 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23486 later (Bug#8403).
23487
234882011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23489
23490 Add lexical binding.
23491
23492 * window.c (Ftemp_output_buffer_show): New fun.
23493 (Fsave_window_excursion):
23494 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23495
23496 * lread.c (lisp_file_lexically_bound_p): New function.
23497 (Fload): Bind Qlexical_binding.
23498 (readevalloop): Remove `evalfun' arg.
23499 Bind Qinternal_interpreter_environment.
23500 (Feval_buffer): Bind Qlexical_binding.
23501 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23502 Mark as dynamic.
23503 (syms_of_lread): Declare `lexical-binding'.
23504
23505 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23506
23507 * keyboard.c (eval_dyn): New fun.
23508 (menu_item_eval_property): Use it.
23509
23510 * image.c (parse_image_spec): Use Ffunctionp.
23511
23512 * fns.c (concat, mapcar1): Accept byte-code-functions.
23513
23514 * eval.c (Fsetq): Handle lexical vars.
23515 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23516 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23517 (FletX, Flet): Obey lexical binding.
23518 (Fcommandp): Handle closures.
23519 (Feval): New `lexical' arg.
23520 (eval_sub): New function extracted from Feval. Use it almost
23521 everywhere where Feval was used. Look up vars in lexical env.
23522 Handle closures.
23523 (Ffunctionp): Move from subr.el.
23524 (Ffuncall): Handle closures.
23525 (apply_lambda): Remove `eval_flags'.
23526 (funcall_lambda): Handle closures and new byte-code-functions.
23527 (Fspecial_variable_p): New function.
23528 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23529 but without exporting it to Lisp.
23530
23531 * doc.c (Fdocumentation, store_function_docstring):
23532 * data.c (Finteractive_form): Handle closures.
23533
23534 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23535 interactive spec.
23536
23537 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23538 New byte-codes.
23539 (exec_byte_code): New function extracted from Fbyte_code to handle new
23540 calling convention for byte-code-functions. Add new byte-codes.
23541
23542 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
23543
23544 * alloc.c (Fmake_symbol): Init new `declared_special' field.
23545
235462011-03-31 Juanma Barranquero <lekktu@gmail.com>
23547
23548 * xdisp.c (redisplay_internal): Fix prototype.
23549
235502011-03-31 Eli Zaretskii <eliz@gnu.org>
23551
23552 * xdisp.c (SCROLL_LIMIT): New macro.
23553 (try_scrolling): Use it when setting scroll_limit.
23554 Limit scrolling to 100 screen lines.
23555 (redisplay_window): Even when falling back on "recentering",
23556 position point in the window according to scroll-conservatively,
23557 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23558
23559 (try_scrolling): When point is above the window, allow searching
23560 as far as scroll_max, or one screenful, to compute vertical
23561 distance from PT to the scroll margin position. This prevents
23562 try_scrolling from unnecessarily failing when
23563 scroll-conservatively is set to a value slightly larger than the
23564 window height. Clean up the case of PT below the margin at bottom
23565 of window: scroll_max can no longer be INT_MAX. When aggressive
23566 scrolling is in use, don't let point enter the opposite scroll
23567 margin as result of the scroll.
23568 (syms_of_xdisp) <scroll-conservatively>: Document the
23569 threshold of 100 lines for never-recentering scrolling.
23570
235712011-03-31 Juanma Barranquero <lekktu@gmail.com>
23572
23573 * dispextern.h (move_it_by_lines):
23574 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23575 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23576 (message_log_check_duplicate): Remove parameters `prev_bol' and
23577 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23578 (redisplay_internal): Remove parameter `preserve_echo_area',
23579 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23580
23581 * indent.c (Fvertical_motion):
23582 * window.c (window_scroll_pixel_based, Frecenter):
23583 Don't pass `need_y_p' to `move_it_by_lines'.
23584
235852011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23586
23587 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23588 steal a few bits to be more compact.
23589 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23590 Remove unneeded casts.
23591
23592 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23593
235942011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23595
23596 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23597 binding" message (bug#7967).
23598
235992011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23600
23601 Fix more problems found by GCC 4.6.0's static checks.
23602
23603 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23604 Remove unused local var.
23605
23606 * editfns.c (Fmessage_box): Remove unused local var.
23607
23608 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23609 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23610 Omit unused local vars.
23611 * window.c (shrink_windows): Omit unused local var.
23612 * menu.c (digest_single_submenu): Omit unused local var.
23613 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23614 Omit unused local var.
23615
23616 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23617 Don't assume string length fits in int.
23618 (keyremap_step, read_key_sequence): Use size_t for sizes.
23619 (read_key_sequence): Don't check last_real_key_start redundantly.
23620
23621 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23622 instead of alloca (Bug#8344).
23623
23624 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23625 (Fbacktrace_frame): Don't assume nframes fits in int.
23626
23627 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23628
23629 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23630 concerns.
23631
23632 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23633
23634 * cm.c (calccost): Turn while-do into do-while, for clarity.
23635
23636 * keyboard.c (syms_of_keyboard): Use the same style as later
23637 in this function when indexing through an array. This also
23638 works around GCC bug 48267.
23639
23640 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23641
23642 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23643
23644 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23645 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23646
23647 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23648 This avoids undefined behavior on integer overflow, and is a bit
23649 more convenient anyway since it is compared to a size_t variable.
23650
23651 Variadic C functions now count arguments with size_t, not int.
23652 This avoids an unnecessary limitation on 64-bit machines, which
23653 caused (substring ...) to crash on large vectors (Bug#8344).
23654 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23655 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23656 All variadic functions and their callers changed accordingly.
23657 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23658 * data.c (arith_driver, float_arith_driver): Likewise.
23659 * editfns.c (general_insert_function): Likewise.
23660 * eval.c (struct backtrace.nargs, interactive_p)
23661 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23662 (funcall_lambda, mark_backtrace): Likewise.
23663 * fns.c (concat): Likewise.
23664 * frame.c (x_set_frame_parameters): Likewise.
23665 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23666 0 if not found, not -1. All callers changed.
23667
23668 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23669 (stack_copy_size): Now size_t, not int.
23670 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23671
236722011-03-28 Juanma Barranquero <lekktu@gmail.com>
23673
23674 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23675 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23676 All callers changed.
23677
23678 * lisp.h (multibyte_char_to_unibyte):
23679 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23680 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23681 * character.h (CHAR_TO_BYTE8):
23682 * cmds.c (internal_self_insert):
23683 * editfns.c (general_insert_function):
23684 * keymap.c (push_key_description):
23685 * search.c (Freplace_match):
23686 * xdisp.c (message_dolog, set_message_1): All callers changed.
23687
236882011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23689
23690 * keyboard.c (safe_run_hook_funcall): New function.
23691 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23692 don't set the hook to nil, but remove the offending function instead.
23693 (Qcommand_hook_internal): Remove, unused.
23694 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23695 Vcommand_hook_internal.
23696
23697 * eval.c (enum run_hooks_condition): Remove.
23698 (funcall_nil, funcall_not): New functions.
23699 (run_hook_with_args): Call each function through a `funcall' argument.
23700 Remove `cond' argument, now redundant.
23701 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23702 (Frun_hook_with_args_until_failure): Adjust accordingly.
23703 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23704
237052011-03-28 Juanma Barranquero <lekktu@gmail.com>
23706
23707 * dispextern.h (string_buffer_position): Remove declaration.
23708
23709 * print.c (strout): Remove parameter `multibyte', unused since
23710 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23711
23712 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23713 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23714 All callers changed.
23715
23716 * w32.c (_wsa_errlist): Use braces for struct initializers.
23717
23718 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23719 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23720 All callers changed.
23721 (string_buffer_position): Likewise. Also, make static (it's never
23722 used outside xdisp.c).
23723 (cursor_row_p): Remove parameter `w', unused since
23724 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23725 (decode_mode_spec): Remove parameter `precision', introduced during
23726 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23727 All callers changed.
23728
237292011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23730
23731 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23732
237332011-03-27 Anders Lindgren <andlind@gmail.com>
23734
23735 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23736 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23737 (ns_update_auto_hide_menu_bar): New functions.
23738 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23739 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23740 ns_constrain_all_frames.
23741 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23742 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23743
237442011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23745
23746 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23747
237482011-03-27 Glenn Morris <rgm@gnu.org>
23749
23750 * syssignal.h: Replace RETSIGTYPE with void.
23751 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23752 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23753 Replace SIGTYPE with void everywhere.
23754 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23755 * s/template.h (SIGTYPE): Remove commented out definition.
23756
237572011-03-26 Eli Zaretskii <eliz@gnu.org>
23758
23759 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23760 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23761
237622011-03-26 Juanma Barranquero <lekktu@gmail.com>
23763
23764 * w32.c (read_unc_volume): Use parameter `henum', instead of
23765 global variable `wget_enum_handle'.
23766
23767 * keymap.c (describe_vector): Remove parameters `indices' and
23768 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23769 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23770
23771 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23772
23773 * keyboard.c (timer_check): Remove parameter `do_it_now',
23774 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23775 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23776 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23777
23778 * keyboard.c (read_char):
23779 * w32menu.c (w32_menu_display_help):
23780 * xmenu.c (show_help_event, menu_help_callback):
23781 Adjust calls to `show_help_echo'.
23782
23783 * gtkutil.c (xg_maybe_add_timer):
23784 * keyboard.c (readable_events):
23785 * process.c (wait_reading_process_output):
23786 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23787
23788 * insdel.c (adjust_markers_gap_motion):
23789 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23790 (gap_left, gap_right): Don't call it.
23791
237922011-03-25 Chong Yidong <cyd@stupidchicken.com>
23793
23794 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23795 incurred during fontification.
23796
237972011-03-25 Juanma Barranquero <lekktu@gmail.com>
23798
23799 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23800 (DEFVAR_PER_BUFFER): Don't pass it.
23801
23802 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23803 (scrolling_window): Don't pass it.
23804
238052011-03-25 Juanma Barranquero <lekktu@gmail.com>
23806
23807 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23808
23809 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23810 and `suffix'.
23811 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23812 of variables specific to SELinux and computation of `encoded_absname'.
23813
23814 * image.c (XPutPixel): Remove unused variable `height'.
23815
23816 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23817
23818 * unexw32.c (get_section_info): Remove unused variable `section'.
23819
23820 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23821 (system_process_attributes): Remove unused variable `sess'.
23822 (sys_read): Remove unused variable `err'.
23823
23824 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23825 (w32_wnd_proc): Remove unused variable `isdead'.
23826 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23827 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23828 (x_create_tip_frame): Remove unused variable `tem'.
23829
23830 * w32inevt.c (w32_console_read_socket):
23831 Remove unused variable `no_events'.
23832
23833 * w32term.c (x_draw_composite_glyph_string_foreground):
23834 Remove unused variable `width'.
23835
238362011-03-24 Juanma Barranquero <lekktu@gmail.com>
23837
23838 * w32term.c (x_set_glyph_string_clipping):
23839 Don't pass uninitialized region to CombineRgn.
23840
238412011-03-23 Juanma Barranquero <lekktu@gmail.com>
23842
23843 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23844 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23845 (Fx_close_connection): Remove unused variable `i'.
23846
23847 * w32font.c (w32font_draw): Return number of glyphs.
23848 (w32font_open_internal): Remove unused variable `i'.
23849 (w32font_driver): Add missing initializer.
23850
23851 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23852 (fill_in_menu): Remove unused variable `items_added'.
23853
23854 * w32term.c (last_mouse_press_frame): Remove static global variable.
23855 (w32_clip_to_row): Remove unused variable `f'.
23856 (x_delete_terminal): Remove unused variable `i'.
23857
23858 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23859 (NOTHING): Remove unused static global variable.
23860 (uniscribe_check_otf): Remove unused variable `table'.
23861 (uniscribe_font_driver): Add missing initializers.
23862
238632011-03-23 Julien Danjou <julien@danjou.info>
23864
23865 * term.c (Fsuspend_tty, Fresume_tty):
23866 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23867 * window.c (temp_output_buffer_show):
23868 * insdel.c (signal_before_change):
23869 * frame.c (Fhandle_switch_frame):
23870 * fileio.c (Fdo_auto_save):
23871 * emacs.c (Fkill_emacs):
23872 * editfns.c (save_excursion_restore):
23873 * cmds.c (internal_self_insert):
23874 * callint.c (Fcall_interactively):
23875 * buffer.c (Fkill_all_local_variables):
23876 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23877 Use Frun_hooks.
23878 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23879 unconditionally since it does the check itself.
23880
238812011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23882
23883 Fix more problems found by GCC 4.5.2's static checks.
23884
23885 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23886 the first time through the loop, since we know p0 < p1 then.
23887 This also avoids a gcc -Wstrict-overflow warning.
23888
23889 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23890 leading to a memory leak, possible in functions like
23891 load_charset_map_from_file that can allocate an unbounded number
23892 of objects (Bug#8318).
23893
23894 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23895 that could (at least in theory) be that large.
23896
23897 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23898 This is less likely to overflow, and avoids undefined behavior if
23899 overflow does occur. All callers changed. Use strtoul to scan
23900 for the unsigned long integer.
23901 (pint2hrstr): Simplify and tune code slightly.
23902 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23903
23904 * scroll.c (do_scrolling): Work around GCC bug 48228.
23905 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23906
23907 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23908 This also avoids a warning with gcc -Wstrict-overflow.
23909 (validate_x_resource_name): Simplify count usage.
23910 This also avoids a warning with gcc -Wstrict-overflow.
23911
23912 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23913 fail (Bug#8306).
23914
23915 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23916
23917 * process.c (Fmake_network_process): Use socklen_t, not int,
23918 where POSIX says socklen_t is required in portable programs.
23919 This fixes a porting bug on hosts like 64-bit HP-UX, where
23920 socklen_t is wider than int (Bug#8277).
23921 (Fmake_network_process, server_accept_connection):
23922 (wait_reading_process_output, read_process_output):
23923 Likewise.
23924
23925 * process.c: Rename or move locals to avoid shadowing.
23926 (list_processes_1, Fmake_network_process):
23927 (read_process_output_error_handler, exec_sentinel_error_handler):
23928 Rename or move locals.
23929 (Fmake_network_process): Define label "retry_connect" only if needed.
23930 (Fnetwork_interface_info): Fix pointer signedness.
23931 (process_send_signal): Add cast to avoid pointer signedness problem.
23932 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23933 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23934
23935 Make tparam.h and terminfo.c consistent.
23936 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23937 Include tparam.h instead, since it declares them.
23938 * cm.h (PC): Remove extern decl; tparam.h now does this.
23939 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23940 * terminfo.c: Include tparam.h, to check interfaces.
23941 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23942 (tparam): Adjust signature to match interface in tparam.h;
23943 this removes some undefined behavior. Check that outstring and len
23944 are zero, which they always are with Emacs.
23945 * tparam.h (PC, BC, UP): New extern decls.
23946
23947 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23948 (xftfont_open): Rename locals to avoid shadowing.
23949
23950 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23951 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23952 (OTF_TAG_SYM): Omit macro if not needed.
23953 (ftfont_list): Remove unused local.
23954 (get_adstyle_property, ftfont_pattern_entity):
23955 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23956 Rename locals to avoid shadowing.
23957
23958 * xfont.c (xfont_list_family): Mark var as initialized.
23959
23960 * xml.c (make_dom): Now static.
23961
23962 * composite.c (composition_compute_stop_pos): Rename local to
23963 avoid shadowing.
23964 (composition_reseat_it): Remove unused locals.
23965 (find_automatic_composition, composition_adjust_point): Likewise.
23966 (composition_update_it): Mark var as initialized.
23967 (find_automatic_composition): Mark vars as initialized,
23968 with a FIXME (Bug#8290).
23969
23970 character.h: Rename locals to avoid shadowing.
23971 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23972 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23973 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23974 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23975 to avoid shadowing.
23976
23977 * textprop.c (property_change_between_p): Remove; unused.
23978
23979 * intervals.c (interval_start_pos): Now static.
23980
23981 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23982
23983 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23984 Rename locals to avoid shadowing.
23985
23986 * sound.c (wav_play, au_play, Fplay_sound_internal):
23987 Fix pointer signedness.
23988 (alsa_choose_format): Remove unused local var.
23989 (wav_play): Initialize a variable to 0, to prevent undefined
23990 behavior (Bug#8278).
23991
23992 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23993
23994 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23995
23996 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23997 clobbering (Bug#8298).
23998 * sysdep.c (sys_subshell): Likewise.
23999 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
24000
24001 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
24002 This should get cleaned up, so that child_setup has the
24003 same signature on all platforms.
24004
24005 * callproc.c (call_process_cleanup): Now static.
24006 (relocate_fd): Rename locals to avoid shadowing.
24007
240082011-03-22 Chong Yidong <cyd@stupidchicken.com>
24009
24010 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
24011 not to be necessary, and produces flickering.
24012
240132011-03-20 Glenn Morris <rgm@gnu.org>
24014
24015 * config.in: Remove file.
24016
240172011-03-20 Juanma Barranquero <lekktu@gmail.com>
24018
24019 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
24020 are now in src/globals.h.
24021 (syms_of_minibuf): Remove spurious & from previous change.
24022
240232011-03-20 Leo Liu <sdl.web@gmail.com>
24024
24025 * minibuf.c (completing-read-function): New variable.
24026 (completing-read-default): Rename from completing-read.
24027 (completing-read): Call completing-read-function.
24028
240292011-03-19 Juanma Barranquero <lekktu@gmail.com>
24030
24031 * xfaces.c (Fx_load_color_file):
24032 Read color file from absolute filename (bug#8250).
24033
240342011-03-19 Juanma Barranquero <lekktu@gmail.com>
24035
24036 * makefile.w32-in: Update dependencies.
24037
240382011-03-17 Eli Zaretskii <eliz@gnu.org>
24039
24040 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
24041
240422011-03-17 Paul Eggert <eggert@cs.ucla.edu>
24043
24044 Fix more problems found by GCC 4.5.2's static checks.
24045
24046 * process.c (make_serial_process_unwind, send_process_trap):
24047 (sigchld_handler): Now static.
24048
24049 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
24050 That way, the code declares only the vars that it needs.
24051 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
24052 * s/cygwin.h (PTY_ITERATION): Likewise.
24053 * s/darwin.h (PTY_ITERATION): Likewise.
24054 * s/gnu-linux.h (PTY_ITERATION): Likewise.
24055
24056 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
24057 * process.c (allocate_pty): Don't declare stb unless it's needed.
24058
24059 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
24060 (CONSTANTLIM): Remove; unused.
24061 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
24062 Define only if needed.
24063
24064 * unexelf.c (unexec): Name an expression,
24065 to avoid gcc -Wbad-function-cast warning.
24066 Use a different way to cause a compilation error if anyone uses
24067 n rather than nn, a way that does not involve shadowing.
24068 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
24069
24070 * deps.mk (unexalpha.o): Remove; unused.
24071
24072 New file unexec.h, the (simple) interface for unexec (Bug#8267).
24073 * unexec.h: New file.
24074 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
24075 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
24076 Depend on unexec.h.
24077 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
24078 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
24079 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
24080 Change as necessary to match prototype in unexec.h.
24081
24082 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
24083 shadowing.
24084 (back_comment, skip_chars): Mark vars as initialized.
24085
24086 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
24087 Rename locals to avoid shadowing.
24088
24089 * lread.c (read1): Rewrite so as not to use empty "else".
24090 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
24091
24092 * print.c (Fredirect_debugging_output): Fix pointer signedess.
24093
24094 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
24095 warning when compiling print.c.
24096
24097 * font.c (font_unparse_fcname): Abort in an "impossible" situation
24098 instead of using an uninitialized var.
24099 (font_sort_entities): Mark var as initialized.
24100
24101 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
24102
24103 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
24104 pointers to constants.
24105 (font_parse_fcname): Remove unused vars.
24106 (font_delete_unmatched): Now static.
24107 (font_get_spec): Remove; unused.
24108 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
24109 (font_update_drivers, Ffont_get_glyphs, font_add_log):
24110 Rename or move locals to avoid shadowing.
24111
24112 * fns.c (require_nesting_list, require_unwind): Now static.
24113 (Ffillarray): Rename locals to avoid shadowing.
24114
24115 * floatfns.c (domain_error2): Define only if needed.
24116 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
24117
24118 * alloc.c (mark_backtrace): Move decl from here ...
24119 * lisp.h: ... to here, so that it can be checked.
24120
24121 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
24122 (Fdefvar): Rewrite so as not to use empty "else".
24123 (lisp_indirect_variable): Name an expression,
24124 to avoid gcc -Wbad-function-cast warning.
24125 (Fdefvar): Rename locals to avoid shadowing.
24126
24127 * callint.c (quotify_arg, quotify_args): Now static.
24128 (Fcall_interactively): Rename locals to avoid shadowing.
24129 Use const pointer when appropriate.
24130
24131 * lisp.h (get_system_name, get_operating_system_release):
24132 Move decls here, to check interfaces.
24133 * process.c (get_operating_system_release): Move decl to lisp.h.
24134 * xrdb.c (get_system_name): Likewise.
24135 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
24136 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
24137 some of which prompt warnings from gcc -Wbad-function-cast.
24138 (Fformat_time_string, Fencode_time, Finsert_char):
24139 (Ftranslate_region_internal, Fformat):
24140 Rename or remove local vars to avoid shadowing.
24141 (Ftranslate_region_internal): Mark var as initialized.
24142
24143 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
24144 avoid shadowing.
24145
24146 * lisp.h (eassert): Check that the argument compiles, even if
24147 ENABLE_CHECKING is not defined.
24148
24149 * data.c (Findirect_variable): Name an expression, to avoid
24150 gcc -Wbad-function-cast warning.
24151 (default_value, arithcompare, arith_driver, arith_error): Now static.
24152 (store_symval_forwarding): Rename local to avoid shadowing.
24153 (Fmake_variable_buffer_local, Fmake_local_variable):
24154 Mark variables as initialized.
24155 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
24156
24157 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
24158 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
24159 Rename locals to avoid shadowing.
24160 (mark_stack): Move local variables into the #ifdef region where
24161 they're used.
24162 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
24163 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
24164 needed otherwise.
24165 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
24166 (GC_STRING_CHARS): Remove; not used.
24167 (Fmemory_limit): Cast sbrk's returned value to char *.
24168
24169 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
24170 avoids undefined behavior in theory.
24171
24172 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
24173
24174 Use functions, not macros, for up- and down-casing (Bug#8254).
24175 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
24176 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
24177 to use the following functions instead of these macros.
24178 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
24179 EMACS_INT, since callers assume the returned value fits in int.
24180 (upcase1): Likewise, for UPCASE_TABLE.
24181 (uppercasep, lowercasep, upcase): New static inline functions.
24182 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
24183 the race-condition problem in the old DOWNCASE.
24184
24185 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
24186 Rename locals to avoid shadowing.
24187 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
24188 (regex_compile, re_search_2, re_match_2_internal):
24189 Remove unused local vars.
24190 (FREE_VAR): Rewrite so as not to use empty "else",
24191 which gcc can warn about.
24192 (regex_compile, re_match_2_internal): Mark locals as initialized.
24193 (RETALLOC_IF): Define only if needed.
24194 (WORDCHAR_P): Likewise. This one is never needed, but is used
24195 only in a comment talking about a compiler bug, so put inside
24196 the #if 0 of that comment.
24197 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
24198 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
24199 Remove; unused.
24200
24201 * search.c (boyer_moore): Rename locals to avoid shadowing.
24202 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
24203 (PREV_CHAR_BOUNDARY): Likewise.
24204
24205 * search.c (simple_search): Remove unused var.
24206
24207 * dired.c (compile_pattern): Move decl from here ...
24208 * lisp.h: ... to here, so that it can be checked.
24209 (struct re_registers): New forward decl.
24210
24211 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
24212
24213 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
24214 All uses changed.
24215 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
24216 Rename locals to avoid shadowing.
24217 (Fvertical_motion): Mark locals as initialized.
24218
24219 * casefiddle.c (casify_object, casify_region): Now static.
24220 (casify_region): Mark local as initialized.
24221
24222 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
24223
24224 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
24225 New macros, so that the caller can use some names other than
24226 gcpro1, gcpro2, etc.
24227 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
24228 of the new macros.
24229 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
24230 argument, for consistency with GCPRO2_VAR, etc: it is now the
24231 prefix of the variable, not the variable itself. All uses
24232 changed.
24233 * dired.c (directory_files_internal, file_name_completion):
24234 Rename locals to avoid shadowing.
24235
24236 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
24237 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
24238 dired.c's scmp function, had undefined behavior.
24239 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
24240 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
24241 * buffer.h: ... to here, because these macros use current_buffer,
24242 and the new implementation with inline functions needs to have
24243 current_buffer in scope now, rather than later when the macros
24244 are used.
24245 (downcase, upcase1): New static inline functions.
24246 (DOWNCASE, UPCASE1): Reimplement using these functions.
24247 This avoids undefined behavior in expressions like
24248 DOWNCASE (x) == DOWNCASE (y), which previously suffered
24249 from race conditions in accessing the global variables
24250 case_temp1 and case_temp2.
24251 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
24252 * lisp.h (case_temp1, case_temp2): Remove their decls.
24253 * character.h (ASCII_CHAR_P): Move from here ...
24254 * lisp.h: ... to here, so that the inline functions mentioned
24255 above can use them.
24256
24257 * dired.c (directory_files_internal_unwind): Now static.
24258
24259 * fileio.c (file_name_as_directory, directory_file_name):
24260 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
24261 Now static.
24262 (file_name_as_directory): Use const pointers when appropriate.
24263 (Fexpand_file_name): Likewise. In particular, newdir might
24264 point at constant storage, so make it a const pointer.
24265 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
24266 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
24267 signedness issues.
24268 (Fset_file_times, Finsert_file_contents, auto_save_error):
24269 Rename locals to avoid shadowing.
24270
24271 * minibuf.c (choose_minibuf_frame_1): Now static.
24272 (Ftry_completion, Fall_completions): Rename or remove locals
24273 to avoid shadowing.
24274
24275 * marker.c (bytepos_to_charpos): Remove; unused.
24276
24277 * lisp.h (verify_bytepos, count_markers): New decls,
24278 so that gcc does not warn that these functions aren't declared.
24279
24280 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
24281 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
24282 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
24283 (copy_text): Remove unused local var.
24284
24285 * filelock.c (within_one_second): Now static.
24286 (lock_file_1): Rename local to avoid shadowing.
24287
24288 * buffer.c (fix_overlays_before): Mark locals as initialized.
24289 (fix_start_end_in_overlays): Likewise. This function should be
24290 simplified by using pointers-to-pointers, but that's a different
24291 matter.
24292 (switch_to_buffer_1): Now static.
24293 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
24294 (report_overlay_modification): Rename locals to avoid shadowing.
24295
24296 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
24297 Fix pointer signedness issue.
24298 (sys_subshell): Mark local as volatile if checking for lint,
24299 to suppress a gcc -Wclobbered warning that does not seem to be right.
24300 (MAXPATHLEN): Define only if needed.
24301
24302 * process.c (serial_open, serial_configure): Move decls from here ...
24303 * systty.h: ... to here, so that they can be checked.
24304
24305 * fns.c (get_random, seed_random): Move extern decls from here ...
24306 * lisp.h: ... to here, so that they can be checked.
24307
24308 * sysdep.c (reset_io): Now static.
24309 (wait_for_termination_signal): Remove; unused.
24310
24311 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
24312 (copy_keymap_item, append_key, push_text_char_description):
24313 Now static.
24314 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
24315 (DENSE_TABLE_SIZE): Remove; unused.
24316 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
24317 (describe_map_tree):
24318 Rename locals to avoid shadowing.
24319
24320 * keyboard.c: Declare functions static if they are not used elsewhere.
24321 (echo_char, echo_dash, cmd_error, top_level_2):
24322 (poll_for_input, handle_async_input): Now static.
24323 (read_char, kbd_buffer_get_event, make_lispy_position):
24324 (make_lispy_event, make_lispy_movement, apply_modifiers):
24325 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
24326 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
24327 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
24328 (read_key_sequence, read_char): Mark locals as initialized.
24329 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
24330
24331 * keyboard.h (make_ctrl_char): New decl.
24332 (mark_kboards): Move decl here ...
24333 * alloc.c (mark_kboards): ... from here.
24334
24335 * lisp.h (force_auto_save_soon): New decl.
24336
24337 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
24338 (DEFINE_DUMMY_FUNCTION): New macro.
24339 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
24340 Use it.
24341 (main): Add casts to avoid warnings
24342 if GCC considers string literals to be constants.
24343
24344 * lisp.h (fatal_error_signal): Add decl, since it's exported.
24345
24346 * dbusbind.c: Pointer signedness fixes.
24347 (xd_signature, xd_append_arg, xd_initialize):
24348 (Fdbus_call_method, Fdbus_call_method_asynchronously):
24349 (Fdbus_method_return_internal, Fdbus_method_error_internal):
24350 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
24351 (Fdbus_register_signal): Use SSDATA when the context wants char *.
24352
24353 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
24354 if GCC considers string literals to be constants.
24355 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
24356
243572011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
24358
24359 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
24360 (print_preprocess, print_object): New macro to fix last change.
24361
24362 * print.c (print_preprocess): Don't forget font objects.
24363
243642011-03-16 Juanma Barranquero <lekktu@gmail.com>
24365
24366 * emacs.c (USAGE3): Doc fixes.
24367
243682011-03-15 Andreas Schwab <schwab@linux-m68k.org>
24369
24370 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
24371 structure.
24372
243732011-03-14 Juanma Barranquero <lekktu@gmail.com>
24374
24375 * lisp.h (VWindow_system, Qfile_name_history):
24376 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
24377 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
24378 (w32_system_caret_x, w32_system_caret_y): Declare extern.
24379
24380 * w32select.c: Don't #include "keyboard.h".
24381 (run_protected): Add extern declaration for waiting_for_input.
24382
24383 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
24384 * w32console.c (detect_input_pending, read_input_pending)
24385 (encode_terminal_code):
24386 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
24387 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
24388 (w32_system_caret_y, Qfile_name_history):
24389 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
24390 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
24391 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
24392 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
24393 * w32proc.c (Qlocal, report_file_error):
24394 * w32term.c (Vwindow_system, updating_frame):
24395 * w32uniscribe.c (initialized, uniscribe_font_driver):
24396 Remove unneeded extern declarations.
24397
243982011-03-14 Chong Yidong <cyd@stupidchicken.com>
24399
24400 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
24401
244022011-03-13 Chong Yidong <cyd@stupidchicken.com>
24403
24404 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24405 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24406 These macros can no longer be used for assignment.
24407
24408 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24409 Assign struct members directly, instead of using BUF_BEGV etc.
24410 (record_buffer_markers, fetch_buffer_markers): New functions for
24411 recording and fetching special buffer markers.
24412 (set_buffer_internal_1, set_buffer_temp): Use them.
24413
24414 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24415
24416 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24417
24418 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24419 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24420
24421 * xdisp.c (hscroll_window_tree):
24422 (reconsider_clip_changes): Use PT instead of BUF_PT.
24423
244242011-03-13 Eli Zaretskii <eliz@gnu.org>
24425
24426 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24427 $(EMACS_ROOT)/lib/intprops.h.
24428
244292011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24430
24431 Fix more problems found by GCC 4.5.2's static checks.
24432
24433 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24434 to unsigned char * to avoid compiler diagnostic.
24435 (xg_free_frame_widgets): Make it clear that a local variable is
24436 needed only if USE_GTK_TOOLTIP.
24437 (gdk_window_get_screen): Make it clear that this macro is needed
24438 only if USE_GTK_TOOLTIP.
24439 (int_gtk_range_get_value): New function, which avoids a diagnostic
24440 from gcc -Wbad-function-cast.
24441 (xg_set_toolkit_scroll_bar_thumb): Use it.
24442 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24443 diagnostic from gcc -Wbad-function-cast.
24444 (get_utf8_string, xg_get_file_with_chooser):
24445 Rename locals to avoid shadowing.
24446 (create_dialog): Move locals to avoid shadowing.
24447
24448 * xgselect.c (xg_select): Remove unused var.
24449
24450 * image.c (four_corners_best): Mark locals as initialized.
24451 (gif_load): Initialize transparent_p to zero (Bug#8238).
24452 Mark another local as initialized.
24453 (my_png_error, my_error_exit): Mark with NO_RETURN.
24454
24455 * image.c (clear_image_cache): Now static.
24456 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
24457 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
24458 (x_edge_detection): Remove unnecessary cast that
24459 gcc -Wbad-function-cast diagnoses.
24460 (gif_load): Fix pointer signedness.
24461 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24462 (jpeg_load, gif_load): Rename locals to avoid shadowing.
24463
244642011-03-12 Paul Eggert <eggert@cs.ucla.edu>
24465
24466 Improve quality of tests for time stamp overflow.
24467 For example, without this patch (encode-time 0 0 0 1 1
24468 1152921504606846976) returns the obviously-bogus value (-948597
24469 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24470 reports time overflow. See
24471 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
24472 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24473 * editfns.c: Include limits.h and intprops.h.
24474 (TIME_T_MIN, TIME_T_MAX): New macros.
24475 (time_overflow): Move earlier, to before first use.
24476 (hi_time, lo_time): New functions, for an accurate test for
24477 out-of-range times.
24478 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24479 (Fget_internal_run_time): Don't assume time_t fits in int.
24480 (make_time): Use list2 instead of Fcons twice.
24481 (Fdecode_time): More accurate test for out-of-range times.
24482 (check_tm_member): New function.
24483 (Fencode_time): Use it, to test for out-of-range times.
24484 (lisp_time_argument): Don't rely on undefined left-shift and
24485 right-shift behavior when checking for time stamp overflow.
24486
24487 * editfns.c (time_overflow): New function, refactoring common code.
24488 (Fformat_time_string, Fdecode_time, Fencode_time):
24489 (Fcurrent_time_string): Use it.
24490
24491 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24492 * dired.c (make_time): Move to ...
24493 * editfns.c (make_time): ... here.
24494 * systime.h: Note the move.
24495
244962011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24497
24498 * fringe.c (update_window_fringes): Remove unused variables.
24499
24500 * unexmacosx.c (copy_data_segment): Also copy __got section.
24501 (Bug#8223)
24502
245032011-03-12 Eli Zaretskii <eliz@gnu.org>
24504
24505 * termcap.c [MSDOS]: Include "msdos.h".
24506 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24507 Constify `char *' arguments and their references according to
24508 prototypes in tparam.h.
24509
24510 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
24511
24512 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24513 Adapt all references accordingly.
24514
24515 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24516
245172011-03-11 Tom Tromey <tromey@redhat.com>
24518
24519 * buffer.c (syms_of_buffer): Remove obsolete comment.
24520
245212011-03-11 Eli Zaretskii <eliz@gnu.org>
24522
24523 * termhooks.h (encode_terminal_code): Declare prototype.
24524
24525 * msdos.c (encode_terminal_code): Don't declare prototype.
24526
24527 * term.c (encode_terminal_code): Now external again, used by
24528 w32console.c and msdos.c.
24529
24530 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24531 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
24532
245332011-03-11 Paul Eggert <eggert@cs.ucla.edu>
24534
24535 Fix some minor problems found by GCC 4.5.2's static checks.
24536
24537 * fringe.c (update_window_fringes): Mark locals as initialized
24538 (Bug#8227).
24539 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
24540
24541 * alloc.c (mark_fringe_data): Move decl from here ...
24542 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24543 to check its interface.
24544 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24545
24546 * fontset.c (free_realized_fontset): Now static.
24547 (Fset_fontset_font): Rename local to avoid shadowing.
24548 (fontset_font): Mark local as initialized.
24549 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
24550
24551 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24552
24553 * xselect.c (x_disown_buffer_selections): Remove; not used.
24554 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
24555 (x_own_selection, Fx_disown_selection_internal): Rename locals
24556 to avoid shadowing.
24557 (x_handle_dnd_message): Remove local to avoid shadowing.
24558
24559 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24560 so that the caller can use some name other than gcpro1.
24561 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
24562 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24563 (Fx_backspace_delete_keys_p):
24564 Use them to avoid shadowing, and rename vars to avoid shadowing.
24565 (x_decode_color, x_set_name, x_window): Now static.
24566 (Fx_create_frame): Add braces to silence GCC warning.
24567 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
24568 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24569 Remove unused locals.
24570 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24571 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24572 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24573 macros.
24574
24575 * xterm.h (x_mouse_leave): New decl.
24576
24577 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24578 Remove unused functions.
24579 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24580 (x_calc_absolute_position): Now static.
24581 (XTread_socket): Don't define label "out" unless it's used.
24582 Don't declare local "event" unless it's used.
24583 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24584 unless they are used.
24585 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24586 (x_fatal_error_signal): Remove; not used.
24587 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24588 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24589 (x_error_catcher, x_connection_closed, x_error_handler):
24590 (x_error_quitter, xembed_send_message, x_iconify_frame):
24591 (my_log_handler): Rename locals to avoid shadowing.
24592 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
24593 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
24594
24595 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24596 Rename or move locals to avoid shadowing.
24597 (tty_defined_color, merge_face_heights): Now static.
24598 (free_realized_faces_for_fontset): Remove; not used.
24599 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24600 does not deduce is never used uninitialized.
24601 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24602 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
24603
24604 * terminal.c (store_terminal_param): Now static.
24605
24606 * xmenu.c (menu_highlight_callback): Now static.
24607 (set_frame_menubar): Remove unused local.
24608 (xmenu_show): Rename parameter to avoid shadowing.
24609 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24610 since they might point to immutable storage.
24611 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24612 since it's unused otherwise.
24613
24614 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24615 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24616 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24617 avoids a gcc -Wuninitialized diagnostic.
24618 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24619 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24620 does not deduce are never used uninitialized.
24621
24622 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24623
24624 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24625 * window.c (window_loop, size_window):
24626 (run_window_configuration_change_hook, enlarge_window): Likewise.
24627
24628 * window.c (display_buffer): Now static.
24629 (size_window): Mark variables that gcc -Wuninitialized
24630 does not deduce are never used uninitialized.
24631 * window.h (check_all_windows): New decl, to forestall
24632 gcc -Wmissing-prototypes diagnostic.
24633 * dispextern.h (bidi_dump_cached_states): Likewise.
24634
24635 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24636 shadowing.
24637 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24638 Include <limits.h>.
24639 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24640 and to avoid gcc -Wuninitialized warning.
24641 (load_charset_map): Mark variables that gcc -Wuninitialized
24642 does not deduce are never used uninitialized.
24643 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24644
24645 * coding.c (coding_set_source, coding_set_destination):
24646 Use "else { /* comment */ }" rather than "else /* comment */;"
24647 for clarity, and to avoid gcc -Wempty-body warning.
24648 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24649 a block, when the outer 'i' will do.
24650 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24651 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24652 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24653 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24654 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24655 Rename locals to avoid shadowing.
24656 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24657 * coding.c (emacs_mule_char, encode_invocation_designation):
24658 Now static, since they're not used elsewhere.
24659 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24660 (decode_coding_object, encode_coding_object, detect_coding_system):
24661 (decode_coding_emacs_mule): Mark variables that gcc
24662 -Wuninitialized does not deduce are never used uninitialized.
24663 (detect_coding_iso_2022): Initialize a local variable that might
24664 be used uninitialized. Leave a FIXME because it's not clear that
24665 this initialization is needed. (Bug#8211)
24666 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24667 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24668 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24669 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24670 Remove unused macros.
24671
24672 * category.c (hash_get_category_set): Remove unused local var.
24673 (copy_category_table): Now static, since it's not used elsewhere.
24674 * character.c (string_count_byte8): Likewise.
24675
24676 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24677 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24678
24679 * chartab.c (copy_sub_char_table): Now static, since it's not used
24680 elsewhere.
24681 (sub_char_table_ref_and_range, char_table_ref_and_range):
24682 Rename locals to avoid shadowing.
24683 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24684
24685 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24686 (BIDI_BOB): Remove unused macro.
24687
24688 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24689 deduce are never used uninitialized.
24690 * term.c (encode_terminal_code): Likewise.
24691
24692 * term.c (encode_terminal_code): Now static. Remove unused local.
24693
24694 * tparam.h: New file.
24695 * term.c, tparam.h: Include it.
24696 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24697 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24698 Move these decls to tparam.h, and make them agree with what
24699 is actually in tparam.c. The previous trick of using incompatible
24700 decls in different modules does not conform to the C standard.
24701 All callers of tparam changed to use tparam's actual API.
24702 * tparam.c (tparam1, tparam, tgoto):
24703 Use const pointers where appropriate.
24704
24705 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24706 * cm.h (struct cm): Likewise.
24707 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24708 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24709 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24710 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24711 (turn_on_face, init_tty): Likewise.
24712 * termchar.h (struct tty_display_info): Likewise.
24713
24714 * term.c (term_mouse_position): Rename local to avoid shadowing.
24715
24716 * alloc.c (mark_ttys): Move decl from here ...
24717 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24718
247192011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24720
24721 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24722
247232011-03-09 Juanma Barranquero <lekktu@gmail.com>
24724
24725 * search.c (compile_pattern_1): Remove argument regp, unused since
24726 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24727 (compile_pattern): Don't pass it.
24728
247292011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24730
24731 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24732 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24733 for ! HAVE_GTK3.
24734 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24735
24736 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24737
24738 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24739 gdk_window_get_screen, gdk_window_get_geometry,
24740 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24741 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24742 (xg_get_pixbuf_from_pixmap): New function.
24743 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24744 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24745 Call xg_get_pixbuf_from_pixmap instead of
24746 gdk_pixbuf_get_from_drawable.
24747 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24748 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24749 (xg_check_special_colors): Use GtkStyleContext and its functions
24750 for HAVE_GTK3.
24751 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24752 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24753 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24754 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24755 Call gtk_widget_get_preferred_size.
24756 (xg_frame_resized): gdk_window_get_geometry only takes 5
24757 parameters.
24758 (xg_win_to_widget, xg_event_is_for_menubar):
24759 Call gdk_x11_window_lookup_for_display.
24760 (xg_set_widget_bg): New function.
24761 (delete_cb): New function.
24762 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24763 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24764 (xg_set_background_color): Call xg_set_widget_bg.
24765 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24766 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24767 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24768 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24769 if ! HAVE_GTK3.
24770 (update_frame_tool_bar): Call gtk_widget_hide.
24771 (xg_initialize): Use GDK_KEY_g.
24772
24773 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24774 if ! HAVE_GTK3
24775 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24776
24777 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24778 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24779 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24780
247812011-03-08 Juanma Barranquero <lekktu@gmail.com>
24782
24783 * w32xfns.c (select_palette): Check success of RealizePalette against
24784 GDI_ERROR, not zero.
24785
24786See ChangeLog.11 for earlier changes.
24787 1864
24788;; Local Variables: 1865;; Local Variables:
24789;; coding: utf-8 1866;; coding: utf-8