Move SETUP_SLAVE_PTY from src/s to configure
[bpt/emacs.git] / src / ChangeLog
CommitLineData
33d63ff4
GM
12012-07-13 Glenn Morris <rgm@gnu.org>
2
3 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
4 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5
b55b9f85
JD
62012-07-13 Jan Djärv <jan.h.d@swipnet.se>
7
0dc8cf50
JD
8 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
11 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
12 where appropriate.
13 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
14 as boolean expression.
15 (x_set_window_size): Remove unused variable toolbar.
16 (ns_get_color_default, ns_mod_to_lisp): Remove.
17 (ns_mouse_position): Remove unused variables xchar and ychar.
18 (ns_compute_glyph_string_overhangs): Remove unused variable face.
19 (ns_set_vertical_scroll_bar): Remove unused variable count.
20 (ns_delete_terminal): Remove unused variable i.
21 (ns_term_init): Remove unused variables r, g and b.
22 (mouseDown): Remove unused variable window.
23 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
24 (initFrameFromEmacs): Remove unused variable vbextra.
25 (mouseEntered): Remove unused variables p and dpyinfo.
26 (mouseExited): Remove unused variables p and r.
27 (ns_define_frame_cursor, ns_clear_frame_area)
28 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
29 (menuDown): Assign [sender tag] to variable and cast the variable.
30
31 * nsterm.h (menuDown): Add id as type to argument sender.
32 (ns_display_info_for_name): Add Lisp_Object argument.
33 (ns_term_init): Add Lisp_Object argument.
34 (ns_map_event_to_object): Add void argument.
35 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
36 prototype with arguments and only declare if __OBJC__.
37 (nxatoms_of_nsselect): Add void argument.
38 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
39 (ns_alloc_autorelease_pool): Add void argument.
40 (ns_release_autorelease_pool): Add void* argument.
41 (ns_get_defaults_value): Add const char* argument.
42
43 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
44 (initFromContents): Use SSDATA where appropriate.
45 (ns_update_menubar): Add braces to ambigous if-else.
46 (initWithTitle): Put () around assignment in if statement.
47 (ns_menu_show): Remove unused variables window and keymap.
48 (update_frame_tool_bar): Remove unused variable selected_p.
49 (initWithContentRect): Remove unused variable this_cmd_name.
50
51 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
52 appropriate.
53 (setXBMColor): Remove unused variable len.
54 (setPixmapData): Put () around assignment in loop statement.
55
56 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
57 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
58 where appropriate.
59 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
60 around assignment in loop statement.
61 (nsfont_open): Remove unused variable i.
62 (nsfont_open): Remove unused variable len.
63 (nsfont_draw): Remove unused variable cs.
64
65 * nsfns.m (x_set_icon_name, ns_set_name_internal)
66 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
67 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
68 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
69 (Fns_font_name, Fns_perform_service)
70 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
71 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
72 (ns_set_name): Remove unused variable view.
73 (x_set_menu_bar_lines): Remove unused variable olines.
74 (x_set_tool_bar_lines): Remove unused variable root_window.
75 (Fns_list_colors): Put () around assignment in while statement.
76 (Fns_perform_service): Remove unused variable len.
77 (Fns_display_usable_bounds): Remove unused variable top.
78 (syms_of_nsfns): Remove unused variable i.
79
b55b9f85
JD
80 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
81 memcpy (Bug#11907).
82
2277de02
JD
832012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
84
85 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
86 and free it with DestroyExceptionInfo (Bug#11558).
87
ef099b57
JB
882012-07-13 Juanma Barranquero <lekktu@gmail.com>
89
90 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
91 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
92 Set here, not in nt/config.nt.
93
ea814a5d
EZ
942012-07-13 Eli Zaretskii <eliz@gnu.org>
95
96 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
97 cursor overflow into the last glyph on display line when the right
98 fringe is off. (Bug#11832)
99
1a952767
PE
1002012-07-13 Paul Eggert <eggert@cs.ucla.edu>
101
102 * xdisp.c (produce_special_glyphs): Now static.
103 * dispextern.h (produce_special_glyphs): Remove decl.
104
983188fd
GM
1052012-07-13 Glenn Morris <rgm@gnu.org>
106
32fb4bb6
GM
107 * s/bsd-common, s/cygwin.h: Remove empty files.
108 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
109
983188fd
GM
110 * s/usg5-4-common.h (USG, USG5):
111 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
112 * s/sol2-6.h (SOLARIS2):
113 * s/irix6-5.h (IRIX6_5):
114 * s/hpux10-20.h (USG, USG5, HPUX):
115 * s/gnu-linux.h (USG, GNU_LINUX):
116 * s/freebsd.h (BSD_SYSTEM):
117 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
118 * s/cygwin.h (CYGWIN):
119 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
120 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
121
d1e68667 1222012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
123
124 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 125
6de0e799
GM
1262012-07-13 Glenn Morris <rgm@gnu.org>
127
739ae010
GM
128 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
129
dbee5793
GM
130 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
131
6de0e799
GM
132 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
133 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
134
b82da769
GM
1352012-07-12 Glenn Morris <rgm@gnu.org>
136
4fae5a7a 137 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
138
139 * process.c (init_process_emacs): Rename from init_process.
140 The old name is also the name of a Mach system call.
141 * lisp.h, emacs.c: Update for this name change.
142 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
143 longer needed.
144
5a979817
EZ
1452012-07-12 Eli Zaretskii <eliz@gnu.org>
146
147 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
148 memmove call that removes glyphs covered by the left truncation
149 glyph. Improve commentary.
150 (display_line): Fix display of continuation glyphs on GUI frames
151 when the right fringe is turned off and variable-size fonts are
152 used in the window. Move the code that appends a stretch glyph to
153 produce_special_glyphs, so that it could be used for truncation
154 and continuation glyphs alike.
155 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
156 glyph of a suitably computed width, to align the special glyphs at
157 the window margin. Code moved from display_line. (Bug#11832)
158
3e91a053
GM
1592012-07-12 Glenn Morris <rgm@gnu.org>
160
ba9e4b84
GM
161 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
162
163 * s/gnu-linux.h, s/hpux10-20.h:
164 Do not unconditionally define HAVE_XRMSETDATABASE.
165
3e91a053
GM
166 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
167
b300b1f4
PE
1682012-07-12 Paul Eggert <eggert@cs.ucla.edu>
169
170 Fix typos that broke OS X build.
171 Reported by Randal L. Schwartz in
172 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
173 * nsterm.m (ns_timeout): Add missing local decl.
174 (ns_get_color): snprintf -> sprintf, to fix typo.
175
6e777848
GM
1762012-07-12 Glenn Morris <rgm@gnu.org>
177
3f922c37
GM
178 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
179 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
180 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
181 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
182
0ab7b23a
GM
183 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
184 Move PTY_OPEN to configure.
185
6e777848
GM
186 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
187 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
188 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
189
4a7edc24
DA
1902012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
191
192 Use empty_unibyte_string where applicable.
193 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
194 * lread.c (read1): Likewise.
195 * xsettings.c (syms_of_xsettings): Likewise.
196
308aab79
GM
1972012-07-12 Glenn Morris <rgm@gnu.org>
198
42bd1719
GM
199 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
200 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
201 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
202 * s/hpux10-20.h (RUN_TIME_REMAP):
203 * s/bsd-common.h (TABDLY): Move to configure.
204
205 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
206
207 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
208
ea0bbd17 209 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 210 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
211
212 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 213
308aab79
GM
214 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
215 * s/template.h: Move NARROWPROTO to configure.
216
ee1cf5cf
GM
2172012-07-11 Glenn Morris <rgm@gnu.org>
218
30fe9bf4
GM
219 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
220 unused since 2011-01-17 change to systty.h.
221
ee1cf5cf
GM
222 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
223 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
224 Move HAVE_PTYS and HAVE_SOCKETS to configure.
225
63e47e07
PE
2262012-07-11 Paul Eggert <eggert@cs.ucla.edu>
227
228 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
229
c43fb4c3
GM
2302012-07-11 Glenn Morris <rgm@gnu.org>
231
232 * s/darwin.h, s/gnu-linux.h, s/template.h:
233 Move INTERRUPT_INPUT to configure.
234
e8df9267
DA
2352012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
236
237 Minor adjustments to interning code.
238 * lisp.h (intern, intern_c_string): Redefine as static inline
239 wrappers for intern_1 and intern_c_string_1, respectively.
240 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
241 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
242 Vobarray checking.
e8df9267
DA
243 * font.c (font_intern_prop): Likewise. Adjust comment.
244 * w32font.c (intern_font_name): Likewise.
245
34348bd4
AS
2462012-07-11 Andreas Schwab <schwab@linux-m68k.org>
247
d96a1e0c
AS
248 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
249
34348bd4
AS
250 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
251 of Fcar/Fcdr if possible.
252 * font.c (check_otf_features): Likewise.
253 * fontset.c (Fnew_fontset): Likewise.
254 * gnutls.c (Fgnutls_boot): Likewise.
255 * minibuf.c (read_minibuf): Likewise.
256 * msdos.c (IT_set_frame_parameters): Likewise.
257 * xmenu.c (Fx_popup_dialog): Likewise.
258 * w32menu.c (Fx_popup_dialog): Likewise.
259
c8add24e
GM
2602012-07-11 Glenn Morris <rgm@gnu.org>
261
4b575b3c
GM
262 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
263 since nothing has defined it on these platforms.
264
09f4e3b0
GM
265 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
266 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
267
172bedef
GM
268 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
269 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
270 Move CLASH_DETECTION to configure.
271
249685df
GM
272 * s/gnu.h: Remove file, which is now empty.
273
c8add24e
GM
274 * s/gnu.h, s/gnu-linux.h:
275 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
276
b41253a3
JW
2772012-07-11 John Wiegley <johnw@newartisans.com>
278
279 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
280 function attribute, so we only use it if it exists in the
281 compiler.
282
d923b542
DA
2832012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
284
285 Avoid call to strlen in fast_c_string_match_ignore_case.
286 * search.c (fast_c_string_match_ignore_case): Change to use
287 length argument. Adjust users accordingly.
288 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
289
5ebbef1d
PE
2902012-07-11 Paul Eggert <eggert@cs.ucla.edu>
291
bb352260
PE
292 Assume mkdir, rmdir.
293 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
294 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
295
57054ddd
PE
296 Assume rename.
297 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
298
b747d3f7
PE
299 Assume perror.
300 * s/hpux10-20.h (HAVE_PERROR): Remove.
301 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
302 Remove dummy definition, as this problem was obsolete long ago.
303
5ebbef1d
PE
304 Assume strerror.
305 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
306
984e7f30
DA
3072012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
308
309 Avoid calls to strlen in font processing functions.
310 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 311 (font_open_by_name): Change to use length argument. Adjust
984e7f30 312 users accordingly.
d923b542
DA
313 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
314 Adjust prototypes.
315 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
316 Change to return ptrdiff_t.
984e7f30
DA
317 (xfont_list_pattern, xfont_match): Use length returned by
318 xfont_decode_coding_xlfd.
319 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
320
20e94fdd
GM
3212012-07-11 Glenn Morris <rgm@gnu.org>
322
9d596af3
GM
323 * s/darwin.h, s/freebsd.h, s/netbsd.h:
324 Move DONT_REOPEN_PTY to configure.
325
20e94fdd
GM
326 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
327 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
328
e99a530f
PE
3292012-07-10 Paul Eggert <eggert@cs.ucla.edu>
330
22ffb973
PE
331 Remove "#define unix" that is no longer needed (Bug#11905).
332 * s/aix4-2.h (unix): Remove; no longer needed.
333
e9a9ae03
PE
334 EMACS_TIME simplification (Bug#11875).
335 This replaces macros (which typically do not work in GDB)
336 with functions, typedefs and enums, making the code easier to debug.
337 The functional style also makes code easier to read and maintain.
338 * systime.h: Include <sys/time.h> on all hosts, not just if
339 WINDOWSNT, since 'struct timeval' is needed in general.
340 (EMACS_TIME): Now a typedef, not a macro.
341 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
342 not macros.
343 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
344 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
345 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
346 (EMACS_TIME_LE): Now functions, not macros.
347 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
348 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
349 which are not functions. All uses rewritten to use:
350 (make_emacs_time): New function.
351 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
352 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
353 not functions. All uses rewritten to use the following, respectively:
354 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
355 (add_emacs_time, sub_emacs_time): New functions.
356 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
357 * fileio.c (Fcopy_file):
358 * xterm.c (XTflash): Get the current time closer to when it's used.
359 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
360
ffacb126
PE
361 * bytecode.c (targets): Suppress -Woverride-init warnings.
362
e99a530f
PE
363 Simplify by avoiding confusing use of strncpy etc.
364 * doc.c (Fsnarf_documentation):
365 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
366 * frame.c (Fmake_terminal_frame):
367 * gtkutil.c (get_utf8_string):
368 * lread.c (openp):
369 * nsmenu.m (ns_update_menubar):
370 * regex.c (regerror):
371 Prefer memcpy to strncpy and strncat when either will do.
372 * fileio.c (Fsubstitute_in_file_name):
373 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
374 (menu_separator_name_p):
375 * nsmenu.m (ns_update_menubar):
376 Prefer memcmp to strncmp when either will do.
377 * nsterm.m: Include <ftoastr.h>.
378 (ns_get_color):
379 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
380 Prefer snprintf to strncpy.
381 * nsterm.m (ns_term_init):
382 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
383 * nsterm.m (ns_term_init):
384 Avoid the need for strncpy, by using build_string or
385 make_unibyte_string directly. Use dtoastr, not snprintf.
386 * process.c (Fmake_network_process): Diagnose service names that
387 are too long, rather than silently truncating them or creating
388 non-null-terminated names.
389 (Fnetwork_interface_info): Likewise, for interface names.
390 * sysdep.c (system_process_attributes) [GNU_LINUX]:
391 Prefer sprintf to strncat.
392 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
393 Prefer vsnprintf to vsprintf + strncpy.
394
c59592b3
GM
3952012-07-10 Glenn Morris <rgm@gnu.org>
396
397 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
398 Clarify fallback case.
399
7d7bbefd
DA
4002012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
401
402 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
403 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
404 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 405 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
406 where argument type is known to be a Lisp_Cons.
407
3a4c8000
TT
4082012-07-10 Tom Tromey <tromey@redhat.com>
409
410 * bytecode.c (BYTE_CODE_THREADED): New macro.
411 (BYTE_CODES): New macro. Replaces all old byte-code defines.
412 (enum byte_code_op): New type.
413 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
414 (exec_byte_code): Use them. Use token threading when applicable.
415
2a0213a6
DA
4162012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
417
418 Optimize pure C strings initialization.
419 * lisp.h (make_pure_string): Fix prototype.
420 (build_pure_c_string): New function, defined as static inline. This
421 provides a better opportunity to optimize away calls to strlen when
422 the function is called with compile-time constant argument.
423 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
424 argument, adjust users accordingly. Use build_pure_c_string where
425 appropriate.
426 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
427 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
428 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
429
cb1caeaf
DA
4302012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
431
432 Avoid calls to strlen in miscellaneous functions.
433 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
434 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
435 * lread.c (openp): Likewise.
436
c293e30c
DA
4372012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
438
439 Avoid calls to strlen in path processing functions.
440 * fileio.c (file_name_as_directory): Add comment. Change to add
441 srclen argument and return the length of result. Adjust users
442 accordingly.
443 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 444 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
445 users accordingly.
446 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
447
9e059e3f
GM
4482012-07-10 Glenn Morris <rgm@gnu.org>
449
d02eb359
GM
450 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
451 Move PENDING_OUTPUT_COUNT definition to configure.
452
882cf227
GM
453 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
454 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
455 * s/gnu.h (DATA_START): Move definitions to configure.
456
af6e839f
GM
457 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
458 We include usg5-4-common.h, which defines them both.
459
40289a12
GM
460 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
461 O_RDONLY already includes it).
462
9e059e3f
GM
463 Stop ns builds setting the EMACSLOADPATH environment variable.
464 * nsterm.m (ns_load_path): Rename from ns_init_paths.
465 Now it does not set EMACSLOADPATH, just returns the load-path string.
466 * nsterm.h: Update accordingly.
467 * lread.c [HAVE_NS]: Include nsterm.h.
468 (init_lread) [HAVE_NS]: Use ns_load_path.
469 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
470
7c4e8ec0
GM
4712012-07-09 Glenn Morris <rgm@gnu.org>
472
d4f600ff
GM
473 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
474 since the included bsd-common.h does so.
475
cbb31951
GM
476 Stop ns builds setting the EMACSPATH environment variable.
477 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
478 (ns_init_paths): Do not set EMACSPATH.
479 * nsterm.h (ns_exec_path): Add it.
480 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
481 Use ns_exec_path.
482
7c4e8ec0
GM
483 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
484
26bccfae
PE
4852012-07-09 Paul Eggert <eggert@cs.ucla.edu>
486
a0bee46f
PE
487 * process.c (wait_reading_process_output): 'waitchannels' was unset
488 when read_kbd || !NILP (wait_for_cell); fix this.
489
5994c183
PE
490 Add GCC-style 'const' attribute to functions that can use it.
491 * character.h (char_resolve_modifier_mask):
492 * keyboard.h (make_ctrl_char):
493 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
494 (init_character_once, next_almost_prime, init_fns, init_image)
495 (flush_pending_output, init_sound):
496 * mem-limits.h (start_of_data):
497 * menu.h (finish_menu_items):
498 Add ATTRIBUTE_CONST.
499 * emacs.c (DEFINE_DUMMY_FUNCTION):
500 Declare the dummy function with ATTRIBUTE_CONST.
501 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
502 Add decls with ATTRIBUTE_CONST.
503
26bccfae
PE
504 Minor improvements to make_formatted_string.
505 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
506 where int is good enough, as vsprintf returns an int.
507 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
508
a8290ec3
DA
5092012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
510
511 Use make_formatted_string to avoid double length calculation.
512 * lisp.h (make_formatted_string): New prototype.
513 * alloc.c (make_formatted_string): New function.
514 * buffer.c (Fgenerate_new_buffer_name): Use it.
515 * dbus.c (syms_of_dbusbind): Likewise.
516 * editfns.c (Fcurrent_time_zone): Likewise.
517 * filelock.c (get_boot_time): Likewise.
518 * frame.c (make_terminal_frame, set_term_frame_name)
519 (x_report_frame_params): Likewise.
520 * image.c (gs_load): Likewise.
521 * minibuf.c (get_minibuffer): Likewise.
522 * msdos.c (dos_set_window_size): Likewise.
523 * process.c (make_process): Likewise.
524 * xdisp.c (ensure_echo_area_buffers): Likewise.
525 * xsettings.c (apply_xft_settings): Likewise.
526
d01ba2f1
GM
5272012-07-09 Glenn Morris <rgm@gnu.org>
528
529 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
530 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
531 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
532 * nsterm.h (ns_etc_directory): Add it.
533 * callproc.c [HAVE_NS]: Include nsterm.h.
534 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
535
f1f924b6
DA
5362012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
537
538 Move marker debugging code under MARKER_DEBUG.
539 * marker.c (MARKER_DEBUG): Move marker debugging code under
540 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
541 for bootstrap with --enable-checking (~3x slowdown reported
542 by Juanma Barranquero <lekktu@gmail.com>).
543 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
544
ab531b66
PE
5452012-07-08 Paul Eggert <eggert@cs.ucla.edu>
546
547 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
548 See <http://bugs.gnu.org/11825#29>.
549
c4b3bc8a
EZ
5502012-07-08 Eli Zaretskii <eliz@gnu.org>
551
552 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
553 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
554 (display_line): Add commentary about displaying truncation glyphs
555 on GUI frames.
556 (produce_special_glyphs): Move here from term.c.
557
558 * term.c (produce_special_glyphs): Move to xdisp.c.
559
560 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
561 section.
c4b3bc8a 562
b676b881
AS
5632012-07-07 Andreas Schwab <schwab@linux-m68k.org>
564
f17c5273
AS
565 * xdisp.c (display_line): Avoid warning about implicit declaration
566 of FRAME_FONT.
567
298819b9
AS
568 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
569
b676b881
AS
570 * lisp.h: Remove empty conditional.
571
6045c4fd
PE
5722012-07-07 Paul Eggert <eggert@cs.ucla.edu>
573
b3350bf9
PE
574 * lread.c (load_path_check): Now static.
575
6045c4fd
PE
576 Fix some minor --with-ns problems found by static checking.
577 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
578 (x_set_font) [!HAVE_X_WINDOWS]:
579 * image.c (xpm_load_image) [HAVE_NS]:
580 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
581 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
582 Remove unused local.
583 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
584 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
585 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
586 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
587 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
588 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
589 Fix pointer signedness problem.
590 * xfaces.c (FRAME_X_FONT_TABLE):
591 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
592
929e7845
GM
5932012-07-07 Glenn Morris <rgm@gnu.org>
594
595 * lread.c (load_path_check): New function, split from init_lread.
596 (init_lread): Reorganize. Motivation:
597 If EMACSLOADPATH is set, check/warn about that rather than the
598 defaults, which we are not going to use. Hence we can remove
599 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
600 Don't warn if site-lisp directories are missing.
601 If not installed, start from a blank load-path, since
602 PATH_LOADSEARCH refers to the eventual installation directories.
603
58dd0aa4
EZ
6042012-07-07 Eli Zaretskii <eliz@gnu.org>
605
606 Support truncation and continuation glyphs on GUI frames, when
607 fringes are disabled. (Bug#11832)
608 * xdisp.c (init_iterator): Get dimensions of truncation and
609 continuation glyphs even if on GUI frames. Adjust
610 it->last_visible_x on GUI frames when the left or right fringes,
611 or both, are absent.
612 (start_display, move_it_in_display_line_to): Handle the case of a
613 GUI frame without a fringe to display continuation or truncation
614 glyphs.
615 (insert_left_trunc_glyphs): Support GUI frames: make sure
616 truncation glyphs overwrite enough glyphs from the current line to
617 have sufficient space in pixels.
618 (display_line): Support truncation and continuation glyphs on GUI
619 frames. If some spare pixels are left on the line after inserting
620 the truncation glyphs, fill that space with a stretch glyph of a
621 suitably computed width.
622
623 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
624 produce_glyphs, to support GUI sessions.
625
31571fd7
PE
6262012-07-07 Paul Eggert <eggert@cs.ucla.edu>
627
5a16b9bc
PE
628 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
629
f3047c75
PE
630 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
631
31571fd7
PE
632 Do not require float-time's arg to fit in time_t (Bug#11825).
633 This works better on hosts where time_t is unsigned, and where
634 float-time is applied to the (negative) difference between two times.
635 * editfns.c (decode_time_components): Last arg is now double *,
636 not int *, and means to store all the result as a double, without
637 worrying about whether the seconds part fits in time_t.
638 All callers changed.
639 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
640 All callers changed.
641 (Ffloat_time): Do not fail merely because the specified time falls
642 outside of time_t range.
643
4516fbef
GM
6442012-07-07 Glenn Morris <rgm@gnu.org>
645
646 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
647 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
648 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
649
07adc2c6
JB
6502012-07-07 Juanma Barranquero <lekktu@gmail.com>
651
652 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
653 Update dependencies.
654
655 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
656
fd573f31
PE
6572012-07-06 Paul Eggert <eggert@cs.ucla.edu>
658
fee5959d
PE
659 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
660 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
661 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
662 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
663 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
664 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
665
fd573f31
PE
666 * xfont.c (compare_font_names): Redo to omit the need for casts.
667
ddadbc0e
AS
6682012-07-06 Andreas Schwab <schwab@linux-m68k.org>
669
fca8d6b6
AS
670 * xfns.c (Fx_change_window_property): Doc fix.
671 * w32fns.c (Fx_change_window_property): Doc fix.
672
ddadbc0e
AS
673 * w32fns.c (Fx_window_property): Accept the same arguments as the
674 X Windows version. Doc fix.
675 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
676
f247498e
JB
6772012-07-06 Juanma Barranquero <lekktu@gmail.com>
678 Eli Zaretskii <eliz@gnu.org>
679
680 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
681 Windows-specific code from nt/config.nt moved here.
682 Obsolete settings removed.
683
216ee680
PE
6842012-07-06 Paul Eggert <eggert@cs.ucla.edu>
685
686 * process.c: Avoid unnecessary calls to gettime.
687 (wait_reading_process_output): Don't get the time of day
688 when gobbling data immediately and not waiting, as there's no need
689 for it in that case. This removes a FIXME.
690
bdd091e4
JD
6912012-07-06 Jan Djärv <jan.h.d@swipnet.se>
692
693 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
694 is defined (Bug#11768).
695
9d44f8ce
DA
6962012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
697
698 Fix marker debugging code.
699 * marker.c (byte_char_debug_check): Do not perform the check
700 if buffer is not multibyte.
090bd7cb
JB
701 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
702 Call byte_char_debug_check with correct arguments.
9d44f8ce 703
90fc4786
DA
7042012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
705
706 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
707 * marker.c (byte_char_debug_check, count_markers):
708 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
709 (byte_debug_flag): Remove.
710 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
711 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
712
7b7ae965
DA
7132012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
714
4e57b342
DA
715 Avoid code repetition in marker-related functions.
716 * marker.c (attach_marker): New function.
717 (Fset_marker, set_marker_restricted, set_marker_both)
718 (set_marker_restricted_both): Use it.
719 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
720 Consistently rename charno to charpos.
721 (marker_position): Add eassert.
722 (marker_byte_position): Convert to eassert.
723
7242012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
725
726 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 727 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 728 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 729
657924ff
DA
7302012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
731
732 Introduce fast path for the widely used marker operation.
733 * alloc.c (build_marker): New function.
734 * lisp.h (build_marker): New prototype.
735 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
736 * composite.c (autocmp_chars): Likewise.
737 * editfns.c (buildmark): Remove.
738 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
739 (save_restriction_save): Use build_marker.
740 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
741 * window.c (save_window_save): Likewise.
742
041a49a6
DA
7432012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
744
745 Do not use Fdelete_overlay in delete_all_overlays
746 to avoid redundant calls to unchain_overlay.
747 * buffer.c (drop_overlay): New function.
748 (delete_all_overlays, Fdelete_overlay): Use it.
749 * minibuf.c (get_minibuffer): Fix comment.
750
7dca65a4
PE
7512012-07-06 Paul Eggert <eggert@cs.ucla.edu>
752
753 Port to OpenBSD 5.1 amd64.
754 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
755 This is needed for OpenBSD, and should be harmless on all BSD systems.
756 Also, include <sys/sysctl.h>, as it should be available on all
757 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
758 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
759 use p_pid member, not kp_proc.pid.
760
8eb876e2
GM
7612012-07-06 Glenn Morris <rgm@gnu.org>
762
763 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
764
38182d90
PE
7652012-07-05 Paul Eggert <eggert@cs.ucla.edu>
766
767 More xmalloc and related cleanup.
768 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
769 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
770 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
771 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
772 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
773 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
774 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
775 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
776 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
777 * xterm.c:
778 Omit needless casts involving void * pointers and allocation.
779 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
780 as the former is more robust if P's type is changed.
781 Prefer xzalloc to xmalloc + memset 0.
782 Simplify malloc-or-realloc to realloc.
783 Don't worry about xmalloc returning a null pointer.
784 Prefer xstrdup to xmalloc + strcpy.
785 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
786 growing it.
787 * keyboard.c (apply_modifiers_uncached): Prefer local array to
788 alloca of a constant.
789
6dd5a677
EZ
7902012-07-05 Eli Zaretskii <eliz@gnu.org>
791
792 * xdisp.c (display_line): Fix horizontal pixel coordinates when
793 hscroll is larger than the line width. Fixes long and futile
794 looping inside extend_face_to_end_of_line (on a TTY) producing
795 glyphs that are not needed and thrown away.
796
6b312f0f
DA
7972012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
798
799 * marker.c (set_marker_restricted_both): Simplify by using
800 clip_to_bounds.
801
f520ef9b
PE
8022012-07-05 Paul Eggert <eggert@cs.ucla.edu>
803
804 * editfns.c (region_limit): Simplify by using clip_to_bounds.
805
383b7c95
JD
8062012-07-05 Jan Djärv <jan.h.d@swipnet.se>
807
808 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
809 not defined (Bug#11768).
810 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
811 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
812 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
813 followed by gtk_box_set_homogeneous (Bug#11768).
814 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
815 (update_theme_scrollbar_width, xg_create_scroll_bar):
816 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
817 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
818 (is_box_type): New function (Bug#11768).
819 (xg_tool_item_stale_p): Call is_box_type.
5293d758 820 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
821 with default display (Bug#11768).
822
d6e7bf45
EZ
8232012-07-05 Eli Zaretskii <eliz@gnu.org>
824
825 * xdisp.c (window_hscroll_limited): New function.
826 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
827 coordinates when window's hscroll is set to insanely large
828 values. (Bug#11857)
829
431391ec
JB
8302012-07-05 Juanma Barranquero <lekktu@gmail.com>
831
832 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
833 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
834
23f86fce
DA
8352012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
836
837 Cleanup xmalloc.
838 * lisp.h (xzalloc): New prototype. Omit needless casts.
839 * alloc.c (xzalloc): New function. Omit needless casts.
840 * charset.c: Omit needless casts. Convert all calls to
841 xmalloc with following memset to xzalloc.
842 * dispnew.c: Likewise.
843 * fringe.c: Likewise.
844 * image.c: Likewise.
845 * sound.c: Likewise.
846 * term.c: Likewise.
847 * w32fns.c: Likewise.
848 * w32font.c: Likewise.
849 * w32term.c: Likewise.
850 * xfaces.c: Likewise.
851 * xfns.c: Likewise.
852 * xterm.c: Likewise.
853 * atimer.c: Omit needless casts.
854 * buffer.c: Likewise.
855 * callproc.c: Likewise.
856 * ccl.c: Likewise.
857 * coding.c: Likewise.
858 * composite.c: Likewise.
859 * doc.c: Likewise.
860 * doprnt.c: Likewise.
861 * editfns.c: Likewise.
862 * emacs.c: Likewise.
863 * eval.c: Likewise.
864 * filelock.c: Likewise.
865 * fns.c: Likewise.
866 * gtkutil.c: Likewise.
867 * keyboard.c: Likewise.
868 * lisp.h: Likewise.
869 * lread.c: Likewise.
870 * minibuf.c: Likewise.
871 * msdos.c: Likewise.
872 * print.c: Likewise.
873 * process.c: Likewise.
874 * region-cache.c: Likewise.
875 * search.c: Likewise.
876 * sysdep.c: Likewise.
877 * termcap.c: Likewise.
878 * terminal.c: Likewise.
879 * tparam.c: Likewise.
880 * w16select.c: Likewise.
881 * w32.c: Likewise.
882 * w32reg.c: Likewise.
883 * w32select.c: Likewise.
884 * w32uniscribe.c: Likewise.
885 * widget.c: Likewise.
886 * xdisp.c: Likewise.
887 * xmenu.c: Likewise.
888 * xrdb.c: Likewise.
889 * xselect.c: Likewise.
890
0497dc44
PE
8912012-07-05 Paul Eggert <eggert@cs.ucla.edu>
892
893 * fileio.c (time_error_value): Check the right error number.
894 Problem reported by Troels Nielsen in
895 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
896
356e7178
PE
8972012-07-04 Paul Eggert <eggert@cs.ucla.edu>
898
4e71fd89
PE
899 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
900 This should be fixed in a better way; see Eli Zaretskii in
901 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
902 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
903
f0941253
PE
904 * fileio.c (time_error_value): Rename from special_mtime.
905 The old name's problems were noted by Eli Zaretskii in
906 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
907
065c9eb4
PE
908 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
909 This variable's comment says Emacs needs at least one GDB-visible
910 symbol of type enum pvec_type, to work around GDB problems.
911 The symbol's value doesn't matter.
912
356e7178
PE
913 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
914 that causes compilation to fail on pre-C99 compilers.
915
95f61aa2
JB
9162012-07-04 Juanma Barranquero <lekktu@gmail.com>
917
918 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
919 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
920
3884d954
DA
9212012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
922
d209e2fb 923 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
924 headers for buffer_defaults and buffer_local_symbols.
925 Reported by Juanma Barranquero <lekktu@gmail.com>.
926
ee28be33
SM
9272012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
928
929 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
930 * lisp.h (enum pvec_type): Use fewer bits.
931 (PSEUDOVECTOR_SIZE_BITS): New constant.
932 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
933 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
934 change in pvec_type.
935 (PSEUDOVECTOR_TYPEP): New macro.
936 (TYPED_PSEUDOVECTORP): Use it.
937 * fns.c (internal_equal): Adapt code to extract pvectype.
938 * emacs.c (gdb_pvec_type): Update type.
939 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
940 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
941 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
942 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
943 (sweep_vectors): Use it. Use local var `total_bytes' instead of
944 abusing vector->header.next.nbytes.
945 (live_vector_p): Use PVEC_TYPE.
946 (mark_object): Adapt code to extract pvectype. Use switch.
947
c7f2cd7f
PE
9482012-07-04 Paul Eggert <eggert@cs.ucla.edu>
949
950 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
951 Tighten new eassert a bit.
952
8ce70ed2
DA
9532012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
954
955 Fix compilation with --enable-gcc-warnings and -O1
956 optimization level.
957 * doprnt.c (doprnt): Change type of tem to int, initialize
958 to avoid compiler warning. Add eassert.
959 * search.c (simple_search): Initialize match_byte to avoid
960 compiler warning. Add eassert.
961
dea7f1e5
PE
9622012-07-04 Paul Eggert <eggert@cs.ucla.edu>
963
24a212eb
PE
964 Avoid weird behavior with large horizontal scrolls.
965 Without this change, for example, large hscroll values would
966 mess up Emacs's display on Fedora 15 x86, presumably due to
967 overflows in int calculations in the display code.
968 Also, if buffers had long lines, Emacs would freeze.
969 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
970 (set_window_hscroll): New function, containing the old guts of
971 Fset_window_hscroll. Return the clipped value.
972 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
973 This avoids the need to check against PTRDIFF_MAX.
974
dea7f1e5
PE
975 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
976
76046526
DA
9772012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
978
979 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
980
39adff0d
PE
9812012-07-04 Paul Eggert <eggert@cs.ucla.edu>
982
63807d47
PE
983 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
984 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
985 since GCC 4.4.6 issues a bogus warning for them.
986
39adff0d
PE
987 Fix bugs in file timestamp newness comparisons.
988 * fileio.c (Ffile_newer_than_file_p):
989 * lread.c (Fload): Use full timestamp resolution of files,
990 not just the 1-second resolution, so that files that are only
991 slightly newer still count as newer.
992 * fileio.c (Ffile_newer_than_file_p): Don't assume file
993 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
994
dbeed9a6
PE
9952012-07-03 Paul Eggert <eggert@cs.ucla.edu>
996
997 * fileio.c: Improve handling of file time marker. (Bug#11852)
998 (special_mtime): New function.
999 (Finsert_file_contents, Fverify_visited_file_modtime):
1000 Use it to set special mtime values consistently.
1001
636334d6
AS
10022012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1003
1004 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1005 marker for non-existing file. (Bug#11852)
1006
e2017fe2
GM
10072012-07-03 Glenn Morris <rgm@gnu.org>
1008
1009 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1010 and did not make it into globals.h).
1011
404dbd37
TT
10122012-07-03 Tom Tromey <tromey@redhat.com>
1013
1014 * window.c (Fset_window_margins, Fset_window_fringes)
1015 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1016 * textprop.c (Fprevious_property_change): No longer static.
1017 * syntax.c (Fsyntax_table_p): No longer static.
1018 * process.c (Fget_process, Fprocess_datagram_address): No longer
1019 static.
1020 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1021 * keyboard.c (Fcommand_execute): No longer static.
1022 Remove EXFUN.
1023 * insdel.c (Fcombine_after_change_execute): No longer static.
1024 * image.c (Finit_image_library): No longer static.
1025 * fileio.c (Fmake_symbolic_link): No longer static.
1026 * eval.c (Ffetch_bytecode): No longer static.
1027 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
1028 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1029 No longer static.
404dbd37
TT
1030 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1031 static.
1032 * dired.c (Ffile_attributes): No longer static.
1033 * composite.c (Fcomposition_get_gstring): No longer static.
1034 * callproc.c (Fgetenv_internal): No longer static.
1035
1036 * ccl.h: Remove EXFUNs.
1037 * buffer.h: Remove EXFUNs.
1038 * dispextern.h: Remove EXFUNs.
1039 * intervals.h: Remove EXFUNs.
1040 * fontset.h: Remove EXFUN.
1041 * font.h: Remove EXFUNs.
1042 * dosfns.c (system_process_attributes): Remove EXFUN.
1043 * keymap.h: Remove EXFUNs.
1044 * lisp.h: Remove EXFUNs.
1045 * w32term.h: Remove EXFUNs.
1046 * window.h: Remove EXFUNs.
1047 * xsettings.h: Remove EXFUN.
1048 * xterm.h: Remove EXFUN.
1049
8e4fd1e1
GM
10502012-07-03 Glenn Morris <rgm@gnu.org>
1051
1052 * lisp.h (Frandom): Make it visible to C.
1053 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
1054 buffer for invisible buffers. (Bug#1229)
1055
ca95b3eb
DA
10562012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1057
1058 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
1059 values which aren't power of 2.
1060 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
1061 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
1062 accordingly.
1063
7555c33f
SM
10642012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
1065
1066 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
1067
1068 * alloc.c (mark_object): Revert part of last patch to use `switch'.
1069
d12e8f5a
DA
10702012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1071
1072 * alloc.c (allocate_vector_block): Remove redundant
1073 calls to mallopt if DOUG_LEA_MALLOC is defined.
1074 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
1075 avoid calls to mallopt if zero_vector is returned.
1076
296094c3
DA
10772012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1078
1079 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
1080 is enabled, avoid dereferencing NULL current_sblock if
1081 running undumped.
1082
36429c89
DA
10832012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1084
1085 Cleanup basic buffer management.
1086 * buffer.h (struct buffer): Change layout to use generic vector
1087 marking code. Fix some comments. Change type of 'clip_changed'
1088 to bitfield. Remove unused #ifndef old.
1089 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
1090 (GET_OVERLAYS_AT): Fix indentation.
1091 (for_each_per_buffer_object_at): New macro.
1092 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
1093 (Fbuffer_local_variables): Use it.
1094 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
1095 * alloc.c (allocate_buffer): Adjust to match new layout of
1096 struct buffer. Fix comment.
1097 (mark_overlay): New function.
1098 (mark_buffer): Use it. Use mark_vectorlike to mark normal
1099 Lisp area of struct buffer.
1100 (mark_object): Use it. Adjust marking of misc objects
1101 and related comments.
1102
3b3e4cac
PE
11032012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1104
1105 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1106 wrapper that is not needed because the wrapped code is a no-op (zero
1107 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1108 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1109
cf5c0175
DA
11102012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1111
1112 * alloc.c (mark_buffer): Simplify. Remove prototype.
1113 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1114 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1115 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1116 redundant calls to mark_vectorlike for bool vectors.
1117
ca26824c
GM
11182012-06-30 Glenn Morris <rgm@gnu.org>
1119
2e4c5312
GM
1120 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1121
ca26824c
GM
1122 * epaths.in (PATH_SITELOADSEARCH): New.
1123 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1124 This is rather than relying on --enable-locallisppath elements
1125 having "site-lisp" in their names. (Bug#10208#25, 11658)
1126
0d23c240
EZ
11272012-06-30 Eli Zaretskii <eliz@gnu.org>
1128
c9240d7a
EZ
1129 * w32proc.c (sys_select): Accept and ignore one more argument.
1130
1131 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1132
0d23c240 1133 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1134 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1135
1136 * sysdep.c: Don't include dos.h and dosfns.h.
1137
1138 * process.c (sys_select):
1139 * msdos.c (sys_select): Accept one more argument and ignore it.
1140
1141 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1142 adapt data types and code to that.
1143
1144 * dosfns.c:
1145 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1146 which clashes with the gnulib function of the same name.
1147
af5a5a98
AS
11482012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1149
c5e4379c
AS
1150 * font.c (font_style_to_value, font_style_symbolic)
1151 (font_prop_validate_style): Add type checks for values in
1152 font_style_table.
1153
af5a5a98
AS
1154 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1155 argument.
1156 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1157 uses.
1158
8d38f461
EZ
11592012-06-29 Eli Zaretskii <eliz@gnu.org>
1160
2e5a6631
EZ
1161 * xdisp.c (try_window_id): Undo last change.
1162
8d38f461
EZ
1163 * w32.c (getwd): Adjust commentary about startup_dir.
1164 (init_environment): Always call sys_access, even in non-MSVC
1165 builds. Don't chdir to the directory of the Emacs executable.
1166 This undoes code from 1997 which was justified by the need to
1167 "avoid conflicts when removing and renaming directories". But its
1168 downside was that every relative file name was being interpreted
1169 relative to the directory of the Emacs executable, which can never
1170 be TRT. In particular, it broke sys_access when called with
1171 relative file names.
1172 (sys_access): Map GetLastError to errno.
1173
2af3565e
DA
11742012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1175
1176 * window.h (struct window): Change type of 'fringes_outside_margins'
1177 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1178 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1179 Adjust comment.
1180 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1181 to ptrdiff_t.
1182
c8d3a25c 11832012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1184
c8d3a25c
GM
1185 * gnutls.c (emacs_gnutls_handshake):
1186 Add QUIT to make the loop interruptible.
57570cd3 1187
c8d3a25c 11882012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1189
c8d3a25c
GM
1190 * charset.c (init_charset): Make lack of etc/charsets fatal.
1191
3e984ee8
DA
11922012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1193
1194 * editfns.c (region_limit): Fix type mismatch.
1195
ef884f23
DA
11962012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1197
1198 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1199 undefined. Convert from xassert to eassert.
1200 * nsmenu.m: Convert from xassert to eassert.
1201 * nsterm.m: Likewise.
1202
7d7e0027
SM
12032012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1204
1205 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1206
aa754e6a
PE
12072012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1208
1209 Avoid integer overflow on scroll-left and scroll-right.
1210 * window.c (HSCROLL_MAX): New macro.
1211 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1212 overflow when requested scroll falls outside ptrdiff_t range.
1213
80b00b08
DA
12142012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1215
1216 * window.h (struct window): Change type of 'hscroll',
1217 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1218 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1219 Adjust users accordingly.
1220 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1221 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1222 from EMACS_INT to ptrdiff_t.
1223 (make_window): Omit redundant initialization.
1224
62b2bcf6
JB
12252012-06-28 Juanma Barranquero <lekktu@gmail.com>
1226
1227 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1228
45942c7d
DA
12292012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1230
1231 * window.h (struct window): Change type of 'use_time' and
1232 'sequence_number' from Lisp_Object to int.
1233 * frame.c (make_frame): Adjust users accordingly.
1234 * print.c (print_object): Likewise.
1235 * window.c (select_window, Fwindow_use_time, make_parent_window)
1236 (make_window): Likewise.
1237
e509cfa6
DA
12382012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1239
1240 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1241 enabled with --enable-checking=[all,glyphs] configure option.
1242 Fix GLYPH_DEBUG usage assuming that it may be undefined,
1243 adjust comments accordingly.
1244 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1245 undefined, adjust comments accordingly.
1246 * image.c: Likewise.
1247 * scroll.c: Likewise.
1248 * w32fns.c: Likewise.
1249 * w32term.c: Likewise.
1250 * xdisp.c: Likewise.
1251 * xfaces.c: Likewise.
1252 * xfns.c: Likewise.
1253 * xterm.c: Likewise.
1254
a54e2c05
DA
12552012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1256
1257 Generalize run-time debugging checks.
1258 * dispextern.h (XASSERTS): Remove.
1259 * fontset.c (xassert): Remove.
1260 Convert from xassert to eassert.
1261 * alloc.c: Convert from xassert to eassert.
1262 * bidi.c: Likewise.
1263 * dispnew.c: Likewise.
1264 * fns.c: Likewise.
1265 * fringe.c: Likewise.
1266 * ftfont.c: Likewise.
1267 * gtkutil.c: Likewise.
1268 * image.c: Likewise.
1269 * keyboard.c: Likewise.
1270 * menu.c: Likewise.
1271 * process.c: Likewise.
1272 * scroll.c: Likewise.
1273 * sound.c: Likewise.
1274 * term.c: Likewise.
1275 * w32console.c: Likewise.
1276 * w32fns.c: Likewise.
1277 * w32term.c: Likewise.
1278 * window.c: Likewise.
1279 * xdisp.c: Likewise.
1280 * xfaces.c: Likewise.
1281 * xfns.c: Likewise.
1282 * xselect.c: Likewise.
1283 * xterm.c: Likewise.
1284
1ec4b7b2
SM
12852012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1286
1287 * fns.c (maybe_resize_hash_table): Output message when growing the
1288 purify-hashtable.
1289
2014308a
DA
12902012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1291
1292 * alloc.c (allocate_string_data): Remove dead code.
1293 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1294 avoid GCC warning about unused macro.
1295
246155eb
DA
12962012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1297
1298 * alloc.c (allocate_string): Omit intervals initialization.
1299 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1300 as in make_pure_string and make_pure_c_string.
1301
43184b7b
DA
13022012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1303
d209e2fb 1304 * alloc.c (allocate_string): Fix last change.
43184b7b 1305
3fe6dd74
DA
13062012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1307
d209e2fb 1308 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1309 to memset, add explicit initialization where appropriate.
1310
1ba6038a
GM
13112012-06-27 Glenn Morris <rgm@gnu.org>
1312
1313 * lisp.mk (lisp): Remove paths.elc.
1314
c89926a5
CY
13152012-06-27 Chong Yidong <cyd@gnu.org>
1316
1317 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1318
ed6b3510
JW
13192012-06-26 John Wiegley <johnw@newartisans.com>
1320
1ec4b7b2 1321 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1322 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1323
ed6b3510
JW
1324 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1325 when building with Clang.
1326
8edd4a2b
SM
13272012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1328
1329 * eval.c (Fapply): Allow calling it with a single argument.
1330
f6f62d1b
EZ
13312012-06-26 Eli Zaretskii <eliz@gnu.org>
1332
1333 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1334 _stricmp and _strnicmp.
1335 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1336
62efea5e
DA
13372012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1338
1339 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1340 allocated window.
1341 (allocate_process): Likewise for new process.
8edd4a2b 1342 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1343 (allocate_frame): Likewise.
1344 * frame.c (make_frame): Omit redundant initialization.
1345 * window.c (make_parent_window): Use memset.
1346 (make_window): Omit redundant initialization.
1347 * process.c (make_process): Omit redundant initialization.
1348 * terminal.c (create_terminal): Likewise.
1349
42997f4d
DA
13502012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1351
1352 * term.c (delete_tty): Remove redundant call to memset.
1353
1130ecfc
DA
13542012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1355
1356 * alloc.c: Remove build_string.
1357 * lisp.h: Define build_string as static inline. This provides
1358 a better opportunity to optimize away calls to strlen when the
1359 function is called with compile-time constant argument.
1360 * image.c (imagemagick_error): Convert to build_string.
1361 * w32proc.c (sys_spawnve): Likewise.
1362 * xterm.c (x_term_init): Likewise.
1363
cf38a720
PE
13642012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1365
99027bdd
PE
1366 Use sprintf return value instead of invoking strlen on result.
1367 In the old days this wasn't portable, since some sprintf
1368 implementations returned char *. But they died out years ago and
1369 Emacs already assumes sprintf returns int.
1370 Similarly for float_to_string.
1371 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1372 * ccl.c (ccl_driver):
1373 * character.c (string_escape_byte8):
1374 * data.c (Fnumber_to_string):
1375 * doprnt.c (doprnt):
1376 * print.c (print_object):
1377 * xdisp.c (message_dolog):
1378 * xfns.c (syms_of_xfns):
1379 Use sprintf or float_to_string result to avoid need to call strlen.
1380 * data.c (Fnumber_to_string):
1381 Use make_unibyte_string, since the string must be ASCII.
1382 * lisp.h, print.c (float_to_string): Now returns int length.
1383 * term.c (produce_glyphless_glyph):
1384 Use sprintf result rather than recomputing it.
1385
cf38a720
PE
1386 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1387 * Makefile.in (ALL_CFLAGS):
1388 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1389 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1390
3511c784
DA
13912012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1392
0a08eb21 1393 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1394 strcasecmp if available.
1395 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1396
fb7da12e
AS
13972012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1398
1399 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1400 Avoid comma operator.
1401 * menu.c (push_submenu_start, push_submenu_end)
1402 (push_left_right_boundary, push_menu_pane): Likewise.
1403 * msdos.c (dos_rawgetc): Likewise.
1404
afa2ffd8
DA
14052012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1406
1407 * xfns.c (xic_create_fontsetname): Remove redundant calls
1408 to memset.
1409
b3b4476b
PE
14102012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1411
4495ff38
PE
1412 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1413 sprintf already null-terminates its output.
1414
b3b4476b
PE
1415 * xfns.c (x_window): Remove redundant cast.
1416
b00876c9
DA
14172012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1418
1419 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1420 `const char *' to `char *' to avoid compiler warning.
1421
d188e26b
PE
14222012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1423
885d1d74
PE
1424 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1425 instead of truncating it to 63 (admittedly a generous limit).
1426
d188e26b
PE
1427 * process.c: Fix spelling and caps in comments.
1428
e2f560b1
DN
14292012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1430
e86db54b 1431 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1432 * sysdep.c (setpgrp): Remove definition, not used in this file.
1433
7583a3a1
JB
14342012-06-24 Juanma Barranquero <lekktu@gmail.com>
1435
1436 * makefile.w32-in: Update dependencies.
1437
696056c2
EZ
14382012-06-24 Eli Zaretskii <eliz@gnu.org>
1439
1440 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1441 (SYSTIME_H): Add nt/inc/sys/time.h.
1442
1443 * systime.h [WINDOWSNT]: Include sys/time.h.
1444
1445 * s/ms-w32.h (struct timespec): Definition moved from
1446 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1447
845ca893
PE
14482012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1449
1450 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1451 * buffer.h (buffer_slot_type_mismatch):
1452 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1453 * eval.c (unwind_to_catch):
1454 * image.c (my_png_error, my_error_exit):
1455 * keyboard.c (quit_throw_to_read_char, user_error)
1456 (Fexit_recursive_edit, Fabort_recursive_edit):
1457 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1458 (wrong_type_argument, buffer_overflow, __executable_start)
1459 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1460 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1461 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1462 (fatal):
1463 (child_setup) [!DOS_NT]:
1464 * lread.c (end_of_file_error, invalid_syntax):
1465 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1466 * puresize.h (pure_write_error):
1467 * search.c (matcher_overflow):
1468 * sound.c (sound_perror, alsa_sound_perror):
1469 * sysdep.c, syssignal.h (croak):
1470 * term.c (maybe_fatal, vfatal):
1471 * textprop.c (text_read_only):
1472 * undo.c (user_error):
1473 * unexmacosx.c (unexec_error):
1474 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1475 Use _Noreturn rather than NO_RETURN.
1476 No need for separate decl merely because of _Noreturn.
1477 * sound.c (sound_warning, parse_sound):
1478 Remove unnecessary forward decls.
1479
f1dd8073
PE
14802012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1481
1482 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1483 * lisp.h (WAIT_READING_MAX): New macro.
1484 * dispnew.c (Fsleep_for, sit_for):
1485 * keyboard.c (kbd_buffer_get_event):
1486 * process.c (Faccept_process_output):
1487 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1488 This improves on the previous patch, which introduced a bug
1489 when time_t is unsigned and as wide as intmax_t.
1490 See <http://bugs.gnu.org/9000#51>.
1491
b82c1755
EZ
14922012-06-23 Eli Zaretskii <eliz@gnu.org>
1493
1494 * dispnew.c (sit_for, Fsleep_for):
1495 * keyboard.c (kbd_buffer_get_event):
1496 * process.c (Faccept_process_output): Avoid compiler warnings when
1497 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1498
ca300656
JB
14992012-06-23 Juanma Barranquero <lekktu@gmail.com>
1500
049ec95b
JB
1501 * makefile.w32-in: Update dependencies.
1502
ca300656
JB
1503 * w32.c (ltime): Add return type and declare static.
1504 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1505
db7b8d06
PE
15062012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1507
1508 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1509 Privately reported by Herbert J. Skuhra.
1510 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1511 All uses changed.
1512 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1513 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1514
0bd8297f
EZ
15152012-06-23 Eli Zaretskii <eliz@gnu.org>
1516
96512555
EZ
1517 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1518 last argument of make_unibyte_string.
1519
0bd8297f
EZ
1520 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1521 language ID in the event parameters.
1522
1523 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1524 event.code, not the obscure "character set ID".
1525
63def6b6
CY
15262012-06-23 Chong Yidong <cyd@gnu.org>
1527
1528 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1529
e8a02204
EZ
15302012-06-23 Eli Zaretskii <eliz@gnu.org>
1531
388cdec0
EZ
1532 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1533 * w32.c (fdutimens): New function.
1534
1535 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1536
1537 * s/ms-w32.h (pselect): Redirect to sys_select.
1538
1539 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1540
e8a02204
EZ
1541 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1542 in the logic of incrementing and decrementing the value of
1543 use_relocatable_buffers.
1544
d054f3fb
PE
15452012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1546
1547 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1548 Privately reported by Herbert J. Skuhra.
1549 [__FreeBSD__]: Remove "*/" typo after "#include".
1550 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1551 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1552 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1553 Don't assume EMACS_TIME and struct timeval are the same type.
1554
d35af63c
PE
15552012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1556
1557 Support higher-resolution time stamps (Bug#9000).
1558 The time stamps are only nanosecond-resolution at the C level,
1559 since that's the best that any real-world system supports now.
1560 But they are picosecond-resolution at the Lisp level, as that's
1561 easy, and leaves room for future OS improvements.
1562
1563 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1564 (LIBES): Use it.
1565
1566 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1567 Don't get current time unless it's needed.
1568
1569 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1570 now provides it if it's absent.
1571 (start_atimer): Port to higher-res time stamps.
1572 Check for time stamp overflow. Don't get current time more
1573 often than is needed.
1574
1575 * buffer.h (struct buffer): Buffer modtime now has high resolution.
1576 Include systime.h, not time.h.
1577 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1578
1579 * dired.c: Include stat-time.h.
1580 (Ffile-attributes): File times now have higher resolution.
1581
1582 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1583 (struct image): Timestamp now has higher resolution.
1584
1585 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1586 has at least microseconds now. All uses removed.
1587 (update_frame, update_single_window, update_window, update_frame_1)
1588 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1589
1590 * editfns.c (time_overflow): Now extern.
1591 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1592 (float-time, Fformat_time_string, Fcurrent_time_string)
1593 (Fcurrent_time_zone): Accept and generate higher-resolution
1594 time stamps.
1595 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1596 (decode_time_components, lisp_seconds_argument): New functions.
1597 (make_time): Now static.
1598 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
1599 Report an error if the time is invalid, rather than having the caller
1600 do that.
1601
1602 * fileio.c: Include <stat-time.h>
1603 (Fcopy_file): Copy higher-resolution time stamps.
1604 Prefer to set the time stamp via a file descriptor if that works.
1605 (Fset_file_times, Finsert_file_contents, Fwrite_region)
1606 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1607 (Fvisited_file_modtime, Fset_visited_file_modtime):
1608 Support higher-resolution time stamps.
1609
1610 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1611
1612 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1613
1614 * image.c (prepare_image_for_display, clear_image_cache)
1615 (lookup_image): Port to higer-resolution time stamps.
1616
1617 * keyboard.c (start_polling, bind_polling_period):
1618 Check for time stamp overflow.
1619 (read_char, kbd_buffer_get_event, timer_start_idle)
1620 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1621 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1622 Port to higher-resolution time stamps. Do not assume time_t is signed.
1623 (decode_timer): New function. Timers are now vectors of length 9,
1624 not 8, to accommodate the picosecond component.
1625 (timer_check_2): Use it.
1626
1627 * nsterm.m (select_timeout, timeval_subtract): Remove.
1628 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1629 as they're a bit more accurate and handle overflow better.
1630 (ns_select): Change prototype to be compatible with pselect.
1631 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1632 * nsterm.h (ns_select): Adjust prototype.
1633
1634 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1635 us-resolution time stamps.
1636 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1637
1638 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1639
1640 * lisp.h (time_overflow): New decl.
1641 (wait_reading_process_output): First arg is now intmax_t, not int,
1642 to accommodate larger waits.
1643
1644 * process.h (struct Lisp_Process.read_output_delay):
1645 Now counts nanoseconds, not microseconds.
1646 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1647 EMACS_HAS_USECS.
1648 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1649 (wait_reading_process_output):
1650 Port to ns-resolution time stamps.
1651 (Faccept_process_output, wait_reading_process_output):
1652 Check for time stamp overflow. Do not assume time_t is signed.
1653 (select_wrapper): Remove; we now use pselect.
1654 (Fprocess_attributes): Now generates ns-resolution time stamps.
1655
1656 * sysdep.c: Include utimens.h. Don't include utime.h
1657 or worry about struct utimbuf; gnulib does that for us now.
1658 (gettimeofday): Remove; gnulib provides a substitute.
1659 (make_timeval): New function.
1660 (set_file_times): Now sets ns-resolution time stamps.
1661 New arg FD; all uses changed.
1662 (time_from_jiffies, ltime_from_jiffies, get_up_time)
1663 (system_process_attributes):
1664 Now returns ns-resolution time stamp. All uses changed.
1665 Check for time stamp overflow.
1666
1667 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1668 provides a substitute now.
1669
1670 * systime.h: Include timespec.h rather than sys/time.h and time.h,
1671 since it guarantees struct timespec.
1672 (EMACS_TIME): Now struct timespec, so that we can support
1673 ns-resolution time stamps.
1674 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1675 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1676 (EMACS_USECS): Remove.
1677 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1678 so multiply the arg by 1000 before storing it.
1679 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1680 New macros.
1681 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1682 Port to ns-resolution time stamps.
1683 (EMACS_TIME_NEG_P): Remove; replaced by....
1684 (EMACS_TIME_SIGN): New macro.
1685 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1686 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1687 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1688 (make_timeval, make_lisp_time, decode_time_components): New decls.
1689 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1690 that it mishandled time_t overflow. You can't compare by subtracting!
1691 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1692 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1693
1694 * term.c: Include <sys/time.h>.
1695 (timeval_to_Time): New function, for proper overflow wraparound.
1696 (term_mouse_position, term_mouse_click): Use it.
1697
1698 * undo.c (record_first_change): Support higher-resolution time stamps
1699 in the undo buffer.
1700 (Fprimitive_undo): Use them when restoring time stamps.
1701
1702 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1703 (w32_get_internal_run_time):
1704 Port to higher-resolution Emacs time stamps.
1705 (ltime): Now accepts single 64-bit integer, as that's more convenient
1706 for callers.
1707
1708 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1709
1710 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1711 for compatibility with pselect. Support ns-resolution time stamps.
1712
1713 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1714
1715 * xselect.c (wait_for_property_change, x_get_foreign_selection):
1716 Check for time stamp overflow, and support ns-resolution time stamps.
1717
1718 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1719 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1720 (timeval_subtract): Remove; no longer needed.
1721 (XTflash, XTring_bell, x_wait_for_event):
1722 Port to ns-resolution time stamps. Don't assume time_t is signed.
1723
b6a92dfe
CY
17242012-06-22 Chong Yidong <cyd@gnu.org>
1725
1726 * xdisp.c (x_consider_frame_title): Revert last change.
1727
d251c37c
EZ
17282012-06-22 Eli Zaretskii <eliz@gnu.org>
1729
1730 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
1731 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1732 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
1733 staticidx goes up to 1597 out of 1600 = 0x640.)
1734
f10deafb
PE
17352012-06-20 Paul Eggert <eggert@cs.ucla.edu>
1736
1737 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1738 Otherwise, the umask might be mistakenly 0 while handling input signals.
1739
ec6de1e2
SM
17402012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
1741
1742 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
1743
28be1ada
DA
17442012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
1745
1746 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
1747 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
1748 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
1749 access to `contents' member of Lisp_Vector objects with AREF and ASET
1750 where appropriate.
1751
c6bf3022
CY
17522012-06-19 Chong Yidong <cyd@gnu.org>
1753
1754 * frame.c (delete_frame): When selecting a frame on a different
1755 text terminal, do not alter the terminal's top-frame.
1756
1757 * xdisp.c (format_mode_line_unwind_data): Record the target
1758 frame's selected window and its terminal's top-frame.
1759 (unwind_format_mode_line): Restore them.
1760 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
1761 Callers changed.
1762 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
1763 since tty frames can be explicitly named.
1764 (prepare_menu_bars): Likewise.
1765
1766 * term.c (Ftty_top_frame): New function.
1767
defd4196
PE
17682012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1769
1770 Port byte-code-meter to modern targets.
1771 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
1772 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 1773 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
1774 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
1775 (METER_1, METER_2): Simplify.
1776
1053a871
SM
17772012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
1778
1779 * data.c (Fdefalias): Return `symbol' (bug#11686).
1780
b7e8d081
MR
17812012-06-18 Martin Rudalics <rudalics@gmx.at>
1782
1783 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
1784 gets killed during executing of this function (Bug#11665).
1785 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
1786 (Vkill_buffer_query_functions): In doc-string say that functions
1787 run by this hook should not change the current buffer.
1788
7ea2b339
PE
17892012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1790
1791 Fix recently-introduced process.c problems found by static checking.
1792 * process.c (write_queue_push, write_queue_pop, send_process):
1793 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
1794 (write_queue_pop): Fix pointer signedness problem.
1795 (send_process): Remove unused local.
1796
96a313a1
CY
17972012-06-17 Chong Yidong <cyd@gnu.org>
1798
1799 * xdisp.c (redisplay_internal): No need to redisplay terminal
1800 frames that are not on top.
1801
20ca2e94
TN
18022012-06-17 Troels Nielsen <bn.troels@gmail.com>
1803
1804 * process.c (make_process): Initialize write_queue.
1805 (write_queue_push, write_queue_pop): New functions.
1806 (send_process): Use them to maintain correct ordering of process
1807 writes (Bug#10815).
1808
9a900ca9
PE
18092012-06-17 Paul Eggert <eggert@cs.ucla.edu>
1810
310fbfa8
PE
1811 * lisp.h (eassert): Assume C89 or later.
1812 This removes the need for CHECK.
1813 (CHECK): Remove. Its comments about always evaluating its
1814 argument were confusing, as 'eassert' typically does not evaluate
1815 its argument.
1816
27bb1ca4
PE
1817 * coding.c (produce_chars): Use ptrdiff_t, not int.
1818
9a900ca9
PE
1819 * xterm.c (x_draw_underwave): Check for integer overflow.
1820 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
1821
41b7f8bc 18222012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
1823
1824 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
1825 referenced (Bug#11583).
1826
9b0e3eba
AA
18272012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
1828
1829 Implement wave-style variant of underlining.
1830 * dispextern.h (face_underline_type): New enum.
1831 (face): Add field for underline type.
1832 * nsterm.m (ns_draw_underwave): New function.
1833 (ns_draw_text_decoration): Use it.
1834 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
1835 New functions.
1836 (x_draw_glyph_string): Use them.
1837 * xfaces.c (Qline, Qwave): New Lisp objects.
1838 (check_lface_attrs, merge_face_ref)
1053a871
SM
1839 (Finternal_set_lisp_face_attribute, realize_x_face):
1840 Handle wave-style underline face attributes.
9b0e3eba
AA
1841 * xterm.c (x_draw_underwave): New function.
1842 (x_draw_glyph_string): Use it.
1843
0fb52f11
JB
18442012-06-16 Juanma Barranquero <lekktu@gmail.com>
1845
1846 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
1847 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
1848 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
1849 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
1850 ($(BLD)/w32select.$(O)): Update dependencies.
1851
e5560ff7
AS
18522012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1853
1854 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
1855 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
1856 * character.c (_fetch_multibyte_char_p): Remove.
1857 * alloc.c: Include "character.h" before "buffer.h".
1858 * bidi.c: Likewise.
1859 * buffer.c: Likewise.
1860 * bytecode.c: Likewise.
1861 * callint.c: Likewise.
1862 * callproc.c: Likewise.
1863 * casefiddle.c: Likewise.
1864 * casetab.c: Likewise.
1865 * category.c: Likewise.
1866 * cmds.c: Likewise.
1867 * coding.c: Likewise.
1868 * composite.c: Likewise.
1869 * dired.c: Likewise.
1870 * dispnew.c: Likewise.
1871 * doc.c: Likewise.
1872 * dosfns.c: Likewise.
1873 * editfns.c: Likewise.
1874 * emacs.c: Likewise.
1875 * fileio.c: Likewise.
1876 * filelock.c: Likewise.
1877 * font.c: Likewise.
1878 * fontset.c: Likewise.
1879 * fringe.c: Likewise.
1880 * indent.c: Likewise.
1881 * insdel.c: Likewise.
1882 * intervals.c: Likewise.
1883 * keyboard.c: Likewise.
1884 * keymap.c: Likewise.
1885 * lread.c: Likewise.
1886 * macros.c: Likewise.
1887 * marker.c: Likewise.
1888 * minibuf.c: Likewise.
1889 * nsfns.m: Likewise.
1890 * nsmenu.m: Likewise.
1891 * print.c: Likewise.
1892 * process.c: Likewise.
1893 * regex.c: Likewise.
1894 * region-cache.c: Likewise.
1895 * search.c: Likewise.
1896 * syntax.c: Likewise.
1897 * term.c: Likewise.
1898 * textprop.c: Likewise.
1899 * undo.c: Likewise.
1900 * unexsol.c: Likewise.
1901 * w16select.c: Likewise.
1902 * w32fns.c: Likewise.
1903 * w32menu.c: Likewise.
1904 * window.c: Likewise.
1905 * xdisp.c: Likewise.
1906 * xfns.c: Likewise.
1907 * xmenu.c: Likewise.
1908 * xml.c: Likewise.
1909 * xselect.c: Likewise.
1910
2f07e6af
EZ
19112012-06-16 Eli Zaretskii <eliz@gnu.org>
1912
1053a871
SM
1913 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
1914 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 1915 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
1916 row.
1917 (handle_face_prop): Use chunk-relative overlay string index when
1918 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
1919 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
1920 the rightmost. (Bug#11720)
2f07e6af 1921
29b83cec
AS
19222012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1923
1924 * category.h (CHAR_HAS_CATEGORY): Define as inline.
1925 (CATEGORY_MEMBER): Enforce 1/0 value.
1926 * category.c (_temp_category_set): Remove.
1927
4c5501e9
EZ
19282012-06-16 Eli Zaretskii <eliz@gnu.org>
1929
1930 * window.c (Fdelete_other_windows_internal)
1931 (Fdelete_window_internal): Don't access frame's mouse highlight
1932 info of the initial frame. (Bug#11677)
1933
2b570124
PE
19342012-06-14 Paul Eggert <eggert@cs.ucla.edu>
1935
e93864f9
PE
1936 * .gdbinit (xgetint): Fix recently-introduced paren typo.
1937 Assume USE_2_TAGS_FOR_INTS.
1938 (xreload): Adjust $tagmask width to match recent lisp.h change.
1939
2b570124
PE
1940 Simplify lisp.h in minor ways that should not affect code.
1941 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
1942 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
1943 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
1944 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
1945 (INTTYPEBITS): New macro, for clarity.
1946 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
1947 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
1948 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
1949 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
1950 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
1951
81755f69
JB
19522012-06-13 Juanma Barranquero <lekktu@gmail.com>
1953
1954 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
1955
16192a57
GM
19562012-06-13 Glenn Morris <rgm@gnu.org>
1957
1958 * s/bsd-common.h (BSD4_3):
1959 * s/usg5-4-common.h (USG5_4): No longer define; unused.
1960
646b5f55
AS
19612012-06-13 Andreas Schwab <schwab@linux-m68k.org>
1962
1963 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
1964 instead of union.
1965 (XLI, XIL): Define.
1053a871
SM
1966 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
1967 Use them.
1968 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 1969 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 1970 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
1971 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
1972 * frame.c (delete_frame): Remove outdated comment.
1973 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
1974 USE_LISP_UNION_TYPE.
1975 (Fw32_unregister_hot_key): Likewise.
1976 (Fw32_toggle_lock_key): Likewise.
1977 * w32menu.c (add_menu_item): Likewise.
1978 (w32_menu_display_help): Use XIL instead of checking
1979 USE_LISP_UNION_TYPE.
1980 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
1981 (init_heap): Likewise.
1982 * w32term.c (w32_read_socket): Update comment.
1983
1d3823c9
GM
19842012-06-13 Glenn Morris <rgm@gnu.org>
1985
c62ff706
GM
1986 * s/usg5-4-common.h, src/s/unixware.h:
1987 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
1988
1d3823c9
GM
1989 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
1990
bfe3e0a2
PE
19912012-06-13 Paul Eggert <eggert@cs.ucla.edu>
1992
1993 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
1994 * alloc.c (make_number) [!defined make_number]:
1995 Remove, as lisp.h always defines this now.
1996 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
1997 (roundup_size): Verify that it is a power of 2.
1998 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
1999 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2000 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2001 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2002 USE_LSB_TAG now is always defined to be either 0 or 1.
2003 All uses changed.
2004 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2005 code works fine either way, and efficiency is not a concern here,
2006 as the union type is for debugging, not for production.
2007 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2008 Use an inline function on all platforms when using the union type,
2009 since this is simpler and 'static inline' can be used portably
2010 within Emacs now.
2011 (LISP_INITIALLY_ZERO): New macro.
2012 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2013 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2014
45fa9c0f
GM
20152012-06-12 Glenn Morris <rgm@gnu.org>
2016
b4492cba
GM
2017 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2018
2019 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 2020
45fa9c0f
GM
2021 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2022 Move BROKEN_SIGIO to configure.
2023
2024 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2025 Move NO_TERMIO to configure.
2026
0e25d334
CY
20272012-06-12 Chong Yidong <cyd@gnu.org>
2028
2029 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2030 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2031 MagickExportImagePixels is undefined.
2032
43682bb6
PE
20332012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2034
2035 * image.c (imagemagick_load_image): Remove unused label.
2036
a9be7d2b
GM
20372012-06-11 Glenn Morris <rgm@gnu.org>
2038
2039 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2040 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2041 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2042 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2043
3017f87f
SM
20442012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2045
2046 * alloc.c (make_byte_code): New function.
2047 (Fmake_byte_code): Use it. Don't purify here.
2048 * lread.c (read1): Use it as well to avoid extra allocation.
2049
1b9b4cf4
CY
20502012-06-11 Chong Yidong <cyd@gnu.org>
2051
2052 * image.c (imagemagick_load_image): Implement transparency.
2053
95988fcf
AS
20542012-06-10 Andreas Schwab <schwab@linux-m68k.org>
2055
2056 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
2057 account for preceding backslashes. (Bug#11663)
2058
cd4eb164
CY
20592012-06-09 Chong Yidong <cyd@gnu.org>
2060
2061 * term.c: Support italics in capable terminals (Bug#9652).
2062 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
2063 (turn_on_face): Output using TS_enter_italic_mode if available.
2064 Don't handle unused blinking and alt-charset cases.
2065 (turn_off_face): Handle italic case; discard unused tty_blinking_p
2066 and tty_alt_charset_p cases.
2067 (tty_capable_p, init_tty): Support italics.
2068
2069 * termchar.h (struct tty_display_info): Add field for italics.
2070 Remove unused blink field.
2071
2072 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
2073 Handle slant.
2074
2075 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
2076 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
2077 tty_alt_charset_p. Add tty_italic_p.
2078
ff88beb8
MA
20792012-06-09 Michael Albinus <michael.albinus@gmx.de>
2080
2081 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
2082 dbus_type_is_basic if available.
2083 (xd_extract_signed, xd_extract_unsigned): Rename from
2084 extract_signed and extract_unsigned, respectively. Adapt callers.
2085
44286096
CY
20862012-06-09 Chong Yidong <cyd@gnu.org>
2087
1682701f
CY
2088 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
2089
44286096
CY
2090 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
2091 case (Bug#9752).
2092
d86feb17
PE
20932012-06-08 Paul Eggert <eggert@cs.ucla.edu>
2094
2095 * xdisp.c (vmessage): Treat frame message as multibyte.
2096 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
2097 would generate the diagnostic "Making \302\247 buffer-local while
2098 let-bound!".
2099
d5c20fe8
EZ
21002012-06-08 Eli Zaretskii <eliz@gnu.org>
2101
2102 * dispnew.c (showing_window_margins_p): Undo last change, which
2103 was done due to an inadvertent commit.
2104 (adjust_frame_glyphs_for_frame_redisplay): Do call
2105 showing_window_margins_p.
2106
513749ee
SM
21072012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2108
2109 * eval.c (Fmake_var_non_special): New primitive.
2110 (syms_of_eval): Defsubr it.
2111 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2112
d4a8f5c1
JB
21132012-06-08 Juanma Barranquero <lekktu@gmail.com>
2114
2115 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2116 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2117
8bbbc977
EZ
21182012-06-08 Eli Zaretskii <eliz@gnu.org>
2119
2120 * alloc.c (allocate_vectorlike): Fix last change.
2121
f3372c87
DA
21222012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2123
2124 Block-based vector allocation of small vectors.
2125 * lisp.h (struct vectorlike_header): New field `nbytes',
2126 adjust comment accordingly.
2127 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2128 to denote vector blocks. Adjust users (live_vector_p,
2129 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2130 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2131 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2132 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2133 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2134 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2135 (roundup_size): New constant.
2136 (struct vector_block): New data type.
2137 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2138 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2139 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2140 (sweep_vectors): New functions.
2141 (allocate_vectorlike): Return `zero_vector' as the only vector of
2142 0 items. Allocate new vector from block if vector size is less than
2143 or equal to VBLOCK_BYTES_MAX.
2144 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2145 (init_alloc_once): Add call to init_vectors.
2146
4f18a4ed
SM
21472012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2148
2149 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2150
86f158bc
PE
21512012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2152
2153 * doprnt.c (doprnt): Truncate multibyte char correctly.
2154 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2155 would mishandle a string argument "Xc" if X was a multibyte
2156 character of length 2: it would truncate after X's first byte
2157 rather than including all of X.
2158
c5cfcbe0
CY
21592012-06-06 Chong Yidong <cyd@gnu.org>
2160
2161 * buffer.c (word_wrap): Doc fix.
2162
c05cf390
PE
21632012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2164
2165 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2166
0c3461de
GM
21672012-06-03 Glenn Morris <rgm@gnu.org>
2168
2169 * xdisp.c (tool-bar-style): Doc fix.
2170
c71232db
UM
21712012-06-03 Ulrich Müller <ulm@gentoo.org>
2172
2173 * Makefile.in (PAXCTL): Define.
2174 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2175 binary via PaX flags if the paxctl utility is available.
2176 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2177 Restore PaX flags to their default. (Bug#11398)
2178
383f7350
CY
21792012-06-03 Chong Yidong <cyd@gnu.org>
2180
2181 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2182 buffer (Bug#11226).
2183
5f2c76c6
CY
21842012-06-03 Chong Yidong <cyd@gnu.org>
2185
2186 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2187 (note_mode_line_or_margin_highlight): If there is no help echo,
2188 use mode-line-default-help-echo. Handle the case where the mouse
2189 position is past the end of the mode line string.
2190
2191 * buffer.c (buffer_local_value_1): New function, split from
2192 Fbuffer_local_value; can return Qunbound.
2193 (Fbuffer_local_value): Use it.
2194 (Vmode_line_format): Docstring tweaks.
2195
773d47f6
PE
21962012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2197
2198 * sysdep.c (system_process_attributes): Improve comment.
2199
f2d6a3df
SM
22002012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2201
2202 * keyboard.c: Export real-this-command to Elisp.
2203 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2204 and DEFVAR it. Update all users.
2205
63810350
PE
22062012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2207
7bd5c1f4
PE
2208 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2209
63810350
PE
2210 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2211 Convert pctcpu and pctmem to Lisp float properly.
2212 Let the compiler fold better, as 100.0/0x8000 is exact.
2213
a2821611
AS
22142012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2215
2216 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2217 cons_block.
2218
5fceba1d
PE
22192012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2220
2221 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2222
c98ff5dd
DA
22232012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2224
2225 For a 'struct window', replace some Lisp_Object fields to
2226 bitfields where appropriate, remove unused fields.
2227 * window.h (struct window): Remove unused 'last_mark_x' and
2228 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2229 change it's type from Lisp_Object to bitfield.
2230 Change type of 'force_start', 'optional_new_start',
2231 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2232 fields from Lisp_Object to bitfield. Adjust users accordingly.
2233
ca34e0be
PE
22342012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2235
2236 Pacify gcc -Wdouble-precision when using Xaw.
2237 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2238 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2239 Use 'float' consistently, rather than 'float' in most places
2240 and 'double' in a couple of places.
2241
efc00ab1 22422012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
2243
2244 * xdisp.c (handle_stop): Detect whether we have overlay strings
2245 loaded by testing it->current.overlay_string_index to be
2246 non-negative, instead of checking whether n_overlay_strings is
2247 positive. (Bug#11587)
2248
efc00ab1 22492012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
2250
2251 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2252
2253 * doc.c (Fsubstitute_command_keys): Doc fix.
2254
efc00ab1 22552012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
2256
2257 * search.c (search_buffer): Remove calls to
2258 r_alloc_inhibit_buffer_relocation, as it is now called by
2259 maybe_unify_char, which was the cause of relocation of buffer text
2260 in bug#11519.
2261
efc00ab1 22622012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
2263
2264 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2265 for the duration of call to load_charset, to avoid problems with
2266 callers of maybe_unify_char that access buffer text through C
2267 pointers.
2268
2269 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2270 decrement the inhibition flag, instead of just setting or
2271 resetting it.
2272
ba93a187
PE
22732012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2274
2275 Remove obsolete '#define static' cruft.
2276 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2277 This #undef was "temporary" in 2000; it is no longer needed
2278 now that '#define static' has gone away.
2279 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2280 (gray_bitmap_bits): Remove; no longer needed.
2281 All uses replaced with definiens.
2282 * xterm.c: Include "bitmaps/gray.xbm".
2283
9e4bf381
PE
22842012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2285
2286 Clean up __executable_start, monstartup when --enable-profiling.
2287 The following changes affect the code only when profiling.
2288 * dispnew.c (__executable_start): Rename from safe_bcopy.
2289 Define only on platforms that need it.
2290 * emacs.c: Include <sys/gmon.h> when profiling.
2291 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2292 (__executable_start): Remove decl, since lisp.h does it now.
2293 (safe_bcopy): Remove decl; no longer has that name.
2294 (main): Coalesce #if into single bit of code, for simplicity.
2295 Cast pointers to uintptr_t, since standard libraries want integers
2296 and not pointers.
2297 * lisp.h (__executable_start): New decl.
2298
32d72c2f
GM
22992012-05-31 Glenn Morris <rgm@gnu.org>
2300
2301 * image.c (Fimagemagick_types): Doc fix.
2302
baac5bc7
JM
23032012-05-30 Jim Meyering <meyering@redhat.com>
2304
2305 * callproc.c (Fcall_process_region): Include directory component
2306 in mkstemp error message (Bug#11586).
2307
72cb32cf
PE
23082012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2309
2310 * alloc.c, lisp.h (make_pure_vector): Now static.
2311
61b108cc
SM
23122012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2313
2314 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2315 Move to byte-run.el.
2316 (Fautoload): Do the hash-doc more carefully.
2317 * data.c (Fdefalias): Purify definition, except for keymaps.
2318 (Qdefun): Move from eval.c.
2319 * lisp.h (Qdefun): Remove.
2320 * lread.c (read1): Tiny simplification.
2321
471fe23d
TN
23222012-05-29 Troels Nielsen <bn.troels@gmail.com>
2323
934f3f58 2324 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2325 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2326 Bug#9642, but explicitly check that the buffer the overlay would
2327 be moved to is live and rearrange lines to make sure that errors
2328 will not put the overlay in an inconsistent state.
2329 (Fdelete_overlay): Cosmetics.
2330
85d0efd1
EZ
23312012-05-28 Eli Zaretskii <eliz@gnu.org>
2332
2333 * w32term.c (my_bring_window_to_top): New function.
2334 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2335 could be different from the original one.
2336 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2337 (Bug#11513)
2338
2339 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2340 by calling BringWindowToTop.
2341
2342 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2343 (WM_EMACS_END): Increase by one.
2344
da92a98c
PE
23452012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2346
2347 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2348 This avoids undefined behavior that might cause the eassert
2349 to not catch an out-of-range value.
2350
74d1f848
JB
23512012-05-28 Juanma Barranquero <lekktu@gmail.com>
2352
2353 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2354 Update dependencies.
2355
9e1a06fc
EZ
23562012-05-27 Eli Zaretskii <eliz@gnu.org>
2357
2358 * bidi.c (bidi_mirror_char): Fix last change.
2359
f3dd7312
AS
23602012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2361
2362 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2363 when referring to sectname field in printf format.
2364
81899c91
PE
23652012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2366
57b81a9f
PE
2367 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2368 Only r_alloc_inhibit_buffer_relocation needed to be added;
2369 the others were already declared.
2370
81899c91
PE
2371 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2372 before checking whether it's out of range. Put the check inside
2373 eassert. See
2374 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2375
33017faf 23762012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2377
2378 * callproc.c (Fcall_process): Restore a line that was accidentally
2379 commented out in the 2011-02-13 change (bug#11547).
2380
33017faf 23812012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2382
2383 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2384 defined on ralloc.c.
2385
2386 * buffer.c [REL_ALLOC]: Remove prototypes of
2387 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2388 they are now on lisp.h.
2389
2390 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2391
2392 * search.c (search_buffer): Use it to inhibit relocation of buffer
2393 text while re_search_2 is doing its job, because re_search_2 is
2394 passed C pointers to buffer text. (Bug#11519)
2395
23415acf
EZ
2396 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2397 Update value to 24.
2398
44e27368
EZ
2399 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2400 state after an additional call to move_it_in_display_line_to, keep
2401 the values of it->max_ascent and it->max_descent found for the
2402 entire line.
2403 (pos_visible_p): Revert the comparison against bottom_y to what it
2404 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2405 (Bug#11464)
2406
c1892f11
PE
24072012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2408
2409 Fix coding-related core dumps with gcc -ftrapv.
2410 The code was computing A - B, where A and B are pointers, and B is
2411 random garbage. This can lead to core dumps on platforms that
2412 have special pointer registers, and it also leads to core dumps on
2413 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2414 A - B only when B is initialized properly.
2415 * coding.c (coding_set_source, coding_set_destination): Return void.
2416 (coding_change_source, coding_change_destinations): New functions,
2417 with the old behaviors of coding_set_source and coding_set_destination.
2418 All callers that need an offset changed to use these new functions.
2419
eb7afdad
GM
24202012-05-26 Glenn Morris <rgm@gnu.org>
2421
2422 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2423
f12fdf02
EZ
24242012-05-26 Eli Zaretskii <eliz@gnu.org>
2425
53a63be6 2426 Extend mouse support on W32 text-mode console.
61b108cc
SM
2427 * xdisp.c (draw_row_with_mouse_face):
2428 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2429
eb3f6f01 2430 * w32console.c: Include window.h.
61b108cc
SM
2431 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2432 New functions.
eb3f6f01
EZ
2433 (initialize_w32_display): Initialize mouse-highlight data.
2434
53a63be6
EZ
2435 * w32inevt.c: Include termchar.h and window.h.
2436 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2437 moves, call note_mouse_highlight. If help_echo changed, call
2438 gen_help_event to produce help-echo message in the echo area.
2439 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2440 highlight info.
2441
4cfd81f6
PE
24422012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2443
2444 * lread.c (read1): Simplify slightly to avoid an overflow warning
2445 with GCC 4.7.0 on x86-64.
2446
4446092a
EZ
24472012-05-26 Eli Zaretskii <eliz@gnu.org>
2448
2449 * bidi.c (bidi_mirror_char): Revert last change: an int is
2450 definitely wide enough here.
2451
42b2a986 24522012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2453
42b2a986 2454 Fix integer width and related bugs (Bug#9874).
eb106a49 2455 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2456 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2457 (string_bytes, check_sblock, allocate_string_data):
2458 (compact_small_strings, Fmake_bool_vector, make_string)
2459 (make_unibyte_string, make_multibyte_string)
2460 (make_string_from_bytes, make_specified_string)
2461 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2462 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2463 (mark_vectorlike):
2464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2465 (allocate_pseudovector):
2466 Use int, not EMACS_INT, where int is wide enough.
2467 (inhibit_garbage_collection, Fgarbage_collect):
2468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2469 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2470 int might not be wide enough.
2471 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2472 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2473 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2474 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2475 (bidi_level_of_next_char, bidi_move_to_visually_next):
2476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2477 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2478 (Fkill_buffer, Fset_buffer_major_mode)
2479 (advance_to_char_boundary, Fbuffer_swap_text)
2480 (Fset_buffer_multibyte, overlays_at, overlays_in)
2481 (overlay_touches_p, struct sortvec, record_overlay_string)
2482 (overlay_strings, recenter_overlay_lists)
2483 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2484 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2485 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2486 (Foverlay_recenter, last_overlay_modification_hooks_used)
2487 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2489 (validate_region): Omit unnecessary test for b <= e,
2490 since that's guaranteed by the previous test.
d311d28c
PE
2491 (adjust_overlays_for_delete): Avoid pos + length overflow.
2492 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2493 (report_overlay_modification):
2494 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2495 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2496 Omit pointer cast, which isn't needed anyway, and doesn't work
2497 after the EMACS_INT -> ptrdiff_t change.
02481186 2498 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2499 * buffer.h: Adjust decls to match defn changes elsewhere.
2500 (struct buffer_text, struct buffer):
2501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2502 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2503 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2504 not int, to avoid needless 32-bit limit on 64-bit hosts.
2505 (exec_byte_code): Use tighter memory-full test, one that checks
2506 for alloca overflow. Don't compute the address of the object just
2507 before an array, as that's not portable. Use EMACS_INT, not
2508 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2509 * callint.c (Fcall_interactively):
2510 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2511 * callproc.c (call_process_kill, Fcall_process):
2512 Don't assume pid_t fits into an Emacs fixnum.
2513 (call_process_cleanup, Fcall_process, child_setup):
2514 Don't assume pid_t fits into int.
2515 (call_process_cleanup, Fcall_process, delete_temp_file)
2516 (Fcall_process_region):
2517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2518 (Fcall_process): Simplify handling of volatile integers.
2519 Use int, not EMACS_INT, where int will do.
2520 * casefiddle.c (casify_object, casify_region, operate_on_word)
2521 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2523 (casify_object): Avoid integer overflow when overallocating buffer.
2524 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2525 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2526 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2527 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2528 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2529 integers are now checked earlier. All uses replaced with XINT.
2530 (ccl_driver):
2531 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2532 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2533 (ccl_driver, Fregister_code_conversion_map):
2534 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2535 (resolve_symbol_ccl_program): Check that vector header is in range.
2536 Always copy the vector, so that we can check its contents reliably
2537 now rather than having to recheck each instruction as it's being
2538 executed. Check that vector words fit in 'int'.
2539 (ccl_get_compiled_code, Fregister_ccl_program)
2540 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2541 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2542 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2543 contents are in range.
2544 (Fccl_execute_on_string): Check that status is in range.
2545 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2546 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2547 Accept and return EMACS_INT, not int, because callers can pass values
2548 out of 'int' range.
2549 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2550 (multibyte_chars_in_text, parse_str_as_multibyte)
2551 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2552 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2553 (string_escape_byte8, Fget_byte):
2554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2555 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2556 avoid mishandling large integers.
2557 * character.h: Adjust decls to match defn changes elsewhere.
2558 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2559 (Ffind_charset_region):
2560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2561 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2562 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2563 Don't assume fixnum fits in int.
d311d28c
PE
2564 (load_charset_map_from_vector, Fmap_charset_chars):
2565 Remove now-unnecessary CHECK_NATNUMs.
2566 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2567 Don't rely on undefined behavior with signed left shift overflow.
2568 Don't assume unsigned int fits into fixnum, or that fixnum fits
2569 into unsigned int. Don't require max_code to be a valid fixnum;
2570 that's not true for gb10830 4-byte on a 32-bit host. Allow
2571 invalid_code to be a cons, for the same reason. Require code_offset
2572 to be a character. Avoid int overflow if max_char is close
2573 to INT_MAX.
2574 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2575 this is intended anyway and avoids some undefined behavior.
2576 (load_charset_map): Pass unsigned, not int, as 2nd arg of
2577 INDEX_TO_CODE_POINT, as that's what it expects.
2578 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
2579 * charset.h (DECODE_CHAR): Return int, not unsigned;
2580 this is what was intended anyway, and it avoids undefined behavior.
2581 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2582 integer-overflow issues.
2583 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2584 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2585 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
2586 * chartab.c (Fmake_char_table, Fset_char_table_range)
2587 (uniprop_get_decoder, uniprop_get_encoder):
2588 Don't assume fixnum fits in int.
2589 * cmds.c (move_point): New function, that does the gist of
2590 Fforward_char and Fbackward_char, but does so while checking
2591 for integer overflow more accurately.
c96e5d6a 2592 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
2593 (Fforward_line, Fend_of_line, internal_self_insert)
2594 (internal_self_insert):
2595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2596 Fix a FIXME, by checking for integer overflow when calculating
2597 target_clm and actual_clm.
2598 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 2599 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
2600 (ASSURE_DESTINATION, coding_alloc_by_realloc)
2601 (coding_alloc_by_making_gap, alloc_destination)
2602 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2603 (encode_coding_utf_16, detect_coding_emacs_mule)
2604 (decode_coding_emacs_mule, encode_coding_emacs_mule)
2605 (detect_coding_iso_2022, decode_coding_iso_2022)
2606 (encode_invocation_designation, encode_designation_at_bol)
2607 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2608 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2609 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2610 (encode_coding_ccl, encode_coding_raw_text)
2611 (detect_coding_charset, decode_coding_charset)
2612 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2613 (produce_composition, produce_charset, produce_annotation)
2614 (decode_coding, handle_composition_annotation)
2615 (handle_charset_annotation, consume_chars, decode_coding_gap)
2616 (decode_coding_object, encode_coding_object, detect_coding_system)
2617 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2618 (code_convert_region, code_convert_string)
8f50130c
PE
2619 (Fdefine_coding_system_internal)
2620 (coding_set_source, coding_set_destination):
d311d28c
PE
2621 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2622 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2623 (Fdefine_coding_system_internal):
2624 Don't assume fixnums fit in int.
2625 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 2626 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
2627 (Funencodable_char_position, Fcheck_coding_systems_region)
2628 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 2629 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 2630 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 2631 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 2632 Don't access memory outside of the args array.
d311d28c 2633 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
2634 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2635 result of ENCODE_CHAR.
d311d28c
PE
2636 * coding.h: Adjust decls to match defn changes elsewhere.
2637 (struct coding_system):
2638 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2639 * composite.c (get_composition_id, find_composition)
2640 (run_composition_function, update_compositions)
2641 (compose_text, composition_gstring_put_cache)
2642 (composition_gstring_p, composition_gstring_width)
2643 (fill_gstring_header, fill_gstring_body, autocmp_chars)
2644 (composition_compute_stop_pos, composition_reseat_it)
2645 (composition_update_it, struct position_record)
2646 (find_automatic_composition, composition_adjust_point)
2647 (Fcomposition_get_gstring, Ffind_composition_internal):
2648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2649 (update_compositions):
2650 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2651 * composite.h: Adjust decls to match defn changes elsewhere.
2652 (struct composition):
2653 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2654 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2655 Do not attempt to compute the address of the object just before a
2656 buffer; this is not portable.
2657 (Faref, Faset):
2658 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2659 (Faset): Use int, not EMACS_INT, where int is wide enough.
2660 (Fstring_to_number): Don't assume fixnums fit in int.
2661 (Frem): Don't assume arg is nonnegative.
2662 * dbusbind.c (xd_append_arg): Check for integers out of range.
2663 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 2664 (extract_signed, extract_unsigned): New functions.
243e0530
PE
2665 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2666 (xd_get_connection_references): Return ptrdiff_t, not int.
2667 All uses changed.
2668 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2669 (xd_read_message_1):
2670 Use int, not unsigned, where the dbus API uses int.
2671 (Fdbus_message_internal): Don't overflow mtype.
2672 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
2673 * dired.c (directory_files_internal, file_name_completion, scmp)
2674 (file_name_completion_stat):
2675 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2676 (file_name_completion): Don't overflow matchcount.
2677 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2678 * dispextern.h: Adjust decls to match defn changes elsewhere.
2679 (struct text_pos, struct glyph, struct bidi_saved_info)
2680 (struct bidi_string_data, struct bidi_it, struct composition_it)
2681 (struct it):
2682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2683 (struct display_pos, struct composition_it, struct it):
2684 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2685 * dispnew.c (increment_matrix_positions)
2686 (increment_row_positions, mode_line_string)
2687 (marginal_area_string):
2688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 2689 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
2690 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2691 (duration_to_sec_usec): New function, to check for overflow better.
2692 (Fsleep_for, sit_for): Use it.
2693 * doc.c (get_doc_string, store_function_docstring):
2694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2695 (get_doc_string, Fsnarf_documentation):
2696 Use int, not EMACS_INT, where int is wide enough.
2697 (get_doc_string):
2698 Use SAFE_ALLOCA, not alloca.
2699 Check for overflow when converting EMACS_INT to off_t.
2700 * doprnt.c (doprnt):
2701 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2702 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2703 Don't assume uid_t fits into fixnum.
2704 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2705 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2706 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2707 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2708 (general_insert_function)
2709 (Finsert_char, make_buffer_string, make_buffer_string_both)
2710 (update_buffer_properties, Fbuffer_substring)
2711 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2712 (Fsubst_char_in_region, check_translation)
2713 (Ftranslate_region_internal, save_restriction_restore, Fformat)
2714 (transpose_markers, Ftranspose_regions):
2715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2716 (clip_to_bounds): Move to lisp.h as an inline function).
2717 (Fconstrain_to_field): Don't assume integers are nonnegative.
2718 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2719 (Fsubst_char_in_region, Fsave_restriction):
2720 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2721 (Femacs_pid): Don't assume pid_t fits into fixnum.
2722 (lo_time): Use int, not EMACS_INT, when int suffices.
2723 (lisp_time_argument): Check for usec out of range.
2724 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
2725 (Fuser_login_name, Fuser_full_name): Signal an error
2726 if a uid argument is out of range, rather than relying on
2727 undefined behavior.
c8d5c857
PE
2728 (Fformat_time_string): Remove now-unnecessary check.
2729 lisp_time_argument checks for out-of-range usec now.
243e0530 2730 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
2731 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2732 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2733 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2734 (init_cmdargs, Fdump_emacs):
2735 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2736 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2737 the bottom (typically) 32 bits of the fixnum.
2738 * eval.c (specpdl_size, call_debugger):
2739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2740 (when_entered_debugger, Fbacktrace_debug):
2741 Don't assume fixnum can fit in int.
2742 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
2743 the object just before a buffer; this is not portable.
2744 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
2745 (grow_specpdl, unbind_to):
2746 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2747 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
2748 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 2749 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
2750 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2751 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2753 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2754 (a_write, e_write):
2755 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2756 (Fcopy_file, non_regular_nbytes, read_non_regular)
2757 (Finsert_file_contents):
2758 Use int, not EMACS_INT, where int is wide enough.
2759 (READ_BUF_SIZE): Verify that it fits in int.
2760 (Finsert_file_contents): Check that counts are in proper range,
2761 rather than assuming fixnums fit into ptrdiff_t etc.
2762 Don't assume fixnums fit into int.
125b3835 2763 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
2764 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
2765 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
2766 (string_char_to_byte, string_byte_to_char)
2767 (string_make_multibyte, string_to_multibyte)
2768 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
2769 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
2770 (substring_both, Fdelete, internal_equal, Ffillarray)
2771 (Fclear_string, mapcar1)
2772 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
2773 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
2774 (larger_vector, make_hash_table, maybe_resize_hash_table)
2775 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
2776 (Fmaphash, secure_hash):
2777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2778 (concat): Check for string index and length overflow.
2779 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
2780 (Frequire):
2781 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2782 (larger_vector): New API (vec, incr_min, size_max) replaces old
2783 one (vec, new_size, init). This catches size overflow.
2784 INIT was removed because it was always Qnil.
2785 All callers changed.
2786 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
2787 the upper bound on a hash table index size.
2788 (make_hash_table, maybe_resize_hash_table): Use it.
2789 (secure_hash): Computer start_byte and end_byte only after
2790 they're known to be in ptrdiff_t range.
2791 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
2792 (Ffont_get_glyphs, Ffont_at):
2793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2794 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
2795 (Flist_fonts, Fopen_font):
2796 Don't assume fixnum can fit in int.
2797 (check_gstring): Don't assume index can fit in int.
2798 (font_match_p): Check that fixnum is a character, not a nonnegative
2799 fixnum, since the later code needs to stuff it into an int.
2800 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
2801 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
2802 conversion overflow issues.
2803 (Fopen_font): Check for integer out of range.
2804 (Ffont_get_glyphs): Don't assume index can fit in int.
2805 * font.h: Adjust decls to match defn changes elsewhere.
2806 * fontset.c (reorder_font_vector): Redo score calculation to avoid
2807 integer overflow.
2808 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
2809 printmax_t, where ptrdiff_t is wide enough.
2810 (Finternal_char_font):
2811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2812 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
2813 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
2814 (Fset_frame_position, x_set_frame_parameters)
2815 (x_set_line_spacing, x_set_border_width)
2816 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
2817 Check that fixnums are in proper range for system types.
2818 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
2819 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2820 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
2821 Use SAFE_ALLOCA_LISP, not alloca.
2822 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
2823 intptr_t is wide enough.
2824 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
2825 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
2826 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
2827 Check for fixnum out of range.
2828 * ftfont.c (ftfont_list): Don't assume index fits in int.
2829 Check that fixnums are in proper range for system types.
2830 (ftfont_shape_by_flt):
2831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
2832 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2834 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
2835 Check that fixnums are in proper range for system types.
2836 * gnutls.h: Adjust decls to match defn changes elsewhere.
2837 * gtkutil.c (xg_dialog_run):
2838 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2839 (update_frame_tool_bar):
2840 Check that fixnums are in proper range for system types.
2841 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 2842 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
2843 * indent.c (last_known_column, last_known_column_point):
2844 (current_column_bol_cache):
2845 (skip_invisible, current_column, check_display_width):
2846 (check_display_width, scan_for_column, current_column_1)
2847 (Findent_to, Fcurrent_indentation, position_indentation)
2848 (indented_beyond_p, Fmove_to_column, compute_motion):
2849 (Fcompute_motion, Fvertical_motion):
2850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2851 (last_known_column_modified): Use EMACS_INT, not int.
2852 (check_display_width):
2853 (Fcompute_motion):
2854 Check that fixnums and floats are in proper range for system types.
2855 (compute_motion): Don't assume index or fixnum fits in int.
2856 (compute_motion, Fcompute_motion):
2857 Use int, not EMACS_INT, when it is wide enough.
2858 (vmotion): Omit local var start_hpos that is always 0; that way
2859 we don't need to worry about overflow in expressions involving it.
2860 * indent.h: Adjust decls to match defn changes elsewhere.
2861 (struct position):
2862 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2863 Use int, not EMACS_INT, where int is wide enough.
2864 Remove unused members ovstring_chars_done and tab_offset;
2865 all uses removed.
2866 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
2867 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
2868 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
2869 (make_gap, copy_text, insert, insert_and_inherit)
2870 (insert_before_markers, insert_before_markers_and_inherit)
2871 (insert_1, count_combining_before, count_combining_after)
2872 (insert_1_both, insert_from_string)
2873 (insert_from_string_before_markers, insert_from_string_1)
2874 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
2875 (adjust_after_replace, adjust_after_insert, replace_range)
2876 (replace_range_2, del_range, del_range_1, del_range_byte)
2877 (del_range_both, del_range_2, modify_region)
2878 (prepare_to_modify_buffer, signal_before_change)
2879 (signal_after_change, Fcombine_after_change_execute):
2880 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2881 * intervals.c (traverse_intervals, rotate_right, rotate_left)
2882 (balance_an_interval, split_interval_right, split_interval_left)
2883 (find_interval, next_interval, update_interval)
2884 (adjust_intervals_for_insertion, delete_node, delete_interval)
2885 (interval_deletion_adjustment, adjust_intervals_for_deletion)
2886 (static_offset_intervals, offset_intervals)
2887 (merge_interval_right, merge_interval_left, make_new_interval)
2888 (graft_intervals_into_buffer, temp_set_point_both)
2889 (temp_set_point, set_point, adjust_for_invis_intang)
2890 (set_point_both, move_if_not_intangible, get_property_and_range)
2891 (get_local_map, copy_intervals, copy_intervals_to_string)
2892 (compare_string_intervals, set_intervals_multibyte_1):
2893 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2894 * intervals.h: Adjust decls to match defn changes elsewhere.
2895 (struct interval):
2896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2897 * keyboard.c (this_command_key_count, this_single_command_key_start)
2898 (before_command_key_count, before_command_echo_length, echo_now)
2899 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
2900 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
2901 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
2902 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
2903 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2904 (last_non_minibuf_size, last_point_position, echo_truncate)
2905 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
2906 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
2907 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
2908 (stuff_buffered_input):
2909 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2910 (last_auto_save, command_loop_1, read_char):
2911 Use EMACS_INT, not int, to avoid integer overflow.
2912 (record_char): Avoid overflow in total_keys computation.
2913 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
2914 * keyboard.h: Adjust decls to match defn changes elsewhere.
2915 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
2916 (Fkey_description, Fdescribe_vector, Flookup_key):
2917 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2918 (click_position): New function, to check that positions are in range.
2919 (Fcurrent_active_maps):
2920 (describe_command):
2921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2922 (Faccessible_keymaps, Fkey_description):
2923 (preferred_sequence_p):
2924 Don't assume fixnum can fit into int.
2925 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
2926 Check for integer overflow in size calculations.
2927 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
2928 avoid mishandling large integers.
2929 * lisp.h: Adjust decls to match defn changes elsewhere.
2930 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
2931 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
2932 (struct Lisp_Marker):
2933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2934 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
2935 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
2936 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
2937 All callers changed.
2938 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
2939 Assume the arg has valid form, since it always does.
2940 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
2941 unsigned integer system type.
2942 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
2943 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
2944 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2945 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
2946 (duration_to_sec_usec): New decl.
2947 * lread.c (read_from_string_index, read_from_string_index_byte)
2948 (read_from_string_limit, readchar, unreadchar, openp)
2949 (read_internal_start, read1, oblookup):
2950 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2951 (Fload, readevalloop, Feval_buffer, Feval_region):
2952 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2953 (openp): Check for out-of-range argument to 'access'.
2954 (read1): Use int, not EMACS_INT, where int is wide enough.
2955 Don't assume fixnum fits into int.
6efdadfd 2956 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
2957 (read_filtered_event): Use duration_to_sec_usec
2958 to do proper overflow checking on durations.
d311d28c
PE
2959 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
2960 in size calculation.
2961 (Fexecute_kbd_macro):
2962 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2963 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
2964 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
2965 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
2966 (set_marker_both, set_marker_restricted_both, marker_position)
2967 (marker_byte_position, Fbuffer_has_markers_at):
2968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2969 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 2970 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
2971 It now merely ensures that the menu is large enough, without
2972 necessarily growing it, as this avoids some integer overflow issues.
2973 All callers changed.
2974 (keymap_panes, parse_single_submenu, Fx_popup_menu):
2975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2976 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
2977 Use SAFE_ALLOCA_LISP, not alloca.
2978 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
2979 to EMACS_INT. Check that fixnums are in proper range for system types.
2980 * minibuf.c (minibuf_prompt_width, string_to_object)
2981 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
2982 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
2983 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2984 (get_minibuffer, read_minibuf_unwind):
2985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2986 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
2987 this simplifies overflow checking. All callers changed.
2988 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
2989 (Ftest_completion):
2990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2991 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
2992 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
2993 Check that fixnums are in proper range for system types.
2994 (Fx_create_frame, Fx_show_tip):
2995 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2996 * nsfont.m (ns_findfonts, nsfont_list_family):
2997 Don't assume fixnum fits in long.
2998 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
2999 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3000 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3001 wide enough.
17fdb222 3002 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
3003 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3004 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3005 (PRINTDECLARE, PRINTPREPARE):
3006 (strout, print_string):
3007 (print, print_preprocess, print_check_string_charset_prop)
3008 (print_object):
3009 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3010 (PRINTDECLARE):
3011 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3012 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3013 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 3014 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 3015 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
3016 (print_error_message): Use SAFE_ALLOCA, not alloca.
3017 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
3018 (print_depth, new_backquote_output, print_number_index):
3019 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
3020 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3021 (Fset_process_window_size, Fformat_network_address)
3022 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 3023 (sigchld_handler):
d311d28c 3024 Check that fixnums are in proper range for system types.
d44287d4 3025 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
3026 Check for process-ids out of pid_t range rather than relying on
3027 undefined behavior.
e4d81efc 3028 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
3029 (Fformat_network_address, read_process_output, send_process)
3030 (Fprocess_send_region, status_notify):
3031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3032 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3033 (wait_reading_process_output, read_process_output, exec_sentinel):
3034 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3035 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3036 (Faccept_process_output): Use duration_to_sec_usec to do proper
3037 overflow checking on durations.
dde14581
PE
3038 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3039 Don't assume pid_t fits in int.
02481186
PE
3040 * process.h (struct Lisp_Process): Members tick and update_tick
3041 are now of type EMACS_INT, not int.
b62b53e8
PE
3042 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3043 configured --with-wide-int.
d311d28c
PE
3044 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3045 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3046 * search.c (looking_at_1, string_match_1):
3047 (fast_string_match, fast_c_string_match_ignore_case)
3048 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3049 (scan_newline, find_before_next_newline, search_command)
3050 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
3051 (set_search_regs, wordify):
3052 (Freplace_match):
3053 (Fmatch_data):
3054 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3055 (string_match_1, search_buffer, set_search_regs):
3056 (Fmatch_data):
3057 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3058 (wordify): Check for overflow in size calculation.
3059 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
3060 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
3061 Check that fixnums are in proper range for system types.
3062 * sound.c (struct sound_device)
3063 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
3064 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3065 (Fplay_sound_internal):
3066 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 3067 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
3068 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
3069 (Fparse_partial_sexp):
3070 Don't assume fixnums can fit in int.
3071 (struct lisp_parse_state, find_start_pos, find_start_value)
3072 (find_start_value_byte, find_start_begv)
3073 (update_syntax_table, char_quoted, dec_bytepos)
3074 (find_defun_start, prev_char_comend_first, back_comment):
3075 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
3076 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
3077 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3078 (Finternal_describe_syntax_value): Check that match_lisp is a
3079 character, not an integer, since the code stuffs it into int.
3080 (scan_words, scan_sexps_forward):
3081 Check that fixnums are in proper range for system types.
3082 (Fforward_word):
3083 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3084 (scan_sexps_forward):
3085 Use CHARACTERP, not INTEGERP, since the value must fit into int.
3086 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
3087 * syntax.h: Adjust decls to match defn changes elsewhere.
3088 (struct gl_state_s):
3089 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
3090 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
3091 MOST_POSITIVE_FIXNUM.
d311d28c
PE
3092 * sysdep.c (wait_for_termination_1, wait_for_termination)
3093 (interruptible_wait_for_termination, mkdir):
3094 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
3095 (emacs_read, emacs_write):
3096 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
3097 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
3098 and double all fit in int.
d311d28c
PE
3099 * term.c (set_tty_color_mode):
3100 Check that fixnums are in proper range for system types.
3101 * termhooks.h (struct input_event):
3102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3103 * textprop.c (validate_interval_range, interval_of)
3104 (Fadd_text_properties, set_text_properties_1)
3105 (Fremove_text_properties, Fremove_list_of_text_properties)
3106 (Ftext_property_any, Ftext_property_not_all)
3107 (copy_text_properties, text_property_list, extend_property_ranges)
3108 (verify_interval_modification):
3109 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3110 (Fnext_single_char_property_change)
3111 (Fprevious_single_char_property_change):
3112 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3113 (copy_text_properties):
3114 Check for integer overflow in index calculation.
d311d28c
PE
3115 * undo.c (last_boundary_position, record_point, record_insert)
3116 (record_delete, record_marker_adjustment, record_change)
3117 (record_property_change):
3118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3119 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3120 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3121 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3122 (Fx_hide_tip, Fx_file_dialog):
3123 * w32menu.c (set_frame_menubar):
3124 Use ptrdiff_t, not int, for consistency with rest of code.
3125 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3126 (select_window, Fdelete_other_windows_internal)
3127 (window_scroll_pixel_based, window_scroll_line_based)
3128 (Frecenter, Fset_window_configuration):
3129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3130 (Fset_window_hscroll, run_window_configuration_change_hook)
3131 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3132 (Fscroll_other_window, Frecenter):
d311d28c
PE
3133 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3134 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3135 Don't assume fixnum fits in int.
3136 (Fset_window_scroll_bars):
3137 Check that fixnums are in proper range for system types.
3138 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3139 (string_pos, c_string_pos, number_of_chars, init_iterator)
3140 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3141 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3142 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3143 (face_before_or_after_it_pos, handle_invisible_prop)
3144 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3145 (display_prop_intangible_p, string_buffer_position_lim)
3146 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3147 (get_overlay_strings_1, get_overlay_strings)
3148 (iterate_out_of_display_property, forward_to_next_line_start)
3149 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3150 (get_next_display_element, set_iterator_to_next)
3151 (get_visually_first_element, compute_stop_pos_backwards)
3152 (handle_stop_backwards, next_element_from_buffer)
3153 (move_it_in_display_line_to, move_it_in_display_line)
3154 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3155 (add_to_log, message_dolog, message_log_check_duplicate)
3156 (message2, message2_nolog, message3, message3_nolog
3157 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3158 (current_message_1, truncate_echo_area, truncate_message_1)
3159 (set_message, set_message_1, store_mode_line_noprop)
3160 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3161 (text_outside_line_unchanged_p, check_point_in_composition)
3162 (reconsider_clip_changes)
3163 (redisplay_internal, set_cursor_from_row, try_scrolling)
3164 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3165 (redisplay_window, find_last_unchanged_at_beg_row)
3166 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3167 (trailing_whitespace_p, find_row_edges, display_line)
3168 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3169 (display_mode_element, store_mode_line_string)
3170 (pint2str, pint2hrstr, decode_mode_spec)
3171 (display_count_lines, display_string, draw_glyphs)
3172 (x_produce_glyphs, x_insert_glyphs)
3173 (rows_from_pos_range, mouse_face_from_buffer_pos)
3174 (fast_find_string_pos, mouse_face_from_string_pos)
3175 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3176 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3177 (safe_call, init_from_display_pos, handle_fontified_prop)
3178 (handle_single_display_spec, load_overlay_strings)
3179 (with_echo_area_buffer, setup_echo_area_for_printing)
3180 (display_echo_area, echo_area_display)
3181 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3182 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3183 (redisplay_window, dump_glyph_row, display_mode_line)
3184 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3185 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3186 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3187 (handle_single_display_spec, build_desired_tool_bar_string)
3188 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3189 (get_specified_cursor_type):
3190 Check that fixnums are in proper range for system types.
3191 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3192 (Flookup_image_map):
3193 Don't assume fixnums fit in int.
3194 (compare_overlay_entries):
3195 Avoid mishandling comparisons due to subtraction overflow.
3196 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3197 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3198 (handle_tool_bar_click):
3199 Use int, not unsigned, since we prefer signed and the signedness
3200 doesn't matter here.
3201 (get_next_display_element, next_element_from_display_vector):
3202 Use int, not EMACS_INT, when int is wide enough.
3203 (start_hourglass): Use duration_to_sec_usec to do proper
3204 overflow checking on durations.
3205 * xfaces.c (Fbitmap_spec_p):
3206 Check that fixnums are in proper range for system types.
3207 (compare_fonts_by_sort_order):
3208 Avoid mishandling comparisons due to subtraction overflow.
3209 (Fx_family_fonts, realize_basic_faces):
3210 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3211 (Fx_family_fonts):
3212 Don't assume fixnum fits in int.
3213 Use SAFE_ALLOCA_LISP, not alloca.
3214 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3215 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3216 (face_at_buffer_position, face_for_overlay_string)
3217 (face_at_string_position):
3218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3219 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3220 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3221 (Fx_show_tip):
3222 Check that fixnums are in proper range for system types.
3223 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3224 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3226 (Fx_change_window_property): Don't assume fixnums fit in int.
3227 * xfont.c (xfont_chars_supported):
3228 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3229 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3230 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3231 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3232 * xml.c (parse_region):
3233 * xrdb.c (magic_file_p):
3234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3235 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3236 (x_get_local_selection, x_reply_selection_request)
3237 (x_handle_selection_request, wait_for_property_change):
3238 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3239 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3240 short is wide enough.
3241 (x_send_client_event): Don't assume fixnum fits in int.
3242 * xterm.c (x_x_to_emacs_modifiers):
3243 Don't assume EMACS_INT overflows nicely into int.
3244 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3245 may come from Lisp.
3246 (handle_one_xevent): NATNUMP can eval its arg twice.
3247 (x_connection_closed):
3248 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3249 * xterm.h: Adjust decls to match defn changes elsewhere.
3250 (struct scroll_bar): Use struct vectorlike_header
3251 rather than rolling our own approximation.
3252 (SCROLL_BAR_VEC_SIZE): Remove; not used.
3253
c6574eb5
GM
32542012-05-25 Glenn Morris <rgm@gnu.org>
3255
3256 * lisp.mk (lisp): Update for more files being compiled now.
3257
e8d32c7e
SM
32582012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
3259
48def666
SM
3260 * lread.c: Remove `read_pure' which makes no difference.
3261 (read_pure): Remove var.
3262 (unreadpure): Remove function.
3263 (readevalloop): Don't call read_list with -1 flag.
3264 (read1, read_vector): Don't test read_pure any more.
3265 (read_list): Simplify.
3266
e8d32c7e
SM
3267 * fileio.c, character.h: Minor style tweaks.
3268
4b2addb7
DA
32692012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
3270
3271 * window.h (clip_changed): Remove useless declaration.
3272
584461b2
JB
32732012-05-22 Juanma Barranquero <lekktu@gmail.com>
3274
3275 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3276 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3277
34374650
PE
32782012-05-22 Paul Eggert <eggert@cs.ucla.edu>
3279
3280 Remove src/m/*.
3281 This directory predates autoconf and is no longer needed nowadays.
3282 Move its few remaining bits of functionality to where they're needed.
3283 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3284 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3285 * m/template.h: Remove.
3286 * Makefile.in (M_FILE): Remove. All uses removed.
3287 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3288 * lisp.h (USE_LSB_TAG):
3289 * mem-limits.h (EXCEEDS_LISP_PTR):
3290 Use VAL_MAX, not VALBITS, in #if.
3291 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3292 (EMACS_UINT): Define unconditionally now.
3293 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3294 (BITS_PER_EMACS_INT): New constants, replacing
3295 what used to be in config.h, but not useful in #if.
3296 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3297 define them any more.
3298 (VAL_MAX): New macro.
3299 (VALMASK): Use it.
3300 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3301 BITS_PER_EMACS_INT, in #if.
3302 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3303 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3304 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3305 * s/ms-w32.h (DATA_START):
3306 Move here from removed file m/intel386.h.
3307 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3308 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3309
261cb4bb
PE
33102012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3311
3312 Assume C89 or later.
3313 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3314 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3315 (xrealloc):
3316 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3317 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3318 * textprop.c, tparam.c (NULL): Remove.
3319 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3320 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3321 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3322 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3323 * xterm.c (input_signal_count): Assume volatile works.
3324
ff23cd9f
KB
33252012-05-21 Ken Brown <kbrown@cornell.edu>
3326
3327 * xgselect.c (xg_select): Fix first argument in call to 'select'
3328 (bug#11508).
3329
1b170bc6
KB
33302012-05-20 Ken Brown <kbrown@cornell.edu>
3331
3332 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3333 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3334
b2f4d39f
KB
33352012-05-19 Ken Brown <kbrown@cornell.edu>
3336
3337 * xfns.c (x_in_use): Remove `static' qualifier.
3338 * xterm.h (x_in_use): Declare.
3339 * xgselect.c: Include xterm.h.
3340 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3341 and `display_arg' (bug#9754).
3342
003fdae2
PE
33432012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3344
9232a6d9
PE
3345 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3346
003fdae2
PE
3347 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3348 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3349
784b56e2
EZ
33502012-05-18 Eli Zaretskii <eliz@gnu.org>
3351
3352 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3353
3354 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3355 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3356
3357 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3358 reference to image_cache->refcount.
3359 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3360
a0a79cde
JL
33612012-05-17 Juri Linkov <juri@jurta.org>
3362
3363 * search.c (Fword_search_regexp, Fword_search_backward)
3364 (Fword_search_forward, Fword_search_backward_lax)
3365 (Fword_search_forward_lax): Move functions to isearch.el
3366 (bug#10145, bug#11381).
3367
b0572523
PE
33682012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3369
3370 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3371
9660f5fc
SM
33722012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3373
3374 * lread.c (init_obarray): Declare Qt and Qnil as special.
3375
4374de83
GM
33762012-05-14 Glenn Morris <rgm@gnu.org>
3377
3378 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3379 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3380
dc44c39a
PE
33812012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3382
078c97cb
PE
3383 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3384
dc44c39a
PE
3385 * unexaix.c: Port to more-recent AIX compilers.
3386 (report_error, report_error_1, make_hdr, copy_sym)
3387 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3388 Make arguments const char *, not char *, to avoid violations of C
3389 standard and to fix some AIX warnings reported by Gilles Pion.
3390
e18afed7 33912012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3392
3393 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3394 already have overlays loaded.
3395 (handle_single_display_spec): Before returning without displaying
3396 fringe bitmap, synchronize the bidi iterator with the main display
3397 iterator, by calling iterate_out_of_display_property.
3398 (iterate_out_of_display_property): Detect buffer iteration by
3399 testing that it->string is a Lisp string.
3400 (get_next_display_element): When the current object is exhausted,
3401 and there's something on it->stack, call set_iterator_to_next to
3402 proceed with what's on the stack, instead of returning zero.
3403 (set_iterator_to_next): If called at the end of a Lisp string,
3404 proceed to consider_string_end without incrementing string
3405 position. Don't increment display vector index past the end of
3406 the display vector. (Bug#11417)
c8fb9dc6
EZ
3407 (pos_visible_p): Don't report a position visible when move_it_to
3408 stopped at the last line of window, which happens to be scanned
3409 backwards by the bidi iteration. (Bug#11464)
ac268e67 3410
e18afed7 34112012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3412
3413 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3414 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3415 are on a TTY, and thus unable to display on the fringes.
3416 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3417 so we need to signal to the caller that this is a "replacing"
3418 display spec. This fixes display when the spec is invalid or we
3419 are on a TTY.
3420
e18afed7 34212012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3422
3423 * unexaix.c (make_hdr): Fix typo in prototype.
3424 This bug broke the build on AIX. Problem reported by Gilles Pion.
3425
9d0a235a
MA
34262012-05-14 Michael Albinus <michael.albinus@gmx.de>
3427
3428 * keyboard.c (kbd_buffer_get_event): Read special events also in
3429 batch mode. (Bug#11415)
3430
9e6b06ed
GM
34312012-05-12 Glenn Morris <rgm@gnu.org>
3432
3433 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3434
c1a1d7a3
EZ
34352012-05-12 Eli Zaretskii <eliz@gnu.org>
3436
3437 * lisp.mk (lisp): Add newcomment.elc.
3438
3fe7cdc8
GM
34392012-05-12 Glenn Morris <rgm@gnu.org>
3440
3441 * Makefile.in (MKDIR_P): New, set by configure.
3442 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3443
53f7d2c0
PE
34442012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3445
3446 Remove unused function hourglass_started.
3447 * dispextern.h (hourglass_started):
3448 * w32fns.c (hourglass_started):
3449 * xdisp.c (hourglass_started): Remove.
3450
75aafb17
JB
34512012-05-10 Juanma Barranquero <lekktu@gmail.com>
3452
3453 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3454 Update dependencies.
3455
12959e8e
PE
34562012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3457
97107e2e
PE
3458 * xgselect.c (xg_select): Put maxfds+1 into a var.
3459 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3460
12959e8e
PE
3461 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3462
836d29b3
DA
34632012-05-10 Dave Abrahams <dave@boostpro.com>
3464
3465 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3466 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3467
5cb67954
MA
34682012-05-09 Michael Albinus <michael.albinus@gmx.de>
3469
3470 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3471 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3472 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3473 Initialize xd_registered_buses.
3474
3478ec45
PE
34752012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3476
b263a6b0
PE
3477 Untag more efficiently if USE_LSB_TAG.
3478 This is based on a proposal by YAMAMOTO Mitsuharu in
3479 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3480 For an admittedly artificial (nth 8000 longlist) benchmark on
3481 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3482 Emacs's overall text size by 1%.
3483 * lisp.h (XUNTAG): New macro.
3484 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3485 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3486 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3487 * eval.c (Fautoload):
3488 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3489 * frame.h (XFRAME): Use XUNTAG.
3490
3478ec45
PE
3491 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3492 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3493 Remove unportable assumptions about print widths of types like
3494 dbus_uint32_t.
3495 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3496 intptr_t when converting between pointer and integer, to avoid GCC
3497 warnings about wrong width.
3498
666b903b 34992012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3500
3501 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3502 stack for each reader_thread, instead of defaulting to 8MB
3503 determined by the linker. This avoids failures in creating
3504 subprocesses on Windows 7, see the discussion in this thread:
3505 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3506
b120cc17
JC
35072012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3508
3509 Fix up display of the *Minibuf-0* buffer in the mini window.
3510 * keyboard.c (read_char): Don't clear the echo area if there's no
3511 message to clear.
3512 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3513 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3514
9a4b36f8
MA
35152012-05-07 Michael Albinus <michael.albinus@gmx.de>
3516
3517 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3518 batch mode.
3519
e5f9458f
CY
35202012-05-06 Chong Yidong <cyd@gnu.org>
3521
3522 * lisp.mk (lisp): Update.
3523
eceeb5fc 35242012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3525
3526 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3527
71873e2b
SM
35282012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3529
3530 * data.c (PUT_ERROR): New macro.
3531 (syms_of_data): Use it. Add new error type `user-error'.
3532 * undo.c (user_error): New function.
3533 (Fprimitive_undo): Use it.
3534 * print.c (print_error_message): Adjust print style for `user-error'.
3535 * keyboard.c (user_error): New function.
3536 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3537
ab0fa4e4
PE
35382012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3539
3540 Do not limit current-time-string to years 1000..9999.
3541 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3542 (Fcurrent_time_string): Support any year that is supported by the
3543 underlying localtime representation. Don't use asctime, as it
3544 has undefined behavior for years outside the range -999..9999.
3545
7ed806a7
PE
35462012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3547
3548 Fix race conditions involving setenv, gmtime, localtime, asctime.
3549 Without this fix, interrupts could mess up code that uses these
3550 nonreentrant functions, since setting TZ invalidates existing
3551 tm_zone or tzname values, and since most of these functions return
3552 pointers to static storage.
3553 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3554 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3555 Grow the critical sections to include not just invoking
3556 localtime/gmtime, but also accessing these functions' results
3557 including their tm_zone values if any, and any related TZ setting.
3558 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3559 so that the struct tm is saved in the critical section.
3560 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3561 motivated by the fact that memory allocation needs to be outside
3562 the critical section.
3563
0c16dfed
DA
35642012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3565
3566 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3567 with RESET_INTERVAL.
3568
3569 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3570 Remove duplicated buffer name initialization.
3571
3f83ace8
JM
35722012-05-02 Jim Meyering <jim@meyering.net>
3573
3574 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3575
c7b8541e
JM
3576 * xfns.c (x_window): Use xstrdup (Bug#11375).
3577
90207a15 35782012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
3579
3580 * xdisp.c (pos_visible_p): If already at a newline from the
3581 display string before the 'while' loop, don't walk back the glyphs
3582 from it3.glyph_row. Solves assertion violation when the display
3583 string begins with a newline (egg.el). (Bug#11367)
3584
b593d6a9
AH
35852012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
3586
3587 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3588 Move to simple.el.
3589
4737362e
GM
35902012-05-01 Glenn Morris <rgm@gnu.org>
3591
99cf43f9
GM
3592 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3593 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3594 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3595 All were removed before 23.1.
3596
9311dcff
GM
3597 * dispnew.c: Remove HAVE_LIBNCURSES test;
3598 it is always true on relevant platforms.
3599
4d5c6349
GM
3600 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3601 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3602
4737362e
GM
3603 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3604
74dd3a6b
AS
36052012-04-30 Andreas Schwab <schwab@linux-m68k.org>
3606
3607 * .gdbinit (xpr): Remove checks for no longer existing misc types.
3608 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3609 Remove.
3610
13c379ee
PE
36112012-04-28 Paul Eggert <eggert@cs.ucla.edu>
3612
3613 Do not avoid creating empty evaporating overlays (Bug#9642).
3614 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3615 That is, do not delete an evaporating overlay if it becomes
3616 empty after its bounds are adjusted to fit within its buffer.
3617 This fix caused other problems, and I'm reverting it until we get
3618 to the bottom of them.
3619
a8e7d6d7 36202012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
3621
3622 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3623
a8e7d6d7 36242012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
3625
3626 * xdisp.c (pos_visible_p): If the window start position is beyond
3627 ZV, start the display from buffer beginning. Prevents assertion
3628 violation in init_iterator when the minibuffer window is scrolled
3629 via the scroll bar.
3630
3631 * window.c (window_scroll_pixel_based): Likewise.
3632
a8e7d6d7 36332012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
3634
3635 * keymap.c (where_is_internal): Doc fix (Bug#10872).
3636
a8e7d6d7 36372012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
3638
3639 * fileio.c (Fcopy_file, Fset_file_selinux_context):
3640 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
3641
a8e7d6d7 36422012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 3643
b593d6a9
AH
3644 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3645 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 3646
1c6900d9
EZ
36472012-04-26 Eli Zaretskii <eliz@gnu.org>
3648
4c3fa1d9
EZ
3649 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3650 display element, check also the underlying string or buffer
3651 character. (Bug#11341)
3652
1c6900d9
EZ
3653 * w32menu.c: Include w32heap.h.
3654 (add_menu_item): If the call to AppendMenuW (via
3655 unicode_append_menu) fails, disable Unicode menus only if we are
3656 running on Windows 9X/Me.
3657
42bf8205
AS
36582012-04-24 Andreas Schwab <schwab@linux-m68k.org>
3659
3660 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3661 (xgetint): Add missing shift for LSB tags.
3662
b1bac16e
MR
36632012-04-24 Martin Rudalics <rudalics@gmx.at>
3664
3665 * keyboard.c (read_char): Don't wipe echo area for select window
3666 events: These might get delayed via `mouse-autoselect-window'
3667 (Bug#11304).
3668
d69621cc
JB
36692012-04-24 Juanma Barranquero <lekktu@gmail.com>
3670
3671 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3672 manipulation of :loaded-from data.
3673
02fd101b
JB
36742012-04-23 Juanma Barranquero <lekktu@gmail.com>
3675
3676 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3677 now a cons (bug#11311).
3678
888bec30
PE
36792012-04-23 Paul Eggert <eggert@cs.ucla.edu>
3680
89a438bd
PE
3681 Do not create empty overlays with the evaporate property (Bug#9642).
3682 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3683 if it becomes empty after its bounds are adjusted to fit within
3684 its buffer. Without this fix, in a nonempty buffer (let ((o
3685 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3686 yields an empty overlay that has the evaporate property, which is
3687 not supposed to happen.
3688
1068fe4d
PE
3689 Fix minor GTK3 problems found by static checking.
3690 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3691 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3692 (struct _EmacsFixedClass, emacs_fixed_get_type):
3693 Move decls here from emacsgtkfixed.h, since they needn't be public.
3694 (emacs_fixed_get_type): Now static.
3695 (emacs_fixed_class_init): Omit unused local.
3696 (emacs_fixed_child_type): Remove; unused.
3697 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3698 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3699 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3700 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3701 (EMACS_FIXED_GET_CLASS): Remove; unused.
3702 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3703
888bec30
PE
3704 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3705 Problem reported by Juanma Barranquero for Windows -Wunused-function.
3706
de85e130
PE
37072012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3708
d0baac98 3709 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 3710 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
3711 (__malloc_size_t, __malloc_ptrdiff_t):
3712 Remove. All uses removed, replaced by the definiens if needed,
3713 since we can assume C89 or better now.
3714 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3715 (protect_malloc_state, align, get_contiguous_space)
3716 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3717 (malloc_atfork_handler_child, malloc_enable_thread)
3718 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3719 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3720 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3721 (special_realloc, _realloc_internal_nolock, _realloc_internal)
3722 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3723 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3724 Define using prototypes, not old style.
3725 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3726 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3727 (align): Don't assume that signed integer overflow wraps around.
3728 Omit unused local var.
3729 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3730 (_free_internal_nolock, memalign, mallochook, reallochook):
3731 Omit no-longer-needed casts.
3732 (valloc): Use getpagesize, not __getpagesize.
3733 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3734 (struct hdr): The 'magic' member is now size_t, not unsigned long.
3735
de85e130
PE
3736 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3737
dcbf5805
MA
37382012-04-22 Michael Albinus <michael.albinus@gmx.de>
3739
3740 Move functions from C to Lisp. Make non-blocking method calls
3741 the default. Implement further D-Bus standard interfaces.
3742
3743 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
3744 (QCdbus_request_name_allow_replacement)
3745 (QCdbus_request_name_replace_existing)
3746 (QCdbus_request_name_do_not_queue)
3747 (QCdbus_request_name_reply_primary_owner)
3748 (QCdbus_request_name_reply_in_queue)
3749 (QCdbus_request_name_reply_exists)
3750 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3751 (QCdbus_registered_serial, QCdbus_registered_method)
3752 (QCdbus_registered_signal): New Lisp objects.
3753 (XD_DEBUG_MESSAGE): Use sizeof.
3754 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3755 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3756 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3757 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3758 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3759 (xd_signature, xd_append_arg): Allow float for integer types.
3760 (xd_get_connection_references): New function.
b593d6a9
AH
3761 (xd_get_connection_address): Rename from xd_initialize.
3762 Return cached address.
dcbf5805
MA
3763 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
3764 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
3765 level.
3766 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 3767 Return number of refcounts.
dcbf5805
MA
3768 (Fdbus_get_unique_name): Make stronger parameter check.
3769 (Fdbus_message_internal): New defun.
3770 (Fdbus_call_method, Fdbus_call_method_asynchronously)
3771 (Fdbus_method_return_internal, Fdbus_method_error_internal)
3772 (Fdbus_send_signal, Fdbus_register_service)
3773 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
3774 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
3775 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
3776 (Vdbus_compiled_version, Vdbus_runtime_version)
3777 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
3778 (Vdbus_message_type_method_return, Vdbus_message_type_error)
3779 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
3780 (Vdbus_registered_buses, Vdbus_registered_objects_table):
3781 Adapt docstring.
dcbf5805 3782
52828e02
PE
37832012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3784
da05bc4c
PE
3785 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
3786 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
3787 Do not assume ptrdiff_t is the same width as 'int'.
3788
52828e02
PE
3789 * alloc.c: Handle unusual debugging option combinations.
3790 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
3791 since the two debugging options are incompatible.
3792 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
3793 is defined.
3794 (mem_init, mem_insert, mem_insert_fixup):
3795 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
3796 (NEED_MEM_INSERT): Remove; no longer needed.
3797
f01769f9
LL
37982012-04-22 Leo Liu <sdl.web@gmail.com>
3799
3800 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
3801
5790543d
PE
38022012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3803
3804 * sysdep.c [__FreeBSD__]: Minor cleanups.
3805 (list_system_processes, system_process_attributes) [__FreeBSD__]:
3806 Use Emacs indenting style more consistently. Avoid some casts.
3807 Use 'double' consistently rather than mixing 'float' and 'double'.
3808
b91b7e4d
EW
38092012-04-21 Eduard Wiebe <usenet@pusto.de>
3810
b593d6a9
AH
3811 * sysdep.c (list_system_processes, system_process_attributes):
3812 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 3813
6114eb15
AS
38142012-04-21 Andreas Schwab <schwab@linux-m68k.org>
3815
3816 * lisp.mk (lisp): Update.
3817
2f38dff7
PE
38182012-04-20 Paul Eggert <eggert@cs.ucla.edu>
3819
3820 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
3821 It is never used otherwise.
3822
4ae29f89
SM
38232012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
3824
3825 * print.c (print_preprocess): Only check print_depth if print-circle
3826 is nil.
3827 (print_object): Check for cycles even when print-circle is nil and
3828 print-gensym is t, but only check print_depth if print-circle is nil.
3829
f30d612a
CY
38302012-04-20 Chong Yidong <cyd@gnu.org>
3831
3832 * process.c (wait_reading_process_output): If EIO occurs on a pty,
3833 set the status to "failed" and ensure that sentinel is run.
3834
c07a4c0b 38352012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
3836
3837 * process.c (Fset_process_inherit_coding_system_flag)
3838 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 3839 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 3840
c07a4c0b 38412012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
3842
3843 * xdisp.c (string_buffer_position_lim): Limit starting position to
3844 BEGV.
3845 (set_cursor_from_row): If called for a mode-line or header-line
3846 row, return zero immediately.
3847 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
3848 farther than the first row after the header line, if any.
3849 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
3850 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
3851
c07a4c0b 38522012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3853
4ae29f89
SM
3854 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
3855 (bug#11238).
ad3a2b41 3856
c07a4c0b 38572012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 38582012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
3859
3860 configure: new option --enable-gcc-warnings (Bug#11207)
3861 * Makefile.in (C_WARNINGS_SWITCH): Remove.
3862 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
3863 (ALL_CFLAGS): Use new macros rather than old.
3864 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
3865 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
3866 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
3867 -Wunused-result, -Wunused-variable. This should go away once
3868 the Emacs and Gnulib regex code is merged.
3869 (xmalloc, xrealloc): Now static.
3870
aba027e8
PE
38712012-04-17 Paul Eggert <eggert@cs.ucla.edu>
3872
3873 * dired.c (Fsystem_groups): Remove unused local.
3874
e5a36063
GM
38752012-04-17 Glenn Morris <rgm@gnu.org>
3876
3877 * dired.c (Fsystem_users): Doc fix.
3878
316411f0
DA
38792012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
3882 (syms_of_dired): Add them.
3883
9426aba4
PE
38842012-04-16 Paul Eggert <eggert@cs.ucla.edu>
3885
b62a57be
PE
3886 Fix minor alloc.c problems found by static checking.
3887 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
3888 New extern decls, to avoid calling undeclared functions.
3889 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
3890 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
3891 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
3892 (NEED_MEM_INSERT): New macro.
3893 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 3894 Remove one incorrect comment and fix another.
b62a57be 3895
3539f31f
PE
3896 Fix minor ralloc.c problems found by static checking.
3897 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3898 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
3899 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
3900 (r_alloc_sbrk): Now static.
3901
a041960a
PE
3902 Improve ralloc.c interface checking.
3903 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3904 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
3905 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
3906 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
3907 [REL_ALLOC]: ... to here, to check interface.
3908 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
3909 Remove decls. This fixes an "It stinks!".
3910
9426aba4
PE
3911 * alloc.c (which_symbols): Fix alignment issue / type clash.
3912
d55c12ed
AS
39132012-04-15 Andreas Schwab <schwab@linux-m68k.org>
3914
3915 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
3916 (struct Lisp_Misc_Any): Likewise.
3917 (struct Lisp_Free): Likewise.
3918 * alloc.c (union aligned_Lisp_Symbol): Define.
3919 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
3920 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
3921 (union aligned_Lisp_Misc): Define.
3922 (MARKER_BLOCK_SIZE, struct marker_block): Use union
3923 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 3924 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 3925
b948ce8b
PE
39262012-04-14 Paul Eggert <eggert@cs.ucla.edu>
3927
3928 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
3929 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
3930 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
3931 * s/netbsd.h, s/sol2-6.h:
3932 Remove definition of GC_MARK_STACK, since the default now works.
3933 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
3934 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
3935 no longer the default.
3936 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
3937
35dc09a1 39382012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3939
35dc09a1
GM
3940 * lread.c (lisp_file_lexically_bound_p):
3941 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 3942
35dc09a1
GM
39432012-04-14 Eli Zaretskii <eliz@gnu.org>
3944
3945 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
3946 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
3947
39482012-04-14 Jan Djärv <jan.h.d@swipnet.se>
3949
3950 * nsterm.m (constrainFrameRect): Always constrain when there is only
3951 one screen (Bug#10962).
3952
bcd86815
KB
39532012-04-13 Ken Brown <kbrown@cornell.edu>
3954
3955 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
3956
c25df26e
RT
39572012-04-13 Reuben Thomas <rrt@sc3d.org>
3958
3959 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
3960
0fc59f1e
DC
39612012-04-11 Daniel Colascione <dancol@dancol.org>
3962
3963 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
3964 against is gone. It's better to use vfork now so that when Cygwin
3965 gains a new, working vfork, we use it automatically (bug#10398).
3966
de8c03dc
SM
39672012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3968
3969 * window.c (save_window_save): Obey window-point-insertion-type.
3970
2f097256
GM
39712012-04-11 Glenn Morris <rgm@gnu.org>
3972
3973 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
3974
453b951e
SM
39752012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3976
3977 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
3978
75f1671a 39792012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
3980
3981 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
3982 (force_quit_count): New var.
3983 (handle_interrupt): Use it.
3984
2a8ce227
JB
39852012-04-10 Juanma Barranquero <lekktu@gmail.com>
3986
3987 * w32.c (w32_delayed_load): Record the full path of the library
3988 being loaded (bug#10424).
3989
935396c0
GM
39902012-04-09 Glenn Morris <rgm@gnu.org>
3991
05920a43
GM
3992 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
3993 not just in the obarray, before snarfing them. (Bug#11036)
3994
935396c0
GM
3995 * Makefile.in ($(leimdir)/leim-list.el):
3996 Pass EMACS rather than BUILT_EMACS.
3997
a18ecafa
TZ
39982012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
3999
4000 * process.c (make_process):
4001 * process.h: Add integer `gnutls_handshakes_tried' member to
4002 process struct.
4003
6bbef4e5
JC
4004 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4005 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
4006
4007 * gnutls.c (gnutls_log_function2i): Convenience log function.
4008 (emacs_gnutls_read): Use new log functions,
4009 `gnutls_handshakes_tried' process member, and
4010 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4011 attempts per process (connection).
4012
b4d3bc10
CY
40132012-04-09 Chong Yidong <cyd@gnu.org>
4014
4015 * eval.c (Fuser_variable_p, user_variable_p_eh)
4016 (lisp_indirect_variable): Functions deleted.
4017 (Fdefvar): Caller changed.
4018
4019 * callint.c (Finteractive, Fcall_interactively):
4020 * minibuf.c (Fread_variable): Callers changed.
4021
70f4d973
EZ
40222012-04-09 Eli Zaretskii <eliz@gnu.org>
4023
4024 * xdisp.c (set_cursor_from_row): If the display string appears in
4025 the buffer at position that is closer to point than the position
4026 after the display string, display the cursor on the first glyph of
4027 the display string. Fixes cursor display when a 'display' text
4028 property immediately follows invisible text. (Bug#11094)
4029
cb3c2e3e
PE
40302012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4031
4032 composite.c: use 'double' consistently
4033 * composite.c (get_composition_id): Use 'double' consistently
4034 instead of converting 'float' to 'double' and vice versa; this is
4035 easier to understand and avoids a GCC warning.
4036
fd06db5d
GM
40372012-04-09 Glenn Morris <rgm@gnu.org>
4038
50fe702a
GM
4039 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4040 preparation for dumping it with emacs. (Bug#4789)
4041 (leimdir): New variable.
4042 ($(leimdir)/leim-list.el): New rule.
4043 (emacs$(EXEEXT)): Depend on leim-list.el.
4044
fd06db5d
GM
4045 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4046 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4047 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4048
55c131ee
AS
40492012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4050
4051 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
4052 proper alignment.
4053
9209588f
JB
40542012-04-07 Juanma Barranquero <lekktu@gmail.com>
4055
4056 * xml.c (init_libxml2_functions) [WINDOWSNT]:
4057 Remove unused local variable.
4058
e3fb2efb
PE
40592012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4060
4061 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
4062 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
4063 (mark_memory): Mark Lisp_Objects only if pointers might hide in
4064 objects, as mark_maybe_pointer will catch them otherwise.
4065 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
4066 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
4067
b5385551
PE
40682012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4069
4070 Fix typo that broke non-Windows builds.
4071 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
4072
9078ead6
EZ
40732012-04-07 Eli Zaretskii <eliz@gnu.org>
4074
4075 Support building on MS-Windows with libxml2.
4076
4077 * makefile.w32-in (OBJ2): Add xml.$(O).
4078 (GLOBAL_SOURCES): Add xml.c.
4079 ($(BLD)/xml.$(O)): New dependency list.
4080
4081 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
4082 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
4083 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
4084 [!WINDOWSNT]: New macros.
4085 (init_libxml2_functions, libxml2_loaded_p): New functions.
4086 (parse_region): Call fn_xmlCheckVersion instead of using the macro
4087 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
4088 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
4089 Calls xmlCleanupParser only if libxml2 was loaded (or statically
4090 linked in).
6bbef4e5
JC
4091 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
4092 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
4093 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
4094
4095 * emacs.c: Don't include libxml/parser.h.
4096 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
4097 xmlCleanupParser directly.
4098
4099 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
4100
3811fdf3
EZ
41012012-04-07 Eli Zaretskii <eliz@gnu.org>
4102
4103 * indent.c (Fvertical_motion): If there is a display string at
4104 point, use it.vpos to compute how many lines to backtrack after
4105 move_it_to point. (Bug#11133)
4106
2f8e16b2
EZ
41072012-04-06 Eli Zaretskii <eliz@gnu.org>
4108
4109 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4110 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4111 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4112 macros related to unification of CJK characters. For the details,
4113 see the discussion following the message here:
4114 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4115
3d439cd1
CY
41162012-04-04 Chong Yidong <cyd@gnu.org>
4117
4118 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4119
8bc53d00
EZ
41202012-04-01 Eli Zaretskii <eliz@gnu.org>
4121
4122 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4123 instead of alloca. (Bug#11138)
4124
3b0512a3
AS
41252012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4126
4127 * w32menu.c (is_simple_dialog): Properly check lisp types.
4128 (Bug#11141)
4129
8427ddd2
EZ
41302012-03-31 Eli Zaretskii <eliz@gnu.org>
4131
979022ef
EZ
4132 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4133 position we get to after a call to move_it_to fails the
4134 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4135 only if we wind up in a string from display property. (Bug#11063)
4136
a6b1c7cc
EZ
4137 * window.c (Fdelete_other_windows_internal): Invalidate the row
4138 and column information about mouse highlight, so that redisplay
4139 restores it after reallocating the glyph matrices. (Bug#7464)
4140
8427ddd2
EZ
4141 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4142 string comes from a `display' text property, use the buffer
4143 position of that property as if we actually saw that position in
4144 the row's glyphs.
697ba24b
EZ
4145 (move_it_by_lines): Remove the assertion that
4146 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4147 violated when there's a before-string at the beginning of a line.
4148 (Bug#11063)
8427ddd2 4149
65a0a738
EZ
41502012-03-30 Eli Zaretskii <eliz@gnu.org>
4151
4152 * xdisp.c (append_space_for_newline): If the default face was
4153 remapped, use the remapped face for the appended newline.
4154 (extend_face_to_end_of_line): Use the remapped default face for
4155 extending the face to the end of the line.
4156 (display_line): Call extend_face_to_end_of_line when the default
4157 face was remapped. (Bug#11068)
4158
581355cc
EZ
41592012-03-29 Eli Zaretskii <eliz@gnu.org>
4160
4161 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4162
e8fc049f
SM
41632012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4164
4165 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4166
4fb9a543
GM
41672012-03-27 Glenn Morris <rgm@gnu.org>
4168
4169 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4170 Doc fixes.
4171
679910f1
KH
41722012-03-26 Kenichi Handa <handa@m17n.org>
4173
4174 * dispextern.h (struct glyph): Fix previous change. Change the
4175 bit length of glyphless.ch to 25 (Bug#11082).
4176
90d49b7f
CY
41772012-03-26 Chong Yidong <cyd@gnu.org>
4178
4179 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4180 (command_loop_1): Use it; inhibit selection update for
4181 handle-select-window too (Bug#8996).
4182
f514f6f0
FP
41832012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4184
e8fc049f 4185 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4186
bf43fa51
KH
41872012-03-25 Kenichi Handa <handa@m17n.org>
4188
4189 * dispextern.h (struct glyph): Change the bit length of
4190 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4191
8a0c01dd
EZ
41922012-03-24 Eli Zaretskii <eliz@gnu.org>
4193
4194 * s/ms-w32.h (tzname): Include time.h before redirecting to
4195 _tzname. Fixes the MSVC build. (Bug#9960)
4196
7d1c3a76
AS
41972012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4198
8ed79523
AS
4199 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4200 characters.
4201
7d1c3a76
AS
4202 * xterm.c (XTread_socket): Only modify handling_signal if
4203 !SYNC_INPUT. (Bug#11080)
4204
e99a9b8b
EZ
42052012-03-23 Eli Zaretskii <eliz@gnu.org>
4206
4207 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4208 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4209 when fetching a multibyte character consumes more bytes than
4210 CHAR_BYTES returns, due to unification of CJK characters in
4211 string_char. (Bug#11073)
4212
5063c0e1
TN
42132012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4214
4215 * process.c (wait_reading_process_output): Handle pty disconnect
4216 by refraining from sending oneself a SIGCHLD (bug#10933).
4217
9f851fbd
CY
42182012-03-22 Chong Yidong <cyd@gnu.org>
4219
4220 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4221
5063c0e1 4222 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4223 Mark string as coming from a prefix property.
4224 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4225 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4226
fb5b8aca
CY
42272012-03-21 Chong Yidong <cyd@gnu.org>
4228
4229 * xfaces.c (Vface_remapping_alist): Doc fix.
4230
62356a1b
EZ
42312012-03-20 Eli Zaretskii <eliz@gnu.org>
4232
4233 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4234 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4235 Doc fixes.
62356a1b 4236
025de85b
CY
42372012-03-20 Chong Yidong <cyd@gnu.org>
4238
4239 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4240 to reflect default non-nil value of redisplay-dont-pause.
4241
4827f94e
KH
42422012-03-19 Kenichi Handa <handa@m17n.org>
4243
4244 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4245 it fit in a valid range (Bug#11003).
4246
e50a24a2
EZ
42472012-03-18 Eli Zaretskii <eliz@gnu.org>
4248
4249 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4250 that is not from display property, accept the row as a "cursor
4251 row" if one of the string's character has a non-nil `cursor'
4252 property. Fixes cursor positioning when there are newlines in
4253 overlay strings, e.g. in icomplete.el. (Bug#11035)
4254
9af5ed87
PE
42552012-03-12 Paul Eggert <eggert@cs.ucla.edu>
4256
4257 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4258
d1f55f16
CY
42592012-03-12 Chong Yidong <cyd@gnu.org>
4260
4261 * eval.c (inhibit_lisp_code): Rename from
4262 inhibit_window_configuration_change_hook; move from window.c.
4263
4264 * xfns.c (unwind_create_frame_1, Fx_create_frame):
4265 * window.c (run_window_configuration_change_hook)
4266 (syms_of_window): Callers changed.
4267
66c5eebd
CY
42682012-03-11 Chong Yidong <cyd@gnu.org>
4269
413df973
CY
4270 * keymap.c (Fkey_description): Doc fix (Bug#9700).
4271
66c5eebd
CY
4272 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4273
1de11f56
CY
42742012-03-10 Chong Yidong <cyd@gnu.org>
4275
4276 * frame.c (other_visible_frames): Don't assume the selected frame
4277 is visible (Bug#10955).
4278
cae07000
SM
42792012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
4280
4281 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4282
89c94350
JD
42832012-03-08 Jan Djärv <jan.h.d@swipnet.se>
4284
4285 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4286 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4287 zero (Bug#10954).
4288
999dd333
GM
42892012-03-03 Glenn Morris <rgm@gnu.org>
4290
01a6dcc8 4291 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4292
de0100f2
EZ
42932012-03-02 Eli Zaretskii <eliz@gnu.org>
4294
4295 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4296 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4297 (redisplay_window, next_element_from_string): Fix typos in
4298 comments.
3e441275
EZ
4299 (redisplay_window): Pass to move_it_vertically the margin in
4300 pixels, not in screen lines.
de0100f2 4301
96a72ee9
GM
43022012-03-02 Glenn Morris <rgm@gnu.org>
4303
4304 * buffer.c (buffer-list-update-hook): Doc fix.
4305
312508d7
EZ
43062012-02-29 Eli Zaretskii <eliz@gnu.org>
4307
4308 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4309 push_it before setting up the iterator for the first overlay
4310 string, even if we have an empty string loaded.
4311 (next_overlay_string): If there's an empty string on the iterator
4312 stack, pop the stack. (Bug#10903)
4313
27f3c637
PE
43142012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4315
4316 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4317 Suggested by Stefan Monnier in
4318 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4319 * alloc.c (widen_to_Lisp_Object): New static function.
4320 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4321 and widening them to Lisp_Objects. This would work even if
4322 USE_LSB_TAG is defined and wide integers are used, which might
4323 happen in a future version of Emacs.
4324
3c9dfce6
CY
43252012-02-25 Chong Yidong <cyd@gnu.org>
4326
fa74b241
CY
4327 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4328 Doc fix.
4329
3c9dfce6
CY
4330 * xselect.c (Fx_selection_exists_p): Doc fix.
4331 (x_clipboard_manager_save_all): Print an informative message
4332 before saving to clipboard manager.
4333
9486df08
CY
43342012-02-24 Chong Yidong <cyd@gnu.org>
4335
4336 * keyboard.c (process_special_events): Handle all X selection
4337 requests in kbd_buffer, not just the next one (Bug#8869).
4338
f01d3321
CY
43392012-02-23 Chong Yidong <cyd@gnu.org>
4340
4341 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4342 call when setting menu-bar-lines and tool-bar-lines parameters.
4343 (unwind_create_frame_1): New helper function.
4344
4345 * window.c (inhibit_window_configuration_change_hook): New var.
4346 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4347 (syms_of_window): Initialize it.
f01d3321 4348
86b847b6
CY
43492012-02-22 Chong Yidong <cyd@gnu.org>
4350
4351 * xterm.c (x_draw_image_relief): Add missing type check for
4352 Vtool_bar_button_margin (Bug#10743).
4353
a59225b1
CY
43542012-02-21 Chong Yidong <cyd@gnu.org>
4355
4356 * fileio.c (Vfile_name_handler_alist): Doc fix.
4357
4358 * buffer.c (Fget_file_buffer): Protect against invalid file
4359 handler return value.
4360
310f5bd4
PE
43612012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4362
cb3a28cc
PE
4363 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4364 when computing $valmask.
4365
310f5bd4
PE
4366 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4367 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4368 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4369 It's useless in that case, and it can cause problems on hosts
4370 that allocate halves of EMACS_INT values separately.
4371 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4372 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4373 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4374 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4375 it avoids undefined behavior on hosts where shifting right by more
4376 than the word width has undefined behavior.
4377
2375c96a
CY
43782012-02-19 Chong Yidong <cyd@gnu.org>
4379
4380 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4381 (Funhandled_file_name_directory, Ffile_name_as_directory)
4382 (Fdirectory_file_name, Fexpand_file_name)
4383 (Fsubstitute_in_file_name): Protect against invalid file handler
4384 return values (Bug#10845).
4385
3eb49e71
EZ
43862012-02-18 Eli Zaretskii <eliz@gnu.org>
4387
4388 * .gdbinit (pitx): Fix incorrect references to fields of the
4389 iterator stack.
4390
7b926f3f
CY
43912012-02-17 Chong Yidong <cyd@gnu.org>
4392
4393 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4394
11273115
PE
43952012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4396
4397 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4398 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4399
c3a70e2b
CY
44002012-02-15 Chong Yidong <cyd@gnu.org>
4401
4402 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4403 marked as special. Also, starting docstrings with * is obsolete.
4404
0ca43699
AS
44052012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4406
4407 * gnutls.c (emacs_gnutls_write): Fix last change.
4408
2e8f3c56
LI
44092012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4410
4411 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4412 send_process.
4413
af70074f
SM
44142012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4415
4416 * keymap.c (Fsingle_key_description): Handle char ranges.
4417
95986d52
CY
44182012-02-12 Chong Yidong <cyd@gnu.org>
4419
afd83bd1
CY
4420 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4421 as that creates a dangerous corner case.
4422
95986d52
CY
4423 * window.c (Fdelete_window_internal): Invalidate the mouse
4424 highlight (Bug#9904).
4425
bd7da63e
GM
44262012-02-12 Glenn Morris <rgm@gnu.org>
4427
4428 * xselect.c (Fx_own_selection_internal)
4429 (Fx_get_selection_internal, Fx_disown_selection_internal)
4430 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4431 * nsselect.m (Fx_own_selection_internal)
4432 (Fx_disown_selection_internal, Fx_selection_exists_p)
4433 (Fx_selection_owner_p, Fx_get_selection_internal):
4434 Sync docs and argument specs with the xselect.c versions.
4435
77abcbc2
LI
44362012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4437
4438 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4439
90b671e2
EZ
44402012-02-11 Eli Zaretskii <eliz@gnu.org>
4441
1c0ca0b7
EZ
4442 * w32select.c (Fx_selection_exists_p): Sync doc string and
4443 argument list with xselect.c. (Bug#10783)
4444
4445 * w16select.c (Fx_selection_exists_p): Sync doc string and
4446 argument list with xselect.c. (Bug#10783)
90b671e2 4447
49241268
GM
44482012-02-10 Glenn Morris <rgm@gnu.org>
4449
4450 * fns.c (Fsecure_hash): Doc fix.
4451
f998bbe7 44522012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4453
4454 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4455
0992bd9c
CY
44562012-02-07 Chong Yidong <cyd@gnu.org>
4457
4458 * buffer.c (Fbuffer_local_variables)
4459 (buffer_lisp_local_variables): Handle unbound vars correctly;
4460 don't let Qunbound leak into Lisp.
4461
af008560
GM
44622012-02-07 Glenn Morris <rgm@gnu.org>
4463
dd605cc4
GM
4464 * image.c (Fimagemagick_types): Doc fix.
4465
af008560
GM
4466 * image.c (imagemagick-render-type): Change it from a lisp object
4467 to an integer. Move the doc here from the lisp manual.
4468 Treat all values not equal to 0 the same.
4469
1449fa1d
CY
44702012-02-06 Chong Yidong <cyd@gnu.org>
4471
4472 * doc.c (store_function_docstring): Avoid applying docstring of
4473 alias to base function (Bug#2603).
4474
3723ec07
AS
44752012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4476
4477 * .gdbinit (pp1, pv1): Remove redundant defines.
4478 (pr): Use pp.
4479
79c1cc1e
CY
44802012-02-04 Chong Yidong <cyd@gnu.org>
4481
4482 * nsterm.m: Declare a global (Bug#10694).
4483
d7f29f8e
EZ
44842012-02-04 Eli Zaretskii <eliz@gnu.org>
4485
cae07000
SM
4486 * w32.c (get_emacs_configuration_options):
4487 Include --enable-checking, if specified, in the return value.
d7f29f8e 4488
3b95a6f9
MR
44892012-02-04 Martin Rudalics <rudalics@gmx.at>
4490
4491 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4492 after rounding frame sizes. (Bug#9723)
4493
d6fa96a6
EZ
44942012-02-04 Eli Zaretskii <eliz@gnu.org>
4495
4496 * keyboard.c (adjust_point_for_property): Don't position point
4497 before BEGV. (Bug#10696)
4498
df0b2940
PE
44992012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4500
4501 Handle overflow when computing char display width (Bug#9496).
4502 * character.c (char_width): Return EMACS_INT, not int.
4503 (char_width, c_string_width): Check for overflow when
4504 computing the width; this is possible now that individual
4505 characters can have unbounded width. Problem introduced
4506 by merge from Emacs 23 on 2012-01-19.
4507
6bee44d6
MA
45082012-02-02 Michael Albinus <michael.albinus@gmx.de>
4509
4510 * dbusbind.c (Fdbus_register_method): Mention the return value
4511 :ignore in the docstring.
4512
44f92739
GM
45132012-02-02 Glenn Morris <rgm@gnu.org>
4514
1b9f60cc
GM
4515 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4516
44f92739
GM
4517 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4518 Unconditionally set to t. (Bug#10673)
4519 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4520 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4521 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4522
c5d3843c
KH
45232012-02-02 Kenichi Handa <handa@m17n.org>
4524
4525 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4526 0, do not call append_composite_glyph.
4527
159462d4 45282012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4529
4530 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4531 NULL (Bug#6988).
4532 (x_produce_glyphs): If the component of a composition is a null
4533 string, set it->pixel_width to 1 to avoid zero-width glyph.
4534
78cef877
EZ
45352012-02-01 Eli Zaretskii <eliz@gnu.org>
4536
4537 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4538 first 2 arguments are identical. This makes inserting large
4539 output from a subprocess an order of magnitude faster on
4540 MS-Windows, where all sbrk'ed memory is always contiguous.
4541
97897668
GM
45422012-01-31 Glenn Morris <rgm@gnu.org>
4543
4544 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4545 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4546 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4547
31fd3586
GM
45482012-01-29 Glenn Morris <rgm@gnu.org>
4549
4550 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4551
0e24a8b2
CY
45522012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4553
4554 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4555
cc0adcb0
CY
45562012-01-28 Chong Yidong <cyd@gnu.org>
4557
4558 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4559
acc28cb9
CY
45602012-01-26 Chong Yidong <cyd@gnu.org>
4561
9c69cfb7
CY
4562 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4563
acc28cb9
CY
4564 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4565 repeat counts (Bug#10507).
4566
48da7392
GM
45672012-01-26 Glenn Morris <rgm@gnu.org>
4568
4569 * lread.c (syms_of_lread): Doc fix.
4570
14af5f7f
CY
45712012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
4572
4573 * coding.c (encode_designation_at_bol): Change return value to
4574 EMACS_INT.
4575
0b21c100
CY
45762012-01-25 Chong Yidong <cyd@gnu.org>
4577
4578 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4579
3c2907f7
CY
45802012-01-21 Chong Yidong <cyd@gnu.org>
4581
4582 * floatfns.c (Fcopysign): Make the second argument non-optional,
4583 since nil is not allowed anyway.
4584
959ad23f
AS
45852012-01-21 Andreas Schwab <schwab@linux-m68k.org>
4586
4587 * process.c (read_process_output): Use p instead of XPROCESS (proc).
4588 (send_process): Likewise.
4589
34a02f46
MR
45902012-01-19 Martin Rudalics <rudalics@gmx.at>
4591
4592 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
4593 (Vwindow_persistent_parameters): Do not use Qstate.
4594 Rewrite doc-strings.
34a02f46 4595
1259009a 45962012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
4597
4598 * character.c (char_width): New function.
70d4fdf6
GM
4599 (Fchar_width, c_string_width, lisp_string_width):
4600 Use char_width (Bug#9496).
25ed9e61 4601
6a6ee00d
MR
46022012-01-16 Martin Rudalics <rudalics@gmx.at>
4603
4604 * window.c (Vwindow_persistent_parameters): New variable.
4605 (Fset_window_configuration, save_window_save): Handle persistent
4606 window parameters.
4607
c85efaf7
EZ
46082012-01-14 Eli Zaretskii <eliz@gnu.org>
4609
4610 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4611 thrashing the stack of the thread. (Bug#9087)
4612
5944709e
PE
46132012-01-12 Paul Eggert <eggert@cs.ucla.edu>
4614
4615 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4616
e71f5d99
EZ
46172012-01-11 Eli Zaretskii <eliz@gnu.org>
4618
4619 * xdisp.c (rows_from_pos_range): Handle the case where the
4620 highlight ends on a newline. (Bug#10464)
4621 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4622 he end column for display of highlight that ends on a newline
4623 before a R2L line.
4624
ce316182
GM
46252012-01-11 Glenn Morris <rgm@gnu.org>
4626
4627 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4628 from load-path also when installation-directory is nil. (Bug#10208)
4629
5b43da69
GM
46302012-01-10 Glenn Morris <rgm@gnu.org>
4631
74cc8ff9
GM
4632 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4633
7d8d6e4e
GM
4634 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4635 Update template values to be closer to their typical values these days.
5b43da69 4636
a0db8d43
EZ
46372012-01-09 Eli Zaretskii <eliz@gnu.org>
4638
4639 * xdisp.c (rows_from_pos_range): Accept additional argument
4640 DISP_STRING, and accept any glyph in a row whose object is that
4641 string as eligible for mouse highlight. Fixes mouse highlight of
4642 display strings from overlays. (Bug#10464)
4643
9a0115ab 46442012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 4645
b9110d6a 4646 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
4647 * fileio.c (auto_saving_dir_umask): New static var.
4648 (Fmake_directory_internal): Use it.
4649 (do_auto_save_make_dir): Set it, instead of invoking chmod after
4650 creating the directory. The old code temporarily assigns
4651 too-generous permissions to the directory.
4652 (do_auto_save_eh): Clear it.
b9110d6a 4653 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
4654 that the var is always cleared.
4655
6c1bd3f3
EZ
46562012-01-07 Eli Zaretskii <eliz@gnu.org>
4657
4658 * search.c (scan_buffer): Pass character positions to
4659 know_region_cache, not byte positions. (Bug#6540)
4660
069d2b50
L
46612012-01-07 LynX <_LynX@bk.ru> (tiny change)
4662
4663 * w32.c (sys_rename): Report EXDEV when rename of a directory
4664 fails because the target is on another logical disk. (Bug#10284)
4665
75bf0d33
DB
46662012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
4667
4668 * xterm.c (x_embed_request_focus): New function.
4669
4670 * xterm.h: Add prototype.
4671
4672 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4673
1c6e5a32
GM
46742012-01-05 Glenn Morris <rgm@gnu.org>
4675
4676 * emacs.c (emacs_copyright): Update short copyright year to 2012.
4677
651e947e
EZ
46782012-01-01 Eli Zaretskii <eliz@gnu.org>
4679
4680 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4681 Load gnutls_transport_set_lowat only if GnuTLS version is below
4682 2.11.1.
4683 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4684 GnuTLS versions below 2.11.1.
4685
3778cdd8
AL
46862011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4687
4688 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4689 to the doc string advising against its use for altering the way
4690 windows are scrolled.
4691
0e5317f7
KH
46922011-12-28 Kenichi Handa <handa@m17n.org>
4693
4694 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4695 coding-system ASCII compatible only when it does not produce BOM
4696 on encoding (Bug#10383).
4697
93d5ca1f
JD
46982011-12-26 Jan Djärv <jan.h.d@swipnet.se>
4699
4700 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4701 can scroll.
4702 (create_and_show_popup_menu): Always use menu_position_func for
4703 Gtk3 (Bug#10361).
4704
ca22b785
AS
47052011-12-24 Andreas Schwab <schwab@linux-m68k.org>
4706
4707 * callint.c (Fcall_interactively): Don't truncate prompt string.
4708
d048e1e6
EZ
47092011-12-23 Eli Zaretskii <eliz@gnu.org>
4710
4711 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4712 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 4713 resumed from there (after widening). (Bug#10360)
d048e1e6 4714
5ccaba1f
JD
47152011-12-22 Jan Djärv <jan.h.d@swipnet.se>
4716
4717 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4718
204ee57f
JD
47192011-12-21 Jan Djärv <jan.h.d@swipnet.se>
4720
b81d40f0
JB
4721 * nsterm.m (x_free_frame_resources):
4722 Release f->output_data.ns->miniimage.
204ee57f
JD
4723 (ns_index_color): Fix indentation. Do not retain
4724 color_table->colors[i].
4725
4726 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4727 before returning.
4728
4729 * nsfns.m (x_set_background_color): Assign return value from
4730 ns_index_color to face-background instead of NSColor*.
4731 (ns_implicitly_set_icon_type): Fix indentation.
4732 Change assignment in for loop to comparison.
4733
4734 * emacs.c (ns_pool): New variable.
4735 (main): Assign ns_pool.
4736 (Fkill_emacs): Call ns_release_autorelease_pool.
4737
4738 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4739 autorelease fdesc, release fdAttrs and tdict.
4740 (ns_get_covering_families): Release charset.
4741 (ns_findfonts): Release NSFontDescriptor created with new.
4742 (ns_uni_to_glyphs): Fix indentation.
4743 (setString): Release attrStr before assigning new value.
4744
c803b2b7
JD
47452011-12-18 Jan Djärv <jan.h.d@swipnet.se>
4746
678f4426
JD
4747 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
4748 and NS_IMPL_COCOA.
4749 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4750 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4751
cd394be1 47522011-12-18 David Reitter <reitter@cmu.edu>
678f4426 4753
5fecd5fc
JD
4754 * nsterm.m (ns_term_init): Subscribe for notifications
4755 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4756 to method trackingNotification in EmacsMenu.
4757
4758 * nsmenu.m (trackingMenu): New variable.
3771cb17 4759 (trackingNotification): New method (from Aquamacs).
5fecd5fc 4760 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 4761 from Aquamacs (Bug#7030).
678f4426
JD
4762
47632011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 4764
c803b2b7
JD
4765 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
4766 (symbol_to_nsstring): Fix indentation.
4767 (ns_symbol_to_pb): New function.
cae07000
SM
4768 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
4769 (Fns_rotate_cut_buffers_internal): Remove.
4770 (Fns_store_selection_internal): Rename from
c803b2b7
JD
4771 Fns_store_cut_buffer_internal.
4772 (ns_get_foreign_selection, Fx_own_selection_internal)
4773 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
4774 (Fns_get_selection_internal, Fns_store_selection_internal):
4775 Use ns_symbol_to_pb and check if return value is nil.
4776 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
4777 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
4778 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
4779 renamed to Sns_store_selection_internal.
4780 (ns_handle_selection_request): Move code to Fx_own_selection_internal
4781 and remove this function.
4782 (ns_handle_selection_clear): Remove, never used.
4783 (Fx_own_selection_internal): Move code from ns_handle_selection_request
4784 here.
4785
e1b01a3a
KB
47862011-12-17 Ken Brown <kbrown@cornell.edu>
4787
4788 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
4789 GID is unknown (Bug#10257).
4790
2adb6e85
PE
47912011-12-17 Paul Eggert <eggert@cs.ucla.edu>
4792
4793 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
4794 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
4795 which caused a build failure on GNU/Linux IA-64. This problem was
4796 introduced by my 2011-10-07 patch.
4797
d1d7b339
JL
47982011-12-15 Juri Linkov <juri@jurta.org>
4799
4800 * image.c (imagemagick_error): New function. (Bug#10112)
4801 (imagemagick_load_image): Comment out `MagickSetResolution' call.
4802 Use `imagemagick_error' where ImageMagick functions return
4803 `MagickFalse'.
4804 (Fimagemagick_types): Add `Fnreverse' to return the list in the
4805 proper order.
4806
100d5755
KH
48072011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4808
4809 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
4810 fill background (Bug#8992).
4811
454592a6
MR
48122011-12-13 Martin Rudalics <rudalics@gmx.at>
4813
4814 * window.c (Vwindow_combination_resize)
4815 (Vwindow_combination_limit): Use t instead of non-nil in
4816 doc-strings.
61d4b438
MR
4817 (Vrecenter_redisplay): Add first sentence of doc-string on
4818 separate line.
53524d93 4819 (Frecenter): Fix doc-string typo.
454592a6 4820
3633e3aa
KH
48212011-12-11 Kenichi Handa <handa@m17n.org>
4822
4823 * coding.c (Funencodable_char_position): Pay attention to the
4824 buffer text relocation (Bug#9389).
4825
7b9d523a 48262011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 4827
7b9d523a
JD
4828 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
4829 gtk_init (Bug#10100).
4830
b73189c6
EZ
48312011-12-10 Eli Zaretskii <eliz@gnu.org>
4832
4833 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
4834 IT->string is nil. (Bug#10263)
4835
f7dfe5d6
JD
48362011-12-10 Jan Djärv <jan.h.d@swipnet.se>
4837
83faebb4
JD
4838 * nsterm.h (x_free_frame_resources): Declare.
4839
f7dfe5d6
JD
4840 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
4841 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
4842
4843 * nsterm.h (ns_get_defaults_value): Declare.
4844
4845 * nsterm.m (ns_default): Call ns_get_defaults_value.
4846
7cd4e72c
EZ
48472011-12-09 Eli Zaretskii <eliz@gnu.org>
4848
4849 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
4850 (Bug#10170)
4851
b34d7317
YM
48522011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4853
4854 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
4855 that where the value of an _OBJC_* symbol points to is in the .bss
4856 section (Bug#10240).
4857
76470ad1
KH
48582011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4859
4860 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 4861 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 4862
745fff94
KH
48632011-12-08 Kenichi Handa <handa@m17n.org>
4864
4865 * ftfont.c (get_adstyle_property): Fix previous change
4866 (Bug#10233).
4867
6e44397c
JB
48682011-12-07 Juanma Barranquero <lekktu@gmail.com>
4869
4870 * w32.c (init_environment): If no_site_lisp, remove site-lisp
4871 dirs from the default value of EMACSLOADPATH (bug#10208).
4872
7efa6272
GM
48732011-12-07 Glenn Morris <rgm@gnu.org>
4874
4875 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
4876 installation and source directories as well. (Bug#10208)
4877
f6fc4d87
CY
48782011-12-06 Chong Yidong <cyd@gnu.org>
4879
4880 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
4881
2bf26180
GM
48822011-12-06 Glenn Morris <rgm@gnu.org>
4883
4884 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
4885 as an error, not just -1. (Bug#10217)
4886
3a6ad4f0
CY
48872011-12-05 Chong Yidong <cyd@gnu.org>
4888
4889 * keyboard.c (process_special_events): New function.
4890 (swallow_events, Finput_pending_p): Use it (Bug#10195).
4891
75a3b399
PE
48922011-12-05 Paul Eggert <eggert@cs.ucla.edu>
4893
4894 * coding.c (encode_designation_at_bol): Don't use uninitialized
4895 local variable (Bug#9318).
4896
c3c9e25e
KH
48972011-12-05 Kenichi Handa <handa@m17n.org>
4898
4899 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
4900 return Qnil (Bug#8046, Bug#10193).
4901
5eb05ea3
KH
49022011-12-05 Kenichi Handa <handa@m17n.org>
4903
4904 * coding.c (encode_designation_at_bol): New args charbuf_end and
4905 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
4906 (coding_set_source): Return how many bytes coding->source was
4907 relocated.
4908 (coding_set_destination): Return how many bytes
4909 coding->destination was relocated.
4910 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 4911 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
4912
49132011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4914
4915 * coding.c (CODING_CHAR_CHARSET_P): New macro.
4916 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
4917 macro (Bug#9318).
4918
49192011-12-05 Andreas Schwab <schwab@linux-m68k.org>
4920
4921 The following changes are to fix Bug#9318.
4922
a79703f5 4923 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
4924 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
4925 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 4926 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 4927
7dbda6df
JB
49282011-12-05 Juanma Barranquero <lekktu@gmail.com>
4929
4930 * lisp.h (process_quit_flag): Fix external declaration.
4931
6d5eb5b0
SM
49322011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
4933
4934 Don't macro-inline non-performance-critical code.
4935 * eval.c (process_quit_flag): New function.
4936 * lisp.h (QUIT): Use it.
4937
a0c3fad0
JD
49382011-12-04 Jan Djärv <jan.h.d@swipnet.se>
4939
4940 * nsfns.m (get_geometry_from_preferences): New function.
4941 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
4942
6c07aac2
AS
49432011-12-04 Andreas Schwab <schwab@linux-m68k.org>
4944
4945 * emacs.c (Qkill_emacs): Define.
4946 (syms_of_emacs): Initialize it.
4947 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
4948 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
4949 (quit_throw_to_read_char): Add parameter `from_signal'.
4950 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
4951 * lisp.h (QUIT): Call Fkill_emacs if requested.
4952
c052ead4
JD
49532011-12-03 Jan Djärv <jan.h.d@swipnet.se>
4954
4955 * widget.c (update_wm_hints): Return if wmshell is null.
4956 (widget_update_wm_size_hints): New function.
4957
4958 * widget.h (widget_update_wm_size_hints): Declare.
4959
4960 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
4961 widget_update_wm_size_hints (Bug#10104).
4962
9e49252b
EZ
49632011-12-03 Eli Zaretskii <eliz@gnu.org>
4964
4965 * xdisp.c (handle_invisible_prop): If the invisible text ends just
4966 before a newline, prepare the bidi iterator for consuming the
4967 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 4968 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 4969
02b16839
JL
49702011-12-02 Juri Linkov <juri@jurta.org>
4971
4972 * search.c (Fword_search_regexp): New Lisp function created from
4973 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
4974 (Fword_search_backward, Fword_search_forward)
4975 (Fword_search_backward_lax, Fword_search_forward_lax):
4976 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
4977 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
4978
0068070e
SM
49792011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
4980
4981 * fileio.c (Finsert_file_contents): Move after-change-function call
4982 to before the "handled:" label, since all "goto handled" appear in
4983 cases where the *-change-functions have already been properly called
4984 (bug#10117).
4985
3360a3fc
AS
49862011-12-01 Andreas Schwab <schwab@linux-m68k.org>
4987
4988 * keyboard.c (interrupt_signal): Don't call kill-emacs when
4989 waiting for input. (Bug#10169)
4990
73d6c093
EZ
49912011-11-30 Eli Zaretskii <eliz@gnu.org>
4992
4993 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
4994 verifies glyph row's hash code--we have just reallocated the
4995 glyphs, so their contents can be complete garbage. (Bug#10164)
4996
febe6bea
JB
49972011-11-30 Juanma Barranquero <lekktu@gmail.com>
4998
4999 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5000
801a4313
EZ
50012011-11-30 Eli Zaretskii <eliz@gnu.org>
5002
5003 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5004 attributes are tested _before_ calling verify_row_hash, to protect
5005 against GCC re-ordering of the tests. (Bug#10164)
5006
2b56b87e
JD
50072011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5008
5009 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5010
5011 * xterm.c (handle_one_xevent): Only set async_visible and friends
5012 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 5013 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
5014 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5015
dbf31225
PE
50162011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5017
5018 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5019 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5020 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5021 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5022 All uses changed to use GCPRO1 etc.
5023 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5024 Revert to old implementation (i.e., before 2011-03-11).
5025
1305621b
YM
50262011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5027
5028 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5029 of scroll runs so as to avoid assigning disabled bogus rows and
5030 unnecessary graphics copy operations.
5031
8c9afb46
EZ
50322011-11-27 Eli Zaretskii <eliz@gnu.org>
5033
5034 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5035 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5036 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5037 (malloc, free, realloc, calloc): Redirect to e_* only when
5038 compiling Emacs.
5039
5040 * lisp.h (GCTYPEBITS): Move before first use.
5041 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5042 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5043 this macro definition.
5044
5045 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5046 _MSC_VER.
5047
54e9e3bf
JD
50482011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5049
6d5eb5b0
SM
5050 * gtkutil.c (xg_create_frame_widgets):
5051 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
5052 present with Gtk+ 2.0.
5053
83aca1cb
PE
50542011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5055
5056 * fileio.c (Finsert_file_contents): Undo previous change; see
5057 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5058
5b76caa4
PE
50592011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5060
5061 Rename locals to avoid shadowing.
5062 * fileio.c (Finsert_file_contents):
5063 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
5064 * process.c (wait_reading_process_output):
5065 Rename inner 'proc' to 'p' to avoid shadowing.
5066 Indent for consistency with usual Emacs style.
5067
8c535114
EZ
50682011-11-25 Eli Zaretskii <eliz@gnu.org>
5069
5070 * xdisp.c (redisplay_window): If cursor row is not fully visible
5071 after recentering, and scroll-conservatively is set to a large
5072 number, scroll window by a few more lines to make the cursor fully
5073 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
5074 (start_display): Don't move to the next line if the display should
5075 start at a newline that is part of a display vector or an overlay
5076 string. (Bug#10119)
8c535114 5077
fa4fdb5c
JL
50782011-11-24 Juri Linkov <juri@jurta.org>
5079
5080 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
5081 after the `MagickPingImage' call. (Bug#10112)
5082
90ec88df
CY
50832011-11-23 Chong Yidong <cyd@gnu.org>
5084
5085 * window.c (Fcoordinates_in_window_p): Accept only live windows.
5086
56e2e794
MR
50872011-11-23 Martin Rudalics <rudalics@gmx.at>
5088
5089 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
5090 making another buffer current. (Bug#10114)
5091
b6e64c41
GM
50922011-11-23 Glenn Morris <rgm@gnu.org>
5093
5094 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
5095
6b21de18
CY
50962011-11-23 Chong Yidong <cyd@gnu.org>
5097
5098 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
5099 using it (Bug#5984).
5100
b12cd789
EZ
51012011-11-22 Eli Zaretskii <eliz@gnu.org>
5102
5103 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5104 and header-lines, as they don't have one computed for them.
5105 (Bug#10098)
5106
5107 * .gdbinit (prow): Make displayed values more self-explaining.
5108 Add row's hash code.
5109
261b6fd4
LMI
51102011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5111
5112 * process.c (wait_reading_process_output): Fix asynchrounous
5113 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5114 (wait_reading_process_output): Add comment and URL.
261b6fd4 5115
e7cfd277
JD
51162011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5117
5118 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5119
a9b9b7f5
CY
51202011-11-21 Chong Yidong <cyd@gnu.org>
5121
5122 * window.c (Fnext_window, Fprevious_window): Doc fix.
5123
b0d15b4f
SM
51242011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5125
5126 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5127
fe7a3057
JB
51282011-11-20 Juanma Barranquero <lekktu@gmail.com>
5129
5130 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5131
d2999b1a
MR
51322011-11-20 Martin Rudalics <rudalics@gmx.at>
5133
5134 * window.c (Fset_window_combination_limit): Rename argument
5135 STATUS to LIMIT.
5136 (Vwindow_combination_limit): Remove "status" from doc-string.
5137
d5ff9cd0
AS
51382011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5139
5140 * m/ibms390.h: Remove.
5141 * m/ibms390x.h: Don't include "ibms390.h".
5142
a5bb9bd3
SM
51432011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5144
5145 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5146 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5147
cd1181db
JB
51482011-11-20 Juanma Barranquero <lekktu@gmail.com>
5149
5150 * casetab.c (Fset_case_table):
5151 * charset.c (Fcharset_after): Fix typos.
5152
615a3b8d 51532011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5154
17e845af
PE
5155 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5156 Otherwise, valgrind does not work on some platforms.
5157 Problem reported by Andreas Schwab in
6a0bf43d
PE
5158 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5159 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5160 is set, removing the need for VIRT_ADDRESS_VARIES.
5161 (PURE_P): Use a more-efficient implementation that needs just one
5162 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5163 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5164 to 4 (xorl, subq, cmpq, setbe).
5165 * alloc.c (pure): Always extern now, since that's the
5166 VIRT_ADDR_VARIES behavior.
5167 (PURE_POINTER_P): Use a single comparison, not two, for
5168 consistency with the new puresize.h.
5169 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5170 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5171 Remove VIRT_ADDR_VARIES no longer needed.
5172
f8fe6f96
EZ
51732011-11-19 Eli Zaretskii <eliz@gnu.org>
5174
5175 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5176 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5177 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5178 behave as if the cursor position were at the window margin.
5179
5180 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5181 and the cursor position is out of bounds, behave as if the cursor
5182 position were at the window margin. (Bug#10075)
5183
df05a53c
CY
51842011-11-18 Chong Yidong <cyd@gnu.org>
5185
5186 * window.c (Fwindow_combination_limit): Make first argument
5187 non-optional, since it is meaningless for live windows like the
5188 selected window.
61ccba97 5189
2071918e
DA
51902011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5191
5192 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5193
b50a28de
SM
51942011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5195
5196 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5197 (graft_intervals_into_buffer): Simplify.
5198
015137db
EZ
51992011-11-18 Eli Zaretskii <eliz@gnu.org>
5200
5201 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5202 hash values of the two rows.
5203 (copy_row_except_pointers): Preserve the used[] arrays and the
5204 hash values of the two rows. (Bug#10035)
68c95424 5205 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5206
5207 * xdisp.c (row_hash): New function, body extracted from
5208 compute_line_metrics.
5209 (compute_line_metrics): Call row_hash, instead of computing the
5210 hash code inline.
5211
5212 * dispnew.c (verify_row_hash): Call row_hash for computing the
5213 hash code of a row, instead of duplicating code from xdisp.c.
5214
5215 * dispextern.h (row_hash): Add prototype.
5216
a2addb04
TH
52172011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5218
5219 * frame.c (delete_frame): Don't delete the terminal when the last
5220 X frame is closed if emacs is built with GTK toolkit.
5221
df85d315
JB
52222011-11-17 Juanma Barranquero <lekktu@gmail.com>
5223
5224 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5225
a0c2d0ae
MR
52262011-11-17 Martin Rudalics <rudalics@gmx.at>
5227
5228 * window.c (Vwindow_splits): Rename to
5229 Vwindow_combination_resize. Suggested by Juri Linkov.
5230 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5231 of Vwindow_splits.
5232
58179cce
JB
52332011-11-16 Juanma Barranquero <lekktu@gmail.com>
5234
7877f373
JB
5235 * nsfns.m (Fns_font_name):
5236 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5237
b6f67890
MR
52382011-11-16 Martin Rudalics <rudalics@gmx.at>
5239
5240 * window.h (window): Rename slot "nest" to "combination_limit".
5241 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5242 (Fset_window_nest): Rename to Fset_window_combination_limit.
5243 (Vwindow_nest): Rename to Vwindow_combination_limit.
5244 (recombine_windows, make_parent_window, make_window)
5245 (Fsplit_window_internal, saved_window)
5246 (Fset_window_configuration, save_window_save): Rename all
5247 occurrences of window_nest to window_combination_limit.
5248
c7015153
JB
52492011-11-15 Juanma Barranquero <lekktu@gmail.com>
5250
5251 * image.c (imagemagick_load_image): Fix typo.
5252
322ad6ec
EZ
52532011-11-14 Eli Zaretskii <eliz@gnu.org>
5254
5255 * xdisp.c (display_line): Move the call to
5256 highlight_trailing_whitespace before the call to
5257 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
5258 faces of all the glyphs to compute ROW's hash value.
5259 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 5260
f067b8ec
JB
52612011-11-14 Juanma Barranquero <lekktu@gmail.com>
5262
5263 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5264 just return (bug#10044).
5265
1e5b2111
EZ
52662011-11-12 Eli Zaretskii <eliz@gnu.org>
5267
7ef3cbd5
EZ
5268 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5269 with user-defined heap size. Bump the default size of the temacs
5270 heap to 27MB, to avoid memory warning when running temacs.
5271 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5272
1e5b2111
EZ
5273 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5274 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
5275 (verify_row_hash) [XASSERTS]: New function.
5276 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5277 that the hash value of glyph rows is correct.
1e5b2111 5278
89d61221
MR
52792011-11-12 Martin Rudalics <rudalics@gmx.at>
5280
5281 * window.h (window): Remove splits slot.
5282 * window.c (Fwindow_splits, Fset_window_splits): Remove.
5283 (Fdelete_other_windows_internal, make_parent_window)
5284 (make_window, Fsplit_window_internal, Fdelete_window_internal)
5285 (Fset_window_configuration, save_window_save): Don't deal with
5286 split status of windows.
5287 (saved_window): Remove splits slot.
5288 (Vwindow_splits): Rewrite doc-string.
5289
97f18cc8
JD
52902011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5291
5292 * xfns.c (unwind_create_frame):
5293 * nsfns.m (unwind_create_frame):
5294 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5295 Vframe_list (Bug#9999).
5296
22a648b4
DA
52972011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5298
0b381c7e 5299 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5300
659afede
KH
53012011-11-11 Kenichi Handa <handa@m17n.org>
5302
5303 * callproc.c (Fcall_process): Set the member dst_multibyte of
5304 process_coding.
5305
9ac0394b
KH
53062011-11-11 Johan Bockgård <bojohan@gnu.org>
5307
5308 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5309 avoid a crash (bug#9496).
5310
2fbdc249
CY
53112011-11-09 Chong Yidong <cyd@gnu.org>
5312
5313 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5314 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5315
ac6b1f81
PE
53162011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5317
5318 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5319
09db192c
PE
53202011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5321
5322 Avoid some portability problems by eschewing 'extern inline' functions.
5323 The trivial performance wins aren't worth the portability hassles; see
5324 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5325 et seq.
5326 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5327 (window_box_width, window_box_left, window_box_left_offset)
5328 (window_box_right, window_box_right_offset): Undo previous change,
5329 by removing the "extern"s.
5330 * intervals.c (adjust_intervals_for_insertion)
5331 (adjust_intervals_for_deletion): Undo previous change,
5332 making these static again.
5333 (offset_intervals, temp_set_point_both, temp_set_point)
5334 (copy_intervals_to_string): No longer inline.
5335 * xdisp.c (window_text_bottom_y, window_box_width)
5336 (window_box_height, window_box_left_offset)
5337 (window_box_right_offset, window_box_left, window_box_right)
5338 (window_box): No longer inline.
5339
105216ed
CY
53402011-11-08 Chong Yidong <cyd@gnu.org>
5341
5342 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5343 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5344 Signal an error if not a live window.
105216ed
CY
5345 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5346 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5347
ae9e237f
JB
53482011-11-07 Juanma Barranquero <lekktu@gmail.com>
5349
5350 * lisp.h (syms_of_abbrev): Remove declaration.
5351 Reported by CHENG Gao <chenggao@royau.me>.
5352
c7aa8333
EZ
53532011-11-07 Eli Zaretskii <eliz@gnu.org>
5354
5355 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5356 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5357 of temacs in GUI mode.
5358
be7f5545
MR
53592011-11-07 Martin Rudalics <rudalics@gmx.at>
5360
5361 * window.h: Declare delete_all_child_windows instead of
5362 delete_all_subwindows.
5363 * window.c (Fwindow_nest, Fset_window_nest)
5364 (Fset_window_new_total, Fset_window_new_normal)
5365 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5366 (delete_all_subwindows): Rename to delete_all_child_windows.
5367 (Fdelete_other_windows_internal, Fset_window_configuration):
5368 Call delete_all_child_windows instead of delete_all_subwindows.
5369 * frame.c (delete_frame): Call delete_all_child_windows instead
5370 of delete_all_subwindows.
5371
ca78dc43
PE
53722011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5375 This is also needed for porting to any host where GC_MARK_STACK is
5376 not GC_MAKE_GCPROS_NOOPS.
5377 (which_symbols): Use it.
5378
a0241d01
KH
53792011-11-07 Kenichi Handa <handa@m17n.org>
5380
5381 * coding.c (coding_set_destination): Check coding->src_pos only
5382 when coding->src_object is a buffer (bug#9910).
5383
5384 * process.c (send_process): Set the member src_multibyte of coding
5385 to 0 (bug#9911) when sending a unibyte text.
5386
5387 * callproc.c (Fcall_process): Set the member src_multibyte of
5388 process_coding to 0 (bug#9912).
5389
a64bfdfa 53902011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5391
5392 * xmenu.c (cleanup_widget_value_tree): New function.
5393 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5394 calling free_menubar_widget_value_tree directly (Bug#9830).
5395
cb41b32a
PE
53962011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5397
5398 Fix some portability problems with 'inline'.
5399 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5400 (window_box_width, window_box_left, window_box_left_offset)
5401 (window_box_right, window_box_right_offset): Declare extern.
5402 Otherwise, these inline functions do not conform to C99 and
5403 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5404 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5405 * intervals.c (adjust_intervals_for_insertion)
5406 (adjust_intervals_for_deletion): Now extern, because otherwise the
5407 extern inline functions 'offset_intervals' couldn't refer to it.
5408 (static_offset_intervals): Remove.
5409 (offset_intervals): Rewrite using the old contents of
5410 static_offset_intervals. The old version didn't conform to C99
5411 because an extern inline function contained a reference to an
5412 identifier with static linkage.
5413
b7041366
AS
54142011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5415
5416 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5417 GC.
5418
88a37c4d
EZ
54192011-11-06 Eli Zaretskii <eliz@gnu.org>
5420
5421 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5422 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5423 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5424 return Qleft_to_right.
5425
49745b39
CY
54262011-11-06 Chong Yidong <cyd@gnu.org>
5427
5428 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5429 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5430 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5431 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5432 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5433 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5434 (Fwindow_vscroll): Doc fix.
5435 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5436 argument, since it makes no sense to pass a live window and for
5437 consistency with window-child.
5438
1f05cd82
CS
54392011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5440
5441 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5442 support MSVC.
5443
22610910
JR
54442011-11-05 Jason Rumney <jasonr@gnu.org>
5445
5446 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5447 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5448 fonts (Bug#6029).
5449 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5450 bitwise arithmetic preventing use of unicode-sip and non-truetype
5451 opentype fonts.
5452
a06776b2
EZ
54532011-11-05 Eli Zaretskii <eliz@gnu.org>
5454
3ad924ba
EZ
5455 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5456 "emacs"-only part.
5457
a06776b2
EZ
5458 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5459 initialization code to keep similarity to xfns.c after changes
5460 from 2011-11-05.
5461
c9e7db78
JD
54622011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5463
a97f8f3f
JD
5464 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5465 (unwind_create_frame): New function (Bug#9943).
5466 (Fx_create_frame): Restructure code to be more similar to the one in
5467 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5468 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5469 Move terminal->reference_count++ just before making the frame official
5470 (Bug#9943).
5471
5472 * nsterm.m (x_free_frame_resources): New function.
5473 (x_destroy_window): Move code to x_free_frame_resources.
5474
c9e7db78 5475 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5476 (Fx_create_frame, x_create_tip_frame):
5477 Move terminal->reference_count++ just before making the frame
75f1671a 5478 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5479 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5480
a6fc3b5c
EZ
54812011-11-05 Eli Zaretskii <eliz@gnu.org>
5482
5483 Support MSVC build with newer versions of Visual Studio.
5484 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5485 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5486 nt/gmake.defs.
5487
5488 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5489 which are not supported by MSVC.
5490 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5491 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5492 bitfields.
5493 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5494 types in bitfields.
5495 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5496
5497 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5498
58179cce 54992011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5500
5501 Support MSVC build with newer versions of Visual Studio.
5502 * w32.c: Don't include w32api.h for MSVC.
5503 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5504
5505 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5506 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5507 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5508 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5509 e_* cousins.
5510 (alloca) [_MSC_VER]: Define to _alloca.
5511
5512 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5513
5514 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5515
a58c13ed
EZ
55162011-11-04 Eli Zaretskii <eliz@gnu.org>
5517
5518 * xdisp.c (note_mouse_highlight): If either of
5519 previous/next-single-property-change returns nil, treat that as
5520 the beginning or the end of the buffer. (Bug#9955)
5521
fe0b6370
JD
55222011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5523
a58c13ed 5524 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5525 label is not null (Bug#9951).
5526 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5527 may be NULL.
5528
89bd5ee1
EZ
55292011-11-04 Eli Zaretskii <eliz@gnu.org>
5530
5531 * window.c (Fwindow_body_size): Mention in the doc string that the
5532 return value is in frame's canonical units. (Bug#9949)
5533
84c3edb9
EZ
55342011-11-03 Eli Zaretskii <eliz@gnu.org>
5535
4e2fb5c7
EZ
5536 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5537
84c3edb9 5538 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5539 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5540 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5541
bc17a887
EZ
55422011-11-01 Eli Zaretskii <eliz@gnu.org>
5543
5544 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5545 Don't stop backward scan on the continuation glyph, even though
5546 its CHARPOS is positive.
6d5eb5b0
SM
5547 (mouse_face_from_buffer_pos, note_mouse_highlight):
5548 Rename cover_string to disp_string.
bc17a887 5549
4ee88440
MR
55502011-11-01 Martin Rudalics <rudalics@gmx.at>
5551
5552 * window.c (temp_output_buffer_show): Don't use
5553 Vtemp_buffer_show_specifiers.
5554 (Vtemp_buffer_show_specifiers): Remove unused variable.
5555
c2ff3c02
EZ
55562011-10-30 Eli Zaretskii <eliz@gnu.org>
5557
5558 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5559 past the beginning of the current glyph matrix.
5560
58179cce 55612011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5562
5563 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5564 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5565 HAVE_GTK3 (Bug#9869).
b77a6a7f 5566
3b574623
JD
5567 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5568 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5569
b77a6a7f
JD
5570 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5571
5572 * xterm.c: Declare x_handle_net_wm_state to return int.
5573 (handle_one_xevent): Check if we are iconified but don't have
5574 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
5575 (get_current_wm_state): Return non-zero if not hidden,
5576 check for _NET_WM_STATE_HIDDEN (Bug#9893).
5577 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5578 (x_handle_net_wm_state): Return what get_current_wm_state returns.
5579 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5580
196e41e4
PE
55812011-10-29 Paul Eggert <eggert@cs.ucla.edu>
5582
5583 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5584 so that this new function doesn't get optimized away by a
5585 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
5586
021f2e1a
AS
55872011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5588
5589 * frame.h (MOUSE_HL_INFO): Remove excess parens.
5590
8b058d44
EZ
55912011-10-29 Eli Zaretskii <eliz@gnu.org>
5592
5593 Fix the `xbytecode' command.
5594 * .gdbinit (xprintbytestr): New command.
b50a28de 5595 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
5596 (xbytecode): Print the byte-code string as well.
5597
4452fb80
EZ
55982011-10-29 Kim Storm <storm@cua.dk>
5599
8b058d44
EZ
5600 * alloc.c (which_symbols): New function.
5601
21b72067
AS
56022011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5603
5604 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5605 line. (Bug#9903)
5606
83ed7b5c
GM
56072011-10-29 Glenn Morris <rgm@gnu.org>
5608
5609 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5610 Not clear what it was for, and it causes various bugs. (Bug#9839)
5611
5a7a728b
EZ
56122011-10-28 Eli Zaretskii <eliz@gnu.org>
5613
5614 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5615 possible random value that matches one of those tested as
5616 condition to clear the mouse face.
5617
d3d0842f
CY
56182011-10-28 Chong Yidong <cyd@gnu.org>
5619
5620 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5621
31b39d13
DN
56222011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
5623
5624 * window.c (make_window): Initialize phys_cursor_on_p.
5625
9aba6043
SM
56262011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5627
5628 * lisp.h (struct Lisp_Symbol): Update comments.
5629
c20992f4
JB
56302011-10-28 Juanma Barranquero <lekktu@gmail.com>
5631
5632 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5633
db4f02f2
EZ
56342011-10-28 Eli Zaretskii <eliz@gnu.org>
5635
5636 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
5637 <oslsachem@gmail.com> for helping to debug this.
5638
5639 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5640 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5641 (g_b_init_get_glyph_outline_w): New static variables.
5642 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5643 (GetGlyphOutlineW_Proc): New typedefs.
5644 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
5645 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5646 New functions.
5647 (w32font_open_internal, compute_metrics):
5648 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
5649 instead of calling the "wide" APIs directly.
5650
5651 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5652
5653 * w32.h (syms_of_w32font): Add prototype.
5654
87e68db4
JB
56552011-10-27 Juanma Barranquero <lekktu@gmail.com>
5656
5657 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5658 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5659 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5660 (Fmove_to_window_line): Doc fix.
5661
435c1d67
CY
56622011-10-27 Chong Yidong <cyd@gnu.org>
5663
5664 * process.c (make_process): Set gnutls_state to NULL.
5665
5666 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5667 non-NULL, regardless of GNUTLS_INITSTAGE.
5668 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
5669 an error. Set process slots as soon as we allocate them.
5670
5671 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5672
9c6c6f49
CY
56732011-10-27 Chong Yidong <cyd@gnu.org>
5674
9aba6043
SM
5675 * gnutls.c (emacs_gnutls_deinit): New function.
5676 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
5677 (Fgnutls_deinit, Fgnutls_boot): Use it.
5678
5679 * process.c (make_process): Initialize GnuTLS credentials to NULL.
5680 (deactivate_process): Call emacs_gnutls_deinit.
5681
657d08d3
JB
56822011-10-27 Juanma Barranquero <lekktu@gmail.com>
5683
5684 * image.c (x_create_x_image_and_pixmap):
5685 * w32.c (sys_rename, w32_delayed_load):
5686 * w32font.c (fill_in_logfont):
5687 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5688
5430d399
JB
56892011-10-26 Juanma Barranquero <lekktu@gmail.com>
5690
5691 * w32fns.c (w32_default_color_map): New function,
5692 extracted from Fw32_default_color_map.
a7ef684b 5693 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 5694
fe0055fa
PE
56952011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5696
5697 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5698
e6346438
SM
56992011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
5700
5701 * keyboard.c (test_undefined): New function (bug#9751).
5702 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5703
e112cc37
ET
57042011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
5705
5706 * sysdep.c (init_sys_modes): Fix the check for the controlling
5707 terminal (Bug#6649).
5708
7b5d6677
EZ
57092011-10-20 Eli Zaretskii <eliz@gnu.org>
5710
5711 * dispextern.h (struct bidi_it): New member next_en_type.
5712
5713 * bidi.c (bidi_line_init): Initialize the next_en_type member.
5714 (bidi_resolve_explicit_1): When next_en_pos is valid for the
5715 current character, check also for next_en_type being WEAK_EN.
5716 (bidi_resolve_weak): Don't enter the expensive loop if the current
5717 position is before next_en_pos. Record the bidi type of the first
5718 non-ET, non-BN character we find, in addition to its position.
5719 (bidi_level_of_next_char): Invalidate next_en_type when
5720 next_en_pos is over-stepped.
5721
7da0b018
PE
57222011-10-20 Paul Eggert <eggert@cs.ucla.edu>
5723
5724 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5725 * editfns.c: Rewrite current-time-zone so that it invokes
5726 the equivalent of (format-time-string "%Z") to get the time zone name.
5727 This fixes a bug when the time zone name contains characters that
5728 need converting from the system time locale to Emacs internal format.
5729 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5730 that patch fixed format-time-string to do the conversion, but
5731 I forgot to fix current-time-zone.
5732 (format_time_string): New function, containing most of
5733 what Fformat_time_string used to contain.
5734 (Fformat_time_string): Rewrite in terms of format_time_string.
5735 This doesn't change this function's behavior.
5736 (current-time-zone): Rewrite to use format_time_string.
5737 This fixes the bug reported by Michael Schierl in
5738 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5739 Jason Rumney's 2007-06-07 change worked around this bug, but
5740 didn't fix it.
5741 * systime.h (tzname, timezone): Remove no-longer-used declarations.
5742
8547b010
EZ
57432011-10-19 Eli Zaretskii <eliz@gnu.org>
5744
5745 * xdisp.c (start_display): If the character at POS is displayed
5746 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
5747 (try_window_reusing_current_matrix): If a line ends in a display
5748 vector or the next line starts in a display vector, continue
5749 redrawing the window even though the character position of
5750 start_row was reached.
8547b010
EZ
5751 (Bug#9771, part 2)
5752
4e948d15
CY
57532011-10-18 Chong Yidong <cyd@gnu.org>
5754
5755 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5756 with nobreak-char-display too.
5757
4787455f
EZ
57582011-10-18 Eli Zaretskii <eliz@gnu.org>
5759
5760 Fix part 3 of bug#9771.
5761 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
5762 (bidi_resolve_neutral): Don't enter the expensive loop looking for
5763 non-neutral characters if the current character is a paragraph
5764 separator (a.k.a. Newline). This avoids running the same
5765 expensive loop twice, once when we consume the preceding newline
5766 and the other time when the line actually needs to be displayed.
5767 Avoid the loop when we see neutrals on the base embedding level
5768 following a character whose directionality is the same as the
5769 paragraph's. This avoids running the expensive loop when a line
5770 ends in a long sequence of neutrals, like control characters.
5771 Add assertion against STRONG_AL type. Slightly rearrange code
5772 that determines the type of a neutral given the first non-neutral
5773 that follows it.
5774 (bidi_level_of_next_char): Set next_en_pos to zero when
5775 invalidating its info.
5776
2c91f553
EZ
57772011-10-17 Eli Zaretskii <eliz@gnu.org>
5778
5779 * xdisp.c (push_display_prop): Determine whether to record string
5780 or buffer position by IT->string, not by IT->method. Allow
5781 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
5782 (move_it_vertically_backward): Don't look for character position
5783 immediately after the newline when in a continuation line.
5784 (Bug#9771, part 1)
2c91f553 5785
c7b08b0d
MR
57862011-10-15 Martin Rudalics <rudalics@gmx.at>
5787
5788 * window.c (coordinates_in_window): Rewrite and delabelize
5789 vertical border check. (Bug#5357) (Bug#9618)
5790
6b02f655
SM
57912011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
5792
5793 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
5794 errors in XSetWindowBorder (bug#9310).
5795
81d40c92
DA
57962011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
5797
5798 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
5799 avoid crash when xmalloc overrun checking is enabled.
5800
d4172c3b
EZ
58012011-10-13 Eli Zaretskii <eliz@gnu.org>
5802
5803 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
5804 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
5805 cursor motion with <left> and <right> arrow keys.
5806
5807 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
5808 some callers set that themselves.
5809
b00eea75
EZ
58102011-10-12 Eli Zaretskii <eliz@gnu.org>
5811
5812 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
5813 display string and the previous row comes from the same string and
5814 is empty. (Bug#9739) (Bug#9738)
5815
8fe012c4
SM
58162011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5817
5818 * doc.c (get_doc_string): Encode file name (bug#9735).
5819
0074aef2
EZ
58202011-10-12 Eli Zaretskii <eliz@gnu.org>
5821
79beb178
EZ
5822 * bidi.c (bidi_level_of_next_char):
5823 * xdisp.c (get_visually_first_element): Remove old incorrect
5824 comments regarding the Unicode Line Separator character.
5825
0074aef2
EZ
5826 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
5827
6e4b3fbe
DA
58282011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
5829
5830 * alloc.c (Fgc_status): Do not access beyond zombies array
5831 boundary if nzombies > MAX_ZOMBIES.
5832 * alloc.c (dump_zombies): Add missing format specifier.
5833
0324f3af
PE
58342011-10-12 Paul Eggert <eggert@cs.ucla.edu>
5835
b5525cac
PE
5836 * xdisp.c (set_cursor_from_row): Simplify conditionals,
5837 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
5838
0324f3af
PE
5839 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
5840 Some packages use them to denote characters with modifiers.
5841
e9b5f888
AS
58422011-10-11 Andreas Schwab <schwab@linux-m68k.org>
5843
5844 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
5845 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
5846 matching a pp-number. Rename parameter var to var1.
5847
127827c0
SM
58482011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5849
5850 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
5851
c8fd3bd0
GM
58522011-10-08 Glenn Morris <rgm@gnu.org>
5853
5854 * callint.c (Fcall_interactively): Give a more explicit error for the
5855 'c' case with a non-character input. (Bug#8479)
5856
352ec8ff
EZ
58572011-10-08 Eli Zaretskii <eliz@gnu.org>
5858
03669ccb
EZ
5859 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
5860 lines.
7061c986
EZ
5861 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
5862 lines that are hscrolled on the left.
03669ccb 5863
352ec8ff
EZ
5864 * dispnew.c (buffer_posn_from_coords): Account for a possible
5865 presence of header-line. (Bug#4426)
5866
a66cfb1c
SM
58672011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
5868
6b02f655
SM
5869 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
5870 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 5871
7c5ee88e
PE
58722011-10-07 Paul Eggert <eggert@cs.ucla.edu>
5873
5874 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
5875 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
5876 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
5877 this makes Emacs dump core during garbage collection on rare
5878 occasions. sizeof is obviously inferior to offsetof here, so
5879 stick with offsetof.
5880 (GC_POINTER_ALIGNMENT): New macro.
5881 (mark_memory): Omit 3rd (offset) arg; caller changed.
5882 Don't assume EMACS_INT alignment is the same as pointer alignment.
5883
df1bbe5b
SM
58842011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
5885
5886 * keyboard.c (read_key_sequence_remapped): New var.
5887 (read_key_sequence): Compute remapping in the right buffer.
5888 (command_loop_1): Use read_key_sequence's remapping directly.
5889
51553db6
SM
58902011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5891
32c1fffd
SM
5892 * dired.c (file_name_completion): Don't expand file name.
5893 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
5894 before checking file name handler.
5895
51553db6
SM
5896 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
5897 they've been requested explicitly (bug#9591).
5898
b6bd1599 58992011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
5900
5901 * keymap.c (Fsingle_key_description): Use make_specified_string
5902 instead of build_string to build string from push_key_description.
5903 (Bug#5193)
5904
f701dc2a
PE
59052011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5906
4222c55d
PE
5907 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
5908 This fixes a Y2038 bug on 64-bit hosts.
5909 * buffer.c (reset_buffer):
5910 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
5911 (Fclear_buffer_auto_save_failure):
5912 Use 0, not -1, to represent an unset failure time, since time_t
5913 might not be signed.
5914
f701dc2a
PE
5915 Remove dependency on glibc malloc internals.
5916 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5917 Move back here from lisp.h, but with their new implementations.
5918 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5919 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
5920 * charset.c (charset_table_init): New static var.
5921 (syms_of_charset): Use it instead of xmalloc. This removes a
5922 dependency on glibc malloc internals. See Eli Zaretskii's comment in
5923 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
5924 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5925 Move back to alloc.c.
5926 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5927 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
5928
9ceebf39
JD
59292011-09-30 Jan Djärv <jan.h.d@swipnet.se>
5930
5931 * nsterm.m (windowDidResize): Call x_set_window_size only when
5932 ns_in_resize is true. Otherwise set pixelwidth/height and
5933 call change_frame_size (Bug#9628).
5934
cb993c58
PE
59352011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5936
3930c88b
PE
5937 Port --enable-checking=all to Fedora 14 x86-64.
5938 * charset.c (syms_of_charset): Also account for glibc malloc's
5939 internal overhead when calculating the initial malloc maximum.
5940
cb993c58
PE
5941 Port --enable-checking=all to Fedora 14 x86.
5942 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5943 Move to lisp.h.
5944 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
5945 (overrun_check_realloc, overrun_check_free):
5946 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
5947 That way, xmalloc returns a properly-aligned pointer even if
5948 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
5949 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
5950 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
5951 into account when calculating the initial malloc maximum.
5952 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5953 Move here from alloc.c, so that charset.c can use it too.
5954 Properly align; the old code wasn't right for common 32-bit hosts
5955 when configured with --enable-checking=all.
5956 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5957 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
5958
31bed486
EZ
59592011-09-29 Eli Zaretskii <eliz@gnu.org>
5960
04c70788 5961 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
5962 use EDOM.
5963
fbcaa2f3
EZ
59642011-09-28 Eli Zaretskii <eliz@gnu.org>
5965
5966 * xdisp.c (compute_display_string_end): If there's no display
5967 string at CHARPOS, return -1.
5968
5969 * bidi.c (bidi_fetch_char): When compute_display_string_end
5970 returns a negative value, treat the character as a normal
5971 character not covered by a display string. (Bug#9624)
5972
a239d4e9
JB
59732011-09-28 Juanma Barranquero <lekktu@gmail.com>
5974
5975 * lread.c (Fread_from_string): Fix typo in docstring.
5976
88652fd5
EZ
59772011-09-27 Eli Zaretskii <eliz@gnu.org>
5978
5979 * xdisp.c (handle_invisible_prop): If invisible text ends on a
5980 newline, reseat the iterator instead of bidi-iterating there one
5981 character at a time. (Bug#9610)
32c1fffd
SM
5982 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
5983 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 5984
ed497dd4
AS
59852011-09-27 Andreas Schwab <schwab@linux-m68k.org>
5986
5987 * lread.c (readevalloop): Use correct code for NBSP.
5988 (read1): Likewise. (Bug#9608)
5989
b2bf61aa
MA
59902011-09-25 Michael Albinus <michael.albinus@gmx.de>
5991
5992 * dbusbind.c (Fdbus_register_signal): When service is not
5993 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
5994
32bbb17c
GM
59952011-09-25 Glenn Morris <rgm@gnu.org>
5996
5997 * buffer.c (truncate-lines): Doc fix.
5998
94e0933e
CY
59992011-09-24 Chong Yidong <cyd@stupidchicken.com>
6000
6001 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6002 (Fset_window_next_buffers): Doc fix.
6003
cddde921
GM
60042011-09-24 Glenn Morris <rgm@gnu.org>
6005
6006 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6007
1260aef1
PE
60082011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6009
25b4bfa0
PE
6010 Fix minor problems found by static checking.
6011 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
6012 * indent.c (Fvertical_motion): Fix == vs = typo.
6013
e3cbd34b
EZ
60142011-09-24 Eli Zaretskii <eliz@gnu.org>
6015
a66cfb1c
SM
6016 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6017 Default value is now t. Doc fix.
6bf7006f 6018
e3cbd34b 6019 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 6020 logic when moving up, not only when moving down. Fix the
e3cbd34b 6021 confusing name and values of the it_overshoot_expected variable;
32c1fffd 6022 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
6023
6024 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6025 CHARPOS is covered by a display string which includes newlines.
6026 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6027 is covered by a display string with embedded newlines.
6028
a3de0cbd
MA
60292011-09-24 Michael Albinus <michael.albinus@gmx.de>
6030
6031 * dbusbind.c (Fdbus_register_signal): Add match rule to
6032 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
6033 (Fdbus_register_method, Vdbus_registered_objects_table):
6034 Fix docstring.
a3de0cbd 6035
b260039d
JM
60362011-09-24 Jim Meyering <meyering@redhat.com>
6037
32c1fffd 6038 do not ignore write error for any output size
b260039d
JM
6039 The previous change was incomplete.
6040 While it makes emacs --batch detect the vast majority of stdout
6041 write failures, errors were still ignored whenever the output size is
6042 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6043 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6044 && echo FAIL: ignored write error
6045 FAIL: ignored write error
6046 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6047 && echo FAIL: ignored write error
6048 FAIL: ignored write error
6049 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6050
8eca8a7c
AS
60512011-09-23 Andreas Schwab <schwab@linux-m68k.org>
6052
6053 * emacs.c (Fkill_emacs): In noninteractive mode exit
6054 non-successfully if a write error occurred on stdout. (Bug#9574)
6055
3341db62
EZ
60562011-09-21 Eli Zaretskii <eliz@gnu.org>
6057
6058 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
6059 the xassert test.
6060
6061 * dispextern.h (struct it): Update the comment documenting what
6062 can it->OBJECT be.
6063
8c203dbf
EZ
60642011-09-20 Eli Zaretskii <eliz@gnu.org>
6065
6066 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
6067 a display string, extend search for cursor position to end of row.
6068 (find_row_edges): If the row ends in a newline from a display
6069 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
6070 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
6071 (Fcurrent_bidi_paragraph_direction): Fix search for previous
6072 non-empty line. Fixes confusing cursor motion with arrow keys at
6073 the beginning of a line that starts with whitespace.
8c203dbf 6074
a4824228
LMI
60752011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6076
6077 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
6078 (bug#9493).
6079
33ed493b
CY
60802011-09-18 Chong Yidong <cyd@stupidchicken.com>
6081
6082 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
6083 boolean (Bug#9154).
6084
56cd55c8
EZ
60852011-09-18 Eli Zaretskii <eliz@gnu.org>
6086
6087 * xdisp.c (display_line): Record maximum and minimum buffer
6088 positions even if no glyphs were produced (e.g., by a zero-width
6089 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
6090 buffer positions that will be removed from the glyph row because
6091 they don't fit.
c02dcedf
EZ
6092 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
6093 column is beyond frame width: don't subtract 1 "pixel" when
6094 computing width of the stretch.
3e62b7e0
EZ
6095 (reseat_at_next_visible_line_start): Undo the change made on
6096 2011-09-17 that saved paragraph information and restored it after
6097 the call to `reseat'. (Bug#9545)
56cd55c8 6098
5ed99d36 60992011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
6100
6101 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
6102 and turn window cursor on if cleared (Bug#9415).
6103
5ed99d36 61042011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6105
6106 * search.c (boyer_moore): Take unibyte characters from pattern
6107 literally. (Bug#9458)
6108
9bade7b2
EZ
61092011-09-18 Eli Zaretskii <eliz@gnu.org>
6110
6111 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6112
e5e9d610
PE
61132011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6114
87e4427a
PE
6115 Fix minor problem found by static checking.
6116 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6117 initialized, to pacify gcc -Wuninitialized.
6118
e5e9d610
PE
6119 * fileio.c: Report proper errno when syscall falls.
6120 (Finsert_file_contents): Save and restore errno,
6121 so that report_file_error outputs the correct diagnostic.
6122 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6123
a1674f0b
EZ
61242011-09-18 Eli Zaretskii <eliz@gnu.org>
6125
6126 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6127
fbfb6dd4
EZ
61282011-09-17 Eli Zaretskii <eliz@gnu.org>
6129
6130 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6131 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6132
bb187662
EZ
61332011-09-17 Eli Zaretskii <eliz@gnu.org>
6134
1137e8b8 6135 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6136 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6137
6138 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6139 (bidi_find_paragraph_start): Search back for paragraph beginning
6140 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6141 (bidi_move_to_visually_next): Only trigger paragraph-related
6142 computations when the last character is a newline or at EOB, not
6143 just any NEUTRAL_B. (Bug#9470)
6144
bb187662
EZ
6145 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6146 truncated lines if point is covered by a display string. (Bug#9524)
6147
2e621251
PE
61482011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6149
6150 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6151 (cons_to_x_long): New function.
6152 (lisp_data_to_selection_data): Use it. Correct the test for
6153 short-versus-long data; it was negated. Break out of vector
6154 loop, for efficiency, when a long datum is discovered.
6155
91a15bc6
SM
61562011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6157
6158 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6159
b41c3a35
EZ
61602011-09-16 Eli Zaretskii <eliz@gnu.org>
6161
6162 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6163 GCC PR/17406) by declaring this function with external scope.
6164
7812ba2d
PE
61652011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6166
6167 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6168 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6169
cf7edc2a
AS
61702011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6171
6172 * editfns.c (Fformat): Correctly handle text properties on "%%".
6173
bd01620e
EZ
61742011-09-15 Eli Zaretskii <eliz@gnu.org>
6175
6176 * xterm.c (x_draw_composite_glyph_string_foreground):
6177 * w32term.c (x_draw_composite_glyph_string_foreground):
6178 * term.c (encode_terminal_code):
6179 * composite.c (composition_update_it, get_composition_id):
6180 * xdisp.c (get_next_display_element)
6181 (fill_composite_glyph_string): Add comments about special meaning
6182 of TAB characters in a composition.
6183
a02719a3
PE
61842011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6185
6186 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6187 This occurs when processing a multibyte format.
6188 Problem reported by Wolfgang Jenker.
a02719a3 6189
72589a3c
JB
61902011-09-15 Johan Bockgård <bojohan@gnu.org>
6191
6192 * xdisp.c (try_cursor_movement): Only check for exact match if
6193 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6194
1c14176c
PE
61952011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6196
6197 Remove unused external symbols.
6198 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6199 * xdisp.c (calc_pixel_width_or_height): Now static.
6200 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6201 * indent.c (check_display_width):
6202 * w32term.c: Fix comment to match code.
6203 * xterm.c, xterm.h (x_catching_errors): Remove.
6204
d2eea5b5
PE
62052011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6206
6207 * xselect.c: Use signed conversions more consistently (Bug#9498).
6208 (selection_data_to_lisp_data): Assume incoming selection data are
6209 signed integers, not unsigned. This is to be consistent with
6210 outgoing selection data, which was modified to use signed integers
6211 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6212 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6213 expects long, not unsigned long.
6214
46888499
EZ
62152011-09-14 Eli Zaretskii <eliz@gnu.org>
6216
6217 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6218 computation of loop end. Reported by Johan Bockgård
6219 <bojohan@gnu.org>.
6220
ef8ef9fb
CY
62212011-09-13 Chong Yidong <cyd@stupidchicken.com>
6222
6223 * frame.c (Fother_visible_frames_p): Function deleted.
6224
fa819fed
EZ
62252011-09-12 Eli Zaretskii <eliz@gnu.org>
6226
6227 * indent.c (compute_motion): Process display vector front to back
6228 rather than the other way around. (Bug#2496)
6229
2ba8e008
SM
62302011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6231
6232 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6233
20f53c69
CY
62342011-09-11 Chong Yidong <cyd@stupidchicken.com>
6235
6236 * minibuf.c (Fread_from_minibuffer): Doc fix.
6237
d562d7a4
EZ
62382011-09-11 Eli Zaretskii <eliz@gnu.org>
6239
6240 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6241 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
6242
1c4d7f3d
LMI
62432011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6244
6245 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6246 value for non-existent files.
6247
b885bf36
EZ
62482011-09-11 Eli Zaretskii <eliz@gnu.org>
6249
6250 * fileio.c (Finsert_file_contents): If the file cannot be opened,
6251 set its "size" to -1. This will set the modtime_size field of
6252 the corresponding buffer to -1, which is what
6253 verify-visited-file-modtime expects for files that do not exist.
6254 (Bug#9139)
6255
6612f0bf
PE
62562011-09-11 Paul Eggert <eggert@cs.ucla.edu>
6257
6258 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6259 here ...
6260 * lisp.h: ... from here. push_key_description is no longer
6261 defined in keyboard.c, so its declaration should not be in
6262 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6263 logically belongs with push_key_description.
6264
dfb3f755
PE
62652011-09-10 Paul Eggert <eggert@cs.ucla.edu>
6266
6267 * buffer.h: Include <sys/types.h> instead of <time.h>.
6268 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6269 Problem reported by Herbert J. Skuhra.
6270
3134906c
LMI
62712011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
6272
6273 * xml.c (parse_region): Make the parsing work for
6274 non-comment-starting XML files again (bug#9144).
6275
8d903f4e
AS
62762011-09-10 Andreas Schwab <schwab@linux-m68k.org>
6277
6278 * image.c (gif_load): Fix calculation of bottom and right corner.
6279 (Bug#9468)
6280
80ad64f4
EZ
62812011-09-10 Eli Zaretskii <eliz@gnu.org>
6282
6283 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
6284 redisplay in small windows.
6285
208a048d
EZ
62862011-09-09 Eli Zaretskii <eliz@gnu.org>
6287
6288 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6289
9b1c252e
MR
62902011-09-08 Martin Rudalics <rudalics@gmx.at>
6291
6292 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6293 Operate on live windows only.
6294
2949f33b
JB
62952011-09-08 Juanma Barranquero <lekktu@gmail.com>
6296
6297 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6298
e08dcafd
EZ
62992011-09-07 Eli Zaretskii <eliz@gnu.org>
6300
6301 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6302 only under bidi iteration.
6303
115b96bd
JD
63042011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6305
6306 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6307
c8199d0f
PE
63082011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6309
6310 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6311 Without this fix, the command to link temacs failed due to an
6312 undefined symbol __builtin_isnan. This is because
6313 /usr/include/iso/math_c99.h #defines isnan(x) to
6314 __builtin_isnan(x), but the bundled gcc, which identifies itself
6315 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6316 a __builtin_isnan.
6317 * floatfns.c (isnan): #undef, and then #define to a clone of
6318 what's in data.c.
6319 (Fisnan): Always define, since it's always available now.
6320 (syms_of_floatfns): Always define isnan at the Lisp level.
6321
e39b275c 63222011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6323
6324 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6325
b2db44d9 63262011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6327
f4af5137 6328 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6329 The previous code assumed that file offsets (off_t values) fit in
6330 EMACS_INT variables, which is not true on typical 32-bit hosts.
6331 The code messed up by falsely reporting buffer overflow in cases
6332 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6333 when "big" contains more than 2**29 bytes, even though this
6334 inserts just one byte and does not overflow the buffer.
6335 (Finsert_file_contents): Store file offsets as off_t
6336 values, not as EMACS_INT values. Check for overflow when
6337 converting between EMACS_INT and off_t. When checking for
6338 buffer overflow or for overlap, take the offsets into account.
6339 Don't use EMACS_INT for small values where int suffices.
6340 When checking for overlap, fix a typo: ZV was used where
6341 ZV_BYTE was intended.
6342 (Fwrite_region): Don't assume off_t fits into 'long'.
6343 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6344
ecfc0a49
MA
63452011-09-05 Michael Albinus <michael.albinus@gmx.de>
6346
6347 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6348
6511acf2 63492011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6350
0999621a 6351 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6352
6353 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6354 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6355 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6356 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6357 (modify_event_symbol): Do not assume that the length of
6358 name_alist_or_stem is safe to alloca and fits in int.
6359 (Fexecute_extended_command): Likewise for function name and binding.
6360 (Frecursion_depth): Wrap around reliably on integer overflow.
6361 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6362 since some callers pass EMACS_INT values.
6363 (Fsingle_key_description): Don't crash if symbol name contains more
6364 than MAX_ALLOCA bytes.
6365 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6366 (get_minibuffer): Arg is now EMACS_INT, not int.
6367 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6368 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6369 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6370
2be7d702
PE
6371 * dbusbind.c (signature_cat): New function.
6372 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6373 Do not overrun buffer; instead, report string overflow.
6374
9d1df220
PE
6375 * dispnew.c (add_window_display_history): Don't overrun buffer.
6376 Truncate instead; this is OK since it's just a log.
6377
33ef5c64
PE
6378 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6379 even if the time zone offset is outlandishly large.
6380 Don't mishandle offset == INT_MIN.
6381
66c6fdd5
PE
6382 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6383 when creating daemon; the previous buffer-overflow check was incorrect.
6384
d749b01b
PE
6385 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6386 which has the guts of the old verror function.
6387
b5cd1905
PE
6388 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6389 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6390
6e1a67fb
PE
6391 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6392 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6393 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6394 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6395 length of string rather than counting it via multiple sprintfs;
6396 that's simpler and more reliable.
c21721cc
PE
6397 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6398 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6399 sprintf, in case result does not fit in int.
6400
c57b67fc
PE
6401 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6402 (fontset_from_font): Print it.
6403
8a401434
PE
6404 * frame.c (tty_frame_count): Now printmax_t, not int.
6405 (make_terminal_frame, set_term_frame_name): Print it.
6406 (x_report_frame_params): In X, window IDs are unsigned long,
6407 not signed long, so print them as unsigned.
6408 (validate_x_resource_name): Check for implausibly long names,
6409 and don't assume name length fits in 'int'.
6410 (x_get_resource_string): Don't blindly alloca invocation name;
6411 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6412 not fit in int.
6413
6e1a67fb
PE
6414 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6415 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6416 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6417
0df02bf3
PE
6418 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6419 Use esprintf, not sprintf, in case result does not fit in int.
6420
48e30793
PE
6421 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6422 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6423 it as a large positive number.
6424 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6425 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6426
a66ff6d8
PE
6427 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6428 in case result does not fit in int.
6429
aca216ff
PE
6430 * print.c (float_to_string): Detect width overflow more reliably.
6431 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6432 buffer overrun. Don't assume list length fits in 'int'. Treat
6433 print length of 0 as 0, not as infinity; to be consistent with other
6434 uses of print length in this function. Don't overflow print length
6435 index. Don't assume hash table size fits in 'long', or that
6436 vectorlike size fits in 'unsigned long'.
6437
31c286f7
PE
6438 * process.c (make_process): Use printmax_t, not int, to format
6439 process-name gensyms.
6440
55e5faa1
PE
6441 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6442
80f2e268
PE
6443 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6444 to avoid potential buffer overrun.
6445
670741ab
PE
6446 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6447 if X resource line is longer than 512 bytes.
6448
b7163a50
PE
6449 * xfns.c (x_window): Make sprintf buffer a bit bigger
6450 to avoid potential buffer overrun.
6451
ae58ff1f
PE
6452 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6453
c43c8a6a
PE
6454 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6455
3f8236f4
PE
64562011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6457
53e9fe90 6458 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6459 Without these, Emacs silently mishandles large integers sometimes.
6460 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6461 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6462
6511acf2
PE
6463 * xdisp.c (try_window_id): Check Emacs fixnum range before
6464 converting to 'int'.
806add1d 6465
6511acf2 6466 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6467 Check that an Emacs fixnum is in range before assigning it to 'int'.
6468 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6469 values converted from Emacs fixnums.
6470 (Frecenter): Don't wrap around a line count if it is out of 'int'
6471 range; instead, treat it as an extreme value.
6472 (Fset_window_configuration, compare_window_configurations):
6473 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6474
6511acf2
PE
6475 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6476 that can exceed INT_MAX. Check that EMACS_INT value is in range
6477 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6478 (match_limit): Don't assume that a fixnum can fit in 'int'.
6479
6511acf2 6480 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6481 exceed INT_MAX.
6482
6511acf2 6483 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6484 (Fvertical_motion): Don't wrap around LINES values that don't fit
6485 in 'int'. Instead, treat them as extreme values. This is good
6486 enough for windows, which can't have more than INT_MAX lines anyway.
6487
fcb901a7
LMI
64882011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6489
0f2f6b6d
LMI
6490 * Require libxml/parser.h to avoid compilation warning.
6491
fcb901a7
LMI
6492 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6493
6494 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6495 since this reportedly can destroy thread storage.
6496
6e20a0d4
CY
64972011-08-30 Chong Yidong <cyd@stupidchicken.com>
6498
6499 * syntax.c (find_defun_start): Update all cache variables if
6500 exiting early (Bug#9401).
6501
148ae00e
EZ
65022011-08-30 Eli Zaretskii <eliz@gnu.org>
6503
f6cfbd8f
EZ
6504 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6505
148ae00e
EZ
6506 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6507 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6508 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6509
6510 * term.c (tty_append_glyph): New function.
6511 (produce_stretch_glyph): Static function and its prototype deleted.
6512
a66cfb1c
SM
6513 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6514 Add prototypes.
148ae00e 6515
c4a07a4c
PE
65162011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6517
6518 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6519 when checking :margin (Bug#9390).
6520 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6521 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6522 so that the name doesn't mislead. All uses changed.
6523
6bc8cd65
JB
65242011-08-28 Johan Bockgård <bojohan@gnu.org>
6525
6526 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6527 set_tty_hooks.
6528
dca4927e
EZ
65292011-08-27 Eli Zaretskii <eliz@gnu.org>
6530
6531 * xdisp.c (move_it_to): Don't bail out early when reaching
6532 position beyond to_charpos, if we are scanning backwards.
6533 (move_it_vertically_backward): When DY == 0, make sure we get to
6534 the first character in the line after the newline.
6535
f2cad773
PE
65362011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6537
6538 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6539 (ccl_driver): Do not generate an out-of-range pointer.
6540 (Fccl_execute_on_string): Remove unnecessary check for
6541 integer overflow, noted by Stefan Monnier in
6542 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6543 Remove a FIXME that didn't need fixing.
6544 Simplify the newly-introduced buffer reallocation code.
6545
0cae2cdb
JB
65462011-08-27 Juanma Barranquero <lekktu@gmail.com>
6547
6548 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6549
5fc295a4 65502011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6551
70c60eb2 6552 Integer and memory overflow issues (Bug#9196).
726e0ab1 6553
d31850da
PE
6554 * doc.c (get_doc_string): Rework so that
6555 get_doc_string_buffer_size is the actual buffer size, rather than
6556 being 1 less than the actual buffer size; this makes xpalloc more
6557 convenient.
6558
a69fbedb
PE
6559 * image.c (x_allocate_bitmap_record, cache_image):
6560 * xselect.c (Fx_register_dnd_atom):
6561 Simplify previous changes by using xpalloc.
6562
fe5c5d37
PE
6563 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6564 since either will do and ptrdiff_t is convenient with xpalloc.
6565
0065d054
PE
6566 * charset.c (charset_table_size)
6567 (struct charset_sort_data.priority): Now ptrdiff_t.
6568 (charset_compare): Don't overflow if priorities differ greatly.
6569 (Fsort_charsets): Don't assume list length fits in int.
6570 Check for size-calculation overflow when allocating sort data.
6571 (syms_of_charset): Allocate an initial charset table that is
6572 just under 64 KiB, to avoid problems with glibc malloc and mmap.
6573
6574 * cmds.c (internal_self_insert): Check for size-calculation overflow.
6575
6576 * composite.h (struct composition.glyph_len): Now int, not unsigned.
6577 The actual value is always <= INT_MAX, and leaving it unsigned made
6578 overflow checking harder.
6579
6580 * dispextern.h (struct glyph_matrix.rows_allocated)
6581 (struct face_cache.size): Now ptrdiff_t, for convenience in use
6582 with xpalloc. The values are still always <= INT_MAX.
6583
6584 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6585
6586 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6587 (SAFE_NALLOCA): New macro.
6588
6589 * region-cache.c (struct boundary.pos, find_cache_boundary)
6590 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6591 (set_cache_region, invalidate_region_cache)
6592 (revalidate_region_cache, know_region_cache, region_cache_forward)
6593 (region_cache_backward, pp_cache):
6594 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
6595 so that ptrdiff_t * can be passed to xpalloc.
6596 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6597 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6598 (pp_cache): Don't assume cache_len fits in int.
6599 * region-cache.h: Adjust extern decls to match.
6600
6601 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6602 EMACS_INT, since either will do, for xpalloc.
6603
6604 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6605 (xnmalloc, xnrealloc, xpalloc): New functions.
6606
726e0ab1
PE
6607 * bidi.c (bidi_shelve_header_size): New constant.
6608 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6609 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6610
51f30bc5 6611 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
6612 * buffer.c (overlays_at, overlays_in, record_overlay_string)
6613 (overlay_strings):
6614 Don't update size of array until after memory allocation succeeds,
6615 because xmalloc/xrealloc may not return.
0065d054
PE
6616 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6617 now that we have proper integer overflow checking.
6618 (record_overlay_string, overlay_strings): Catch overflows when
6619 calculating size of overlay_str_buf.
726e0ab1 6620
0065d054
PE
6621 * callproc.c (Fcall_process): Check for size overflow when
6622 calculating size of args2.
6623 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6624 Normally we prefer signed values, but sticking with ptrdiff_t would
6625 require adding more-complicated checks.
726e0ab1
PE
6626
6627 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6628 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6629 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 6630 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
6631
6632 * character.c (Fstring): Check for size-calculation overflow.
6633
6634 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6635 unnecessary integer overflow. Check for size overflow.
6636 (encode_coding_object): Don't update size until xmalloc succeeds.
6637
6638 * composite.c (get_composition_id): Check for overflow in glyph
6639 length calculations.
6640
6641 Integer and memory overflow fixes for display code.
6642 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6643 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6644 (scrolling_window): Check for overflow in size calculations.
6645 (line_draw_cost, realloc_glyph_pool, add_row_entry):
6646 Don't assume glyph table len fits in int.
6647 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6648 (row_table_size): Now ptrdiff_t, not int.
6649 (scrolling_window): Avoid overflow in size calculations.
6650 Don't update size until allocation succeeds.
6651 * fns.c (concat): Check for overflow in size calculations.
6652 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6653 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6654 (NEXT_ALMOST_PRIME_LIMIT): New constant.
6655
6656 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6657 (get_doc_string): Check for size calculation overflow.
6658 Don't update size until allocation succeeds.
6659 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6660 EMACS_INT, where ptrdiff_t will do.
6661 (Fsubstitute_command_keys): Check for string overflow.
6662
6663 * editfns.c (set_time_zone_rule): Don't assume environment length
6664 fits in int.
6665 (message_length): Now ptrdiff_t, not int.
6666 (Fmessage_box): Don't update size until allocation succeeds.
6667 Don't assume message length fits in int.
6668 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6669
0065d054
PE
6670 * emacs.c (main): Do not reallocate argv, since there is a null at
6671 the end that can be overwritten, and this way there's no need to
6672 worry about size-calculation overflow.
6673 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
6674
6675 * eval.c (init_eval_once, grow_specpdl): Don't update size until
6676 alloc succeeds.
6677 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6678
6679 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6680 (x_set_scroll_bar_width, x_figure_window_size):
6681 Check for integer overflow.
6682 (x_set_alpha): Do not assume XINT fits in int.
6683
6684 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6685 This is for the members text_lines, text_cols, total_lines, total_cols,
6686 where the system imposes an 'int' limit.
6687
6688 * fringe.c (Fdefine_fringe_bitmap):
6689 Don't update size until alloc works.
6690
6691 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6692 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6693
6694 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6695 Check for size-calculation overflow.
6696 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6697 do, as we prefer signed integers.
6698 (id_to_widget.max_size, id_to_widget.used)
6699 (xg_store_widget_in_map, xg_remove_widget_from_map)
6700 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6701 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6702 Use and return ptrdiff_t, not int.
6703 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6704 * gtkutil.h: Change prototypes to match the above.
6705
6706 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6707 are duplicate now that they've been promoted to lisp.h.
6708 (x_allocate_bitmap_record, x_alloc_image_color)
6709 (make_image_cache, cache_image, xpm_load):
6710 Don't update size until alloc is done.
6711 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6712 (x_detect_edges):
3256efce 6713 Check for size calculation overflow.
726e0ab1
PE
6714 (ct_colors_allocated_max): New constant.
6715 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6716 overflow.
3256efce 6717
726e0ab1
PE
6718 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6719 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6720 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6721 Use ptrdiff_t, not int, to count maps.
6722 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
6723 calculations. Don't update size until allocation succeeds.
6724 Redo calculations to avoid overflow.
726e0ab1
PE
6725 * keyboard.h: Change prototypes to match the above.
6726
6727 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6728 to count maps.
6729 (current_minor_maps): Check for size calculation overflow.
6730 * keymap.h: Change prototypes to match the above.
6731
6732 * lread.c (read1, init_obarray): Don't update size until alloc done.
6733
6734 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6735 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6736
726e0ab1
PE
6737 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6738 Now ptrdiff_t, not int.
6739 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6740 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6741
6742 * process.c (Fnetwork_interface_list): Check for overflow
6743 in size calculation.
6744
6745 * region-cache.c (move_cache_gap): Check for size calculation overflow.
6746
6747 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
6748 overflow. Don't bother calling xmalloc when xrealloc will do.
6749
6750 * search.c (Freplace_match): Check for size calculation overflow.
6751 (Fset_match_data): Don't assume list lengths fit in 'int'.
6752
6753 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6754 for command line length. Do not attempt to address one before the
6755 beginning of an array, as that's not portable.
6756
6757 * term.c (max_frame_lines): Remove; unused.
6758 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6759 not int.
6760 (encode_terminal_code, calculate_costs): Check for size
6761 calculation overflow.
6762 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
6763 table lengths and related sizes. Don't update size until alloc
6764 done. Redo calculations to avoid overflow.
6765 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
6766
6767 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
6768 subtracting pointers.
6769 (gobble_line): Check for overflow more carefully. Don't update size
6770 until alloc done.
6771
6772 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
6773 Don't update size until alloc done.
6774 Redo size calculations to avoid overflow.
6775 Check for size calculation overflow.
0065d054 6776 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
6777
6778 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
6779 Use ptrdiff_t, not int, for sizes.
6780 (store_mode_line_noprop_char): Don't update size until alloc done.
6781
0065d054
PE
6782 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
6783 Use ptrdiff_t, not int, for sizes.
6784 (Finternal_make_lisp_face, cache_face):
6785 Check for size calculation overflow.
6786 (cache_face): Treat size calculation overflows as if they were
6787 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
6788
6789 * xfns.c (x_encode_text, x_set_name_internal)
6790 (Fx_change_window_property): Use ptrdiff_t, not int, to count
6791 sizes, since they can exceed INT_MAX in size. Check for size
6792 calculation overflow.
6793
0065d054
PE
6794 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
6795 (xg_select): Check for size calculation overflow.
726e0ab1
PE
6796 Don't update size until alloc done.
6797
0065d054 6798 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 6799 as sprintf is limited to int lengths.
1d526e2f 6800
252c5ee1
PE
6801 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
6802 (X_LONG_MIN): New macros.
864d7ce7
PE
6803 Use them to make the following changes clearer.
6804 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
6805 This change doesn't affect the value now, but it may help remind
6806 future maintainers not to raise the value too much later.
6807 (SELECTION_QUANTUM): Remove, replacing with ...
6808 (selection_quantum): ... new function, which avoids overflow.
6809 All uses changed.
6810 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
6811 assumption that selection length fits in 'int'.
6812 (x_reply_selection_request, x_handle_selection_request)
6813 (x_get_window_property, receive_incremental_selection)
6814 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
6815 (lisp_data_to_selection_data, clean_local_selection_data):
6816 Use ptrdiff_t, not int, to record length of selection.
6817 (x_reply_selection_request, x_get_window_property)
6818 (receive_incremental_selection, x_property_data_to_lisp):
6819 Redo calculations to avoid overflow.
6820 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 6821 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
6822 something.
6823 (x_get_window_property, receive_incremental_selection)
6824 (lisp_data_to_selection_data, x_property_data_to_lisp):
6825 Check for size-calculation overflow.
6826 (x_get_window_property, receive_incremental_selection)
6827 (lisp_data_to_selection_data, Fx_register_dnd_atom):
6828 Don't store size until memory allocation succeeds.
6829 (x_get_window_property): Plug memory leak on memory exhaustion.
6830 Don't double-block input; malloc is safe here. Don't assume 2**34
6831 - 4 fits in unsigned long. Add an xassert to check
6832 XGetWindowProperty overflow. Be more careful about overflow
6833 calculations, and distinguish size from memory overflow better.
6834 (receive_incremental_selection): When tracing, don't assume
6835 unsigned int is less than INT_MAX.
6836 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
6837 harmful) conversions of unsigned short to int.
6838 (lisp_data_to_selection_data): Don't assume that integers
6839 in the range -65535 through -1 fit in an X unsigned short.
6840 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
6841 result parameters unless successful. Rely on cons_to_unsigned
6842 to report problems with elements; the old code wasn't right anyway.
6843 (x_check_property_data): Check for int overflow; we cannot use
6844 a wider type due to X limits.
6845 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
6846
726e0ab1 6847 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 6848
0065d054
PE
6849 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
6850 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
6851 (x_color_cells): Don't store size until memory allocation succeeds.
6852 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 6853 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
6854 (x_term_init): Don't assume length fits in int (sprintf is limited
6855 to int size).
bc18e09d 6856
ebfa62c0
PE
6857 Use ptrdiff_t for composition IDs.
6858 * character.c (lisp_string_width):
6859 * composite.c (composition_table_size, n_compositions)
6860 (get_composition_id, composition_gstring_from_id):
6861 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
6862 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
6863 * window.c (Frecenter):
6864 Use ptrdiff_t, not int, for composition IDs.
6865 * composite.c (get_composition_id): Check for integer overflow.
6866 * composite.h: Adjust prototypes to match the above changes.
6867
d3411f89
PE
6868 Use ptrdiff_t for hash table indexes.
6869 * category.c (hash_get_category_set):
6870 * ccl.c (ccl_driver):
6871 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
6872 * coding.c (coding_system_charset_list, detect_coding_system):
6873 * coding.h (struct coding_system.id):
6874 * composite.c (get_composition_id, gstring_lookup_cache):
6875 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
6876 * image.c (xpm_get_color_table_h):
6877 * lisp.h (hash_lookup, hash_put):
6878 * minibuf.c (Ftest_completion):
6879 Use ptrdiff_t for hash table indexes, not int (which is too
6880 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
6881 32-bit --with-wide-int hosts).
6882
e097a6fa
PE
6883 * charset.c (Fdefine_charset_internal): Check for integer overflow.
6884 Add a FIXME comment about memory leaks.
6885 (syms_of_charset): Don't assume xmalloc returns.
6886
5637687f
PE
6887 Don't assume that stated character widths fit in int.
6888 * character.c (Fchar_width, c_string_width, lisp_string_width):
6889 * character.h (CHAR_WIDTH):
6890 * indent.c (MULTIBYTE_BYTES_WIDTH):
6891 Use sanitize_char_width to avoid undefined and/or bad behavior
6892 with outlandish widths.
a66cfb1c 6893 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
6894 now that we have two such functions. All uses changed.
6895 (sanitize_char_width): New inline function.
6896
a2271ba2
PE
6897 Don't assume that tab-width fits in int.
6898 * character.h (sanitize_width): New inline function.
6899 (SANE_TAB_WIDTH): New macro.
6900 (ASCII_CHAR_WIDTH): Use it.
6901 * indent.c (sane_tab_width): Remove. All uses replaced by
6902 SANE_TAB_WIDTH (current_buffer).
6903 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
6904
18c52557
PE
6905 * fileio.c: Integer overflow issues with file modes.
6906 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
6907
caeeedc1
PE
6908 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
6909 Remove unreachable code.
6910 (read_hex, load_charset_map_from_file): Check for integer overflow.
6911
6df6ae42 6912 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
6913 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
6914 (x_send_scroll_bar_event): Likewise. Check that the size does not
6915 exceed limits imposed by XClientMessageEvent, as well as the usual
6916 ptrdiff_t and size_t limits.
6917
b13995db
PE
6918 * keyboard.c: Overflow, signedness and related fixes.
6919 (make_lispy_movement): Use same integer type in forward decl
6920 that is used in the definition.
6921 (read_key_sequence, keyremap_step):
6922 Change bufsize argument back to int, undoing my 2011-03-30 change.
6923 We prefer signed types, and int is wide enough here.
6924 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
6925 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
6926 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
6927 length, not size_t. Use ptrdiff_t for index, not int.
6928 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
6929 possibility of integer overflow.
6930
13464394
PE
6931 Overflow, signedness and related fixes for images.
6932
6933 * dispextern.h (struct it.stack[0].u.image.image_id)
6934 (struct_it.image_id, struct image.id, struct image_cache.size)
6935 (struct image_cache.used, struct image_cache.ref_count):
6936 * gtkutil.c (update_frame_tool_bar):
6937 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
6938 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
6939 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
6940 * nsmenu.m (update_frame_tool_bar):
6941 * xdisp.c (calc_pixel_width_or_height):
6942 * xfns.c (image_cache_refcount):
6943 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
6944 on typical 64-bit hosts.
6945
6946 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6947 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
6948 Omit unnecessary casts to int.
6949 (parse_image_spec): Check that integers fall into 'int' range
6950 when the callers expect that.
6951 (image_ascent): Redo ascent calculation to avoid int overflow.
6952 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
6953 (lookup_image): Remove unnecessary tests.
6954 (xbm_image_p): Locals are now of int, not EMACS_INT,
6955 since parse_image_check makes sure they fit into int.
6956 (png_load, gif_load, svg_load_image):
6957 Prefer int to unsigned where either will do.
6958 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
6959 old tiff_error_handler and tiff_warning_handler.
6960 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
6961 stack buffer overflows. It uses only the features of vsnprintf
6962 that are common to both POSIX and native Microsoft.
6963 (tiff_error_handler, tiff_warning_handler): Use it.
6964 (tiff_load, gif_load, imagemagick_load_image):
6965 Don't assume :index value fits in 'int'.
6966 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
6967 (imagemagick_load_image): Check that crop parameters fit into
6968 the integer types that MagickCropImage accepts. Don't assume
6969 Vimagemagick_render_type has a nonnegative value. Don't assume
6970 size_t fits in 'long'.
6971 (gs_load): Use printmax_t to print the widest integers possible.
6972 Check for integer overflow when computing image height and width.
6973
c11821d4
EZ
69742011-08-26 Eli Zaretskii <eliz@gnu.org>
6975
6976 * xdisp.c (redisplay_window): Don't force window start if point
6977 will be invisible in the resulting window. (Bug#9324)
6978
0c95fcf7
EZ
69792011-08-25 Eli Zaretskii <eliz@gnu.org>
6980
6981 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
6982 the display spec is of the form `(space ...)'.
6983 (handle_display_spec): Return the value returned by
6984 handle_single_display_spec, not just 1 or zero.
6985 (handle_single_display_spec): If the display spec is of the form
6986 `(space ...)', and specifies display in the text area, return 2
6987 rather than 1.
fee65a97 6988 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
6989 accurately, and prefer exact match for point under bidi.
6990 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
6991
6992 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
6993 into disp_prop; all users changed.
6994
6995 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
6996 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
6997 for the text covered by the display property.
6998
e4ed06f1
CY
69992011-08-25 Chong Yidong <cyd@stupidchicken.com>
7000
7001 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7002 Change return value to nil.
7003 (Frecord_buffer): Delete unused function.
7004
f67cdd7f
EZ
70052011-08-24 Eli Zaretskii <eliz@gnu.org>
7006
5980d4c6
EZ
7007 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7008 buffers, return left-to-right.
8610fe8b
EZ
7009 (set_cursor_from_row): Consider candidate row a win if its glyph
7010 represents a newline and point is on that newline. Fixes cursor
7011 positioning on the newline at EOL of R2L text within L2R
7012 paragraph, and vice versa.
7013 (try_cursor_movement): Check continued rows, in addition to
7014 continuation rows. Fixes unwarranted scroll when point enters a
7015 continued line of R2L text within an L2R paragraph, or vice versa.
7016 (cursor_row_p): Consider the case of point being equal to
7017 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7018 from the end of a short line to the beginning of a continued line
7019 of R2L text within L2R paragraph.
7020 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7021 composed characters.
5980d4c6 7022
f67cdd7f
EZ
7023 * bidi.c (bidi_check_type): Use xassert.
7024 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7025 members.
7026
bca633fb
EZ
70272011-08-23 Eli Zaretskii <eliz@gnu.org>
7028
7029 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7030 a character.
7031
4a5885a7
CY
70322011-08-23 Chong Yidong <cyd@stupidchicken.com>
7033
7034 * nsfont.m (ns_otf_to_script): Fix typo.
7035
0902a04e
KH
70362011-08-22 Kenichi Handa <handa@m17n.org>
7037
7038 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7039 extra slot even if the purpose is char-code-property-table.
7040
1a2e6670
EZ
70412011-08-23 Eli Zaretskii <eliz@gnu.org>
7042
8ddde651
EZ
7043 * xdisp.c (redisplay_window): When computing centering_position,
7044 account for the height of the header line. (Bug#8874)
7045
425cc014
EZ
7046 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7047 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7048 candidate is selected by the mouse, and that candidate has a
7049 composed character under the mouse.
7050
1a2e6670
EZ
7051 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
7052 coordinates reported by pos-visible-in-window-p for a composed
7053 character in column zero.
7054
8b76d6f8
SM
70552011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
7056
7057 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
7058
dac347dd
EZ
70592011-08-22 Eli Zaretskii <eliz@gnu.org>
7060
7061 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
7062 consider it a hit if to_charpos is anywhere in the range of the
7063 composed buffer positions.
7064
e013fb34
CY
70652011-08-22 Chong Yidong <cyd@stupidchicken.com>
7066
7067 * image.c (gif_load): Don't assume that each subimage has the same
7068 dimensions as the base image. Handle disposal method that is
7069 "undefined" by the gif spec (Bug#9335).
7070
bd1ba3e8
CY
70712011-08-20 Chong Yidong <cyd@stupidchicken.com>
7072
7073 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 7074 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 7075
54a1215b
EZ
70762011-08-19 Eli Zaretskii <eliz@gnu.org>
7077
823564e5
EZ
7078 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
7079 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
7080 from an Org mode buffer to a Speedbar frame.
7081
54a1215b
EZ
7082 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
7083 a composition, take its buffer position from IT->cmp_it.charpos.
7084 Fixes cursor positioning at the beginning of a line that begins
7085 with a composed character.
7086
9778ebcc
EZ
70872011-08-18 Eli Zaretskii <eliz@gnu.org>
7088
0be6ee06
EZ
7089 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
7090 character bidirectional type, use STRONG_L instead. Fixes crashes
7091 in a buffer produced by `describe-categories'.
7092
9778ebcc
EZ
7093 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
7094 members before the level stack, so they would be saved and
7095 restored when copying iterator state. Fixes incorrect reordering
7096 around TABs covered by display properties.
7097
156bffbe
AS
70982011-08-18 Andreas Schwab <schwab@linux-m68k.org>
7099
6b02f655 7100 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 7101
72ad093b
CY
71022011-08-17 Chong Yidong <cyd@stupidchicken.com>
7103
7104 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7105 (internal_condition_case_2, internal_condition_case_n):
7106 Remove unnecessary aborts (Bug#9081).
72ad093b 7107
35774242
EZ
71082011-08-17 Eli Zaretskii <eliz@gnu.org>
7109
7110 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7111 has no `load' handler, try opening the file locally. (Bug#9311)
7112
db76dd85
KB
71132011-08-16 Ken Brown <kbrown@cornell.edu>
7114
7115 * gmalloc.c: Expand comment.
7116
b215eee5
EZ
71172011-08-16 Eli Zaretskii <eliz@gnu.org>
7118
7119 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7120 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7121
a4579d33
KB
71222011-08-16 Ken Brown <kbrown@cornell.edu>
7123
7124 Fix memory allocation problems in Cygwin build (Bug#9273).
7125
7126 * unexcw.c ( __malloc_initialized): Declare external variable.
7127 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7128
8b76d6f8
SM
7129 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7130 New variables.
a4579d33
KB
7131 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7132 dumped emacs.
7133 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7134 in the static heap.
7135 [CYGWIN] (special_realloc): New function.
7136 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7137 requests to realloc storage in the static heap.
7138
3ebec551
PE
71392011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7140
7141 * bidi.c (bidi_initialize): Remove unused local.
7142
9fd8be00
EZ
71432011-08-15 Eli Zaretskii <eliz@gnu.org>
7144
6b02f655
SM
7145 * bidimirror.h:
7146 * biditype.h: Remove file.
7147 * makefile.w32-in ($(BLD)/bidi.$(O)):
7148 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7149
7150 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7151
7152 * chartab.c: Improve commentary for the uniprop_table API.
7153
32413314
EZ
7154 * bidi.c (bidi_paragraph_init): Support zero value of
7155 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7156 (bidi_initialize): Use uniprop_table instead of including
7157 biditype.h and bidimirror.h.
32413314 7158
9fd8be00
EZ
7159 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7160 coordinates of the iterator when restoring from ppos_it.
7161 (Bug#9296)
7162
5cf2b69b
KH
71632011-08-14 Kenichi Handa <handa@m17n.org>
7164
7165 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7166 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7167
daf17d00
EZ
71682011-08-14 Eli Zaretskii <eliz@gnu.org>
7169
7170 * xdisp.c (move_it_in_display_line_to): Don't invoke
7171 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7172 ppos_it. Fixes vertical cursor motion when line beginning is
7173 covered by an image. (Bug#9296)
7174
08e3161a
JD
71752011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7176
7177 * nsterm.h (ns_run_ascript): Declare.
7178 (NSAPP_DATA2_RUNASSCRIPT): Define.
7179
7180 * nsfns.m (as_script, as_result, as_status): New static variables.
7181 (ns_run_ascript): New function.
5e617bc2 7182 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7183 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7184 the event loop. Get status from as_status (Bug#7276).
7185
7186 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7187 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7188 the event loop (Bug#7276).
7189
a3720aa2
AS
71902011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7191
7192 * gnutls.c (QCgnutls_bootprop_priority)
7193 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7194 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7195 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7196 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7197 (QCgnutls_bootprop_verify_hostname_error)
7198 (QCgnutls_bootprop_callbacks_verify): Rename from
7199 Qgnutls_bootprop_..., all uses changed.
7200
7201 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7202 uses changed.
7203
0a0d27fb
PE
72042011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7205
19d5c50c
PE
7206 * xfaces.c (Qframe_set_background_mode): Now static.
7207 * dispextern.h (Qframe_set_background_mode): Remove decl.
7208
0a0d27fb
PE
7209 * process.c (Fnetwork_interface_info): Declare local only if needed.
7210
377538cb
JD
72112011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7212
7213 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7214 (Fnetwork_interface_list): Allocate in increments of bytes instead
7215 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7216 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7217 sockaddr.
7218 (struct ifflag_def): notrailers is smart on OSX.
7219 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7220 Get hardware address with getifaddrs if available.
7221
08fff70c
EZ
72222011-08-12 Eli Zaretskii <eliz@gnu.org>
7223
7224 * xdisp.c (iterate_out_of_display_property): xassert that
7225 IT->position is set to within IT->object's boundaries. Break from
7226 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7227 when IT->position is set up wrongly due to some bug.
7228 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7229 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7230 entry. Force push_it to save on the stack the current
7231 buffer/string position, to be restored by pop_it. Fix flags in
7232 the iterator structure wrt the object coming from a display
7233 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7234 properties. (Bug#9284)
7235
7be1c708 72362011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7237
7be1c708
CY
7238 * fontset.c (fontset_get_font_group): Add proper type checks.
7239 (Bug#9172)
aac0c6e3 7240
7be1c708 72412011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 7242
7be1c708
CY
7243 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7244 and LC_VERSION_MIN_MACOSX.
7245 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7246 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 7247
97bb72a6
EZ
72482011-08-08 Eli Zaretskii <eliz@gnu.org>
7249
7250 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
7251 no-display-properties-and-no-overlays under bidi display.
7252 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 7253 properties and overlays.
97bb72a6 7254
d5617611
CY
72552011-08-08 Chong Yidong <cyd@stupidchicken.com>
7256
37e11a63
CY
7257 * editfns.c (Fset_time_zone_rule): Document relationship with the
7258 setenv function.
7259
d5617611
CY
7260 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7261 the font entity extracted from the cache (Bug#8109).
7262
58872834
CY
72632011-08-07 Chong Yidong <cyd@stupidchicken.com>
7264
7265 * composite.c (autocmp_chars): Don't reset point. That is done by
7266 restore_point_unwind (Bug#5984).
7267
75bfc667
JL
72682011-08-07 Juri Linkov <juri@jurta.org>
7269
7270 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7271 to show the arg `TIME' instead of `TIMEVAL'.
7272
d1410150
EZ
72732011-08-06 Eli Zaretskii <eliz@gnu.org>
7274
7275 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7276 display property strides EOL and includes a newline, as in
7277 longlines-mode. (Bug#9254)
75b771e4
EZ
7278 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7279 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
7280
7281 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7282 is non-zero, even if the data buffer is NULL. Fixes a crash in
7283 vertical-motion with longlines-mode. (Bug#9254)
7284
35928349
EZ
72852011-08-05 Eli Zaretskii <eliz@gnu.org>
7286
ec7cc85b
EZ
7287 * bidi.c <bidi_cache_total_alloc>: Now static.
7288 (bidi_initialize): Initialize bidi_cache_total_alloc.
7289
8b76d6f8 7290 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7291 cache. (Bug#9221)
7292
7293 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7294 amount allocated this far in `bidi_cache_total_alloc'.
7295 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7296 non-zero, only free the data buffer without restoring the cache
7297 contents. All callers changed.
7298
7299 * dispextern.h (bidi_unshelve_cache): Update prototype.
7300
7301 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7302 (move_it_in_display_line, move_it_to)
7303 (move_it_vertically_backward, move_it_by_lines): Replace the call
7304 to xfree to an equivalent call to bidi_unshelve_cache.
7305 (move_it_in_display_line_to): Fix logic of returning
412b6358 7306 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7307
e2e2423b
EZ
73082011-08-05 Eli Zaretskii <eliz@gnu.org>
7309
7310 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7311 came from a string character with a `cursor' property. (Bug#9229)
7312
ae9e757a
JD
73132011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7314
7315 * Makefile.in (LIB_PTHREAD): New variable.
7316 (LIBES): Add LIB_PTHREAD (Bug#9216).
7317
7318 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7319 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7320
213bd7f2
AS
73212011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7322
6b02f655 7323 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7324
99aaf75f
JD
73252011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7326
7327 * xterm.c (x_find_topmost_parent): New function.
7328 (x_set_frame_alpha): Find topmost parent window with
7329 x_find_topmost_parent and set the property there also (bug#9181).
7330 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7331
c74e9d86
PE
73322011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7333
7334 * callproc.c (Fcall_process): Avoid vfork clobbering
7335 the local vars buffer, coding_systems, current_dir.
7336
640c8776
SM
73372011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7338
7339 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7340
f26d0e4c
PE
73412011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7342
8a10d76c
PE
7343 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7344 so that it is not optimized away.
7345
f26d0e4c
PE
7346 * xdisp.c (compute_display_string_pos): Remove unused local.
7347
55439c61
EZ
73482011-08-02 Eli Zaretskii <eliz@gnu.org>
7349
7350 Fix slow cursor motion and scrolling in large buffers with
7351 selective display, like Org Mode buffers. (Bug#9218)
7352
7353 * dispextern.h (struct bidi_it): New member disp_prop_p.
7354
7355 * xdisp.c: Remove one-slot cache of display string positions.
7356 (compute_display_string_pos): Accept an additional argument
5e617bc2 7357 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7358 for a display string or property. If found, set DISP_PROP_P
7359 non-zero.
7360
7361 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7362 DISP_PROP_P, and pass it to compute_display_string_pos.
7363 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7364 non-zero. All callers of bidi_fetch_char changed.
7365
fb33fa43
SM
73662011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7367
7368 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7369
b099e063
DM
73702010-12-03 Don March <don@ohspite.net>
7371
7372 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7373 last character M-[char] is translated to ESC [char] (bug#7541).
7374
5cc7f7af
KH
73752011-08-02 Kenichi Handa <handa@m17n.org>
7376
d0fffa3f 7377 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7378
7379 * chartab.c (uniprop_table): Make it non-static.
7380
525d5e6e
EZ
73812011-08-01 Eli Zaretskii <eliz@gnu.org>
7382
7383 * xdisp.c (forward_to_next_line_start): Accept additional argument
7384 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7385 on the newline.
7386 (reseat_at_next_visible_line_start): Use the bidi iterator state
7387 returned by forward_to_next_line_start to restore the state of
7388 it->bidi_it after backing up to previous newline. (Bug#9212)
7389
31011111
AS
73902011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7391
7392 * regex.c (re_comp): Protoize.
7393 (re_exec): Fix return type.
7394 (regexec): Fix type of `ret'. (Bug#9203)
7395
476371c4
PE
73962011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7397
e5d76069
PE
7398 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7399 This is needed if max-image-size is a floating-point number.
7400
9a79b20c
AS
74012011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7402
7403 * print.c (print_object): Print empty symbol as ##.
7404
7405 * lread.c (read1): Read ## as empty symbol.
7406
d8c2fa78
AA
74072011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7408
7409 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7410 setting frame foreground color (Bug#9175).
7411 (x_set_background_color): Likewise.
7412
ffe57a7a
AA
7413 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7414 contents (Bug#9176).
7415 (EmacsTooltip -init): Remove bezels and add shadows to
7416 tooltip windows.
7417
bf3492a5
AA
7418 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7419 or scroll bar (Bug#8470).
7420
d55e9c53
AA
7421 * nsfont.m (nsfont_open): Remove assignment to voffset and
7422 unnecessary vars hshink, expand, hd, full_height, min_height.
7423 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7424
7425 * nsterm.h (nsfont_info): Remove voffset field.
7426
d8c2fa78 74272011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7428
7429 Implement strike-through and overline on NextStep (Bug#8863).
7430
7431 * nsfont.m (nsfont_open): Use underline position provided by font,
7432 instead of hard-coded value of 2.
7433 (nsfont_draw): Call ns_draw_text_decoration instead.
7434
7435 * nsterm.h: Add declaration for ns_draw_text_decoration.
7436
7437 * nsterm.m (ns_draw_text_decoration): New function for drawing
7438 underline, overline, and strike-through.
7439 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7440 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7441 accommodate underlining, etc.
4843aac3 7442
4cc60b9b
EZ
74432011-07-28 Eli Zaretskii <eliz@gnu.org>
7444
bc7ece87
EZ
7445 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7446 default.
4cc60b9b 7447
476371c4
PE
74482011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7449
66606eea
PE
7450 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7451 Without this fix, if a signal arrives just after memory fills up,
7452 'malloc' might be invoked reentrantly.
7453
476371c4
PE
7454 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7455 In other words, assume that every image size is allowed, on non-X
7456 hosts. This assumption is probably wrong, but it lets Emacs compile.
7457
f3fcc40d
AS
74582011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7459
7460 * regex.c (re_iswctype): Convert return values to boolean.
7461
350c992f
EZ
74622011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7463
7464 * xdisp.c (compute_display_string_pos): Don't use cached display
7465 string position if the buffer had its restriction changed.
7466 (Bug#9184)
7467
5266b4bb
PE
74682011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7469
7470 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7471
2573a837 74722011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7473
41f55ccd 7474 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7475
39e378da
PE
7476 * bidi.c: Integer size and overflow fixes.
7477 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7478 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7479 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7480 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7481 (bidi_find_other_level_edge):
7482 Use ptrdiff_t instead of EMACS_INT where either will do.
7483 This works better on 32-bit hosts configured --with-wide-int.
7484 (bidi_cache_ensure_space): Check for size-calculation overflow.
7485 Use % rather than repeated addition, for better worst-case speed.
7486 Don't set bidi_cache_size until after xrealloc returns, because it
7487 might not return.
7488 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7489 (bidi_cache_ensure_space): Also check that the bidi cache size
7490 does not exceed that of the largest Lisp string or buffer. See Eli
7491 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7492
5e927815
PE
7493 * alloc.c (__malloc_size_t): Remove.
7494 All uses replaced by size_t. See Andreas Schwab's note
7495 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7496
ca4aa935
PE
7497 * image.c: Improve checking for integer overflow.
7498 (check_image_size): Assume that f is nonnull, since
7499 it is always nonnull in practice. This is one less thing to
7500 worry about when checking for integer overflow later.
7501 (x_check_image_size): New function, which checks for integer
7502 overflow issues inside X.
7503 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7504 This removes the need for a memory_full check.
7505 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7506 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7507 (xbm_read_bitmap_data): Change locals back to 'int', since
7508 their values must fit in 'int'.
7509 (xpm_load_image, png_load, tiff_load):
7510 Invoke x_create_x_image_and_pixmap earlier,
7511 to avoid much needless work if the image is too large.
7512 (tiff_load): Treat overly large images as if
7513 x_create_x_image_and_pixmap failed, not as malloc failures.
7514 (gs_load): Use x_check_image_size.
7515
5f8f9cc2
PE
7516 * gtkutil.c: Omit integer casts.
7517 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7518 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7519
5adf60bc
PE
7520 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7521
c8907a93
PE
7522 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7523 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7524 would wrongly return t on a 64-bit host.
7525
e3c25c68
PE
7526 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7527 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7528 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7529 and therefore cause GCC to emit a bogus diagnostic in some cases.
7530
3f791afe
PE
7531 * image.c: Integer signedness and overflow and related fixes.
7532 This is not an exhaustive set of fixes, but it's time to
7533 record what I've got.
7534 (lookup_pixel_color, check_image_size): Remove redundant decls.
7535 (check_image_size): Don't assume that arbitrary EMACS_INT values
7536 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7537 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7538 (tiff_load, imagemagick_load_image):
7539 Check for overflow in size calculations.
7540 (x_create_x_image_and_pixmap): Remove unnecessary test for
7541 xmalloc returning NULL; that can't happen.
7542 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7543 (xpm_color_bucket): Use better integer hashing function.
7544 (xpm_cache_color): Don't possibly over-allocate memory.
7545 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7546 (gif_memory_source):
7547 Use ptrdiff_t, not int or size_t, to record sizes.
7548 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7549 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7550 either works, as we prefer signed integers.
7551 (tiff_read_from_memory, tiff_write_from_memory):
7552 Return tsize_t, not size_t, since that's what the TIFF API wants.
7553 (tiff_read_from_memory): Don't fail simply because the read would
7554 go past EOF; instead, return a short read.
7555 (tiff_load): Omit no-longer-needed casts.
7556 (Fimagemagick_types): Don't assume size fits into 'int'.
7557
3cc5a532
PE
7558 Improve hashing quality when configured --with-wide-int.
7559 * fns.c (hash_string): New function, taken from sxhash_string.
7560 Do not discard information about ASCII character case; this
7561 discarding is no longer needed.
7562 (sxhash-string): Use it. Change sig to match it. Caller changed.
7563 * lisp.h: Declare it.
7564 * lread.c (hash_string): Remove, since we now use fns.c's version.
7565 The fns.c version returns a wider integer if --with-wide-int is
7566 specified, so this should help the quality of the hashing a bit.
7567
b312a492
PE
7568 * emacs.c: Integer overflow minor fix.
7569 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
7570 Define only if GNU_LINUX.
7571 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7572
dfd153ae
PE
7573 * dispnew.c: Integer signedness and overflow fixes.
7574 Remove unnecessary forward decls, that were a maintenance hassle.
7575 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7576 All uses changed.
7577 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7578 (scrolling_window): Use ptrdiff_t, not int, for byte count.
7579 (prepare_desired_row, line_draw_cost):
7580 Use int, not unsigned, where either works.
7581 (save_current_matrix, restore_current_matrix):
7582 Use ptrdiff_t, not size_t, where either works.
7583 (init_display): Check for overflow more accurately, and without
7584 relying on undefined behavior.
7585
a81d11a3
PE
7586 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7587 Remove, replacing with the new symbols in lisp.h. All uses changed.
7588 * fileio.c (make_temp_name):
7589 * filelock.c (lock_file_1, lock_file):
7590 * xdisp.c (message_dolog):
7591 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7592 Use pMd etc. instead.
7593 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7594 replacing the pWIDE etc. symbols removed from editfns.c.
7595
3300e6fd
PE
7596 * keyboard.h (num_input_events): Now uintmax_t.
7597 This is (very slightly) less likely to mess up due to wraparound.
7598 All uses changed.
7599
fd05c7e9
PE
7600 * buffer.c: Integer signedness fixes.
7601 (alloc_buffer_text, enlarge_buffer_text):
7602 Use ptrdiff_t rather than size_t when either will do, as we prefer
7603 signed integers.
7604
903fe15d
PE
7605 * alloc.c: Integer signedness and overflow fixes.
7606 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7607 (__malloc_size_t): Default to size_t, not to int.
7608 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7609 (Fgarbage_collect, mark_object_loop_halt, mark_object):
7610 Prefer ptrdiff_t to size_t when either would do, as we prefer
7611 signed integers.
7612 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7613 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7614 Now const. Initialize with values that are in range even if char
7615 is signed.
7616 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7617 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
7618 These functions do the right thing with sizes > 2**32.
7619 (check_depth): Now ptrdiff_t, not int.
7620 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7621 Adjust to new way of storing sizes. Check for size overflow bugs
7622 in rest of code.
7623 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
7624 slightly wrong anyway, as it missed one instance of
7625 XMALLOC_OVERRUN_CHECK_OVERHEAD.
7626 (refill_memory_reserve): Omit needless cast to size_t.
7627 (mark_object_loop_halt): Mark as externally visible.
7628
ac82cc6a
PE
7629 * xselect.c: Integer signedness and overflow fixes.
7630 (Fx_register_dnd_atom, x_handle_dnd_message):
7631 Use ptrdiff_t, not size_t, since we prefer signed.
7632 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7633 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7634 x_dnd_atoms_size and x_dnd_atoms_length.
7635
c2d1e36d
PE
7636 * doprnt.c: Prefer signed to unsigned when either works.
7637 * eval.c (verror):
7638 * doprnt.c (doprnt):
7639 * lisp.h (doprnt):
7640 * xdisp.c (vmessage):
7641 Use ptrdiff_t, not size_t, when using or implementing doprnt,
7642 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7643 prefer signed arithmetic to avoid comparison confusion.
7644 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7645 but is a bit tricky.
7646
0e926e56
PE
7647 Assume freestanding C89 headers, string.h, stdlib.h.
7648 * data.c, doprnt.c, floatfns.c, print.c:
7649 Include float.h unconditionally.
7650 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7651 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
7652 * regex.c: Likewise for stddef.h, string.h.
7653 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
7654 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7655 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7656 (STDC_HEADERS): Remove obsolete defines.
7657 * sysdep.c: Include limits.h unconditionally.
7658
9cfdb3ec
PE
7659 Assume support for memcmp, memcpy, memmove, memset.
7660 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7661 * regex.c (memcmp, memcpy):
7662 Remove; we assume C89 now.
7663
7664 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7665 (__malloc_safe_bcopy): Remove; no longer needed.
7666
cf950e6b 7667 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
7668 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
7669 well either way, and we prefer signed to unsigned.
7670
dbf38e02
LMI
76712011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7672
7673 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7674 closes the connection while we're reading (bug#9182).
7675
d6f0886c 76762011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 7677
d6f0886c
JD
7678 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7679 are specified (Bug#9168).
24e0f6b1 7680
2eb1f9e6
PE
76812011-07-25 Paul Eggert <eggert@cs.ucla.edu>
7682
7683 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7684 Found by GCC static checking and --with-wide-int on a 32-bit host.
7685
22381272 76862011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
7687
7688 * xdisp.c (compute_display_string_pos): Fix logic of caching
7689 previous display string position. Initialize cached_prev_pos to
7690 -1. Fixes slow-down at the beginning of a buffer.
7691
f25e39b4
EZ
76922011-07-24 Eli Zaretskii <eliz@gnu.org>
7693
7694 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7695 for attrs[LFACE_FONTSET_INDEX].
7696
04c4b52e
PE
76972011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7698
7699 * xml.c (parse_region): Remove unused local
7700 that was recently introduced.
7701
c1734fbd
EZ
77022011-07-23 Eli Zaretskii <eliz@gnu.org>
7703
be18c5a5
EZ
7704 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7705 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7706
c1734fbd
EZ
7707 * xdisp.c (move_it_in_display_line_to): Record the best matching
7708 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
7709 exit if none of the characters scanned was an exact match.
7710 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
7711 when exact match is impossible due to invisible text, and the
7712 lines are truncated.
7713
a258d627
JD
77142011-07-23 Jan Djärv <jan.h.d@swipnet.se>
7715
7716 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7717 for OSX >= 10.7.
7718
b6d5a689
EZ
77192011-07-22 Eli Zaretskii <eliz@gnu.org>
7720
0f74f785
EZ
7721 Fix a significant slow-down of cursor motion with C-n, C-p,
7722 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7723 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 7724 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
7725 (next_element_from_buffer): Call compute_stop_pos_backwards to
7726 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
7727 base_level_stop.
7728 (reseat): Don't look for prev_stop, as that could mean a very long
7729 run.
7730 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7731 <cached_disp_overlay_modiff>: Cache for last found display string
7732 position.
551918c1 7733 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
7734 about the same buffer in the same area of character positions, and
7735 the buffer wasn't changed since the time the display string
7736 position was cached.
551918c1 7737
b2d0c91a
EZ
77382011-07-22 Eli Zaretskii <eliz@gnu.org>
7739
7740 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7741 is an integer, which is important for empty lines. (Bug#9149)
7742
043604ee
CY
77432011-07-22 Chong Yidong <cyd@stupidchicken.com>
7744
7745 * frame.c (Fmodify_frame_parameters): In tty case, update the
7746 default face if necessary (Bug#4238).
7747
da4adb04
CY
77482011-07-21 Chong Yidong <cyd@stupidchicken.com>
7749
7750 * editfns.c (Fstring_to_char): No need to explain what a character
7751 is in the docstring (Bug#6576).
7752
9abd0532
LMI
77532011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7754
7755 * xml.c (parse_region): Make sure we always return a tree.
7756
36881d16
HK
77572011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
7758
7759 * xml.c (parse_region): If a document contains only comments,
7760 return that, too.
7761
1e98674d
LMI
77622011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7763
7764 * xml.c (make_dom): Return comments, too.
7765
590bd467
PE
77662011-07-19 Paul Eggert <eggert@cs.ucla.edu>
7767
7768 Port to OpenBSD.
7769 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
7770 and the surrounding thread.
7771 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
7772 rather than fgets, and retry after EINTR. Otherwise, 'emacs
7773 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
7774 timer goes off.
7775 * s/openbsd.h (BROKEN_SIGIO): Define.
7776 * unexelf.c (unexec) [__OpenBSD__]:
7777 Don't update the .mdebug section of the Alpha COFF symbol table.
7778
f41628b2
LMI
77792011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7780
7781 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
7782 (bug#8460).
7783
b59b67c5
PE
77842011-07-18 Paul Eggert <eggert@cs.ucla.edu>
7785
15e3a074
PE
7786 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
7787 This fixes some race conditions on the permissions of any newly
7788 created file.
7789
41bed37d
PE
7790 * alloc.c (valid_pointer_p): Use pipe, not open.
7791 This fixes some permissions issues when debugging.
7792
b59b67c5
PE
7793 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
7794 If fchown fails to set both uid and gid, try to set just gid,
7795 as that is sometimes allowed. Adjust the file's mode to eliminate
7796 setuid or setgid bits that are inappropriate if fchown fails.
7797
925a6be7
SM
77982011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7799
7800 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
7801 to compare Lisp_Objects.
7802 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
7803 global_gnutls_log_level, don't mistake it for a Lisp_Object.
7804 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
7805
52968808
AS
78062011-07-17 Andreas Schwab <schwab@linux-m68k.org>
7807
0a6a104b
AS
7808 * lread.c (read_integer): Unread even EOF character.
7809 (read1): Likewise. Properly record start position of symbol.
7810
52968808
AS
7811 * lread.c (read1): Read `#:' as empty uninterned symbol if no
7812 symbol character follows.
7813
9e381cdd
PE
78142011-07-17 Paul Eggert <eggert@cs.ucla.edu>
7815
7816 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
7817 This works around a problem with the previous change to Fcopy_file.
7818 Recent glibc declares fchown with __attribute__((warn_unused_result)),
7819 and without this change, GCC might complain about discarding
7820 fchown's return value.
7821
b5641435
JB
78222011-07-16 Juanma Barranquero <lekktu@gmail.com>
7823
7824 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
7825
a8031457
PE
78262011-07-16 Paul Eggert <eggert@cs.ucla.edu>
7827
7828 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
7829
dd889327
LMI
78302011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
7831
750c33f7
LMI
7832 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
7833 it's used from the C level.
7834
dd889327
LMI
7835 * process.c: Use the same condition for POLL_FOR_INPUT in both
7836 keyboard.c and process.c (bug#1858).
7837
87e86684
LM
78382011-07-09 Lawrence Mitchell <wence@gmx.li>
7839
7840 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
7841 (Fgnutls_boot): Use it.
7842
64348f40
AS
78432011-07-15 Andreas Schwab <schwab@linux-m68k.org>
7844
7845 * doc.c (Fsubstitute_command_keys): Revert last change.
7846
1d698799
LMI
78472011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
7848
f863868c
LMI
7849 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
7850 quotes the next character, and doesn't affect other longer
7851 sequences (bug#8935).
7852
1d698799
LMI
7853 * lread.c (syms_of_lread): Clarify that is isn't only
7854 `eval-buffer' and `eval-defun' that's affected by
7855 `lexical-binding' (bug#8460).
7856
aa4b6df6
EZ
78572011-07-15 Eli Zaretskii <eliz@gnu.org>
7858
7859 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 7860 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 7861
5d856da6
PE
78622011-07-14 Paul Eggert <eggert@cs.ucla.edu>
7863
ad6042bb
PE
7864 Fix minor problems found by static checking.
7865 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
7866 (elsz): Now a signed constant, not a size_t var. We prefer signed
7867 types to unsigned, to avoid integer comparison confusion. Without
7868 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
7869 "cannot optimize loop, the loop counter may overflow", a symptom
7870 of the confusion.
f00bbb22 7871 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
7872 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
7873
6468f31c
LMI
78742011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7875
49080b10
LMI
7876 * search.c (Fre_search_backward): Mention `case-fold-search' in
7877 all the re_search_* functions (bug#8138).
7878
6468f31c
LMI
7879 * keyboard.c (Fopen_dribble_file): Document when the file is
7880 closed (bug#8056).
7881
c965adc5
EZ
78822011-07-14 Eli Zaretskii <eliz@gnu.org>
7883
df9733bf
EZ
7884 * bidi.c (bidi_dump_cached_states): Fix format of displaying
7885 bidi_cache_idx.
7886
0bb23927
EZ
7887 Support bidi reordering of display and overlay strings.
7888 * xdisp.c (compute_display_string_pos)
7889 (compute_display_string_end): Accept additional argument STRING.
7890 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
7891 (reseat_to_string): Initialize bidi_it->string.s and
7892 bidi_it->string.schars.
7893 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
7894 NULL (avoids a crash in bidi_paragraph_init).
7895 Initialize itb.string.lstring.
0bb23927
EZ
7896 (init_iterator): Call bidi_init_it only of a valid
7897 buffer position was specified. Initialize paragraph_embedding to
7898 L2R.
7899 (reseat_to_string): Initialize the bidi iterator.
7900 (display_string): If we need to ignore text properties of
7901 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
7902 original value of -1 will not work with bidi.)
7903 (compute_display_string_pos): First arg is now struct
7904 `text_pos *'; all callers changed. Support display properties on
7905 Lisp strings.
7906 (compute_display_string_end): Support display properties on Lisp
7907 strings.
7908 (init_iterator, reseat_1, reseat_to_string): Initialize the
7909 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
7910 when iterating on a string not from display properties).
640c8776
SM
7911 (compute_display_string_pos, compute_display_string_end):
7912 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
7913 arrow keys.
7914 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
7915 base_level_stop; instead, set base_level_stop to BEGV.
7916 Fixes crashes in vertical-motion.
0bb23927
EZ
7917 (next_element_from_buffer): Improve commentary for when
7918 the iterator is before prev_stop.
7919 (init_iterator): Initialize bidi_p from the default value of
7920 bidi-display-reordering, not from buffer-local value. Use the
7921 buffer-local value only if initializing for buffer iteration.
7922 (handle_invisible_prop): Support invisible properties on strings
7923 that are being bidi-reordered.
7924 (set_iterator_to_next): Support bidi reordering of C strings and
7925 Lisp strings.
7926 (next_element_from_string): Support bidi reordering of Lisp
7927 strings.
7928 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
7929 (display_string): Support display of R2L glyph rows.
7930 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
7931 (init_iterator): Don't initialize it->bidi_p for strings
7932 here.
7933 (reseat_to_string): Initialize it->bidi_p for strings here.
7934 (next_element_from_string, next_element_from_c_string)
7935 (next_element_from_buffer): Add xassert's for correspondence
7936 between IT's object being iterated and it->bidi_it.string
7937 structure.
7938 (face_before_or_after_it_pos): Support bidi iteration.
7939 (next_element_from_c_string): Handle the case of the first string
7940 character that is not the first one in the visual order.
7941 (get_visually_first_element): New function, refactored from common
7942 parts of next_element_from_buffer, next_element_from_string, and
7943 next_element_from_c_string.
7944 (tool_bar_lines_needed, redisplay_tool_bar)
7945 (display_menu_bar): Force left-to-right direction. Add a FIXME
7946 comment for making that be controlled by a user option.
7947 (push_it, pop_it): Save and restore the state of the
7948 bidi iterator. Save and restore the bidi_p flag.
7949 (pop_it): Iterate out of display property for string iteration as
7950 well.
7951 (iterate_out_of_display_property): Support iteration over strings.
7952 (handle_single_display_spec): Set up it->bidi_it for iteration
7953 over a display string, and call bidi_init_it.
7954 (handle_single_display_spec, next_overlay_string)
7955 (get_overlay_strings_1, push_display_prop): Set up the bidi
7956 iterator for displaying display or overlay strings.
7957 (forward_to_next_line_start): Don't use the shortcut if
7958 bidi-iterating.
7959 (back_to_previous_visible_line_start): If handle_display_prop
7960 pushed the iterator stack, restore the internal state of the bidi
7961 iterator by calling bidi_pop_it same number of times.
7962 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
7963 and we are bidi-iterating, don't decrement the iterator position;
7964 instead, set the first_elt flag in the bidi iterator, to produce
7965 the same effect.
7966 (reseat_1): Remove redundant setting of string_from_display_prop_p.
7967 (push_display_prop): xassert that we are iterating a buffer.
7968 (push_it, pop_it): Save and restore paragraph_embedding member.
7969 (handle_single_display_spec, next_overlay_string)
7970 (get_overlay_strings_1, reseat_1, reseat_to_string)
7971 (push_display_prop): Set up the `unibyte' member of bidi_it.string
7972 correctly. Don't assume unibyte strings are not bidi-reordered.
7973 (compute_display_string_pos)
7974 (compute_display_string_end): Fix handling the case of C string.
7975 (push_it, pop_it): Save and restore from_disp_prop_p.
7976 (handle_single_display_spec, push_display_prop): Set the
7977 from_disp_prop_p flag.
7978 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
7979 (pop_it): Call iterate_out_of_display_property only if we are
7980 popping after iteration over a string that came from a display
7981 property. Fix a typo in popping stretch info. Add an assertion
7982 for verifying that the iterator position is in sync with the bidi
7983 iterator.
7984 (handle_single_display_spec, get_overlay_strings_1)
7985 (push_display_prop): Fix initialization of paragraph direction for
7986 string when that of the parent object is not yet determined.
7987 (reseat_1): Call bidi_init_it to resync the bidi
7988 iterator with IT's position. (Bug#7616)
7989 (find_row_edges): If ROW->start.pos gives position
7990 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
7991 (handle_stop, back_to_previous_visible_line_start, reseat_1):
7992 Reset the from_disp_prop_p flag.
7993 (SAVE_IT, RESTORE_IT): New macros.
7994 (pos_visible_p, face_before_or_after_it_pos)
7995 (back_to_previous_visible_line_start)
7996 (move_it_in_display_line_to, move_it_in_display_line)
7997 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7998 (try_scrolling, redisplay_window, display_line): Use them when
7999 saving a temporary copy of the iterator and restoring it back.
8000 (back_to_previous_visible_line_start, reseat_1)
8001 (init_iterator): Empty the bidi cache "stack".
8002 (move_it_in_display_line_to): If iterator ended up at
8003 EOL, but we never saw any buffer positions smaller than
8004 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8005 motion in bidi-reordered lines.
8006 (move_it_in_display_line_to): Record prev_method and prev_pos
8007 immediately before the call to set_iterator_to_next. Fixes cursor
8008 motion in bidi-reordered lines with stretch glyphs and strings
8009 displayed in margins. (Bug#8133) (Bug#8867)
8010 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8011 TO_CHARPOS.
640c8776
SM
8012 (pos_visible_p): Support positions in bidi-reordered lines.
8013 Save and restore bidi cache.
0bb23927
EZ
8014
8015 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8016 (bidi_paragraph_info): Delete unused struct.
8017 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8018 (bidi_cache_start): New variable.
8019 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8020 to zero.
8021 (bidi_cache_fetch_state, bidi_cache_search)
8022 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8023 (bidi_cache_find, bidi_peek_at_next_level)
8024 (bidi_level_of_next_char, bidi_find_other_level_edge)
8025 (bidi_move_to_visually_next): Compare cache index with
8026 bidi_cache_start rather than with zero.
8027 (bidi_fetch_char): Accept new argument STRING; all callers
8028 changed. Support iteration over a string. Support strings with
8029 display properties. Support unibyte strings. Fix the type of
8030 `len' according to what STRING_CHAR_AND_LENGTH expects.
8031 (bidi_paragraph_init, bidi_resolve_explicit_1)
8032 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
8033 (bidi_level_of_next_char, bidi_move_to_visually_next):
8034 Support iteration over a string.
0bb23927
EZ
8035 (bidi_set_sor_type, bidi_resolve_explicit_1)
8036 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8037 can now be zero (for strings); special values 0 and -1 were
8038 changed to -1 and -2, respectively.
8039 (bidi_char_at_pos): New function.
8040 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8041 Call it instead of FETCH_MULTIBYTE_CHAR.
8042 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8043 initialized to valid values.
8044 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8045 values.
8046 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8047 the test for valid cached positions. Fix the logic for looking up
8048 the sentinel state in the cache. GCPRO the Lisp string we are
8049 iterating.
8050 (bidi_push_it, bidi_pop_it): New functions.
8051 (bidi_initialize): Initialize the bidi cache start stack pointer.
8052 (bidi_cache_ensure_space): New function, refactored from part of
8053 bidi_cache_iterator_state. Don't assume the required size is just
8054 one BIDI_CACHE_CHUNK away.
8055 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
8056 (bidi_count_bytes, bidi_char_at_pos): New functions.
8057 (bidi_cache_search): Don't assume bidi_cache_last_idx is
8058 always valid if bidi_cache_idx is valid.
8059 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
8060 is valid if it's going to be used.
8061 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
8062 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
8063 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8064 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
8065 (bidi_find_other_level_edge, bidi_cache_start_stack):
8066 All variables related to cache indices are now EMACS_INT.
c965adc5 8067
0bb23927
EZ
8068 * dispextern.h (struct bidi_string_data): New structure.
8069 (struct bidi_it): New member `string'. Make flag members be 1-bit
8070 fields, and put them last in the struct.
640c8776
SM
8071 (compute_display_string_pos, compute_display_string_end):
8072 Update prototypes.
0bb23927
EZ
8073 (bidi_push_it, bidi_pop_it): Add prototypes.
8074 (struct iterator_stack_entry): New members bidi_p,
8075 paragraph_embedding, and from_disp_prop_p.
8076 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
8077 (bidi_shelve_cache, bidi_unshelve_cache):
8078 Declare prototypes.
0bb23927
EZ
8079
8080 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
8081 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
8082 and vector-like objects.
8083
8084 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
8085 cache around display iteration.
8086
8087 * window.c (Fwindow_end, window_scroll_pixel_based)
8088 (displayed_window_lines, Frecenter): Save and restore the bidi
8089 cache around display iteration.
8090
3bbd2265
LMI
80912011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8092
8093 * editfns.c (Fdelete_region): Clarify the use of the named
8094 parameters (bug#6788).
8095
adc47434
MR
80962011-07-14 Martin Rudalics <rudalics@gmx.at>
8097
8098 * indent.c (Fvertical_motion): Set and restore w->pointm when
8099 saving and restoring the window's buffer (Bug#9006).
8100
837c31f8
LMI
81012011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
8102
8103 * editfns.c (Fstring_to_char): Clarify just what is returned
8104 (bug#6576). Text by Eli Zaretskii.
8105
ac389d0c
JB
81062011-07-13 Juanma Barranquero <lekktu@gmail.com>
8107
8108 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8109
0be0ce47
EZ
81102011-07-13 Eli Zaretskii <eliz@gnu.org>
8111
8112 * buffer.c (mmap_find): Fix a typo.
8113
cd18e7e3
JB
81142011-07-13 Johan Bockgård <bojohan@gnu.org>
8115
8116 Fix execution of x selection hooks.
8117 * xselect.c (Qx_lost_selection_functions)
8118 (Qx_sent_selection_functions): New vars.
8119 (syms_of_xselect): DEFSYM them.
8120 (x_handle_selection_request): Pass Qx_sent_selection_functions
8121 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8122 (x_handle_selection_clear,x_clear_frame_selections):
8123 Pass Qx_lost_selection_functions rather than
8124 Vx_lost_selection_functions to Frun_hook_with_args.
8125
47ea7f44
PE
81262011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8127
ac389d0c 8128 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8129 The old code sometimes used this field without initializing it.
8130
47ea7f44
PE
8131 * alloc.c (gc_sweep): Don't read past end of array.
8132 In theory, the old code could also have corrupted Emacs internals,
8133 though it'd be very unlikely.
8134
bc985c87
AS
81352011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8136
8137 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8138 argument. (Bug#4026)
bc985c87 8139
0cf34688
LMI
81402011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8141
b3dadd76
LMI
8142 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8143 key" (bug#4257).
8144
0cf34688
LMI
8145 * window.c (Fset_window_start): Doc fix (bug#4199).
8146 (Fset_window_hscroll): Ditto.
8147
270768cd
PE
81482011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8149
077e3dda 8150 Fix minor new problems caught by GCC 4.6.1.
270768cd 8151 * term.c (init_tty): Remove unused local.
490011a6 8152 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8153 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8154 not used otherwise.
270768cd 8155
b1f58454
CY
81562011-07-12 Chong Yidong <cyd@stupidchicken.com>
8157
8158 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8159
22b9578d
LMI
81602011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8161
6e70ab07
LMI
8162 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8163 are the mini-buffer and the echo area (bug#3320).
8164
22b9578d
LMI
8165 * term.c (init_tty): Remove support for supdup, c10 and perq
8166 terminals, which are no longer supported (bug#1482).
8167
8974cc9f
JB
81682011-07-10 Johan Bockgård <bojohan@gnu.org>
8169
8170 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8171
a560d974
JD
81722011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8173
8174 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8175 for non-popups (Bug#3642).
8176
1dae0f0a
AS
81772011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8178
268c2c36 8179 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8180 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8181 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8182 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8183 * data.c (fmod): Likewise.
8184 * dispnew.c (swap_glyphs_in_rows): Likewise.
8185 * emacs.c (memory_warning_signal): Likewise.
8186 * floatfns.c (float_error): Likewise.
8187 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8188 (otf_open, font_otf_capability, generate_otf_features)
8189 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8190 Likewise.
8191 * image.c (pbm_read_file): Likewise.
8192 * indent.c (string_display_width): Likewise.
8193 * intervals.c (check_for_interval, search_for_interval)
8194 (inc_interval_count, count_intervals, root_interval)
8195 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8196 * lread.c (defalias): Likewise.
268c2c36 8197 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8198 * regex.c (set_image_of_range_1, set_image_of_range)
8199 (regex_grow_registers): Likewise.
8200 * sysdep.c (strerror): Likewise.
8201 * termcap.c (valid_filename_p, tprint, main): Likewise.
8202 * tparam.c (main): Likewise.
8203 * unexhp9k800.c (run_time_remap, save_data_space)
8204 (update_file_ptrs, read_header, write_header, calculate_checksum)
8205 (copy_file, copy_rest, display_header): Likewise.
8206 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8207 Likewise.
8208 * xdisp.c (check_it): Likewise.
8209 * xfaces.c (register_color, unregister_color, unregister_colors):
8210 Likewise.
8211 * xfns.c (print_fontset_result): Likewise.
8212 * xrdb.c (member, fatal, main): Likewise.
8213
99033785
PE
82142011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8215
8216 Fix minor problems found by static checking (Bug#9031).
8217 * chartab.c (char_table_set_range, map_sub_char_table):
8218 Remove unused locals.
8219 (uniprop_table): Now static.
8220 * composite.c (_work_char): Remove unused static var.
8221
9cb2ac56
JB
82222011-07-09 Juanma Barranquero <lekktu@gmail.com>
8223
8224 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8225
f25661f0
JD
82262011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8227
8228 * gtkutil.c (qttip_cb): Remove code without function.
8229
8278c4fe
EZ
82302011-07-09 Eli Zaretskii <eliz@gnu.org>
8231
8232 * w32.c (pthread_sigmask): New stub.
8233
1692ae2d 82342011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8235
8a6ebd58 8236 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8237 sigprocmask is portable only for single-threaded applications, and
8238 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8239 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8240 (LIBES): Use it.
8241 * callproc.c (Fcall_process):
8242 * process.c (create_process):
8243 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8244 Use pthread_sigmask, not sigprocmask.
123403e4 8245
1b854618
JD
82462011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8247
8248 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8249 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8250 wrong (Bug#8591).
8251
3fe4b549
JD
82522011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8253
0ce7e563
JD
8254 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8255 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8256 (xg_hide_tooltip): Fix comment.
8257
3fe4b549
JD
8258 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8259 in registerServicesMenuSendTypes.
8260 (validRequestorForSendType): Don't check ns_return_types.
8261
8262 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8263 ns_return_type.
8264
5df75e47
JR
82652011-07-08 Jason Rumney <jasonr@gnu.org>
8266
22610910
JR
8267 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8268 SH_SHOW for hidden windows (Bug#5482).
8269
5df75e47
JR
8270 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8271 frame struct members of non-existent frames (Bug#6284).
8272
699c10bd
JD
82732011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8274
4393663b
JD
8275 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8276 variable firstTime not needed on OSX >= 10.6.
8277 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8278 >= 10.5. Use setKnobProportion, setDoubleValue.
8279
8280 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8281 (MAC_OS_X_VERSION_10_5): Define if not defined.
8282 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8283 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8284 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8285
8286 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8287 cString and lossyCString on OSX >= 10.4.
4393663b 8288
58179cce 8289 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8290 sizeToFit on OSX >= 10.2.
8291
8292 * nsimage.m (allocInitFromFile): Don't use deprecated method
8293 bestRepresentationForDevice on OSX >= 10.6.
8294
8295 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8296 to avoid warning.
8297
8298 * emacs.c: Declare unexec_init_emacs_zone.
8299
a63e0781
JD
8300 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8301
699c10bd
JD
8302 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8303
8304 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8305 on svcsMenu (Bug#8842).
8306
8307 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8308 ns_return_types.
8309 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8310
8311 * nsterm.m (QUTF8_STRING): Declare.
8312 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8313 (validRequestorForSendType): Return type is (id).
8314 Change indexOfObjectIdenticalTo to indexOfObject.
8315 Check if we have local selection before returning self (Bug#8842).
8316 (writeSelectionToPasteboard): Put local selection into paste board
8317 if we have a local selection (Bug#8842).
8318 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8319
8320 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8321 (ns_get_local_selection): Declare.
8322
54e10184
LMI
83232011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8324
9888ff71
LMI
8325 * keymap.c (describe_map_tree): Don't insert a double newline at
8326 the end of the buffer (bug#1169) and return whether we inserted
8327 something.
8328
54e10184
LMI
8329 * callint.c (Fcall_interactively): Change "reading args" to
8330 "providing args" to try to clarify what it does (bug#1010).
8331
15fa4783
KH
83322011-07-07 Kenichi Handa <handa@m17n.org>
8333
8334 * composite.c (composition_compute_stop_pos): Ignore a static
8335 composition starting before CHARPOS (Bug#8915).
8336
8337 * xdisp.c (handle_composition_prop): Likewise.
8338
a8815b00
EZ
83392011-07-07 Eli Zaretskii <eliz@gnu.org>
8340
8341 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8342 (Bug#9015)
8343
ef7b981d 83442011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8345
8346 * character.h (unicode_category_t): New enum type.
8347
8348 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8349 (Qchar_code_property_table): New variable.
8350 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8351 (UNIPROP_COMPRESSED_FORM_P): New macros.
8352 (char_table_ascii): Uncompress the compressed values.
8353 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8354 Uncompress the compressed values.
ac389d0c 8355 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8356 (char_table_ref_and_range): Uncompress the compressed values.
8357 (sub_char_table_set): New arg is_uniprop. Callers changed.
8358 Uncompress the compressed values.
8359 (sub_char_table_set_range): Args changed. Callers changed.
8360 (char_table_set_range): Adjuted for the above change.
8361 (map_sub_char_table): Delete args default_val and parent. Add arg
8362 top. Give decoded values to a Lisp function.
640c8776 8363 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8364 values to a Lisp function. Gcpro more variables.
8365 (uniprop_table_uncompress)
8366 (uniprop_decode_value_run_length): New functions.
8367 (uniprop_decoder, uniprop_decoder_count): New variables.
8368 (uniprop_get_decoder, uniprop_encode_value_character)
8369 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8370 New functions.
8371 (uniprop_encoder, uniprop_encoder_count): New variables.
8372 (uniprop_get_encoder, uniprop_table)
8373 (Funicode_property_table_internal, Fget_unicode_property_internal)
8374 (Fput_unicode_property_internal): New functions.
8375 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8376 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8377 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8378 char-code-property-alist.
8379
640c8776 8380 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8381 Vunicode_category_table.
8382
640c8776 8383 * font.c (font_range): Adjust for the change of
c805dec0
KH
8384 Vunicode_category_table.
8385
76b397fb
DN
83862011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8387
8388 * m/iris4d.h: Remove file, move contents ...
8389 * s/irix6-5.h: ... here.
8390
22b4128e
PE
83912011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8392
8393 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8394 * alloc.c (mark_buffer):
8395 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8396 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8397 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8398 This isn't true in general, and it's particularly not true
8399 if Emacs is configured with --with-wide-int.
8400 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8401 New macros, used in the buffer.c change.
8402
869795d6
JD
84032011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8404
8405 * xsettings.c: Use both GConf and GSettings if both are available.
8406 (store_config_changed_event): Add comment.
8407 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8408 (store_tool_bar_style_changed): New functions.
5e617bc2 8409 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8410 (struct xsettings): Move font inside HAVE_XFT.
8411 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8412 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8413 Move inside HAVE_XFT.
640c8776 8414 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8415 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8416 also.
8417 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8418 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8419 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8420 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8421 (parse_settings): Move check for font inside HAVE_XFT.
8422 (read_settings, apply_xft_settings): Add comment.
8423 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8424 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8425 call store_font_name_changed.
8426 (xft_settings_event): Add comment.
8427 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8428 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8429 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8430 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8431 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8432 (xsettings_get_system_font, xsettings_get_system_normal_font):
8433 Add comment.
869795d6 8434
d8ed26bd
PE
84352011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8436
8437 Random fixes. E.g., (random) never returned negative values.
8438 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8439 subseconds part to the entropy, as that's a bit more random.
8440 Prefer signed to unsigned, since the signedness doesn't matter and
8441 in general we prefer signed. When given a limit, use a
8442 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8443 latter isn't right if USE_2_TAGS_FOR_INTS.
8444 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8445 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8446
cabf1cac
SM
84472011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8448
8449 * textprop.c (text_property_stickiness):
8450 Obey Vtext_property_default_nonsticky.
8451 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8452 * w32fns.c (syms_of_w32fns):
8453 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8454
6e9b2be9
PE
84552011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8456
8457 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8458 This is more efficient than Ffile_directory_p and avoids a minor race.
8459
90186c68
LMI
84602011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8461
7c301272
LMI
8462 * buffer.c (Foverlay_put): Say what the return value is
8463 (bug#7835).
8464
c4f2d8d4
LMI
8465 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8466 is a directory before asking whether to use the file name
8467 (bug#7564).
ad637907
LMI
8468 (barf_or_query_if_file_exists): Make the "File is a directory"
8469 error be more correct.
c4f2d8d4 8470
90186c68
LMI
8471 * fns.c (Frequire): Remove the mention of the .gz files, since
8472 that's installation-specific, but keep the mention of
8473 `get-load-suffixes'.
8474
da64016e
PE
84752011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8476
8477 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8478 Report string overflow if the output is too long.
8479
7d47b580
JB
84802011-07-04 Juanma Barranquero <lekktu@gmail.com>
8481
a555cb87
JB
8482 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8483 (syms_of_gnutls): Remove duplicate DEFSYM for
8484 Qgnutls_bootprop_verify_hostname_error, an error for
8485 Qgnutls_bootprop_verify_error (which is no longer used).
8486
7d47b580
JB
8487 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8488 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8489 Also (re)move comments that are misplaced or no longer relevant.
8490
1e49bfab
LMI
84912011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8492
8493 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8494
1485f4c0
CY
84952011-07-03 Chong Yidong <cyd@stupidchicken.com>
8496
8497 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8498 and background color parameters if they have been changed.
8499
a9ab721e
LMI
85002011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8501
8502 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8503
cf7cff57
PE
85042011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8505
2e13213d
PE
8506 * xsettings.c (SYSTEM_FONT): Define only when used.
8507 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8508
cf7cff57
PE
8509 * keymap.c (access_keymap_1): Now static.
8510
7a8e04f7
CY
85112011-07-02 Chong Yidong <cyd@stupidchicken.com>
8512
8513 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8514 leave any prefix arg for the up event (Bug#1586).
8515
61352f62
LMI
85162011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8517
69bb1ef7
LMI
8518 * lread.c (syms_of_lread): Mention single symbols defined by
8519 `defvar' or `defconst' (bug#7154).
8520
61352f62 8521 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8522 (Frequire): Mention get-load-suffixes.
61352f62 8523
28545e04
MR
85242011-07-02 Martin Rudalics <rudalics@gmx.at>
8525
8526 * window.h (window): Remove clone_number slot.
8527 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8528 Remove.
8529 (make_parent_window, make_window, saved_window)
8530 (Fset_window_configuration, save_window_save): Don't deal with
8531 clone numbers.
8532 * buffer.c (Qclone_number): Remove declaration.
8533 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8534
3349e122
SM
85352011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8536
8537 Add multiple inheritance to keymaps.
8538 * keymap.c (Fmake_composed_keymap): New function.
8539 (Fset_keymap_parent): Simplify.
8540 (fix_submap_inheritance): Remove.
8541 (access_keymap_1): New function extracted from access_keymap to handle
8542 embedded parents and handle lists of maps.
8543 (access_keymap): Use it.
8544 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8545 (Fcopy_keymap): Handle embedded parents.
8546 (Fcommand_remapping, define_as_prefix): Simplify.
8547 (Fkey_binding): Simplify.
8548 (syms_of_keymap): Move minibuffer-local-completion-map,
8549 minibuffer-local-filename-completion-map,
8550 minibuffer-local-must-match-map, and
8551 minibuffer-local-filename-must-match-map to Elisp.
8552 (syms_of_keymap): Defsubr make-composed-keymap.
8553 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8554 (parse_menu_item): Trivial simplification.
8555
3279eb87
GM
85562011-07-01 Glenn Morris <rgm@gnu.org>
8557
8558 * Makefile.in (SETTINGS_LIBS): Fix typo.
8559
4550efdf
KI
85602011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8561
8562 * coding.c (Fencode_coding_string): Record the last coding system
8563 used, as the function doc string says (bug#8738).
8564
0949d2b6
JD
85652011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8566
8567 * xsettings.c (store_monospaced_changed): Take new font as arg and
8568 check for change against current_mono_font.
8569 (EMACS_TYPE_SETTINGS): Remove this and related defines.
8570 (emacs_settings_constructor, emacs_settings_get_property)
8571 (emacs_settings_set_property, emacs_settings_class_init)
8572 (emacs_settings_init, gsettings_obj): Remove.
8573 (something_changedCB): New function for HAVE_GSETTINGS.
8574 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8575 with value as argument.
8576 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8577 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 8578 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
8579 "changed".
8580
8581 * xgselect.c: Add defined (HAVE_GSETTINGS).
8582 (xgselect_initialize): Ditto.
8583
8584 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8585 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8586 xg_select.
8587
bbc6b304
PE
85882011-07-01 Paul Eggert <eggert@cs.ucla.edu>
8589
8590 * eval.c (struct backtrace): Simplify and port the data structure.
8591 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8592 signed bit field, as this assumption is not portable and it makes
8593 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
8594 "char debug_on_exit : 1" as this is not portable either; instead,
8595 use the portable "unsigned int debug_on_exit : 1". Remove unused
8596 member evalargs. Remove obsolete comments about cc bombing out.
8597
9851bfc5
JD
85982011-06-30 Jan Djärv <jan.h.d@swipnet.se>
8599
51bb811f 8600 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
8601 Let HAVE_GSETTINGS override HAVE_GCONF.
8602 (store_monospaced_changed): New function.
8603 (EMACS_SETTINGS): A new type derived from GObject to handle
8604 GSettings notifications.
8605 (emacs_settings_constructor, emacs_settings_get_property)
8606 (emacs_settings_set_property, emacs_settings_class_init):
8607 New functions.
8608 (gsettings_client, gsettings_obj): New variables.
8609 (GSETTINGS_SCHEMA): New define.
8610 (something_changedCB): Call store_monospaced_changed.
8611 (init_gsettings): New function.
8612 (xsettings_initialize): Call init_gsettings.
8613 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8614 to NULL.
8615
640c8776 8616 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
8617 GCONF_CFLAGS/LIBS.
8618
5386012d
MR
86192011-06-29 Martin Rudalics <rudalics@gmx.at>
8620
8621 * window.c (resize_root_window, grow_mini_window)
8622 (shrink_mini_window): Rename Qresize_root_window to
8623 Qwindow_resize_root_window and Qresize_root_window_vertically to
8624 Qwindow_resize_root_window_vertically.
8625
f13e0b08
PE
86262011-06-28 Paul Eggert <eggert@cs.ucla.edu>
8627
8628 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8629
94515237
JB
86302011-06-27 Juanma Barranquero <lekktu@gmail.com>
8631
8632 * makefile.w32-in: Redesign dependencies so they reflect more
8633 clearly which files are directly included by each source file,
8634 and not through other includes.
8635
e43b6e43
MR
86362011-06-27 Martin Rudalics <rudalics@gmx.at>
8637
8638 * buffer.c (Qclone_number): Declare static and DEFSYM it.
8639 (sort_overlays, overlay_strings): When an overlay's clone number
8640 matches the window's clone number process the overlay even if
8641 the overlay's window property doesn't match the current window.
8642
d68443dc
MR
8643 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8644 (Fwindow_hchild): Rename to Fwindow_left_child.
8645 (Fwindow_next): Rename to Fwindow_next_sibling.
8646 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
8647 (resize_window_check): Rename to window_resize_check.
8648 (resize_window_apply): Rename to window_resize_apply.
8649 (Fresize_window_apply): Rename to Fwindow_resize_apply.
8650 (Fdelete_other_windows_internal, resize_frame_windows)
8651 (Fsplit_window_internal, Fdelete_window_internal)
8652 (grow_mini_window, shrink_mini_window)
8653 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 8654
c7e73be5
JD
86552011-06-26 Jan Djärv <jan.h.d@swipnet.se>
8656
8657 * emacsgtkfixed.h: State that this is only used with Gtk+3.
8658 (emacs_fixed_set_min_size): Remove.
8659 (emacs_fixed_new): Take frame as argument.
8660
8661 * emacsgtkfixed.c: State that this is only used with Gtk+3.
8662 (_EmacsFixedPrivate): Remove minwidth/height.
8663 Add struct frame *f.
8664 (emacs_fixed_init): Initialize priv->f.
8665 (get_parent_class, emacs_fixed_set_min_size): Remove.
8666 (emacs_fixed_new): Set priv->f to argument.
8667 (emacs_fixed_get_preferred_width)
8668 (emacs_fixed_get_preferred_height): Use min_width/height from
8669 frames size_hint to set minimum and natural (Bug#8919).
8670 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8671 and use min_width/height from frames size_hint to set
8672 min_width/height (Bug#8919).
8673
8674 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
8675 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8676 Fix indentation.
c7e73be5 8677
cf99dcf8
EZ
86782011-06-26 Eli Zaretskii <eliz@gnu.org>
8679
8680 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8681 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8682 called at ZV.
8683
029529ac
CY
86842011-06-26 Chong Yidong <cyd@stupidchicken.com>
8685
8686 * process.c (wait_reading_process_output): Bypass select if
8687 waiting for a cell while ignoring keyboard input, and input is
8688 pending. Suggested by Jan Djärv (Bug#8869).
8689
7a7ef429
PE
86902011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8691
8692 Use gnulib's dup2 module instead of rolling our own.
8693 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8694
11fdef7d 86952011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
8696
8697 * dispnew.c (scrolling_window): Before scrolling, turn off a
8698 mouse-highlight in the window being scrolled.
8699
cd3520a4
JB
87002011-06-24 Juanma Barranquero <lekktu@gmail.com>
8701
8702 Move DEFSYM to lisp.h and use everywhere.
8703
8704 * character.h (DEFSYM): Move declaration...
8705 * lisp.h (DEFSYM): ...here.
8706
8707 * gnutls.c:
8708 * minibuf.c:
8709 * w32menu.c:
8710 * w32proc.c:
8711 * w32select.c: Don't include character.h.
8712
8713 * alloc.c (syms_of_alloc):
8714 * buffer.c (syms_of_buffer):
8715 * bytecode.c (syms_of_bytecode):
8716 * callint.c (syms_of_callint):
8717 * casefiddle.c (syms_of_casefiddle):
8718 * casetab.c (init_casetab_once):
8719 * category.c (init_category_once, syms_of_category):
8720 * ccl.c (syms_of_ccl):
8721 * cmds.c (syms_of_cmds):
8722 * composite.c (syms_of_composite):
8723 * dbusbind.c (syms_of_dbusbind):
8724 * dired.c (syms_of_dired):
8725 * dispnew.c (syms_of_display):
8726 * doc.c (syms_of_doc):
8727 * editfns.c (syms_of_editfns):
8728 * emacs.c (syms_of_emacs):
8729 * eval.c (syms_of_eval):
8730 * fileio.c (syms_of_fileio):
8731 * fns.c (syms_of_fns):
8732 * frame.c (syms_of_frame):
8733 * fringe.c (syms_of_fringe):
8734 * insdel.c (syms_of_insdel):
8735 * keymap.c (syms_of_keymap):
8736 * lread.c (init_obarray, syms_of_lread):
8737 * macros.c (syms_of_macros):
8738 * msdos.c (syms_of_msdos):
8739 * print.c (syms_of_print):
8740 * process.c (syms_of_process):
8741 * search.c (syms_of_search):
8742 * sound.c (syms_of_sound):
8743 * syntax.c (init_syntax_once, syms_of_syntax):
8744 * terminal.c (syms_of_terminal):
8745 * textprop.c (syms_of_textprop):
8746 * undo.c (syms_of_undo):
8747 * w32.c (globals_of_w32):
8748 * window.c (syms_of_window):
8749 * xdisp.c (syms_of_xdisp):
8750 * xfaces.c (syms_of_xfaces):
8751 * xfns.c (syms_of_xfns):
8752 * xmenu.c (syms_of_xmenu):
8753 * xsettings.c (syms_of_xsettings):
8754 * xterm.c (syms_of_xterm): Use DEFSYM.
8755
4228cf16
TZ
87562011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
8757
cd3520a4 8758 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 8759
7fcccf1e
PE
87602011-06-23 Paul Eggert <eggert@cs.ucla.edu>
8761
7efb4e0e
PE
8762 Integer and buffer overflow fixes (Bug#8873).
8763
ff5844ad
PE
8764 * print.c (printchar, strout): Check for string overflow.
8765 (PRINTPREPARE, printchar, strout):
8766 Don't set size unless allocation succeeds.
8767
90532f02
PE
8768 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
8769 for sizes. Check for string overflow more accurately.
8770 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
8771
6d84508d
PE
8772 * macros.c: Integer and buffer overflow fixes.
8773 * keyboard.h (struct keyboard.kbd_macro_bufsize):
8774 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
8775 Use ptrdiff_t, not int, for sizes.
8776 Don't increment bufsize until after realloc succeeds.
8777 Check for size-calculation overflow.
8778 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
8779
437b2cb4
PE
8780 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
8781
8b9ac8b4
PE
8782 * lread.c: Integer overflow fixes.
8783 (read_integer): Radix is now EMACS_INT, not int,
8784 to improve quality of diagnostics for out-of-range radices.
8785 Calculate buffer size correctly for out-of-range radices.
8786 (read1): Check for integer overflow in radices, and in
8787 read-circle numbers.
82cb60d3
PE
8788 (read_escape): Avoid int overflow.
8789 (Fload, openp, read_buffer_size, read1)
8790 (substitute_object_recurse, read_vector, read_list, map_obarray):
8791 Use ptrdiff_t, not int, for sizes.
8792 (read1): Use EMACS_INT, not int, for sizes.
20270765 8793 Check for size overflow.
8b9ac8b4 8794
7fcccf1e
PE
8795 * image.c (cache_image): Check for size arithmetic overflow.
8796
bfbbd7e7
PE
8797 * lread.c: Integer overflow issues.
8798 (saved_doc_string_size, saved_doc_string_length)
8799 (prev_saved_doc_string_size, prev_saved_doc_string_length):
8800 Now ptrdiff_t, not int.
8801 (read1): Don't assume doc string length fits in int. Check for
8802 out-of-range doc string lengths.
8803 (read_list): Don't assume file position fits in int.
39019e54 8804 (read_escape): Check for hex character overflow.
bfbbd7e7 8805
4e323265
LL
88062011-06-22 Leo Liu <sdl.web@gmail.com>
8807
8808 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
8809 Move to minibuffer.el.
8810
85fece3e
PE
88112011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8812
20b84ce9 8813 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
8814 The following patches are for when GLYPH_DEBUG && !XASSERT.
8815 * dispextern.h (trace_redisplay_p, dump_glyph_string):
8816 * dispnew.c (flush_stdout):
8817 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
8818 Mark as externally visible.
8819 * dispnew.c (check_window_matrix_pointers): Now static.
8820 * dispnew.c (window_to_frame_vpos):
8821 * xfns.c (unwind_create_frame):
8822 * xterm.c (x_check_font): Remove unused local.
8823 * scroll.c (CHECK_BOUNDS):
8824 * xfaces.c (cache_fache): Rename local to avoid shadowing.
8825 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
8826 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
8827 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
8828 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
8829 Now static.
8830 (debug_method_add): Use va_list and vsprintf rather than relying
8831 on undefined behavior with wrong number of arguments.
8832 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
8833 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
8834 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
8835 since we're not interested in debugging glyphs with old libraries.
8836 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
8837 GCC 4.6.0's static checking.
8838
0766b489
PE
88392011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8840
31fd4b32
PE
8841 Integer overflow and signedness fixes (Bug#8873).
8842 A few related buffer overrun fixes, too.
8843
b79e8648
PE
8844 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
8845
0766b489
PE
8846 * dispextern.h (struct face.stipple):
8847 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
8848 (x_bitmap_mask, x_allocate_bitmap_record)
8849 (x_create_bitmap_from_data, x_create_bitmap_from_file)
8850 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
8851 (x_create_bitmap_from_xpm_data):
8852 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
8853 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
8854 (.bitmaps_last):
8855 * xfaces.c (load_pixmap):
8856 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
8857 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
8858 (.bitmaps_last, struct x_output.icon_bitmap):
8859 Use ptrdiff_t, not int, for bitmap indexes.
8860 (x_allocate_bitmap_record): Check for size overflow.
8861 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
8862
b081724f
PE
8863 Use ptrdiff_t, not int, for overlay counts.
8864 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
8865 * editfns.c (overlays_around, get_pos_property):
8866 * textprop.c (get_char_property_and_overlay):
8867 * xdisp.c (next_overlay_change, note_mouse_highlight):
8868 * xfaces.c (face_at_buffer_position):
21514da7
PE
8869 * buffer.c (OVERLAY_COUNT_MAX): New macro.
8870 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
8871 (Fnext_overlay_change, Fprevious_overlay_change)
8872 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 8873 Use ptrdiff_t, not int, for sizes.
21514da7 8874 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 8875
3de73e5e
PE
8876 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
8877
2606c57b
PE
8878 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
8879 (x_session_initialize): Do not assume string length fits in int.
8880
aaafe47a
PE
8881 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
8882 This is unlikely, but can occur if DPI is outlandish.
8883
2674ddc8 8884 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
8885 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
8886
28154962
PE
8887 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
8888 * xrdb.c (magic_file_p, search_magic_path):
8889 Omit last arg SUFFIX; it was always 0. All callers changed.
8890 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
8891
7de51af5
PE
8892 * xfont.c (xfont_match): Avoid need for strlen.
8893
25ed6cc3
PE
8894 * xfns.c: Don't assume strlen fits in int.
8895 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
8896
4eab31dd
PE
8897 * xdisp.c (message_log_check_duplicate): Return intmax_t,
8898 not unsigned long, as we prefer signed integers. All callers changed.
8899 Detect integer overflow in repeat count.
8900 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 8901 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 8902
171e2a58
PE
8903 * termcap.c: Don't assume sizes fit in int and never overflow.
8904 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
8905 (gobble_line): Check for size-calculation overflow.
8906
ad39faca 8907 * minibuf.c (Fread_buffer):
6e5bb2dc 8908 * lread.c (intern, intern_c_string):
74ca2eb3
PE
8909 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
8910 Don't assume string length fits in int.
8911
52c61c22 8912 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
8913 * gtkutil.c (style_changed_cb): Avoid need for strlen.
8914
b5b8c9e5
PE
8915 * font.c: Don't assume string length fits in int.
8916 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
8917 Use ptrdiff_t, not int.
ccd6111c
PE
8918 (font_intern_prop): Don't assume string length fits in int.
8919 Don't assume integer property fits in fixnum.
8920 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 8921
882f0d81 8922 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 8923 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
8924 Reformulate so as not to need the command string.
8925 Invoke gzip -cd rather than gunzip, as it's more portable.
8926 (lock_info_type, lock_file_1, lock_file):
8927 Don't assume pid_t and time_t fit in unsigned long.
8928 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
8929 (current_lock_owner): Prefer signed type for sizes.
8930 Use memcpy, not strncpy, where memcpy is what is really wanted.
8931 Don't assume (via atoi) that time_t and pid_t fit in int.
8932 Check for time_t and/or pid_t out of range, e.g., via a network share.
8933 Don't alloca where an auto var works fine.
8934
93f4cf88
PE
8935 * fileio.c: Fix some integer overflow issues.
8936 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
8937 Don't assume string length fits in int.
8938 (directory_file_name): Don't assume string length fits in long.
8939 (make_temp_name): Don't assume pid fits in int, or that its print
8940 length is less than 20.
8941
f3e92b69
PE
8942 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
8943
1bfdaf10
PE
8944 * coding.c (make_subsidiaries): Don't assume string length fits in int.
8945
35016e9a
PE
8946 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
8947
3d1e65a1
PE
8948 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
8949 We prefer signed integers, even for size calculations.
8950
0b963a93
PE
8951 * emacs.c: Don't assume string length fits in 'int'.
8952 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
8953 (main): Don't invoke strlen when not needed.
8954
573f4b54
PE
8955 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
8956 (XD_DEBUG_MESSAGE): Don't waste a byte.
8957
989f33ba
PE
8958 * callproc.c (getenv_internal_1, getenv_internal)
8959 (Fgetenv_internal):
965d34eb
PE
8960 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
8961
e4d29b33
PE
8962 * lread.c (invalid_syntax): Omit length argument.
8963 All uses changed. This doesn't fix a bug, but it simplifies the
8964 code away from its former Hollerith-constant appearance, and it's
8965 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 8966 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 8967
eb49b136
PE
8968 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
8969 This didn't break anything, but it didn't help either.
8970 It's confusing to put a bogus integer in a place where the actual
8971 value does not matter.
9f62aeb1 8972 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 8973 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 8974
15375a22
PE
8975 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
8976 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
8977 implementation.
b61cc01c
PE
8978 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
8979 We prefer signed types, and the value cannot exceed the EMACS_INT
8980 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
8981 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
8982 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
8983 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 8984
53b2623d
PE
8985 * indent.c (sane_tab_width): New function.
8986 (current_column, scan_for_column, Findent_to, position_indentation)
8987 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 8988 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 8989
51cab52b 8990 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 8991
f2ed8a70
PE
8992 * lisp.h (lint_assume): New macro.
8993 * composite.c (composition_gstring_put_cache):
8994 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
8995
abe80cc6
PE
8996 * editfns.c, insdel.c:
8997 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 8998
b02c740e
PE
8999 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9000
ebc96716
PE
9001 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9002
b4e50fa0 9003 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 9004 Use much-faster test for byte-length change.
311d5d7c 9005 Don't assume string byte-length fits in 'int'.
a4cf38e4 9006 Check that character arg fits in 'int'.
85461888 9007 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 9008
c0c1ee9f
PE
9009 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9010
a498d7f4
PE
9011 * fns.c (concat): Catch string overflow earlier.
9012 Do not rely on integer wraparound.
9013
51cab52b
PE
9014 * dispextern.h (struct it.overlay_strings_charpos)
9015 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
9016 * xdisp.c (forward_to_next_line_start)
9017 (back_to_previous_visible_line_start)
9018 (reseat_at_next_visible_line_start, next_element_from_buffer):
9019 Don't arbitrarily truncate the value of 'selective' to int.
9020
76031fad
PE
9021 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9022
5eb55db9
PE
9023 * composite.c: Don't truncate sizes to 'int'.
9024 (composition_gstring_p, composition_reseat_it)
9025 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
9026 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9027 not EMACS_UINT, for indexes.
5eb55db9 9028
0703a717
PE
9029 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9030
d6202519
PE
9031 * buffer.c: Include <verify.h>.
9032 (struct sortvec.priority, struct sortstr.priority):
8961a454 9033 Now EMACS_INT, not int.
c20998a7 9034 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
9035 (struct sortstr.size, record_overlay_string)
9036 (struct sortstrlist.size, struct sortlist.used):
9037 Don't truncate size to int.
9038 (record_overlay_string): Check for size-calculation overflow.
d6202519 9039 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 9040
d5a19415
JM
90412011-06-22 Jim Meyering <meyering@redhat.com>
9042
029529ac 9043 Don't leak an XBM-image-sized buffer
d5a19415
JM
9044 * image.c (xbm_load): Free the image buffer after using it.
9045
a9041e6c
PE
90462011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9047
9048 Port to Sun C.
9049 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9050 that Sun C diagnosed.
9051 * fns.c (secure_hash): Fix pointer signedness issue.
9052 * intervals.c (static_offset_intervals): New function.
9053 (offset_intervals): Use it.
9054
7f3f739f
LL
90552011-06-21 Leo Liu <sdl.web@gmail.com>
9056
9057 * deps.mk (fns.o):
9058 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
9059 sha512.h.
9060
9061 * fns.c (secure_hash): Rename from crypto_hash_function and change
9062 the first arg to accept symbols.
5b66d427 9063 (Fsecure_hash): New primitive.
7f3f739f
LL
9064 (syms_of_fns): New symbols.
9065
76147d94
DD
90662011-06-20 Deniz Dogan <deniz@dogan.se>
9067
9068 * process.c (Fset_process_buffer): Clarify return value in
9069 docstring.
9070
7d7d0045
CY
90712011-06-18 Chong Yidong <cyd@stupidchicken.com>
9072
9073 * dispnew.c (add_window_display_history): Use BVAR.
9074
9075 * xdisp.c (debug_method_add): Use BVAR.
9076 (check_window_end, dump_glyph_matrix, dump_glyph)
9077 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
9078
9079 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
9080 Likewise.
9081
9082 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
9083 check till after the cache is created in init_frame_faces.
9084
ff2bc410
SM
90852011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
9086
9087 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
9088
28177add
PE
90892011-06-16 Paul Eggert <eggert@cs.ucla.edu>
9090
dd3482fe
PE
9091 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
9092 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
9093 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
9094
393d71f3 9095 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
9096 * fileio.c (Finsert_file_contents):
9097 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
9098 Remove the old (too-loose) buffer overflow checks.
9099 They weren't needed, since make_gap checks for buffer overflow.
9100 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
9101 The old code merely checked for Emacs fixnum overflow, and relied
9102 on undefined (wraparound) behavior. The new code avoids undefined
9103 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9104
2e6813b0 9105 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9106 Tune. Don't use wider integers than needed. Don't use alloca.
9107 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9108
599a9e4f
PE
9109 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9110
99561444
PE
9111 * insdel.c, lisp.h (buffer_overflow): New function.
9112 (insert_from_buffer_1, replace_range, replace_range_2):
9113 * insdel.c (make_gap_larger):
9114 * editfns.c (Finsert_char):
9115 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9116
28177add
PE
9117 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9118
e69dafad
PE
91192011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9120
4baa020d 9121 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9122
b1c46f02
PE
9123 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9124 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9125
e69dafad
PE
9126 * fileio.c: Don't assume EMACS_INT fits in off_t.
9127 (emacs_lseek): New static function.
9128 (Finsert_file_contents, Fwrite_region): Use it.
9129 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9130
566684ea
PE
9131 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9132
e6966cd6
PE
9133 * fns.c: Don't overflow int when computing a list length.
9134 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9135 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9136 truncation on 64-bit hosts. Check for QUIT every
9137 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9138 faster and is responsive enough.
9139 (Flength): Report an error instead of overflowing an integer.
9140 (Fsafe_length): Return a float if the value is not representable
9141 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9142 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9143 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9144
dd0b0efb
PE
9145 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9146 (header_size, word_size): New constants.
9147 (allocate_vectorlike): Don't check size overflow here.
9148 (allocate_vector): Check it here instead, since this is the only
9149 caller of allocate_vectorlike that could cause overflow.
9150 Check that the new vector's length is representable as a fixnum.
9151
86fe5cfe
PE
9152 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9153 The previous code was bogus. For example, next_almost_prime (32)
9154 returned 39, which is undesirable as it is a multiple of 3; and
9155 next_almost_prime (24) returned 25, which is a multiple of 5 so
9156 why was the code bothering to check for multiples of 7?
9157
80e88859
PE
9158 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9159
4a2f0ad6
PE
9160 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9161
f66c7cf8
PE
9162 Variadic C functions now count arguments with ptrdiff_t.
9163 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9164 Back then I didn't know that the Emacs coding style prefers signed int.
9165 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9166 were being counted with int, which may truncate counts on 64-bit
9167 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9168 * lisp.h (struct Lisp_Subr.function.aMANY)
9169 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9170 Arg counts are now ptrdiff_t, not size_t.
9171 All variadic functions and their callers changed accordingly.
9172 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9173 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9174 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9175 * callint.c (Fcall_interactively): Check arg count for overflow,
9176 to avoid potential buffer overrun. Use signed char, not 'int',
9177 for 'varies' array, so that we needn't bother to check its size
9178 calculation for overflow.
9179 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9180 * eval.c (apply_lambda):
9181 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9182 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9183 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9184
a1759b76
PE
9185 * callint.c (Fcall_interactively): Don't use index var as event count.
9186
d96be9fc
PE
9187 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9188 * mem-limits.h (SIZE): Remove; no longer used.
9189
a690a978 9190 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9191
578c21e6
PE
9192 Remove unnecessary casts.
9193 * xterm.c (x_term_init):
9194 * xfns.c (x_set_border_pixel):
9195 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9196 These aren't needed now that we assume ANSI C.
9197
96f53c6c
PE
9198 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9199 It's more likely to cause problems (due to unsigned overflow)
9200 than to cure them.
9201
83c77d31
PE
9202 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9203
ee2079f1
PE
9204 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9205
6da65536
PE
9206 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9207
7147c4a4
PE
9208 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9209
193e32d9
PE
9210 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9211
e5533da6
PE
9212 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9213
9910e595
PE
9214 GLYPH_CODE_FACE returns EMACS_INT, not int.
9215 * dispextern.h (merge_faces):
9216 * xfaces.c (merge_faces):
01103c44
PE
9217 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9218 Don't assume EMACS_INT fits in int.
9910e595 9219
2638320e
PE
9220 * character.h (CHAR_VALID_P): Remove unused parameter.
9221 * fontset.c, lisp.h, xdisp.c: All uses changed.
9222
045eb8d9
PE
9223 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9224
c1f134b5
PE
9225 * fns.c (concat): Minor tuning based on overflow analysis.
9226 This doesn't fix any bugs. Use int to hold character, instead
9227 of constantly refetching from Emacs object. Use XFASTINT, not
9228 XINT, for value known to be a character. Don't bother comparing
9229 a single byte to 0400, as it's always less.
9230
395fcb93 9231 * floatfns.c (Fexpt):
327eeec8
PE
9232 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9233
abbd3d23
PE
9234 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9235 for characters.
9236
684a03ef
PE
9237 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9238
0fed43f3
PE
9239 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9240 Without this fix, on a 64-bit host (aset S 0 4294967386) would
9241 incorrectly succeed when S was a string, because 4294967386 was
9242 truncated before it was used.
9243
8fd02eb7
PE
9244 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9245 Otherwise, an out-of-range integer could cause undefined behavior
9246 on a 64-bit host.
9247
f8c86b69
PE
9248 * composite.c: Use int, not EMACS_INT, for characters.
9249 (fill_gstring_body, composition_compute_stop_pos): Use int, not
9250 EMACS_INT, for values that are known to be in character range.
9251 This doesn't fix any bugs but is the usual style inside Emacs and
9252 may generate better code on 32-bit machines.
9253
34206dd2
PE
9254 Make sure a 64-bit char is never passed to ENCODE_CHAR.
9255 This is for reasons similar to the recent CHAR_STRING fix.
9256 * charset.c (Fencode_char): Check that character arg is actually
9257 a character. Pass an int to ENCODE_CHAR.
9258 * charset.h (ENCODE_CHAR): Verify that the character argument is no
9259 wider than 'int', as a compile-time check to prevent future regressions
9260 in this area.
9261
c5958d4c 9262 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
9263
9264 Make sure a 64-bit char is never passed to CHAR_STRING.
9265 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9266 by silently ignoring the top 32 bits, allowing some values
9267 that were far too large to be valid characters.
9268 * character.h: Include <verify.h>.
9269 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9270 arguments are no wider than unsigned, as a compile-time check
9271 to prevent future regressions in this area.
9272 * data.c (Faset):
01103c44 9273 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
9274 (Fsubst_char_in_region):
9275 * fns.c (concat):
9276 * xdisp.c (decode_mode_spec_coding):
9277 Adjust to CHAR_STRING's new requirement.
9278 * editfns.c (Finsert_char, Fsubst_char_in_region):
9279 * fns.c (concat): Check that character args are actually
9280 characters. Without this test, these functions did the wrong
9281 thing with wildly out-of-range values on 64-bit hosts.
9282
d37ca623
PE
9283 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9284 These casts should not be needed on 32-bit hosts, either.
9285 * keyboard.c (read_char):
9286 * lread.c (Fload): Remove casts to unsigned.
9287
ea204efb
PE
9288 * lisp.h (UNSIGNED_CMP): New macro.
9289 This fixes comparison bugs on 64-bit hosts.
9290 (ASCII_CHAR_P): Use it.
9291 * casefiddle.c (casify_object):
01103c44 9292 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9293 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9294 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9295 * dispextern.h (FACE_FROM_ID):
9296 * keyboard.c (read_char): Use UNSIGNED_CMP.
9297
41cb286c
PE
9298 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9299 not to EMACS_INT, to avoid GCC warning.
9300
4a1b9832
PE
9301 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9302
55daad71
PE
9303 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9304 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9305 isn't needed on 32-bit machines.
8f95c75c 9306
01103c44
PE
9307 * buffer.c (Fgenerate_new_buffer_name):
9308 Use EMACS_INT for count, not int.
0ceccced 9309 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9310
9311 * data.c (Qcompiled_function): Now static.
9312
c6f072e7
PE
9313 * window.c (window_body_lines): Now static.
9314
20ce5912
PE
9315 * image.c (gif_load): Rename local to avoid shadowing.
9316
9c4c5f81
PE
9317 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9318 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9319 * alloc.c (make_save_value): Integer argument is now of type
9320 ptrdiff_t, not int.
9321 (mark_object): Use ptrdiff_t, not int.
9322 * lisp.h (pD): New macro.
9323 * print.c (print_object): Use it.
9324
c0c5c8ae
PE
9325 * alloc.c: Use EMACS_INT, not int, to count objects.
9326 (total_conses, total_markers, total_symbols, total_vector_size)
9327 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9328 (total_free_floats, total_floats, total_free_intervals)
9329 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9330 Now EMACS_INT, not int. All uses changed.
9331 (Fgarbage_collect): Compute overall total using a double, so that
9332 integer overflow is less likely to be a problem. Check for overflow
9333 when converting back to an integer.
5a25e253
PE
9334 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9335 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9336 These were 'int' variables that could overflow on 64-bit hosts;
9337 they were never used, so remove them instead of repairing them.
211a0b2a 9338 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9339 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9340 Previously, this ceilinged at INT_MAX, but that doesn't work on
9341 64-bit machines.
e46bb31a 9342 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9343
c78baabf 9344 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9345 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9346 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9347 when a (possibly-narrower) signed value would do just as well.
9348 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9349
c9d624c6
PE
9350 * alloc.c: Catch some string size overflows that we were missing.
9351 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9352 for convenience in STRING_BYTES_MAX.
9353 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9354 The definition here is exact; the one in lisp.h was approximate.
9355 (allocate_string_data): Check for string overflow. This catches
9356 some instances we weren't catching before. Also, it catches
9357 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9358 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9359 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9360
c9d624c6
PE
9361 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9362 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9363 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9364
353032ce
PE
9365 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9366
2bccce07
PE
9367 * alloc.c (Fmake_string): Check for out-of-range init.
9368
0ac30604
SM
93692011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9370
9371 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9372
c195f2de
JD
93732011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9374
9375 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9376 xg_get_default_scrollbar_width.
9377
9378 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9379 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9380 (style_changed_cb): Call update_theme_scrollbar_width and call
9381 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9382 all frames (Bug#8505).
9383 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9384 Call gtk_window_set_resizable if HAVE_GTK3.
9385 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9386 and height if HAVE_GTK3 (Bug#8505).
9387 (scroll_bar_width_for_theme): New variable.
9388 (update_theme_scrollbar_width): New function.
9389 (xg_get_default_scrollbar_width): Move code to
9390 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9391 (xg_initialize): Call update_theme_scrollbar_width.
9392
9393 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9394
9395 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9396
e10ac9f1
MR
93972011-06-12 Martin Rudalics <rudalics@gmx.at>
9398
9399 * frame.c (make_frame): Call other_buffer_safely instead of
9400 other_buffer.
9401
9402 * window.c (temp_output_buffer_show): Call display_buffer with
9403 second argument Vtemp_buffer_show_specifiers and reset latter
9404 immediately after the call.
9405 (Vtemp_buffer_show_specifiers): New variable.
9406 (auto_window_vscroll_p, next_screen_context_lines)
9407 (Vscroll_preserve_screen_position): Remove leading asterisks from
9408 doc-strings.
9409
2d3c217e 94102011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9411
7b7f97e8 9412 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9413 * buffer.c (Qclone_number): Remove for now, as it's unused.
9414 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9415 (record_buffer): Remove unused local.
9416 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9417 (set_frame_buffer_list): Remove; unused.
9418 * frame.h (other_visible_frames): Remove decl.
9419 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9420 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9421 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9422 if HAVE_GPM.
9423 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9424 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9425 Define only if HAVE_GPM.
9426 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9427 (update_hints_inhibit): Remove; never set. All uses removed.
9428 * widgetprv.h (emacsFrameClassRec): Remove decl.
9429 * window.c (delete_deletable_window): Now returns void, since it
9430 wasn't returning anything.
9431 (compare_window_configurations): Remove unused locals.
9432 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9433 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9434 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9435 the same widths as pointers. This follows up on the 2011-05-06 patch.
9436 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9437 * xterm.h: Likewise.
9438 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9439
1384b89e
JB
94402011-06-12 Juanma Barranquero <lekktu@gmail.com>
9441
9442 * makefile.w32-in: Update dependencies.
9443 (LISP_H): Add lib/intprops.h.
9444
1100a63c
CY
94452011-06-11 Chong Yidong <cyd@stupidchicken.com>
9446
9447 * image.c (gif_load): Add animation frame delay to the metadata.
9448 (syms_of_image): Use DEFSYM. New symbol `delay'.
9449
6198ccd0
MR
94502011-06-11 Martin Rudalics <rudalics@gmx.at>
9451
9452 * window.c (delete_deletable_window): Re-add.
9453 (Fset_window_configuration): Rewrite to handle dead buffers and
9454 consequently deletable windows.
9455 (window_tree, Fwindow_tree): Remove. Supply functionality in
9456 window.el.
9457 (compare_window_configurations): Simplify code.
9458
b6e3633c
AS
94592011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9460
1ab0dee5
AS
9461 * image.c (imagemagick_load_image): Fix type mismatch.
9462 (Fimagemagick_types): Likewise.
9463
b6e3633c
AS
9464 * window.h (replace_buffer_in_windows): Declare.
9465
9397e56f
MR
94662011-06-11 Martin Rudalics <rudalics@gmx.at>
9467
9468 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9469 Qclone_number. Remove external declaration of Qdelete_window.
9470 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9471 code.
640c8776
SM
9472 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9473 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9474 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9475 buffer list implementation.
9476 (other_buffer_safely): New function.
9477 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9478 calls to replace_buffer_in_windows and
9479 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9480 if allowed.
9481 (record_buffer): Inhibit quitting and rewrite using quittable
9482 functions. Run Qbuffer_list_update_hook if allowed.
9483 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9484 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9485 Move switch-to-buffer to window.el.
9397e56f
MR
9486 (bury-buffer): Move to window.el.
9487 (Vbuffer_list_update_hook): New variable.
9488
9489 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9490 section.
9491
9492 * window.h (resize_frame_windows): Move up in code.
9493 (Fwindow_frame): Remove EXFUN.
9494 (replace_buffer_in_all_windows): Remove prototype.
9495 (replace_buffer_in_windows_safely): Add prototype.
9496
9497 * window.c: Declare Qdelete_window static again. Move down
9498 declaration of select_count.
9499 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9500 (Fother_window): Move to window.el.
9501 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9502 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9503 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9504 window.el.
9505 (replace_buffer_in_windows): Implement by calling
9506 Qreplace_buffer_in_windows.
9507 (replace_buffer_in_all_windows): Remove with some functionality
9508 moved into replace_buffer_in_windows_safely.
9509 (replace_buffer_in_windows_safely): New function.
9510 (select_window_norecord, select_frame_norecord): Move in front
9511 of run_window_configuration_change_hook. Remove now obsolete
9512 declarations.
640c8776
SM
9513 (Fset_window_buffer): Rewrite doc-string.
9514 Call Qrecord_window_buffer.
9397e56f
MR
9515 (keys_of_window): Move binding for other-window to window.el.
9516
b50691aa
CY
95172011-06-11 Chong Yidong <cyd@stupidchicken.com>
9518
9519 * dispextern.h (struct image): Replace data member, whose int_val
9520 and ptr_val fields were not used by anything, with a single
9521 lisp_val object.
9522
9523 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9524 (gif_clear_image, gif_load, imagemagick_load_image)
9525 (gs_clear_image, gs_load): Callers changed.
9526
3f754b86
PE
95272011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9528
cca69397
PE
9529 * buffer.h: Include <time.h>, for time_t.
9530 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9531
109e28d0
PE
9532 Fix minor problems found by static checking.
9533
60737f02
PE
9534 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9535
4b66faf3
PE
9536 Make identifiers static if they are not used in other modules.
9537 * data.c (Qcompiled_function, Qframe, Qvector):
9538 * image.c (QimageMagick, Qsvg):
9539 * minibuf.c (Qmetadata):
9540 * window.c (resize_window_check, resize_root_window): Now static.
9541 * window.h (resize_window_check, resize_root_window): Remove decls.
9542
109e28d0
PE
9543 * window.c (window_deletion_count, delete_deletable_window):
9544 Remove; unused.
46a4ce9e
PE
9545 (window_body_lines): Now static.
9546 (Fdelete_other_windows_internal): Mark vars as initialized.
9547 Make sure 'resize_failed' is initialized.
9548 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9549 (resize_window_apply): Remove unused local.
9550 * window.h (delete_deletable_window): Remove decl.
9551
109e28d0 9552 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9553 (imagemagick_load_image): Fix pointer signedness problem by changing
9554 last arg from unsigned char * to char *. All uses changed.
9555 Also, fix a local for similar reasons.
9556 Remove unused locals. Remove locals to avoid shadowing.
9557 (fn_rsvg_handle_free): Remove; unused.
9558 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9559 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9560
3f754b86
PE
9561 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9562
2547adb1
CY
95632011-06-10 Chong Yidong <cyd@stupidchicken.com>
9564
9565 * image.c (gif_load): Fix omitted cast error introduced by
9566 2011-06-06 change.
9567
2c8e37d4
MR
95682011-06-10 Martin Rudalics <rudalics@gmx.at>
9569
9570 * window.h (resize_proportionally, orig_total_lines)
9571 (orig_top_line): Remove from window structure.
9572 (set_window_height, set_window_width, change_window_heights)
9573 (Fdelete_window): Remove prototypes.
9574 (resize_frame_windows): Remove duplicate declaration.
9575
440a42e3
EZ
95762011-06-10 Eli Zaretskii <eliz@gnu.org>
9577
9578 * window.h (resize_frame_windows, resize_window_check)
9579 (delete_deletable_window, resize_root_window)
9580 (resize_frame_windows): Declare prototypes.
9581
9582 * window.c (resize_window_apply): Make definition be "static" to
9583 match the prototype.
9584
562dd5e9
MR
95852011-06-10 Martin Rudalics <rudalics@gmx.at>
9586
9587 * window.c: Remove declarations of Qwindow_size_fixed,
9588 window_min_size_1, window_min_size_2, window_min_size,
9589 size_window, window_fixed_size_p, enlarge_window, delete_window.
9590 Remove static from declaration of Qdelete_window, it's
9591 temporarily needed by Fbury_buffer.
9592 (replace_window): Don't assign orig_top_line and
9593 orig_total_lines.
9594 (Fdelete_window, delete_window): Remove. Window deletion is
9595 handled by window.el.
640c8776
SM
9596 (window_loop): Remove DELETE_OTHER_WINDOWS case.
9597 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
9598 (Fdelete_other_windows): Remove. Deleting other windows is
9599 handled by window.el.
9600 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
9601 handled in window.el.
9602 (window_min_size_2, window_min_size_1, window_min_size): Remove.
9603 Window minimum sizes are handled in window.el.
9604 (shrink_windows, size_window, set_window_height)
9605 (set_window_width, change_window_heights, window_height)
9606 (window_width, CURBEG, CURSIZE, enlarge_window)
9607 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9608 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
9609 handled in window.el.
9610 (make_dummy_parent): Rename to make_parent_window and give it a
9611 second argument horflag.
9612 (make_window): Don't set resize_proportionally any more.
9613 (Fsplit_window): Remove. Windows are split in window.el.
9614 (save_restore_action, save_restore_orig_size)
9615 (shrink_window_lowest_first, save_restore_orig_size): Remove.
9616 Resize mini windows in window.el.
9617 (grow_mini_window, shrink_mini_window): Implement by calling
9618 Qresize_root_window_vertically, resize_window_check and
9619 resize_window_apply.
640c8776
SM
9620 (saved_window, Fset_window_configuration, save_window_save):
9621 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
9622 resize_proportionally.
9623 (window_min_height, window_min_width): Move to window.el.
9624 (keys_of_window): Move bindings for delete-other-windows,
9625 split-window, delete-window and enlarge-window to window.el.
9626
9627 * buffer.c: Temporarily extern Qdelete_window.
9628 (Fbury_buffer): Temporarily call Qdelete_window instead of
9629 Fdelete_window (Fbury_buffer will move to window.el soon).
9630
9631 * frame.c (set_menu_bar_lines_1): Remove code handling
9632 orig_top_line and orig_total_lines.
9633
9634 * dispnew.c (adjust_frame_glyphs_initially): Don't use
9635 set_window_height but set heights directly.
9636 (change_frame_size_1): Use resize_frame_windows.
9637
9638 * xdisp.c (init_xdisp): Don't use set_window_height but set
9639 heights directly.
9640
640c8776
SM
9641 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9642 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
9643 run_window_configuration_change_hook.
9644
9645 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9646 instead of change_window_heights and run
9647 run_window_configuration_change_hook.
9648
1a13852e
MR
96492011-06-09 Martin Rudalics <rudalics@gmx.at>
9650
9651 * window.c (replace_window): Rename second argument REPLACEMENT to
9652 NEW. New third argument SETFLAG. Rewrite.
9653 (delete_window, make_dummy_parent): Call replace_window with
9654 third argument 1.
9655 (window_list_1): Move down in code.
9656 (run_window_configuration_change_hook): Move set_buffer part
9657 before select_frame_norecord part in order to unwind correctly.
9658 Rename count1 to count.
9659 (recombine_windows, delete_deletable_window, resize_root_window)
9660 (Fdelete_other_windows_internal)
9661 (Frun_window_configuration_change_hook, make_parent_window)
9662 (resize_window_check, resize_window_apply, Fresize_window_apply)
9663 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
9664 (Fdelete_window_internal, Fresize_mini_window_internal):
9665 New functions.
1a13852e
MR
9666 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9667
f3d1777e
MR
96682011-06-08 Martin Rudalics <rudalics@gmx.at>
9669
496e208e
MR
9670 * window.h (window): Add some new members to window structure -
9671 normal_lines, normal_cols, new_total, new_normal, clone_number,
9672 splits, nest, prev_buffers, next_buffers.
9673 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 9674 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 9675
f3d1777e
MR
9676 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9677 Remove.
496e208e
MR
9678 (make_dummy_parent): Set new members of windows structure.
9679 (make_window): Move down in code. Handle new members of window
9680 structure.
9681 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9682 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9683 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9684 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
9685 (Fset_window_next_buffers, Fset_window_clone_number):
9686 New functions.
496e208e
MR
9687 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9688 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9689 Doc-string fixes.
9690 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9691 Argument WINDOW can be now internal window too.
9692 (Fwindow_use_time): Move up in code.
9693 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9694 Rewrite doc-string.
9695 (Fset_window_configuration, saved_window)
9696 (Fcurrent_window_configuration, save_window_save): Handle new
9697 members of window structure.
b9e809c2
MR
9698 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9699 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9700 (syms_of_window): New Lisp objects Qrecord_window_buffer,
9701 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9702 Qget_mru_window, Qresize_root_window,
9703 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9704 Qauto_buffer_name; staticpro them.
f3d1777e 9705
abde8f8c
MR
97062011-06-07 Martin Rudalics <rudalics@gmx.at>
9707
9708 * window.c (Fwindow_total_size, Fwindow_left_column)
9709 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9710 (Fwindow_list_1): New functions.
9711 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
9712 (Fwindow_width, Fscroll_left, Fscroll_right):
9713 Use window_body_cols instead of window_box_text_cols.
9714 (delete_window, Fset_window_configuration):
9715 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
9716 (delete_all_subwindows): Take a window as argument and not a
9717 structure. Rewrite.
190b47e6
MR
9718 (window_loop): Remove handling of GET_LRU_WINDOW and
9719 GET_LARGEST_WINDOW.
9720 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
9721
9722 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
9723 window_box_text_cols. delete_all_subwindows now takes a
9724 Lisp_Object as argument.
abde8f8c 9725
640c8776
SM
9726 * indent.c (compute_motion, Fcompute_motion):
9727 Use window_body_cols instead of window_box_text_cols.
abde8f8c 9728
fa8a67e6
MR
9729 * frame.c (delete_frame): Call delete_all_subwindows with root
9730 window as argument.
9731
a54e3482
DC
97322011-06-07 Daniel Colascione <dan.colascione@gmail.com>
9733
9734 * fns.c (Fputhash): Document return value.
9735
60002bf5
CY
97362011-06-06 Chong Yidong <cyd@stupidchicken.com>
9737
9738 * image.c (gif_load): Implement gif89a spec "no disposal" method.
9739
0c671da6 97402011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 9741
b862a52a 9742 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 9743
be44ca6c
PE
9744 Check for overflow when converting integer to cons and back.
9745 * charset.c (Fdefine_charset_internal, Fdecode_char):
9746 Use cons_to_unsigned to catch overflow.
9747 (Fencode_char): Use INTEGER_TO_CONS.
9748 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
9749 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9750 * data.c (long_to_cons, cons_to_long): Remove.
9751 (cons_to_unsigned, cons_to_signed): New functions.
9752 These signal an error for invalid or out-of-range values.
9753 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9754 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9755 * font.c (Ffont_variation_glyphs):
9756 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9757 * lisp.h: Include <intprops.h>.
9758 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9759 (cons_to_signed, cons_to_unsigned): New decls.
9760 (long_to_cons, cons_to_long): Remove decls.
9761 * undo.c (record_first_change): Use INTEGER_TO_CONS.
9762 (Fprimitive_undo): Use CONS_TO_INTEGER.
9763 * xfns.c (Fx_window_property): Likewise.
9764 * xselect.c: Include <limits.h>.
9765 (x_own_selection, selection_data_to_lisp_data):
9766 Use INTEGER_TO_CONS.
9767 (x_handle_selection_request, x_handle_selection_clear)
9768 (x_get_foreign_selection, Fx_disown_selection_internal)
9769 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
9770 (lisp_data_to_selection_data): Use cons_to_unsigned.
9771 (x_fill_property_data): Use cons_to_signed.
9772 Report values out of range.
9773
d1f3d2af
PE
9774 Check for buffer and string overflow more precisely.
9775 * buffer.h (BUF_BYTES_MAX): New macro.
9776 * lisp.h (STRING_BYTES_MAX): New macro.
9777 * alloc.c (Fmake_string):
9778 * character.c (string_escape_byte8):
9779 * coding.c (coding_alloc_by_realloc):
9780 * doprnt.c (doprnt):
9781 * editfns.c (Fformat):
9782 * eval.c (verror):
9783 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
9784 since they may not be the same number.
9785 * editfns.c (Finsert_char):
9786 * fileio.c (Finsert_file_contents):
9787 Likewise for BUF_BYTES_MAX.
9788
dd52fcea
PE
9789 * image.c: Use ptrdiff_t, not int, for sizes.
9790 (slurp_file): Switch from int to ptrdiff_t.
9791 All uses changed.
9792 (slurp_file): Check that file size fits in both size_t (for
9793 malloc) and ptrdiff_t (for sanity and safety).
9794
7f9bbdbb
PE
9795 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
9796 if b->modtime has its maximal value.
9797
dfe18f82
PE
9798 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
9799
84acfcf0
PE
9800 Don't assume time_t can fit into int.
9801 * buffer.h (struct buffer.modtime): Now time_t, not int.
9802 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
9803 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
9804
ccd9a01a
PE
9805 Minor fixes for signed vs unsigned integers.
9806 * character.h (MAYBE_UNIFY_CHAR):
9807 * charset.c (maybe_unify_char):
9808 * keyboard.c (read_char, reorder_modifiers):
9809 XINT -> XFASTINT, since the integer must be nonnegative.
9810 * ftfont.c (ftfont_spec_pattern):
9811 * keymap.c (access_keymap, silly_event_symbol_error):
9812 XUINT -> XFASTINT, since the integer must be nonnegative.
9813 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
9814 since it makes no difference and we prefer signed.
9815 * keyboard.c (record_char): Use XUINT when all the neighbors do.
9816 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
9817 nonnegative.
9818
d6d100dd
SM
98192011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
9820
9821 * window.h (Fwindow_frame): Declare.
9822
2b6148e4
PE
98232011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9824
9825 * alloc.c: Simplify handling of large-request failures (Bug#8800).
9826 (SPARE_MEMORY): Always define.
9827 (LARGE_REQUEST): Remove.
9828 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
9829
f230ecc9
MR
98302011-06-06 Martin Rudalics <rudalics@gmx.at>
9831
727e958e
MR
9832 * lisp.h: Move EXFUNS for Fframe_root_window,
9833 Fframe_first_window and Fset_frame_selected_window to window.h.
9834
9835 * window.h: Move EXFUNS for Fframe_root_window,
9836 Fframe_first_window and Fset_frame_selected_window here from
9837 lisp.h.
9838
9839 * frame.c (Fwindow_frame, Fframe_first_window)
9840 (Fframe_root_window, Fframe_selected_window)
9841 (Fset_frame_selected_window): Move to window.c.
9842 (Factive_minibuffer_window): Move to minibuf.c.
9843 (Fother_visible_frames_p): New function.
9844
9845 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
9846
f230ecc9
MR
9847 * window.c (decode_window, decode_any_window): Move up in code.
9848 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
9849 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
9850 (Fwindow_buffer): Move up and rewrite doc-string.
9851 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
9852 (Fwindow_prev): New functions.
727e958e
MR
9853 (Fwindow_frame): Move here from frame.c. Accept any window as
9854 argument.
9855 (Fframe_root_window, Fframe_first_window)
9856 (Fframe_selected_window): Move here from frame.c. Accept frame
9857 or arbitrary window as argument. Update doc-strings.
9858 (Fminibuffer_window): Move up in code.
9859 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
9860 (Fset_frame_selected_window): Move here from frame.c.
9861 Marginal rewrite.
727e958e
MR
9862 (Fselected_window, select_window, Fselect_window): Move up in
9863 code. Minor doc-string fixes.
f230ecc9 9864
4d09bcf6
PE
98652011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9866
9867 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
9868 Do not assume that spare memory exists; that assumption is valid
9869 only if SYSTEM_MALLOC.
9870 (LARGE_REQUEST): New macro, so that the issue of large requests
9871 is separated from the issue of spare memory.
9872
810928a2
AS
98732011-06-05 Andreas Schwab <schwab@linux-m68k.org>
9874
172418ad
AS
9875 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
9876 format. (Bug#8806)
9877
43f862f7
AS
9878 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
9879
810928a2
AS
9880 * xfns.c (x_set_scroll_bar_default_width): Move declarations
9881 before statements.
9882
a059fe24
JD
98832011-06-05 Jan Djärv <jan.h.d@swipnet.se>
9884
9885 * gtkutil.c (xg_get_default_scrollbar_width): New function.
9886
9887 * gtkutil.h: Declare xg_get_default_scrollbar_width.
9888
9889 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
9890 min width by calling x_set_scroll_bar_default_width (Bug#8505).
9891
989bf368
JB
98922011-06-05 Juanma Barranquero <lekktu@gmail.com>
9893
9894 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
9895
4b80f674
CY
98962011-06-04 Chong Yidong <cyd@stupidchicken.com>
9897
9898 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
9899 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
9900 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
9901 New error handlers.
4b80f674
CY
9902 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
9903 Obey Vx_select_enable_clipboard_manager. Catch errors in
9904 x_clipboard_manager_save (Bug#8779).
9905 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 9906 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 9907
99a33b77 99082011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
9909
9910 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
9911
99a33b77 99122011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
9913
9914 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
9915 in the current matrix if keep_current_p is non-zero.
9916
8264569d
EZ
99172011-06-04 Eli Zaretskii <eliz@gnu.org>
9918
9919 * bidi.c (bidi_level_of_next_char): Fix last change.
9920
57f97249
EZ
99212011-06-03 Eli Zaretskii <eliz@gnu.org>
9922
fec2107c 9923 Support bidi reordering of text covered by display properties.
57f97249 9924
fec2107c
EZ
9925 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
9926 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
9927 (bidi_cache_search, bidi_cache_iterator_state)
9928 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
9929 (bidi_level_of_next_char, bidi_move_to_visually_next):
9930 Support character positions inside a run of characters covered by a
fec2107c
EZ
9931 display string.
9932 (bidi_paragraph_init, bidi_resolve_explicit_1)
9933 (bidi_level_of_next_char): Call bidi_fetch_char and
9934 bidi_fetch_char_advance instead of FETCH_CHAR and
9935 FETCH_CHAR_ADVANCE.
9936 (bidi_init_it): Initialize new members.
9937 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
9938 definitions.
9939 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
9940 instead of using explicit *_CHAR codes.
d6d100dd
SM
9941 (bidi_resolve_explicit, bidi_resolve_weak):
9942 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
9943 bidirectional text is supported only in multibyte buffers.
9944 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
9945 it to initialize the frame_window_p member of struct bidi_it.
9946 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
9947 (bidi_resolve_explicit, bidi_resolve_weak)
9948 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
9949 bidi_it->nchars is non-positive.
9950 (bidi_level_of_next_char): Don't try to lookup the cache for the
9951 next/previous character if nothing is cached there yet, or if we
9952 were just reseat()'ed to a new position.
c40e2fb2 9953
0e14fe90
EZ
9954 * xdisp.c (set_cursor_from_row): Set start and stop points
9955 according to the row's direction when priming the loop that looks
9956 for the glyph on which to display cursor.
9957 (single_display_spec_intangible_p): Function deleted.
9958 (display_prop_intangible_p): Reimplement to call
9959 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
9960 Accept 3 additional arguments needed by handle_display_spec.
9961 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
9962 values: lists, `(when COND...)' forms, etc.
9963 (single_display_spec_string_p): Support property values that are
9964 lists with the argument STRING its top-level element.
9965 (display_prop_string_p): Fix the condition for processing a
9966 property that is a list to be consistent with handle_display_spec.
fec2107c 9967 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
9968 last portion of handle_display_prop.
9969 (compute_display_string_pos): Accept additional argument
9970 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
9971 value of a `display' property is a "replacing spec".
9972 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
9973 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
9974 the display property, but just return a value indicating whether
9975 the display property will replace the characters it covers.
9976 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
9977 frame_window_p members of struct bidi_it.
d6d100dd
SM
9978 (compute_display_string_pos, compute_display_string_end):
9979 New functions.
fec2107c
EZ
9980 (push_it): Accept second argument POSITION, where pop_it should
9981 jump to continue iteration.
9982 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 9983
fec2107c
EZ
9984 * keyboard.c (adjust_point_for_property): Adjust the call to
9985 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
9986
9987 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
9988 (bidi_init_it): Update prototypes.
9989 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
9990 (compute_display_string_pos, compute_display_string_end):
9991 Declare prototypes.
fec2107c
EZ
9992 (struct bidi_it): New members nchars and disp_pos. ch_len is now
9993 EMACS_INT.
fc6f18ce 9994
40087514 99952011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 9996
57f53182
PE
9997 Malloc failure behavior now depends on size of allocation.
9998 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
9999 * lisp.h: Change signatures accordingly.
10000 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10001 All callers changed. (Bug#8762)
10002
10003 * gnutls.c: Use Emacs's memory allocators.
10004 Without this change, the gnutls library would invoke malloc etc.
10005 directly, which causes problems on non-SYNC_INPUT hosts, and which
10006 runs afoul of improving memory_full behavior. (Bug#8761)
10007 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10008 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10009 xfree instead of the default malloc, realloc, free.
10010 (Fgnutls_boot): No need to check for memory allocation failure,
10011 since xmalloc does that for us.
10012
ac32cd99 10013 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
10014 * category.c (hash_get_category_set):
10015 * ccl.c (ccl_driver):
10016 * charset.c (Fdefine_charset_internal):
10017 * charset.h (struct charset.hash_index):
10018 * composite.c (get_composition_id, gstring_lookup_cache)
10019 (composition_gstring_put_cache):
10020 * composite.h (struct composition.hash_index):
10021 * dispextern.h (struct image.hash):
10022 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10023 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10024 (hashfn_equal, hashfn_user_defined, make_hash_table)
10025 (maybe_resize_hash_table, hash_lookup, hash_put)
10026 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10027 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10028 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10029 * image.c (make_image, search_image_cache, lookup_image)
10030 (xpm_put_color_table_h):
10031 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 10032 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 10033 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 10034 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
10035 * alloc.c (allocate_vectorlike):
10036 Check for overflow in vector size calculations.
10037 * ccl.c (ccl_driver):
10038 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
10039 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10040 need to be updated by these changes.
40087514
PE
10041 * fns.c (make_hash_table, maybe_resize_hash_table):
10042 Check for integer overflow with large hash tables.
0de4bb68
PE
10043 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10044 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10045 (SXHASH_REDUCE): New macro.
10046 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10047 Use it instead of discarding useful hash info with large hash values.
10048 (sxhash_float): New function.
10049 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10050 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
10051 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
10052 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
10053 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
10054 Adjust signatures to match updated version of code.
10055 (consing_since_gc): Now EMACS_INT, since a single hash table can
10056 use more than INT_MAX bytes.
10057
698d32e2
DN
100582011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
10059
10060 Make it possible to build with GCC-4.6+ -O2 -flto.
10061
10062 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
10063
fd6fa53f
SM
100642011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
10065
10066 * minibuf.c (get_minibuffer, read_minibuf_unwind):
10067 Call minibuffer-inactive-mode.
10068
864db017
JB
100692011-05-31 Juanma Barranquero <lekktu@gmail.com>
10070
10071 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
10072 Update dependencies.
10073
2ad0baf4
DN
100742011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10075
10076 * data.c (init_data): Remove code for UTS, this system is not
10077 supported anymore.
10078
4fcc2638
DN
100792011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10080
10081 Don't force ./temacs to start in terminal mode.
10082
10083 * frame.c (make_initial_frame): Initialize faces in all cases, not
10084 only when CANNOT_DUMP is defined.
10085 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
10086
c56e0fd5
DN
100872011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10088
10089 * dispnew.c (add_window_display_history): Use const for the string
10090 pointer. Remove declaration, not needed.
10091
333d54da 100922011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 10093
55d4c1b2 10094 Use 'inline', not 'INLINE'.
333d54da 10095 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
10096 * alloc.c, fontset.c (INLINE): Remove.
10097 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
10098 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
10099 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
10100 * gmalloc.c (register_heapinfo): Use inline unconditionally.
10101 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
10102
738db178
DN
101032011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10104
10105 Make it possible to run ./temacs.
10106
10107 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10108 syms_of_callproc does the same thing. Remove test for
10109 "initialized", do it in the caller.
10110 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10111
620c53a6
SM
101122011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10113
10114 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10115 (read_minibuf): Use get_minibuffer.
10116 (syms_of_minibuf): Use DEFSYM.
10117 (Qmetadata): New var.
10118 * data.c (Qbuffer): Don't make it static.
10119 (syms_of_data): Use DEFSYM.
10120
e003a292
PE
101212011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10122
10123 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10124 (CCL_CODE_MIN): New macro.
10125
ed008a6d
PE
101262011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10127
3687c2ef
PE
10128 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10129
ed008a6d
PE
10130 * eval.c (Qdebug): Now static.
10131 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10132 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10133 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10134
d66c4c7c
CY
101352011-05-29 Chong Yidong <cyd@stupidchicken.com>
10136
10137 * image.c: Various fixes to ImageMagick code comments.
10138 (Fimagemagick_types): Doc fix.
10139
5fbc2025
PE
101402011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10141
0196f88a
PE
10142 Minor fixes prompted by GCC 4.6.0 warnings.
10143
10144 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10145
5fbc2025
PE
10146 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10147 (x_clipboard_manager_save_all): Move extern decl to ...
10148 * xterm.h: ... here, so that it can be checked for consistency.
10149
1dd3c2d9
CY
101502011-05-29 Chong Yidong <cyd@stupidchicken.com>
10151
10152 * xselect.c (x_clipboard_manager_save_frame)
10153 (x_clipboard_manager_save_all): New functions.
10154 (Fx_clipboard_manager_save): Lisp function deleted.
10155
10156 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10157 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10158
10159 * xterm.h: Update prototype.
10160
5ba6571d
WX
101612011-05-28 William Xu <william.xwl@gmail.com>
10162
10163 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10164 exiting (Bug#8239).
10165
3eaff834
JM
101662011-05-28 Jim Meyering <meyering@redhat.com>
10167
e1900994 10168 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10169 * fns.c (to_uchar): Define.
10170 (crypto_hash_function): Use it to convert some newly-signed
10171 variables to unsigned, to avoid sign-extension bugs. For example,
10172 without this change, (md5 "truc") would evaluate to
10173 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10174 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10175 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10176
0f6990a7
PE
101772011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10178
10179 Integer overflow fixes.
c8a9ca5a 10180
08686060
PE
10181 * dbusbind.c: Serial number integer overflow fixes.
10182 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10183 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10184 to hold a serial number that is too large for a fixnum.
10185 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10186 Check for serial numbers out of range. Decode any serial number
59568bf0 10187 that was so large that it became a float. (Bug#8722)
08686060 10188
2d1fc3c7
PE
10189 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10190 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10191 Use XFASTINT rather than XUINT when numbers are nonnegative.
10192 (xd_append_arg, Fdbus_method_return_internal):
10193 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10194 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10195 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10196 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10197 (Bug#8722)
2d1fc3c7 10198
c8a9ca5a
PE
10199 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10200
519e1d69
PE
10201 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10202
6df6ae42 10203 ccl: Add integer overflow checks.
30569699
PE
10204 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10205 (IN_INT_RANGE): New macros.
10206 (ccl_driver): Use them to check for integer overflow when
10207 decoding a CCL program. Many of the new checks are whether XINT (x)
10208 fits in int; it doesn't always, on 64-bit hosts. The new version
10209 doesn't catch all possible integer overflows, but it's an
847044ea 10210 improvement. (Bug#8719)
30569699 10211
c11285dc
PE
10212 * alloc.c (make_event_array): Use XINT, not XUINT.
10213 There's no need for unsigned here.
10214
fdccd48e
PE
10215 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10216 This follows up to the 2011-05-06 change that substituted uintptr_t
10217 for EMACS_INT. This case wasn't caught back then.
10218
37910ab2
PE
10219 Rework Fformat to avoid integer overflow issues.
10220 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10221 now (part of C89). Include <verify.h>.
10222 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10223 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10224 (Fformat): Avoid the prepass trying to compute sizes; it was only
10225 approximate and thus did not catch overflow reliably. Instead, walk
10226 through the format just once, formatting and computing sizes as we go,
10227 checking for integer overflow at every step, and allocating a larger
10228 buffer as needed. Keep track separately whether the format is
10229 multibyte. Keep only the most-recently calculated precision, rather
10230 than them all. Record whether each argument has been converted to
10231 string. Use EMACS_INT, not int, for byte and char and arg counts.
10232 Support field widths and precisions larger than INT_MAX. Avoid
10233 sprintf's undefined behavior with conversion specifications such as %#d
10234 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10235 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10236 formatting out-of-range floating point numbers with int
9173deec 10237 formats. (Bug#8668)
37910ab2 10238
2e6578fb
PE
10239 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10240
0ae6bdee
PE
10241 * data.c: Avoid integer truncation in expressions involving floats.
10242 * data.c: Include <intprops.h>.
10243 (arith_driver): When there's an integer overflow in an expression
10244 involving floating point, convert the integers to floating point
10245 so that the resulting value does not suffer from catastrophic
10246 integer truncation. For example, on a 64-bit host (* 4
10247 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10248 Do not rely on undefined behavior after integer overflow.
10249
de883a70
PE
10250 merge count_size_as_multibyte, parse_str_to_multibyte
10251 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 10252 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
10253 Check for integer overflow.
10254 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10255 since it's now a duplicate of the other. This is more of
10256 a character than a buffer op, so better that it's in character.c.
10257 * fns.c, print.c: Adjust to above changes.
10258
2ff916cb
PE
102592011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
10260
10261 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10262
f1b54466
PE
102632011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10264
fb1ac845
PE
10265 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10266 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10267 (x_clipboard_manager_save): Now static.
10268 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10269
f1b54466
PE
10270 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10271 (crypto_hash_function): Now static.
10272 Fix pointer signedness problems. Avoid unnecessary initializations.
10273
a9f737ee
CY
102742011-05-27 Chong Yidong <cyd@stupidchicken.com>
10275
10276 * termhooks.h (Vselection_alist): Make it terminal-local.
10277
10278 * terminal.c (create_terminal): Initialize it.
10279
10280 * xselect.c: Support for clipboard managers.
10281 (Vselection_alist): Move to termhooks.h as terminal-local var.
10282 (LOCAL_SELECTION): New macro.
10283 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10284 (symbol_to_x_atom): Remove gratuitous arg.
10285 (x_handle_selection_request, lisp_data_to_selection_data)
10286 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10287 (x_own_selection, x_get_local_selection, x_convert_selection):
10288 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10289 (some_frame_on_display): Delete unused function.
10290 (Fx_own_selection_internal, Fx_get_selection_internal)
10291 (Fx_disown_selection_internal, Fx_selection_owner_p)
10292 (Fx_selection_exists_p): New optional frame arg.
10293 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10294 (x_handle_selection_clear): Don't treat other terminals with the
10295 same keyboard specially. Use the terminal-local Vselection_alist.
10296 (x_clear_frame_selections): Use Frun_hook_with_args.
10297
10298 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10299
10300 * xterm.h: Add support for those atoms.
10301
e067f0c1
CY
103022011-05-26 Chong Yidong <cyd@stupidchicken.com>
10303
10304 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10305 (converted_selections, conversion_fail_tag): New global variables.
10306 (x_selection_request_lisp_error): Free the above.
10307 (x_get_local_selection): Remove unnecessary code.
10308 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10309 of converted selections stored in converted_selections.
10310 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10311 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10312 (x_convert_selection): New function.
10313 (x_handle_selection_event): Simplify.
10314 (x_get_foreign_selection): Don't ignore incoming requests while
10315 waiting for an answer; this will fail when we implement
10316 SAVE_TARGETS, and seems unnecessary anyway.
10317 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10318 (Vx_sent_selection_functions): Doc fix.
10319
0f4aebc0
LL
103202011-05-26 Leo Liu <sdl.web@gmail.com>
10321
10322 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10323
e61124cd
YM
103242011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10325
10326 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10327
10328 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10329 for fringe update if it has periodic bitmap.
ac389d0c 10330 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10331 and fringe_bitmap_periodic_p.
10332
10333 * fringe.c (get_fringe_bitmap_data): New function.
10334 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10335 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10336 row. Mark glyph row for fringe update if periodicity changed.
10337
10338 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10339 for fringe update unless it has periodic bitmap.
10340
f16d9837
KH
103412011-05-25 Kenichi Handa <handa@m17n.org>
10342
10343 * xdisp.c (get_next_display_element): Set correct it->face_id for
10344 a static composition.
10345
e1b90ef6
LL
103462011-05-24 Leo Liu <sdl.web@gmail.com>
10347
10348 * deps.mk (fns.o):
10349 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10350
10351 * fns.c (crypto_hash_function, Fsha1): New function.
10352 (Fmd5): Use crypto_hash_function.
10353 (syms_of_fns): Add Ssha1.
10354
7400048f
PE
103552011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10356
10357 * gnutls.c: Remove unused macros.
10358 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10359 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10360 Remove macros that are defined and never used.
10361 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10362
abb71cf4
CY
103632011-05-22 Chong Yidong <cyd@stupidchicken.com>
10364
10365 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10366 (Fx_get_selection_internal): Minor cleanup.
10367 (Fx_own_selection_internal): Rename arguments for consistency with
10368 select.el.
10369
6307db39
PE
103702011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10371
10372 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10373
f3d4e0a4
CY
103742011-05-22 Chong Yidong <cyd@stupidchicken.com>
10375
10376 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10377
4d8ade89
YM
103782011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10379
10380 * dispnew.c (scrolling_window): Don't exclude the case that the
10381 last enabled row in the desired matrix touches the bottom boundary.
10382
32078c8d
GM
103832011-05-21 Glenn Morris <rgm@gnu.org>
10384
10385 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10386 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10387 and add some more files.
32078c8d 10388
7285dc67
EZ
103892011-05-20 Eli Zaretskii <eliz@gnu.org>
10390
10391 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10392 report_file_error introduced by the change from 2011-05-07.
10393
89d1bd22
PE
103942011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10395
10396 * systime.h (Time): Define only if emacs is defined.
10397 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10398 where the include path doesn't have X11/X.h by default. See
10399 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10400
cd394be1 104012011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10402
10403 * composite.c (find_automatic_composition): Fix previous change.
10404
b9704ad9
GM
104052011-05-20 Glenn Morris <rgm@gnu.org>
10406
10407 * lisp.mk: New file, split from Makefile.in.
10408 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10409 (shortlisp): Remove.
10410 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10411
4a720484
GM
104122011-05-19 Glenn Morris <rgm@gnu.org>
10413
10414 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10415 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10416 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10417 (lisp): Set the order to that of loadup.el.
10418 (shortlisp): Make it a copy of $lisp.
10419 (SOME_MACHINE_LISP): Remove.
10420 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10421 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10422
a28d4396
KH
104232011-05-18 Kenichi Handa <handa@m17n.org>
10424
10425 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10426 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10427 (find_automatic_composition): Mostly rewrite for efficiency.
10428
a2b1fa8e
JB
104292011-05-18 Juanma Barranquero <lekktu@gmail.com>
10430
10431 * makefile.w32-in: Update dependencies.
10432
8e1f5610
CS
104332011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10434
10435 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10436 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10437
7025ee00 104382011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10439
cdfa6eab
PE
10440 Fix some integer overflow issues, such as string length overflow.
10441
06d6db33
PE
10442 * insdel.c (count_size_as_multibyte): Check for string overflow.
10443
2b4560a8
PE
10444 * character.c (lisp_string_width): Check for string overflow.
10445 Use EMACS_INT, not int, for string indexes and lengths; in
10446 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10447 the resulting string length overflows an EMACS_INT; instead,
10448 report a string overflow if no precision given. When checking for
10449 precision exhaustion, use a check that cannot possibly have
10450 integer overflow. (Bug#8675)
10451 * character.h (lisp_string_width): Adjust to new signature.
10452
cb93f9be
PE
10453 * alloc.c (string_overflow): New function.
10454 (Fmake_string): Use it. This doesn't change behavior, but saves
10455 a few bytes and will simplify future changes.
10456 * character.c (string_escape_byte8): Likewise.
10457 * lisp.h (string_overflow): New decl.
10458
1a1f3366
PE
10459 Fixups, following up to the user-interface timestamp change.
10460 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10461 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10462 * msdos.c (mouse_get_pos): Likewise.
10463 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10464 * w32gui.h (Time): Define by including "systime.h" rather than by
10465 declaring it ourselves. (Bug#8664)
10466
d4e3e4d3
PE
10467 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10468 * image.c (clear_image_cache): Likewise.
10469
f6a24d19
PE
10470 * term.c (term_mouse_position): Don't assume time_t wraparound.
10471
08dc5ae6
PE
10472 Be more systematic about user-interface timestamps.
10473 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10474 and sometimes 'EMACS_UINT', to represent these timestamps.
10475 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10476 This makes the code easier to follow, and makes it easier to catch
10477 integer overflow bugs such as Bug#8664.
10478 * frame.c (Fmouse_position, Fmouse_pixel_position):
10479 Use Time, not unsigned long, for user-interface timestamps.
10480 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10481 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10482 * keyboard.h (last_event_timestamp): Likewise.
10483 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10484 * menu.h (xmenu_show): Likewise.
10485 * term.c (term_mouse_position): Likewise.
10486 * termhooks.h (struct input_event.timestamp): Likewise.
10487 (struct terminal.mouse_position_hook): Likewise.
10488 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10489 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10490 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10491 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10492 what it was before.
10493 * menu.h, termhooks.h: Include "systime.h", for Time.
10494
8e55734a
PE
10495 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10496 Don't assume that the difference between two unsigned long values
10497 can fit into an integer. At this point, we know button_down_time
10498 <= event->timestamp, so the difference must be nonnegative, so
10499 there's no need to cast the result if double-click-time is
10500 nonnegative, as it should be; check that it's nonnegative, just in
10501 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10502 apart (about 25 days). (Bug#8664)
8e55734a 10503
841f1b75 10504 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10505 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10506
3e26f69c
PE
10507 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10508 that always fit in int. Use a sentinel instead of a counter, to
10509 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10510 * frame.h (struct frame): Use int for menu_bar_items_used
10511 instead of EMACS_INT, since it always fits in int.
3e26f69c 10512
5cc152c0
PE
10513 * menu.c (grow_menu_items): Check for int overflow.
10514
d89eb65e
PE
10515 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10516
5235bd3e
PE
10517 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10518 Before, the code was not consistent. These values cannot exceed
10519 2**31 - 1 so there's no need to make them unsigned.
10520 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10521 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10522 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10523 as modifiers.
10524 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10525
bc827e23
PE
10526 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10527 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10528 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10529 presumably because the widths might not match.
10530
78eb494e
PE
10531 * window.c (size_window): Avoid needless test at loop start.
10532
04f2d78b
CB
105332011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10534
10535 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10536
d2fc7e3d 105372011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10538
10539 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10540
d2fc7e3d 105412011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10542
10543 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10544 `width' to `bar_area_x' and `bar_area_width', respectively.
10545 (x_scroll_run): Take account of fringe background extension.
10546
04f2d78b
CB
10547 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10548 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10549 `bar_area_width', respectively.
10550 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10551 background extension.
10552
79b70037
GM
105532011-05-10 Jim Meyering <meyering@redhat.com>
10554
10555 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10556
2f142cc5
JB
105572011-05-10 Juanma Barranquero <lekktu@gmail.com>
10558
10559 * image.c (Finit_image_library): Return t for built-in image types,
10560 like pbm and xbm. (Bug#8640)
10561
57679c86
AS
105622011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10563
10564 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10565
888c9e86
EZ
105662011-05-07 Eli Zaretskii <eliz@gnu.org>
10567
b0512a1d
EZ
10568 * w32console.c (Fset_screen_color): Doc fix.
10569 (Fget_screen_color): New function.
10570 (syms_of_ntterm): Defsubr it.
10571
7285dc67
EZ
10572 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10573 unlink the temporary file if Fcall_process didn't create it in the
10574 first place.
10575 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10576 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
10577 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10578 cue to call_process_cleanup not to close that handle.
10579
4d3fcc8e
BK
105802011-05-07 Ben Key <bkey76@gmail.com>
10581
10582 * makefile.w32-in: The bootstrap-temacs rule now makes use of
10583 one of two shell specific rules, either bootstrap-temacs-CMD or
10584 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
10585 to the previous implementation of the bootstrap-temacs rule.
10586 The bootstrap-temacs-CMD rule is similar to the previous
10587 implementation of the bootstrap-temacs rule except that it
10588 makes use of the ESC_CFLAGS variable instead of the CFLAGS
10589 variable.
10590
10591 These changes, along with some changes to nt/configure.bat,
10592 nt/gmake.defs, and nt/nmake.defs, are required to extend my
10593 earlier fix to add support for --cflags and --ldflags options
10594 that include quotes so that it works whether make uses cmd or
10595 sh as the shell.
10596
b4289b64
MA
105972011-05-06 Michael Albinus <michael.albinus@gmx.de>
10598
10599 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10600 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10601 is a constant.
10602 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10603 a string. Handle both cases.
10604 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10605 (Fdbus_register_method): Use Qinvalid_function.
10606
af4c0e28
JB
106072011-05-06 Juanma Barranquero <lekktu@gmail.com>
10608
10609 * makefile.w32-in: Update dependencies.
10610 (LISP_H): Add inttypes.h and stdin.h.
10611 (PROCESS_H): Add unistd.h.
10612
c51453d9
EZ
106132011-05-06 Eli Zaretskii <eliz@gnu.org>
10614
10615 * lread.c: Include limits.h (fixes the MS-Windows build broken by
10616 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10617
8ff0ac3c 106182011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 10619
4c4b566b
PE
10620 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10621
aab2b9b5
PE
10622 * term.c (vfatal): Remove stray call to va_end.
10623 It's not needed and the C Standard doesn't allow it here anyway.
10624
c378da0b
PE
10625 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10626 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
10627
288b08c7
PE
10628 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10629 bytes.
10630
e3601888
PE
10631 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10632
db6c0e74
PE
10633 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10634
dd5963ea
PE
10635 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10636
88c9450f
PE
10637 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10638
2f9442b8
PE
10639 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10640
c032b5f8
PE
10641 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10642 * charset.c (Fdefine_charset_internal): Don't initialize
10643 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 10644 32-bit int (Bug#8600).
a108c10b
PE
10645
10646 * lread.c (read_integer): Be more consistent with string-to-number.
10647 Use string_to_number to do the actual conversion; this avoids
10648 rounding errors and fixes some other screwups. Without this fix,
10649 for example, #x1fffffffffffffff was misread as -2305843009213693952.
10650 (digit_to_number): Move earlier, for benefit of read_integer.
10651 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 10652 not a digit in any supported base. (Bug#8602)
a108c10b 10653
ad5f9eea
PE
10654 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10655
aec1708a
PE
10656 * dispnew.c (scrolling_window): Return 1 if we scrolled,
10657 to match comment at start of function. This also removes a
10658 GCC warning about overflow in a 32+64-bit port.
10659
47be4ab5
PE
10660 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10661
371cac43
PE
10662 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10663 Reported by Stefan Monnier in
10664 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
10665 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10666 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 10667
d01a7826
PE
10668 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
10669 (EMACS_UINTPTR): Likewise, with uintptr_t.
10670
7fd47d5c
PE
10671 * lisp.h: Prefer 64-bit EMACS_INT if available.
10672 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10673 on 32-bit hosts that have 64-bit int, so that they can access
10674 large files.
122b0c86
PE
10675 However, temporarily disable this change unless the temporary
10676 symbol WIDE_EMACS_INT is defined.
7fd47d5c 10677
8727937b
PE
10678 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10679
8ac068ac
PE
10680 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10681 This removes an assumption that EMACS_INT and long are the same
10682 width as pointers. The assumption is true for Emacs porting targets
10683 now, but we want to make other targets possible.
10684 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10685 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10686 In the rest of the code, change types of integers that hold casted
10687 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10688 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10689 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10690 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10691 No need to cast type when ORing.
10692 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10693 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10694 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10695 assume EMACS_INT is the same width as char *.
10696 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10697 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10698 Remove no-longer-needed casts.
10699 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10700 (xg_tool_bar_help_callback, xg_make_tool_item):
10701 Use EMACS_INTPTR to hold an integer
10702 that will be cast to void *; this can avoid a GCC warning
10703 if EMACS_INT is not the same width as void *.
10704 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10705 * xdisp.c (display_echo_area_1, resize_mini_window_1):
10706 (current_message_1, set_message_1):
10707 Use a local to convert to proper width without a cast.
10708 * xmenu.c (dialog_selection_callback): Likewise.
10709
ede49d71
PE
10710 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10711 Also, don't assume VALBITS / RAND_BITS is less than 5,
10712 and don't rely on undefined behavior when shifting a 1 left into
10713 the sign bit.
10714 * lisp.h (get_random): Change signature to match.
10715
2f30ecd0
PE
10716 * lread.c (hash_string): Use size_t, not int, for hash computation.
10717 Normally we prefer signed values; but hashing is special, because
10718 it's better to use unsigned division on hash table sizes so that
10719 the remainder is nonnegative. Also, size_t is the natural width
10720 for hashing into memory. The previous code used 'int', which doesn't
10721 retain enough info to hash well into very large tables.
10722 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10723
2a866e7b
PE
10724 * dbusbind.c: Don't possibly lose pointer info when converting.
10725 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10726 Use XPNTR rather than XHASH, so that the high-order bits of
10727 the pointer aren't lost when converting through void *.
10728
51639eac
PE
10729 * eval.c (Fautoload): Don't double-shift a pointer.
10730
92394119
PE
10731 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10732
dbdb9a7c
JB
107332011-05-06 Juanma Barranquero <lekktu@gmail.com>
10734
10735 * gnutls.c (DEF_GNUTLS_FN):
10736 * image.c (DEF_IMGLIB_FN): Make function pointers static.
10737
db7a0b4f
AS
107382011-05-05 Andreas Schwab <schwab@linux-m68k.org>
10739
10740 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10741 marker. (Bug#8610)
10742
cd394be1 107432011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
10744
10745 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
10746 New version that can reserve upto 2GB of heap space.
10747
f7ff1b0f 107482011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
10749
10750 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10751
639c109b
TZ
107522011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
10753
10754 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10755 `gnutls_certificate_set_x509_key_file'.
10756
d2127135
JB
107572011-05-05 Juanma Barranquero <lekktu@gmail.com>
10758
10759 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
10760 Update dependencies.
10761
e968f4f3
JB
107622011-05-04 Juanma Barranquero <lekktu@gmail.com>
10763
10764 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
10765 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10766 Remove unused parameter `fildes'.
10767 * process.c (read_process_output, send_process): Don't pass it.
10768
84d358f0
JB
107692011-05-04 Juanma Barranquero <lekktu@gmail.com>
10770
10771 Fix previous change: the library cache is defined in w32.c.
10772 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
10773 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
10774
0898ca10
JB
107752011-05-04 Juanma Barranquero <lekktu@gmail.com>
10776
10777 Implement dynamic loading of GnuTLS on Windows.
10778
10779 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
10780 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
10781 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10782 Declare.
10783
10784 * gnutls.c (Qgnutls_dll): Define.
10785 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
10786 (gnutls_*): Declare function pointers.
10787 (init_gnutls_functions): New function to initialize function pointers.
10788 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
10789 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
10790 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10791 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
10792 (emacs_gnutls_write, emacs_gnutls_read)
10793 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
10794 (Fgnutls_available_p): New function.
10795 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
10796 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
10797 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
10798
10799 * image.c: Include w32.h.
10800 (Vimage_type_cache): Delete.
10801 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
10802 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
10803 (w32_delayed_load): Move to w32.c.
10804
10805 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
10806
10807 * w32.c (QCloaded_from, Vlibrary_cache): Define.
10808 (w32_delayed_load): Move from image.c. When loading a library, record
10809 its filename in the :loaded-from property of the library id.
10810 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
10811 Initialize and staticpro them.
10812 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
10813
10814 * process.c: Include lisp.h before w32.h, not after.
10815 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
10816 instead of gnutls_record_check_pending.
10817
10818 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
10819
ff4de4aa
TZ
108202011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
10821
10822 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
10823 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
10824 as passed in.
10825
abe95abb
JD
108262011-05-03 Jan Djärv <jan.h.d@swipnet.se>
10827
10828 * xterm.c (x_set_frame_alpha): Do not set property on anything
10829 else than FRAME_X_OUTER_WINDOW (Bug#8608).
10830
e16e55d4
JB
108312011-05-02 Juanma Barranquero <lekktu@gmail.com>
10832
10833 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
10834
bafcf6a5
JB
108352011-05-02 Juanma Barranquero <lekktu@gmail.com>
10836
10837 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
10838 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
10839 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
10840 (gnutls_global_initialized, Qgnutls_bootprop_priority)
10841 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
10842 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
10843 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
10844 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
10845 (Qgnutls_bootprop_callbacks_verify): Make static.
10846
e7a6747f
AS
108472011-05-01 Andreas Schwab <schwab@linux-m68k.org>
10848
19ed11ba
AS
10849 * callproc.c: Indentation fixup.
10850
e7a6747f 10851 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
10852 (wait_for_termination, interruptible_wait_for_termination):
10853 Move after wait_for_termination_1.
e7a6747f 10854
1ef14cb4
LMI
108552011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
10856
10857 * sysdep.c (interruptible_wait_for_termination): New function
10858 which is like wait_for_termination, but allows keyboard
10859 interruptions.
10860
10861 * callproc.c (Fcall_process): Add (:file "file") as an option for
10862 the STDOUT buffer.
10863 (Fcall_process_region): Ditto.
10864
330d880c
EZ
108652011-04-30 Eli Zaretskii <eliz@gnu.org>
10866
8db90b73
EZ
10867 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
10868 rather than `XVECTOR (FOO)->size'.
10869
330d880c
EZ
10870 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
10871 inttypes.h, as a gnulib replacement is used if it not available in
10872 system headers.
10873
15cbd324
EZ
108742011-04-21 Eli Zaretskii <eliz@gnu.org>
10875
10876 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
10877 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
10878 of MOST_POSITIVE_FIXNUM. (Bug#8528)
10879
10880 * coding.c (coding_alloc_by_realloc): Error out if destination
10881 will grow beyond MOST_POSITIVE_FIXNUM.
10882 (decode_coding_emacs_mule): Abort if there isn't enough place in
10883 charbuf for the composition carryover bytes. Reserve an extra
10884 space for up to 2 characters produced in a loop.
10885 (decode_coding_iso_2022): Abort if there isn't enough place in
10886 charbuf for the composition carryover bytes.
10887
108882011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 10889
ae940cca
EZ
10890 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
10891 aborting when %lld or %lll format is passed.
10892 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
10893 %llo or %llx format is passed. (Bug#8545)
10894
03ab8921
EZ
10895 * window.c (window_scroll_line_based): Use a marker instead of
10896 simple variables to record original value of point. (Bug#7952)
10897
afda1437
EZ
10898 * doprnt.c (doprnt): Fix the case where a multibyte sequence
10899 produced by %s or %c overflows available buffer space. (Bug#8545)
10900
f76dee0c
PE
109012011-04-28 Paul Eggert <eggert@cs.ucla.edu>
10902
10903 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 10904 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 10905
fdc5744d
JB
109062011-04-28 Juanma Barranquero <lekktu@gmail.com>
10907
10908 * w32.c (init_environment): Warn about defaulting HOME to C:\.
10909
638f053a
JB
109102011-04-28 Juanma Barranquero <lekktu@gmail.com>
10911
10912 * keyboard.c (Qdelayed_warnings_hook): Define.
10913 (command_loop_1): Run `delayed-warnings-hook'
10914 if Vdelayed_warnings_list is non-nil.
10915 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
10916 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
10917
d178f871
EZ
109182011-04-28 Eli Zaretskii <eliz@gnu.org>
10919
10920 * doprnt.c (doprnt): Don't return value smaller than the buffer
10921 size if the message was truncated. (Bug#8545).
10922
b124fd93
JB
109232011-04-28 Juanma Barranquero <lekktu@gmail.com>
10924
10925 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
10926 (Fx_window_property): #if-0 the whole functions, not just the bodies.
10927
e810457d
PE
109282011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10929
10930 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
10931
ea51cceb
JB
109322011-04-27 Juanma Barranquero <lekktu@gmail.com>
10933
10934 * makefile.w32-in: Update dependencies.
10935
94dcfacf
EZ
109362011-04-27 Eli Zaretskii <eliz@gnu.org>
10937
10938 Improve `doprnt' and its usage. (Bug#8545)
10939 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
10940 `format_end'. Remove support for %l as a conversion specifier.
10941 Don't use xrealloc. Improve diagnostics when the %l size modifier
10942 is used. Update the commentary.
10943
10944 * eval.c (verror): Simplify calculation of size_t.
10945
10946 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
10947 messages.
10948
f61f41d7
PE
109492011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
10950
10951 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
10952 change.
10953
96fb4434
PE
109542011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10955
10956 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
10957 This makes this file independent of the recent pseudovector change.
10958
671875da 109592011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 10960
69e9b5a3
PE
10961 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
10962
b5f869a7 10963 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 10964 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 10965 Remove unused local.
c8926152 10966 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 10967
841a1577 10968 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
10969 GCC 4.6.0 optimizes based on type-based alias analysis.
10970 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
10971 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
10972 != &v->size, and therefore "v->size = 1; b->size = 2; return
10973 v->size;" must therefore return 1. This assumption is incorrect
10974 for Emacs, since it type-puns struct Lisp_Vector * with many other
10975 types. To fix this problem, this patch adds a new type struct
f904488f 10976 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
10977 and pseudovectors, and helps optimizing compilers not get fooled
10978 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
10979 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
10980 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
10981 the size member.
eab3844f
PE
10982 (XSETPVECTYPE): Rewrite in terms of new macro.
10983 (XSETPVECTYPESIZE): New macro, specifying both type and size.
10984 This is a bit clearer, and further avoids the possibility of
10985 undesirable aliasing.
10986 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 10987 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
10988 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
10989 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
10990 (ASIZE): Now uses header.size rather than size.
10991 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
10992 to avoid the hassle of writing XVECTOR (foo)->header.size.
10993 (struct vectorlike_header): New type.
eab3844f
PE
10994 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
10995 object, to help avoid aliasing.
10996 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
10997 (SUBRP): Likewise, since Lisp_Subr is a special case.
10998 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
10999 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11000 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 11001 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
11002 changed to be "header.size" and "header.next".
11003 * buffer.h (struct buffer): Likewise.
11004 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11005 * frame.h (struct frame): Likewise.
11006 * process.h (struct Lisp_Process): Likewise.
11007 * termhooks.h (struct terminal): Likewise.
11008 * window.c (struct save_window_data, struct saved_window): Likewise.
11009 * window.h (struct window): Likewise.
11010 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11011 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11012 * buffer.c (init_buffer_once): Likewise.
11013 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11014 special case.
11015 * process.c (Fformat_network_address): Use local var for size,
11016 for brevity.
11017
0df1eac5
PE
11018 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11019
847ab9d1 11020 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
11021 * data.c (atof): Remove decl; no longer used or needed.
11022 (digit_to_number): Move to lread.c.
11023 (Fstring_to_number): Use new string_to_number function, to be
11024 consistent with how the Lisp reader treats infinities and NaNs.
11025 Do not assume that floating-point numbers represent EMACS_INT
11026 without losing information; this is not true on most 64-bit hosts.
11027 Avoid double-rounding errors, by insisting on integers when
11028 parsing non-base-10 numbers, as the documentation specifies.
11029 * lisp.h (string_to_number): New decl, replacing ...
11030 (isfloat_string): Remove.
bc0a5c13 11031 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 11032 (read1): Do not accept +. and -. as integers; this
452f4150
PE
11033 appears to have been a coding error. Similarly, do not accept
11034 strings like +-1e0 as floating point numbers. Do not report
11035 overflow for integer overflows unless the base is not 10 which
11036 means we have no simple and reliable way to continue.
11037 Break out the floating-point parsing into a new
11038 function string_to_number, so that Fstring_to_number parses
11039 floating point numbers consistently with the Lisp reader.
04f2d78b 11040 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
11041 (E_CHAR, EXP_INT): Remove, replacing with ...
11042 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11043 (string_to_number): New function, replacing isfloat_string.
11044 This function checks for valid syntax and produces the resulting
11045 Lisp float number too. Rework it so that string-to-number
bc0a5c13 11046 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
11047 so that overflow for non-base-10 numbers is reported only when
11048 there's no portable and simple way to convert to floating point.
452f4150 11049
67769ffc
PE
11050 * textprop.c (set_text_properties_1): Rewrite for clarity,
11051 and to avoid GCC warning about integer overflow.
11052
c20db43f
PE
11053 * intervals.h (struct interval): Use EMACS_INT for members
11054 where EMACS_UINT might cause problems. See
11055 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
11056 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
11057 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
11058 All uses changed.
37aa2f85
PE
11059 (offset_intervals): Tell GCC not to worry about length overflow
11060 when negating a negative length.
c20db43f 11061
2538aa2f
PE
11062 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
11063 (overrun_check_free): Likewise.
11064
f2d3008d
PE
11065 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
11066 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
11067 word size.
11068
ec8df744
PE
11069 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11070 (gnutls_make_error): Rename local to avoid shadowing.
11071 (gnutls_emacs_global_deinit): ifdef out; not used.
11072 (Fgnutls_boot): Use const for pointer to readonly storage.
11073 Comment out unused local. Fix pointer signedness problems.
11074
640ee02d
PE
11075 * lread.c (openp): Don't stuff size_t into an 'int'.
11076 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
11077 about possible signed overflow.
11078
6048fb2a
PE
11079 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11080 (GDK_KEY_g): Don't define if already defined.
11081 (xg_prepare_tooltip): Avoid pointer signedness problem.
11082 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
11083
fa3c87e1
PE
11084 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
11085 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
11086
2172544b
PE
11087 * xfns.c (Fx_window_property): Simplify a bit,
11088 to make a bit faster and to avoid GCC 4.6.0 warning.
11089 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
11090
9b821a21
PE
11091 * fns.c (internal_equal): Don't assume size_t fits in int.
11092
3c616cfa
PE
11093 * alloc.c (compact_small_strings): Tighten assertion a little.
11094
c2982e87
PE
11095 Replace pEd with more-general pI, and fix some printf arg casts.
11096 * lisp.h (pI): New macro, generalizing old pEd macro to other
11097 conversion specifiers. For example, use "...%"pI"d..." rather
11098 than "...%"pEd"...".
11099 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 11100 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
11101 * alloc.c (check_pure_size): Don't overflow by converting size to int.
11102 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
11103 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11104 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11105 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11106 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11107 64-bit hosts.
11108 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11109 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11110 * print.c (safe_debug_print, print_object): Likewise.
11111 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11112 to int.
6f04d126
PE
11113 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11114 avoiding the 0 flag, which is not portable.
c2982e87
PE
11115 * process.c (Fmake_network_process): Use pI to avoid cast.
11116 * region-cache.c (pp_cache): Likewise.
11117 * xdisp.c (decode_mode_spec): Likewise.
11118 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11119 behavior on 64-bit hosts with printf arg.
6f04d126 11120 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11121 (x_stop_queuing_selection_requests): Likewise.
11122 (x_get_window_property): Don't truncate byte count to an 'int'
11123 when tracing.
0b432f21 11124
5e073ec7
PE
11125 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11126 here, since it parses constructs like leading '-' and spaces,
11127 which are not wanted; and it overflows with large numbers.
11128 Instead, simply match F[0-9]+, which is what is wanted anyway.
11129
36372bf9
PE
11130 * alloc.c: Remove unportable assumptions about struct layout.
11131 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11132 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11133 (allocate_vectorlike, make_pure_vector): Use the new macros,
11134 plus offsetof, to remove unportable assumptions about struct layout.
11135 These assumptions hold on all porting targets that I know of, but
11136 they are not guaranteed, they're easy to remove, and removing them
11137 makes further changes easier.
11138
0b432f21
PE
11139 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11140 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11141 (string_overrun_cookie): Now const. Use initializers that
11142 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11143 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11144 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11145 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11146 multiple of sizeof (EMACS_INT); it need not be, if
11147 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11148 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11149
895009e1
JB
111502011-04-26 Juanma Barranquero <lekktu@gmail.com>
11151
11152 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11153
6a7a1b0b
TZ
111542011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11155
11156 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11157 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11158 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11159
841a1577 111602011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11161
11162 * lisp.h (Qdebug): List symbol.
895009e1 11163 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11164 * keyboard.c (debug-on-event): New variable.
11165 (handle_user_signal): Break into debugger when debug-on-event
11166 matches the current signal symbol.
11167
f2d3ba6f
DN
111682011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11169
11170 * alloc.c (check_sblock, check_string_bytes)
11171 (check_string_free_list): Convert to standard C.
11172
42ce4c63
TZ
111732011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11174
11175 * w32.c (emacs_gnutls_push): Fix typo.
11176
825cd63c
EZ
111772011-04-25 Eli Zaretskii <eliz@gnu.org>
11178
fb11d64d
EZ
11179 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11180 "cast to pointer from integer of different size".
11181
825cd63c
EZ
11182 Improve doprnt and its use in verror. (Bug#8545)
11183 * doprnt.c (doprnt): Document the set of format control sequences
11184 supported by the function. Use SAFE_ALLOCA instead of always
11185 using `alloca'.
11186
11187 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11188 is one byte too soon. Don't use xrealloc; instead xfree and
11189 xmalloc anew.
11190
e061a11b
TZ
111912011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11192
11193 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11194 callbacks stage.
11195
11196 * gnutls.c: Renamed global_initialized to
11197 gnutls_global_initialized. Added internals for the
11198 :verify-hostname-error, :verify-error, and :verify-flags
11199 parameters of `gnutls-boot' and documented those parameters in the
11200 docstring. Start callback support.
9173deec
JB
11201 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11202 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11203 on error. Return error code.
e061a11b
TZ
11204 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11205 (emacs_gnutls_read): Likewise.
11206 (Fgnutls_boot): Return handshake error code.
11207 (emacs_gnutls_handle_error): New function.
11208 (wsaerror_to_errno): Likewise.
11209
11210 * w32.h (emacs_gnutls_pull): Add prototype.
11211 (emacs_gnutls_push): Likewise.
11212
11213 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11214 (emacs_gnutls_push): Likewise.
11215
112162011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11217
11218 * process.c (wait_reading_process_output): Check if GnuTLS
11219 buffered some data internally if no FDs are set for TLS
11220 connections.
11221
11222 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11223 (LIBS): Link to USER_LIBS.
11224 ($(BLD)/gnutls.$(0)): New target.
11225
fa6996bc
EZ
112262011-04-24 Eli Zaretskii <eliz@gnu.org>
11227
eb35682e
EZ
11228 * xdisp.c (handle_single_display_spec): Rename the
11229 display_replaced_before_p argument into display_replaced_p, to
11230 make it consistent with the commentary. Fix typos in the
11231 commentary.
11232
e2ad650c
EZ
11233 * textprop.c (syms_of_textprop): Remove dead code.
11234 (copy_text_properties): Delete obsolete commentary about an
11235 interface that was deleted long ago. Fix typos in the description
11236 of arguments.
11237
1b2de274
EZ
11238 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11239 to changes in oldXMenu/XMenu.h from 2011-04-16.
11240 <menu_help_message, prev_menu_help_message>: Constify.
11241 (IT_menu_make_room): menu->help_text is now `const char **';
11242 adjust.
11243
11244 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11245 to changes in oldXMenu/XMenu.h from 2011-04-16.
11246 (struct XMenu): Declare `help_text' `const char **'.
11247
11248 * xfaces.c <Qunspecified>: Make extern again.
11249
11250 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 11251 required by POSIX.
1b2de274 11252
762b15be
EZ
11253 * doc.c (get_doc_string): Improve the format passed to `error'.
11254
11255 * doprnt.c (doprnt): Improve commentary.
11256
11257 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11258
11259 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11260 them with etags.
11261
f1052e5d
EZ
11262 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11263 changes in globals.h immediately force recompilation.
762b15be
EZ
11264 (TAGS): Depend on $(CURDIR)/m/intel386.h and
11265 $(CURDIR)/s/ms-w32.h.
11266 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 11267
fa6996bc
EZ
11268 * character.c (Fchar_direction): Function deleted.
11269 (syms_of_character): Don't defsubr it.
11270 <char-direction-table>: Deleted.
11271
e6c3da20
EZ
112722011-04-23 Eli Zaretskii <eliz@gnu.org>
11273
11274 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
11275 * doprnt.c: Include limits.h.
11276 (SIZE_MAX): New macro.
04f2d78b
CB
11277 (doprnt): Return a size_t value. 2nd arg is now size_t.
11278 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
11279 Improve overflow protection. Support `l' modifier for integer
11280 conversions. Support %l conversion. Don't assume an EMACS_INT
11281 argument for integer conversions and for %c.
11282
11283 * lisp.h (doprnt): Restore prototype.
11284
11285 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11286 $(SRC)/character.h.
11287
11288 * Makefile.in (base_obj): Add back doprnt.o.
11289
11290 * deps.mk (doprnt.o): Add back prerequisites.
11291 (callint.o): Depend on character.h.
11292
11293 * eval.c (internal_lisp_condition_case): Include the handler
11294 representation in the error message.
11295 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11296 when breaking from the loop.
11297
11298 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11299
11300 * callint.c (Fcall_interactively): When displaying error message
11301 about invalid control letter, pass the character's codepoint, not
11302 a pointer to its multibyte form. Improve display of the character
11303 in octal and display also its hex code.
11304
11305 * character.c (char_string): Use %x to display the (unsigned)
11306 codepoint of an invalid character, to avoid displaying a bogus
11307 negative value.
11308
11309 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11310 `error', not SYMBOL_NAME itself.
11311
11312 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11313 character arguments to `error'.
11314
11315 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11316 to `error' in error message about FINAL_CHAR argument. Make sure
11317 FINAL_CHAR is a character, and use %c when it is passed as
11318 argument to `error'.
11319
4ffd0d6b 113202011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11321
11322 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11323
11324 * w32.c: Include <time.h>.
11325 (sys_localtime): New function.
11326
4ffd0d6b 113272011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11328
11329 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11330
4ffd0d6b 11331 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11332
4ffd0d6b 113332011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11334
4ffd0d6b
GM
11335 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11336 zombies (Bug#8467).
aac0c6e3 11337
04c56954
EZ
113382011-04-19 Eli Zaretskii <eliz@gnu.org>
11339
11340 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11341 gl_state.e_property when gl_state.object is Qt.
11342
11343 * insdel.c (make_gap_larger): Remove limitation of buffer size
11344 to <= INT_MAX.
11345
16a43933
CY
113462011-04-18 Chong Yidong <cyd@stupidchicken.com>
11347
11348 * xdisp.c (lookup_glyphless_char_display)
11349 (produce_glyphless_glyph): Handle cons cell entry in
11350 glyphless-char-display.
11351 (Vglyphless_char_display): Document it.
11352
11353 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11354 glyphless-char-display.
11355
4581706e
CY
113562011-04-17 Chong Yidong <cyd@stupidchicken.com>
11357
11358 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11359
11360 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11361
11362 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11363 definition for no-X builds.
11364
4887c6e2 113652011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11366
fd35b6f9
PE
11367 Static checks with GCC 4.6.0 and non-default toolkits.
11368
5c1ccb01
PE
11369 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11370
006c5daa
PE
11371 * process.c (keyboard_bit_set): Define only if SIGIO.
11372 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11373 (send_process): Repair possible setjmp clobbering.
11374
efc736d3
PE
11375 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11376
4e2fe2e6
PE
11377 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11378
f97334a2
PE
11379 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11380
4e75f29d
PE
11381 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11382 Define only if needed.
11383
90efadd1
PE
11384 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11385 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11386 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11387
3c647824
PE
11388 * dispextern.h (struct redisplay_interface): Rename param
11389 to avoid shadowing.
e264f262 11390 * termhooks.h (struct terminal): Likewise.
761383f4 11391 * xterm.c (xembed_send_message): Likewise.
3c647824 11392
b58c5c4a
PE
11393 * insdel.c (make_gap_smaller): Define only if
11394 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11395
cad59032
PE
11396 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11397 it.
11398
c339dc2e
PE
11399 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11400 so that we aren't warned about unused symbols.
11401
91a3e27b
PE
11402 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11403
399c71d3 11404 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11405
8ffc96f5
PE
11406 * xfns.c (x_real_positions): Mark locals as initialized.
11407
eef9bc79
PE
11408 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11409
098db9dd
PE
11410 * xterm.c: Fix problems found by static analysis with other toolkits.
11411 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11412 (x_dispatch_event): Declare static if USE_GTK, and
11413 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11414 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11415 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11416 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11417 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11418
eb18f6cc
PE
11419 * xmenu.c (menu_help_callback): Pointer type fixes.
11420 Use const pointers when pointing at readonly data. Avoid pointer
11421 signedness clashes.
11422 (FALSE): Remove unused macro.
11423 (update_frame_menubar): Remove unused decl.
11424
1fe72bf8
PE
11425 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11426
60d9e1db
PE
11427 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11428 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11429 (single_menu_item): Rename local to avoid shadowing.
11430
39261c26
PE
11431 * keyboard.c (make_lispy_event): Remove unused local var.
11432
018c5e19
PE
11433 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11434 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11435
63d2b86e
PE
11436 * bitmaps: Change bitmaps from unsigned char back to the X11
11437 compatible char. Avoid the old compiler warnings about
11438 out-of-range initializers by using, for example, '\xab' rather
11439 than 0xab.
11440
aefd87e1
PE
11441 * xgselect.c (xgselect_initialize): Check vs interface
11442 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11443
bf501fb9
PE
11444 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11445
e9829fdf
PE
11446 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11447 to read-only memory.
11448
1086c095
PE
11449 * fns.c (vector): Remove; this old hack is no longer needed.
11450
2baccd04 11451 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11452 Remove unused var.
dde42981 11453 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11454
72391843 11455 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11456
436c16df 11457 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11458 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11459 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11460
92bb796d 11461 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11462 (x_term_init): Remove local to avoid shadowing.
92bb796d 11463
764430a3 11464 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11465
11466 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11467 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11468
d1dfb56c
EZ
114692011-04-16 Eli Zaretskii <eliz@gnu.org>
11470
c4354cb4
EZ
11471 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11472
d1dfb56c
EZ
11473 Fix regex.c, syntax.c and friends for buffers > 2GB.
11474 * syntax.h (struct gl_state_s): Declare character position members
11475 EMACS_INT.
11476
11477 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11478
04f2d78b
CB
11479 * textprop.c (verify_interval_modification, interval_of):
11480 Declare arguments EMACS_INT.
d1dfb56c
EZ
11481
11482 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11483 EMACS_INT.
11484
11485 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11486
11487 * indent.c (Fvertical_motion): Local variable it_start is now
11488 EMACS_INT.
11489
11490 * regex.c (re_match, re_match_2, re_match_2_internal)
11491 (bcmp_translate, regcomp, regexec, print_double_string)
11492 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11493 (re_compile_pattern, re_exec): Declare arguments and local
11494 variables `size_t' and `ssize_t' and return values `regoff_t', as
11495 appropriate.
11496 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11497 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11498 <compile_stack_type>: `size' and `avail' are now `size_t'.
11499
11500 * regex.h <regoff_t>: Use ssize_t, not int.
11501 (re_search, re_search_2, re_match, re_match_2): Arguments that
11502 specify buffer/string position and length are now ssize_t and
11503 size_t. Return type is regoff_t.
11504
613052cd
BK
115052011-04-16 Ben Key <bkey76@gmail.com>
11506
11507 * nsfont.m: Fixed bugs in ns_get_family and
11508 ns_descriptor_to_entity that were caused by using free to
11509 deallocate memory blocks that were allocated by xmalloc (via
11510 xstrdup). This caused Emacs to crash when compiled with
11511 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11512 --enable-checking=xmallocoverrun). xfree is now used to
11513 deallocate these memory blocks.
11514
4170f62f 115152011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11516
71b41406
PE
11517 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11518
9587a89d
PE
11519 emacs_write: Accept and return EMACS_INT for sizes.
11520 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11521 et seq.
11522 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11523 Accept and return EMACS_INT.
11524 (emacs_gnutls_write): Return the number of bytes written on
11525 partial writes.
11526 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11527 (emacs_read, emacs_write): Remove check for negative size, as the
11528 Emacs source code has been audited now.
9587a89d
PE
11529 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11530 (emacs_read, emacs_write): Use it.
273a5f82
PE
11531 * process.c (send_process): Adjust to the new signatures of
11532 emacs_write and emacs_gnutls_write. Do not attempt to store
11533 a byte offset into an 'int'; it might overflow.
9587a89d 11534 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11535
3e047f51
PE
11536 * sound.c: Don't assume sizes fit in 'int'.
11537 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11538 Return EMACS_INT, not int.
3e047f51 11539 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11540 Accept EMACS_INT, not int.
11541 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11542 record read return values.
11543
cc39a9db
BK
115442011-04-15 Ben Key <bkey76@gmail.com>
11545
c9d0ec6d
JB
11546 * keyboard.c (Qundefined): Don't declare static since it is used
11547 in nsfns.m.
11548 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11549 static since they are used in nsfont.m.
cc39a9db 11550
6c60eb9f
SM
115512011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11552
11553 * process.c (Qprocessp): Don't declare static.
11554 * lisp.h (Qprocessp): Declare again.
11555
7990b61a
JB
115562011-04-15 Juanma Barranquero <lekktu@gmail.com>
11557
11558 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11559
5d4cb038
PE
115602011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11561
8bd7b830 11562 Improve C-level modularity by making more things 'static'.
cd64ea1d 11563
e3b27b31
PE
11564 Don't publish debugger-only interfaces to other modules.
11565 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11566 (verify_bytepos, count_markers): Move decls to the only modules
11567 that need them.
11568 * region-cache.h (pp_cache): Likewise.
11569 * window.h (check_all_windows): Likewise.
11570 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11571
5d4cb038
PE
11572 * sysdep.c (croak): Now static, if
11573 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11574 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
11575
11576 * alloc.c (refill_memory_reserve): Now static if
11577 !defined REL_ALLOC || defined SYSTEM_MALLOC.
11578 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 11579
e87b6180
PE
11580 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11581 Define only if USE_LUCID.
11582
ac64929e
PE
11583 * xrdb.c (x_customization_string, x_rm_string): Now static.
11584
6f37259d
PE
11585 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11586 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11587
1683e3ab
PE
11588 * xdisp.c (draw_row_with_mouse_face): Now static.
11589 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11590
de9c2632
PE
11591 * window.h (check_all_windows): Mark externally visible.
11592
2b96acb7
PE
11593 * window.c (window_deletion_count): Now static.
11594
11595 * undo.c: Make symbols static if they're not exported.
11596 (last_undo_buffer, last_boundary_position, pending_boundary):
11597 Now static.
11598
50436f33
PE
11599 * textprop.c (interval_insert_behind_hooks): Now static.
11600 (interval_insert_in_front_hooks): Likewise.
11601
64520e5c
PE
11602 * term.c: Make symbols static if they're not exported.
11603 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11604 (max_frame_lines, tty_set_terminal_modes):
11605 (tty_reset_terminal_modes, tty_turn_off_highlight):
11606 (get_tty_terminal): Now static.
11607 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11608 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 11609 HAVE_WINDOW_SYSTEM.
64520e5c
PE
11610 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11611 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11612
1fa53021
PE
11613 * sysdep.c: Make symbols static if they're not exported.
11614 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11615 Now static.
11616 (sigprocmask_set, full_mask): Remove; unused.
11617 (wait_debugging): Mark as visible.
11618 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11619 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11620
d4b43b22
PE
11621 * syntax.c (syntax_temp): Define only if !__GNUC__.
11622
b7c513d0
PE
11623 * sound.c (current_sound_device, current_sound): Now static.
11624
989b29ad
PE
11625 * search.c (searchbufs, searchbuf_head): Now static.
11626
13a55a78
PE
11627 * scroll.c (scroll_cost): Remove; unused.
11628 * dispextern.h (scroll_cost): Remove decl.
11629
de68a1fc
PE
11630 * region-cache.h (pp_cache): Mark as externally visible.
11631
40ccffa6
PE
11632 * process.c: Make symbols static if they're not exported.
11633 (process_tick, update_tick, create_process, chan_process):
11634 (Vprocess_alist, proc_buffered_char, datagram_access):
11635 (fd_callback_data, send_process_frame, process_sent_to): Now static.
11636 (deactivate_process): Mark defn as static, as well as decl.
11637 * lisp.h (create_process): Remove decl.
11638 * process.h (chan_process, Vprocess_alist): Remove decls.
11639
ad64fc97
PE
11640 * print.c: Make symbols static if they're not exported.
11641 (print_depth, new_backquote_output, being_printed, print_buffer):
11642 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11643 (print_interval, print_number_index, initial_stderr_stream):
11644 Now static.
11645 * lisp.h (Fprinc): Remove decl.
11646 (debug_output_compilation_hack): Mark as externally visible.
11647
adddb265
PE
11648 * sysdep.c (croak): Move decl from here to syssignal.h.
11649 * syssignal.h (croak): Put it here, so the API can be checked when
11650 'croak' is called from dissociate_if_controlling_tty.
11651
1717ede2
PE
11652 * minibuf.c: Make symbols static if they're not exported.
11653 (minibuf_save_list, choose_minibuf_frame): Now static.
11654 * lisp.h (choose_minibuf_frame): Remove decl.
11655
fa5fb2bc
PE
11656 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11657
1e3890d1
PE
11658 * lread.c: Make symbols static if they're not exported.
11659 (read_objects, initial_obarray, oblookup_last_bucket_number):
11660 Now static.
11661 (make_symbol): Remove; unused.
11662 * lisp.h (initial_obarray, make_symbol): Remove decls.
11663
8a1414fa
PE
11664 * keyboard.c: Make symbols static if they're not exported.
11665 (single_kboard, recent_keys_index, total_keys, recent_keys):
11666 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11667 (this_single_command_key_start, echoing, last_auto_save):
11668 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11669 (command_loop, echo_now, keyboard_init_hook, help_char_p):
11670 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11671 (Vlispy_mouse_stem, double_click_count):
11672 Now static.
11673 (force_auto_save_soon): Define only if SIGDANGER.
11674 (ignore_mouse_drag_p): Now static if
11675 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11676 (print_help): Remove; unused.
11677 (stop_character, last_timer_event): Mark as externally visible.
11678 * keyboard.h (ignore_mouse_drag_p): Declare only if
11679 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11680 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11681 * lisp.h (echoing): Remove decl.
11682 (force_auto_save_soon): Declare only if SIGDANGER.
11683 * xdisp.c (redisplay_window): Simplify code, to make it more
11684 obvious that ignore_mouse_drag_p is not accessed if !defined
11685 USE_GTK && !defined HAVE_NS.
11686
93ea6e8f
PE
11687 * intervals.c: Make symbols static if they're not exported.
11688 (merge_properties_sticky, merge_interval_right, delete_interval):
11689 Now static.
11690 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11691
77382fcc
PE
11692 * insdel.c: Make symbols static if they're not exported.
11693 However, leave prepare_to_modify_buffer alone. It's never
11694 called from outside this function, but that appears to be a bug.
11695 (combine_after_change_list, combine_after_change_buffer):
4889fc82 11696 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
11697 (adjust_after_replace_noundo): Remove; unused.
11698 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 11699 (signal_before_change): Remove decls.
77382fcc 11700
9306c32e
PE
11701 * indent.c (val_compute_motion, val_vmotion): Now static.
11702
cd44d2eb
PE
11703 * image.c: Make symbols static if they're not exported.
11704 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11705 if USE_GTK.
11706 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11707 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11708
ad9a7a06
PE
11709 * fringe.c (standard_bitmaps): Now static.
11710 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11711
81626931
PE
11712 * frame.c: Make symbols static if they're not exported.
11713 (x_report_frame_params, make_terminal_frame): Now static.
11714 (get_frame_param): Now static, unless HAVE_NS.
11715 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11716 (x_get_resource_string): Remove; not used.
11717 * frame.h (make_terminal_frame, x_report_frame_params):
11718 (x_get_resource_string); Remove decls.
11719 (x_fullscreen_adjust): Declare only if WINDOWSNT.
11720 * lisp.h (get_frame_param): Declare only if HAVE_NS.
11721
239f9db9
PE
11722 * font.c, fontset.c: Make symbols static if they're not exported.
11723 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11724 (FACE_SUITABLE_FOR_CHAR_P): Use it.
11725 * font.c (font_close_object): Now static.
11726 * font.h (font_close_object): Remove.
11727 * fontset.c (FONTSET_OBJLIST): Remove.
11728 (free_realized_fontset) #if-0 the body, which does nothing.
11729 (face_suitable_for_char_p): #if-0, as it's never called.
11730 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
11731 * xfaces.c (face_at_string_position):
11732 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
11733 since 0 is always ASCII.
11734
dfcf3579
PE
11735 * fns.c (weak_hash_tables): Now static.
11736
5045092b
PE
11737 * fileio.c: Make symbols static if they're not exported.
11738 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11739 (Vwrite_region_annotation_buffers): Now static.
11740
57a96f5c
PE
11741 * eval.c: Make symbols static if they're not exported.
11742 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
11743 * lisp.h (backtrace_list): Remove decl.
11744
35f08c38
PE
11745 * emacs.c: Make symbols static if they're not exported.
11746 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
11747 (fatal_error_code, fatal_error_signal_hook, standard_args):
11748 Now static.
11749 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11750 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11751 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11752 * lisp.h (fatal_error_signal_hook): Remove decl.
11753 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11754
f44bd759
PE
11755 * editfns.c: Move a (normally-unused) function to its only use.
11756 * editfns.c, lisp.h (get_operating_system_release): Remove.
11757 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11758 worth the hassle of breaking this out.
11759
b532497d
PE
11760 * xterm.c: Make symbols static if they're not exported.
11761 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
11762 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
11763 (x_destroy_window, x_delete_display):
11764 Now static.
11765 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
11766 (x_mouse_leave): Remove; unused.
11767 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
11768 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
11769 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
11770 Remove decls.
11771 (x_mouse_leave): Declare only if WINDOWSNT.
11772 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
11773 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
11774 USE_X_TOOLKIT.
11775
1675728f
PE
11776 * ftxfont.c: Make symbols static if they're not exported.
11777 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
11778 HAVE_FREETYPE.
11779 * font.h (ftxfont_driver): Likewise.
11780
e4cebfca
PE
11781 * xfns.c: Make symbols static if they're not exported.
11782 (x_last_font_name, x_display_info_for_name):
11783 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
11784 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
11785 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
11786 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
11787 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
11788 (last_show_tip_args): Now static.
11789 (xic_defaut_fontset, xic_create_fontsetname): Define only if
11790 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
11791 (x_screen_planes): Remove; unused.
11792 * dispextern.h (x_screen_planes): Remove decl.
11793
5bf46f05
PE
11794 * dispnew.c: Make symbols static if they're not exported.
11795 * dispextern.h (redraw_garbaged_frames, scrolling):
11796 (increment_row_positions): Remove.
11797 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
11798 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
11799 Now static.
11800 (redraw_garbaged_frames): Remove; unused.
11801
435f4c28
PE
11802 * xfaces.c: Make symbols static if they're not exported.
11803 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
11804 Remove decls.
11805 * xterm.h (defined_color): Remove decls.
11806 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
11807 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
11808 (menu_face_changed_default, defined_color, free_realized_face):
11809 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
11810 (ascii_face_of_lisp_face): Remove; unused.
11811
8524aef3
PE
11812 * xdisp.c: Make symbols static if they're not exported.
11813 * dispextern.h (scratch_glyph_row, window_box_edges):
11814 (glyph_to_pixel_coords, set_cursor_from_row):
11815 (get_next_display_element, set_iterator_to_next):
11816 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
11817 (show_mouse_face): Remove decls
11818 * frame.h (message_buf_print): Likewise.
11819 * lisp.h (pop_message, set_message, check_point_in_composition):
11820 Likewise.
11821 * xterm.h (set_vertical_scroll_bar): Likewise.
11822 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
11823 (message_buf_print, scratch_glyph_row, displayed_buffer):
11824 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
11825 (get_next_display_element, show_mouse_face, window_box_edges):
11826 (frame_to_window_pixel_xy, check_point_in_composition):
11827 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
11828 (glyph_to_pixel_coords): Remove; unused.
11829
16390cd2
PE
11830 * dired.c (file_name_completion): Now static.
11831
11832 * dbusbind.c (xd_in_read_queued_messages): Now static.
11833
a25f4dfa
PE
11834 * lisp.h (circular_list_error, FOREACH): Remove; unused.
11835 * data.c (circular_list_error): Remove.
11836
14a9c8df
PE
11837 * commands.h (last_point_position, last_point_position_buffer):
11838 (last_point_position_window): Remove decls.
11839 * keyboard.c: Make these variables static.
11840
04f2d78b
CB
11841 * coding.h (coding, code_convert_region, encode_coding_gap):
11842 Remove decls.
74ab6df5
PE
11843 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
11844 (iso_code_class, detect_coding, code_convert_region): Now static.
11845 (encode_coding_gap): Remove; unused.
11846
38dfbee1
PE
11847 * chartab.c (chartab_chars, chartab_bits): Now static.
11848
a2cb4e63
PE
11849 * charset.h (charset_iso_8859_1): Remove decl.
11850 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
11851 Now static.
11852
127198fd
PE
11853 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
11854 * ccl.c (Vccl_program_table): Now static.
11855 (check_ccl_update): Remove; unused.
11856
d85b608f
PE
11857 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
11858 * category.h: ... from here.
11859 * category.c (check_category_table, set_category_set): Now static.
11860
31cd66f3
PE
11861 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
11862 * lisp.h: Remove these decls.
11863
c358e587
PE
11864 * buffer.c (buffer_count): Remove unused var.
11865
e78aecca
PE
11866 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
11867 so that it's not optimized away.
11868 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
11869 * dispextern.h (bidi_dump_cached_states): Remove, since it's
11870 exported only to the debugger.
11871
e192d7d3 11872 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 11873 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 11874
92470028
PE
11875 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
11876 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
11877 was inaccessible from Lisp.
11878 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
11879 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
11880
244ed907
PE
11881 alloc.c: Import and export fewer symbols, and remove unused items.
11882 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
11883 is defined.
11884 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
11885 it's not optimized away by whole-program optimization.
11886 (message_enable_multibyte, free_misc): Remove.
11887 (catchlist, handlerlist, mark_backtrace):
11888 Declare only if BYTE_MARK_STACK.
11889 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
11890 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
11891 (message_enable_multibyte): Remove decl.
11892 (free_misc, interval_free_list, float_block, float_block_index):
11893 (n_float_blocks, float_free_list, cons_block, cons_block_index):
11894 (cons_free_list, last_marked_index):
11895 Now static.
11896 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
11897 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
11898 (mark_backtrace): Define only if BYTE_MARK_STACK.
11899 * xdisp.c (message_enable_multibyte): Now static.
11900
61c2b50e 11901 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
11902 This makes it easier for human readers (and static analyzers)
11903 to see whether these variables are used from other modules.
11904 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
11905 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
11906 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
11907 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
11908 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
11909 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
11910 * xmenu.c, xselect.c:
11911 Declare Q* vars static if they are not used in other modules.
11912 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
11913 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
11914 Remove decls of unexported vars.
11915 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
11916
95c82688
PE
11917 * lisp.h (DEFINE_FUNC): Make sname 'static'.
11918
16a97296
PE
11919 Make Emacs functions such as Fatom 'static' by default.
11920 This makes it easier for human readers (and static analyzers)
11921 to see whether these functions can be called from other modules.
11922 DEFUN now defines a static function. To make the function external
11923 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
11924 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
11925 (Finit_image_library):
16a97296
PE
11926 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
11927 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
11928 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
11929 Remove decls, since these functions are now static.
11930 (Funintern, Fget_internal_run_time): New decls, since these functions
11931 were already external.
95c82688 11932
16a97296
PE
11933 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
11934 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
11935 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
11936 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
11937 * keyboard.c, keymap.c, lread.c:
11938 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
11939 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
11940 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
11941 Mark functions with DEFUE instead of DEFUN,
11942 if they are used in other modules.
11943 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
11944 decls for now-static functions.
11945 * buffer.h (Fdelete_overlay): Remove decl.
11946 * callproc.c (Fgetenv_internal): Mark as internal.
11947 * composite.c (Fremove_list_of_text_properties): Remove decl.
11948 (Fcomposition_get_gstring): New forward static decl.
11949 * composite.h (Fcomposite_get_gstring): Remove decl.
11950 * dired.c (Ffile_attributes): New forward static decl.
11951 * doc.c (Fdocumntation_property): New forward static decl.
11952 * eval.c (Ffetch_bytecode): New forward static decl.
11953 (Funintern): Remove extern decl; now in .h file where it belongs.
11954 * fileio.c (Fmake_symbolic_link): New forward static decl.
11955 * image.c (Finit_image_library): New forward static decl.
11956 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
11957 * intervals.h (Fprevious_property_change):
11958 (Fremove_list_of_text_properties): Remove decls.
11959 * keyboard.c (Fthis_command_keys): Remove decl.
11960 (Fcommand_execute): New forward static decl.
11961 * keymap.c (Flookup_key): New forward static decl.
11962 (Fcopy_keymap): Now static.
11963 * keymap.h (Flookup_key): Remove decl.
11964 * process.c (Fget_process): New forward static decl.
11965 (Fprocess_datagram_address): Mark as internal.
11966 * syntax.c (Fsyntax_table_p): New forward static decl.
11967 (skip_chars): Remove duplicate decl.
11968 * textprop.c (Fprevious_property_change): New forward static decl.
11969 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
11970 Now internal.
11971 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
11972 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
11973
785bbd42
PE
11974 * editfns.c (Fformat): Remove unreachable code.
11975
8b913b57
AS
119762011-04-14 Andreas Schwab <schwab@linux-m68k.org>
11977
11978 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
11979 change. (Bug#8496)
11980
a6744a35
EZ
119812011-04-13 Eli Zaretskii <eliz@gnu.org>
11982
11983 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
11984 when at ZV. (Bug#8487)
11985
e7974947
AS
119862011-04-12 Andreas Schwab <schwab@linux-m68k.org>
11987
baad03f0
AS
11988 * charset.c (Fclear_charset_maps): Use xfree instead of free.
11989 (Bug#8437)
11990 * keyboard.c (parse_tool_bar_item): Likewise.
11991 * sound.c (sound_cleanup, alsa_close): Likewise.
11992 * termcap.c (tgetent): Likewise.
11993 * xfns.c (x_default_font_parameter): Likewise.
11994 * xsettings.c (read_and_apply_settings): Likewise.
11995
e7974947
AS
11996 * alloc.c (overrun_check_malloc, overrun_check_realloc)
11997 (overrun_check_free): Protoize.
11998
28272684
PE
119992011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12000
12001 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12002 since callers should never pass a negative size.
12003 Change the signature to match that of plain 'read' and 'write'; see
12004 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12005 * lisp.h: Update prototypes of emacs_write and emacs_read.
12006
11997c76
EZ
120072011-04-11 Eli Zaretskii <eliz@gnu.org>
12008
12009 * xdisp.c (redisplay_window): Don't try to determine the character
12010 position of the scroll margin if the window start point w->startp
e896f03c 12011 is outside the buffer's accessible region. (Bug#8468)
11997c76 12012
8a2cbd72
EZ
120132011-04-10 Eli Zaretskii <eliz@gnu.org>
12014
12015 Fix write-region and its subroutines for buffers > 2GB.
12016 * fileio.c (a_write, e_write): Modify declaration of arguments and
12017 local variables to support buffers larger than 2GB.
12018 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12019
12020 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12021 argument, local variables, and return value.
12022
12023 * lisp.h: Update prototypes of emacs_write and emacs_read.
12024
12025 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12026
4073e537 120272011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 12028
1ebfdcb6
PE
12029 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12030
b2ded58d
PE
12031 Fix more problems found by GCC 4.6.0's static checks.
12032
7d66342c
PE
12033 * xdisp.c (vmessage): Use a better test for character truncation.
12034
bbf47d44
PE
12035 * charset.c (load_charset_map): <, not <=, for optimization,
12036 and to avoid potential problems with integer overflow.
9248994d 12037 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 12038 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 12039 * editfns.c (Fformat): Likewise.
1e69125e 12040 * syntax.c (skip_chars): Likewise.
3befa583 12041
e3019616
PE
12042 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12043 This also lets GCC 4.6.0 generate slightly better loop code.
12044
becfa255
PE
12045 * callint.c (Fcall_interactively): <, not <=, for optimization.
12046 (Fcall_interactively): Count the number of arguments produced,
12047 not the number of arguments given. This is simpler and lets GCC
12048 4.6.0 generate slightly better code.
12049
dae0cd48
PE
12050 * ftfont.c: Distingish more carefully between FcChar8 and char.
12051 The previous code passed unsigned char * to a functions like
12052 strlen and xstrcasecmp that expect char *, which does not
12053 conform to the C standard.
12054 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
12055 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
12056 char * when the C standard requires it.
12057
76032d70
PE
12058 * keyboard.c (read_char): Remove unused var.
12059
eb3f1cc8
PE
12060 * eval.c: Port to Windows vsnprintf (Bug#8435).
12061 Include <limits.h>.
12062 (SIZE_MAX): Define if the headers do not.
12063 (verror): Do not give up if vsnprintf returns a negative count.
12064 Instead, grow the buffer. This ports to Windows vsnprintf, which
12065 does not conform to C99. Problem reported by Eli Zaretskii.
12066 Also, simplify the allocation scheme, by avoiding the need for
12067 calling realloc, and removing the ALLOCATED variable.
12068
70476b54
PE
12069 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
12070
12020a9e
PE
12071 Remove invocations of doprnt, as Emacs now uses vsnprintf.
12072 But keep the doprint source code for now, as we might revamp it
12073 and use it again (Bug#8435).
ea6c7ae6
PE
12074 * lisp.h (doprnt): Remove.
12075 * Makefile.in (base_obj): Remove doprnt.o.
12076 * deps.mk (doprnt.o): Remove.
12077
5fdb398c
PE
12078 error: Print 32- and 64-bit integers portably (Bug#8435).
12079 Without this change, on typical 64-bit hosts error ("...%d...", N)
12080 was used to print both 32- and 64-bit integers N, which relied on
12081 undefined behavior.
61bdb816 12082 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
12083 * lisp.h (error, verror): Mark as printf-like functions.
12084 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
12085 Report overflow in size calculations when allocating printf buffer.
12086 Do not truncate output string at its first null byte.
12087 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
12088 Truncate the output at a character boundary, since vsnprintf does not
12089 do that.
12090 * charset.c (check_iso_charset_parameter): Convert internal
12091 character to string before calling 'error', since %c now has the
12092 printf meaning.
12093 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
12094 overflow when computing char to be passed to 'error'. Do not
12095 pass Lisp_Object to 'error'; pass the integer instead.
12096 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
12097 formatted with plain %d.
12098
b189fa66
PE
12099 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
12100
bff87ef0
PE
12101 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
12102
7e2cac20
PE
12103 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12104
ce4d90b5
PE
12105 * xterm.c (x_catch_errors): Remove duplicate declaration.
12106
266c9547
PE
12107 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12108
79c49ad2
PE
12109 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12110
368f4090
JM
121112011-04-10 Jim Meyering <meyering@redhat.com>
12112
12113 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12114 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12115 return ssize_t not "int", and use size_t as the buffer length.
12116 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12117 * gnutls.h: Update declarations.
12118 * process.c (read_process_output): Use ssize_t, to match.
12119 (send_process): Likewise.
12120
a32d4040
CY
121212011-04-09 Chong Yidong <cyd@stupidchicken.com>
12122
12123 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12124
8546720e 121252011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12126
04f2d78b
CB
12127 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12128 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12129
8546720e
GM
12130 * xterm.c (handle_one_xevent):
12131 * xmenu.c (create_and_show_popup_menu):
12132 * xselect.c (x_decline_selection_request)
12133 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12134
0a2f5c1a 121352011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12136
12137 Fix some uses of `int' instead of EMACS_INT.
12138 * search.c (string_match_1, fast_string_match)
12139 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12140 (scan_buffer, find_next_newline_no_quit)
12141 (find_before_next_newline, search_command, Freplace_match)
12142 (Fmatch_data): Make some `int' variables be EMACS_INT.
12143
12144 * xdisp.c (display_count_lines): 3rd argument and return value now
12145 EMACS_INT. All callers changed.
12146 (pint2hrstr): Last argument is now EMACS_INT.
12147
12148 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12149 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12150 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12151 (decode_coding_utf_16, decode_coding_emacs_mule)
12152 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12153 (decode_coding_ccl, decode_coding_charset)
12154 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12155 (decode_coding_iso_2022, decode_coding_emacs_mule)
12156 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12157 <char_offset, last_offset>: Declare EMACS_INT.
12158 (encode_coding_utf_8, encode_coding_utf_16)
12159 (encode_coding_emacs_mule, encode_invocation_designation)
12160 (encode_designation_at_bol, encode_coding_iso_2022)
12161 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12162 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12163 Declare EMACS_INT.
12164 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12165 (encode_invocation_designation): Last argument P_NCHARS is now
12166 EMACS_INT.
12167 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12168 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12169
12170 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12171 All users changed.
12172
12173 * ccl.c (Fccl_execute_on_string): Declare some variables
12174 EMACS_INT.
12175
8546720e 121762011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12177
12178 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12179
4e19a977
CS
121802011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12181
12182 * process.c (Fformat_network_address): Doc fix.
12183
87302331
R
121842011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12185
ee7683eb 12186 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12187
cbb59342
CY
121882011-04-08 Chong Yidong <cyd@stupidchicken.com>
12189
12190 * keyboard.c (read_char): Call Lisp function help-form-show,
12191 instead of using internal_with_output_to_temp_buffer.
12192 (Qhelp_form_show): New var.
e0d38eeb 12193 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12194
12195 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12196
12197 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12198
e67a13ab
CY
121992011-04-06 Chong Yidong <cyd@stupidchicken.com>
12200
04f2d78b
CB
12201 * process.c (Flist_processes): Remove to Lisp.
12202 (list_processes_1): Delete.
e67a13ab 12203
973f782d
EZ
122042011-04-06 Eli Zaretskii <eliz@gnu.org>
12205
7c106b1e
EZ
12206 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12207
973f782d
EZ
12208 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12209
41cf7d1a 122102011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12211
ca23cc88
PE
12212 Fix more problems found by GCC 4.6.0's static checks.
12213
f390e2d5
PE
12214 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12215
42eea0d0
PE
12216 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12217
b69769da 12218 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12219
f9541e84
PE
12220 * xdisp.c (vmessage): Mark as a printf-like function.
12221
13841b55
PE
12222 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12223
c136c10f
PE
12224 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12225
5e2d4a30
PE
12226 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12227 printf-like functions.
12228 (tiff_load): Add casts to remove these marks before passing them
12229 to system-supplied API.
12230
583f48b9
PE
12231 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12232
b25d760e
PE
12233 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12234 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12235 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12236 directly, rather than having caller test rule sign. This avoids
12237 some unnecessary tests.
12238 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12239 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12240 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 12241
bc7b6697 12242 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 12243 (xfont_open): Avoid unnecessary tests.
bc7b6697 12244
27ccc379
PE
12245 * composite.c (composition_gstring_put_cache): Use unsigned integer.
12246
dcd5c89a
PE
12247 * composite.h, composite.c (composition_gstring_put_cache):
12248 Use EMACS_INT, not int, for length.
12249
b13a45c6
PE
12250 * composite.h (COMPOSITION_DECODE_REFS): New macro,
12251 breaking out part of COMPOSITION_DECODE_RULE.
12252 (COMPOSITION_DECODE_RULE): Use it.
12253 * composite.c (get_composition_id): Remove unused local vars,
12254 by using the new macro.
12255
1e792e4d
PE
12256 * textprop.c (set_text_properties_1): Change while to do-while,
12257 since the condition is always true at first.
12258
dc6c6455 12259 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
12260 (interval_deletion_adjustment): Return unsigned value.
12261 All uses changed.
dc6c6455 12262
aba7731a
PE
12263 * process.c (list_processes_1, create_pty, read_process_output):
12264 (exec_sentinel): Remove vars that were set but not used.
afd4052b 12265 (create_pty): Remove unnecessary "volatile"s.
bc57d757 12266 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 12267 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 12268 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 12269
fdfc4bf3
PE
12270 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12271
fca8fe46 12272 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 12273 (update_syntax_table): Use unsigned instead of int.
fca8fe46 12274
06a0259a 12275 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 12276 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 12277 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 12278
e7b9e80f
PE
12279 * print.c (print_error_message): Avoid int overflow.
12280
56201685
PE
12281 * font.c (font_list_entities): Redo for clarity,
12282 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12283
78834453 12284 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 12285 (font_score): Avoid potential overflow in diff calculation.
78834453 12286
0bc0b309 12287 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12288 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12289
e610eaca
PE
12290 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12291
b895abce
PE
12292 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12293 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12294 can always succeed if overflow has undefined behavior.
12295
1f1d9321 12296 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12297 (wordify): Omit three unnecessary tests.
1f1d9321 12298
c59478bc
PE
12299 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12300 All callers changed. This avoids the need for an unused var.
12301
79b73827
PE
12302 * casefiddle.c (casify_region): Remove var that is set but not used.
12303
a4db5dfe
PE
12304 * dired.c (file_name_completion): Remove var that is set but not used.
12305
43aae36e
PE
12306 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12307
2a47c44d 12308 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12309 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12310
a37c69bf
PE
12311 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12312 Check for integer overflow on size calculations.
12313
328ab8e7
PE
12314 * buffer.c (Fprevious_overlay_change): Remove var that is set
12315 but not used.
12316
e5a2a5cb
PE
12317 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12318 Remove vars that are set but not used.
8d84a6eb 12319 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12320 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12321
a60e5f68
PE
12322 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12323
f661cb61 12324 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12325 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12326
f0397f5a
PE
12327 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12328 that are set but not used.
12329
8664db06 12330 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12331 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12332
6abdaa4a
PE
12333 * xselect.c (x_get_local_selection, x_handle_property_notify):
12334 Remove vars that are set but not used.
12335
0ce7538d 12336 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12337 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12338
9ae848fc
PE
12339 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12340 Remove var that is set but not used.
0b918413
PE
12341 (scroll_bar_windows_size): Now size_t, not int.
12342 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12343 Check for overflow.
9ae848fc 12344
a5a62657
PE
12345 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12346 (map_tty_color) [!defined MSDOS]: Likewise.
12347
5c5cdd39
PE
12348 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12349
66ebf983
PE
12350 * coding.c: Remove vars that are set but not used.
12351 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12352 All callers changed.
12353 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12354 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12355 (decode_coding_charset): Remove vars that are set but not used.
12356
1be4d761
PE
12357 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12358 that is set but not used.
12359
47553fa8
PE
12360 * print.c (print_object): Remove var that is set but not used.
12361
1f7196bf 12362 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12363 The gnulib version avoids calling malloc in the usual case,
12364 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12365 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12366 * filelock.c (current_lock_owner): Likewise.
12367 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12368 * sysdep.c: Include allocator.h, careadlinkat.h.
12369 (emacs_no_realloc_allocator): New static constant.
12370 (emacs_readlink): New function.
fdb61804
PE
12371 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12372 ../lib/careadlinkat.h.
d1fdcab7 12373
f84c17c7
SM
123742011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12375
12376 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12377 first non-nil return value).
12378
ef3862ad
JD
123792011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12380
12381 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12382 if not defined (Bug#8403).
12383
376a7006
JB
123842011-04-02 Juanma Barranquero <lekktu@gmail.com>
12385
12386 * xdisp.c (display_count_lines): Remove parameter `start',
12387 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12388 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12389 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12390 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12391 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12392 and thereabouts. All callers changed.
12393 (get_per_char_metric): Remove parameter `f', unused since
12394 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12395
6ca3801d
JM
123962011-04-02 Jim Meyering <meyering@redhat.com>
12397
12398 do not dereference NULL upon failed strdup
12399 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12400 (ns_get_family): Likewise.
12401
d8e2b5ba
JB
124022011-04-02 Juanma Barranquero <lekktu@gmail.com>
12403
12404 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12405
8c74fcbd
JD
124062011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12407
12408 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12409 later (Bug#8403).
12410
7200d79c
SM
124112011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12412
03408648 12413 Add lexical binding.
7200d79c 12414
03408648
SM
12415 * window.c (Ftemp_output_buffer_show): New fun.
12416 (Fsave_window_excursion):
12417 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12418
12419 * lread.c (lisp_file_lexically_bound_p): New function.
12420 (Fload): Bind Qlexical_binding.
12421 (readevalloop): Remove `evalfun' arg.
12422 Bind Qinternal_interpreter_environment.
12423 (Feval_buffer): Bind Qlexical_binding.
12424 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12425 Mark as dynamic.
12426 (syms_of_lread): Declare `lexical-binding'.
12427
12428 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12429
12430 * keyboard.c (eval_dyn): New fun.
12431 (menu_item_eval_property): Use it.
ca105506
SM
12432
12433 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12434
03408648
SM
12435 * fns.c (concat, mapcar1): Accept byte-code-functions.
12436
12437 * eval.c (Fsetq): Handle lexical vars.
12438 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12439 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12440 (FletX, Flet): Obey lexical binding.
12441 (Fcommandp): Handle closures.
12442 (Feval): New `lexical' arg.
12443 (eval_sub): New function extracted from Feval. Use it almost
12444 everywhere where Feval was used. Look up vars in lexical env.
12445 Handle closures.
12446 (Ffunctionp): Move from subr.el.
12447 (Ffuncall): Handle closures.
12448 (apply_lambda): Remove `eval_flags'.
12449 (funcall_lambda): Handle closures and new byte-code-functions.
12450 (Fspecial_variable_p): New function.
12451 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12452 but without exporting it to Lisp.
23aba0ea 12453
23aba0ea 12454 * doc.c (Fdocumentation, store_function_docstring):
03408648 12455 * data.c (Finteractive_form): Handle closures.
23aba0ea 12456
03408648
SM
12457 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12458 interactive spec.
ba83908c 12459
04f2d78b
CB
12460 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12461 New byte-codes.
03408648
SM
12462 (exec_byte_code): New function extracted from Fbyte_code to handle new
12463 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12464
03408648 12465 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12466
03408648 12467 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12468
e2abce01
JB
124692011-03-31 Juanma Barranquero <lekktu@gmail.com>
12470
12471 * xdisp.c (redisplay_internal): Fix prototype.
12472
63696a73 124732011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12474
63696a73 12475 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12476 (try_scrolling): Use it when setting scroll_limit.
12477 Limit scrolling to 100 screen lines.
63696a73
EZ
12478 (redisplay_window): Even when falling back on "recentering",
12479 position point in the window according to scroll-conservatively,
12480 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12481
12482 (try_scrolling): When point is above the window, allow searching
12483 as far as scroll_max, or one screenful, to compute vertical
12484 distance from PT to the scroll margin position. This prevents
12485 try_scrolling from unnecessarily failing when
12486 scroll-conservatively is set to a value slightly larger than the
12487 window height. Clean up the case of PT below the margin at bottom
12488 of window: scroll_max can no longer be INT_MAX. When aggressive
12489 scrolling is in use, don't let point enter the opposite scroll
12490 margin as result of the scroll.
12491 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12492 threshold of 100 lines for never-recentering scrolling.
12493
e4cc2dfc
JB
124942011-03-31 Juanma Barranquero <lekktu@gmail.com>
12495
12496 * dispextern.h (move_it_by_lines):
12497 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12498 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12499 (message_log_check_duplicate): Remove parameters `prev_bol' and
12500 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12501 (redisplay_internal): Remove parameter `preserve_echo_area',
12502 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12503
12504 * indent.c (Fvertical_motion):
12505 * window.c (window_scroll_pixel_based, Frecenter):
12506 Don't pass `need_y_p' to `move_it_by_lines'.
12507
1c470562
SM
125082011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12509
44f230aa
SM
12510 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12511 steal a few bits to be more compact.
12512 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12513 Remove unneeded casts.
12514
1c470562
SM
12515 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12516
888adce9
ZK
125172011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12518
12519 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12520 binding" message (bug#7967).
12521
f838ed7b
PE
125222011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12523
77861b95
PE
12524 Fix more problems found by GCC 4.6.0's static checks.
12525
de6dbc14
PE
12526 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12527 Remove unused local var.
12528
f838ed7b
PE
12529 * editfns.c (Fmessage_box): Remove unused local var.
12530
792c7b2b
PE
12531 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12532 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12533 Omit unused local vars.
c499e557 12534 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12535 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12536 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12537 Omit unused local var.
12538
ba0165e1
PE
12539 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12540 Don't assume string length fits in int.
32ad8845 12541 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12542 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12543
3c59b4c9
PE
12544 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12545 instead of alloca (Bug#8344).
12546
a3eed478 12547 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12548 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12549
eb4d412d
PE
12550 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12551
1658b401
PE
12552 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12553 concerns.
12554
12555 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12556
12557 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12558
9a2c6e05
PE
12559 * keyboard.c (syms_of_keyboard): Use the same style as later
12560 in this function when indexing through an array. This also
12561 works around GCC bug 48267.
12562
03d0a109
PE
12563 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12564
44f730c8
PE
12565 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12566
fe75f926
PE
12567 * chartab.c (sub_char_table_ref_and_range): Redo for slight
12568 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12569
ffa8c828
PE
12570 * keyboard.c, keyboard.h (num_input_events): Now size_t.
12571 This avoids undefined behavior on integer overflow, and is a bit
12572 more convenient anyway since it is compared to a size_t variable.
12573
c5101a77
PE
12574 Variadic C functions now count arguments with size_t, not int.
12575 This avoids an unnecessary limitation on 64-bit machines, which
12576 caused (substring ...) to crash on large vectors (Bug#8344).
12577 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12578 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 12579 All variadic functions and their callers changed accordingly.
c5101a77
PE
12580 (struct gcpro.nvars): Now size_t, not int. All uses changed.
12581 * data.c (arith_driver, float_arith_driver): Likewise.
12582 * editfns.c (general_insert_function): Likewise.
12583 * eval.c (struct backtrace.nargs, interactive_p)
12584 (internal_condition_case_n, run_hook_with_args, apply_lambda)
12585 (funcall_lambda, mark_backtrace): Likewise.
12586 * fns.c (concat): Likewise.
12587 * frame.c (x_set_frame_parameters): Likewise.
12588 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12589 0 if not found, not -1. All callers changed.
12590
dd3f25f7
PE
12591 * alloc.c (garbage_collect): Don't assume stack size fits in int.
12592 (stack_copy_size): Now size_t, not int.
12593 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12594
461c2ab9
JB
125952011-03-28 Juanma Barranquero <lekktu@gmail.com>
12596
12597 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12598 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12599 All callers changed.
12600
12601 * lisp.h (multibyte_char_to_unibyte):
12602 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12603 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12604 * character.h (CHAR_TO_BYTE8):
12605 * cmds.c (internal_self_insert):
12606 * editfns.c (general_insert_function):
12607 * keymap.c (push_key_description):
12608 * search.c (Freplace_match):
12609 * xdisp.c (message_dolog, set_message_1): All callers changed.
12610
f6d62986
SM
126112011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12612
12613 * keyboard.c (safe_run_hook_funcall): New function.
12614 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12615 don't set the hook to nil, but remove the offending function instead.
12616 (Qcommand_hook_internal): Remove, unused.
12617 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12618 Vcommand_hook_internal.
12619
12620 * eval.c (enum run_hooks_condition): Remove.
12621 (funcall_nil, funcall_not): New functions.
12622 (run_hook_with_args): Call each function through a `funcall' argument.
12623 Remove `cond' argument, now redundant.
12624 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12625 (Frun_hook_with_args_until_failure): Adjust accordingly.
12626 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12627
1db5b1ad
JB
126282011-03-28 Juanma Barranquero <lekktu@gmail.com>
12629
12630 * dispextern.h (string_buffer_position): Remove declaration.
12631
12632 * print.c (strout): Remove parameter `multibyte', unused since
12633 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
12634
12635 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12636 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12637 All callers changed.
12638
12639 * w32.c (_wsa_errlist): Use braces for struct initializers.
12640
12641 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12642 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12643 All callers changed.
12644 (string_buffer_position): Likewise. Also, make static (it's never
12645 used outside xdisp.c).
12646 (cursor_row_p): Remove parameter `w', unused since
12647 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
12648 (decode_mode_spec): Remove parameter `precision', introduced during
12649 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12650 All callers changed.
12651
5ffb62aa
JD
126522011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12653
12654 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12655
461c2ab9 126562011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
12657
12658 * nsterm.m (ns_menu_bar_is_hidden): New variable.
12659 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12660 (ns_update_auto_hide_menu_bar): New functions.
12661 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12662 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12663 ns_constrain_all_frames.
12664 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12665 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12666
5c380ffb
JD
126672011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12668
12669 * nsmenu.m (runDialogAt): Remove argument to timer_check.
12670
9af30bdf
GM
126712011-03-27 Glenn Morris <rgm@gnu.org>
12672
12673 * syssignal.h: Replace RETSIGTYPE with void.
12674 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12675 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12676 Replace SIGTYPE with void everywhere.
12677 * s/usg5-4-common.h (SIGTYPE): Remove definition.
12678 * s/template.h (SIGTYPE): Remove commented out definition.
12679
e2abce01
JB
126802011-03-26 Eli Zaretskii <eliz@gnu.org>
12681
12682 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12683 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12684
f868cd8a
JB
126852011-03-26 Juanma Barranquero <lekktu@gmail.com>
12686
59eb0929
JB
12687 * w32.c (read_unc_volume): Use parameter `henum', instead of
12688 global variable `wget_enum_handle'.
12689
12690 * keymap.c (describe_vector): Remove parameters `indices' and
12691 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12692 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12693
f868cd8a
JB
12694 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12695
12696 * keyboard.c (timer_check): Remove parameter `do_it_now',
12697 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12698 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12699 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12700
12701 * keyboard.c (read_char):
12702 * w32menu.c (w32_menu_display_help):
12703 * xmenu.c (show_help_event, menu_help_callback):
12704 Adjust calls to `show_help_echo'.
12705
12706 * gtkutil.c (xg_maybe_add_timer):
12707 * keyboard.c (readable_events):
12708 * process.c (wait_reading_process_output):
12709 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12710
12711 * insdel.c (adjust_markers_gap_motion):
12712 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12713 (gap_left, gap_right): Don't call it.
12714
2ecf6fdb
CY
127152011-03-25 Chong Yidong <cyd@stupidchicken.com>
12716
12717 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12718 incurred during fontification.
12719
6b1f9ba4
JB
127202011-03-25 Juanma Barranquero <lekktu@gmail.com>
12721
12722 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12723 (DEFVAR_PER_BUFFER): Don't pass it.
12724
12725 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12726 (scrolling_window): Don't pass it.
12727
0f4a96b5
JB
127282011-03-25 Juanma Barranquero <lekktu@gmail.com>
12729
12730 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12731
12732 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12733 and `suffix'.
12734 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12735 of variables specific to SELinux and computation of `encoded_absname'.
12736
12737 * image.c (XPutPixel): Remove unused variable `height'.
12738
12739 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12740
12741 * unexw32.c (get_section_info): Remove unused variable `section'.
12742
12743 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
12744 (system_process_attributes): Remove unused variable `sess'.
12745 (sys_read): Remove unused variable `err'.
12746
12747 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
12748 (w32_wnd_proc): Remove unused variable `isdead'.
12749 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12750 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12751 (x_create_tip_frame): Remove unused variable `tem'.
12752
12753 * w32inevt.c (w32_console_read_socket):
12754 Remove unused variable `no_events'.
12755
12756 * w32term.c (x_draw_composite_glyph_string_foreground):
12757 Remove unused variable `width'.
12758
1149507c
JB
127592011-03-24 Juanma Barranquero <lekktu@gmail.com>
12760
12761 * w32term.c (x_set_glyph_string_clipping):
12762 Don't pass uninitialized region to CombineRgn.
12763
9c88f339
JB
127642011-03-23 Juanma Barranquero <lekktu@gmail.com>
12765
12766 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
12767 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
12768 (Fx_close_connection): Remove unused variable `i'.
12769
12770 * w32font.c (w32font_draw): Return number of glyphs.
12771 (w32font_open_internal): Remove unused variable `i'.
12772 (w32font_driver): Add missing initializer.
12773
12774 * w32menu.c (utf8to16): Remove unused variable `utf16'.
12775 (fill_in_menu): Remove unused variable `items_added'.
12776
12777 * w32term.c (last_mouse_press_frame): Remove static global variable.
12778 (w32_clip_to_row): Remove unused variable `f'.
12779 (x_delete_terminal): Remove unused variable `i'.
12780
12781 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
12782 (NOTHING): Remove unused static global variable.
12783 (uniscribe_check_otf): Remove unused variable `table'.
12784 (uniscribe_font_driver): Add missing initializers.
12785
dee091a3
JD
127862011-03-23 Julien Danjou <julien@danjou.info>
12787
12788 * term.c (Fsuspend_tty, Fresume_tty):
12789 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
12790 * window.c (temp_output_buffer_show):
12791 * insdel.c (signal_before_change):
12792 * frame.c (Fhandle_switch_frame):
12793 * fileio.c (Fdo_auto_save):
12794 * emacs.c (Fkill_emacs):
12795 * editfns.c (save_excursion_restore):
12796 * cmds.c (internal_self_insert):
12797 * callint.c (Fcall_interactively):
12798 * buffer.c (Fkill_all_local_variables):
12799 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
12800 Use Frun_hooks.
0f4a96b5 12801 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 12802 unconditionally since it does the check itself.
dee091a3 12803
2c520ab5 128042011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 12805
c9c49752
PE
12806 Fix more problems found by GCC 4.5.2's static checks.
12807
8abc3f12
PE
12808 * coding.c (encode_coding_raw_text): Avoid unnecessary test
12809 the first time through the loop, since we know p0 < p1 then.
12810 This also avoids a gcc -Wstrict-overflow warning.
12811
a2d26660
PE
12812 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
12813 leading to a memory leak, possible in functions like
12814 load_charset_map_from_file that can allocate an unbounded number
b12ef411 12815 of objects (Bug#8318).
a2d26660 12816
916c72e9
PE
12817 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
12818 that could (at least in theory) be that large.
12819
19ab8a18
PE
12820 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
12821 This is less likely to overflow, and avoids undefined behavior if
12822 overflow does occur. All callers changed. Use strtoul to scan
12823 for the unsigned long integer.
b7cbbd6f
PE
12824 (pint2hrstr): Simplify and tune code slightly.
12825 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 12826
f0641eff
PE
12827 * scroll.c (do_scrolling): Work around GCC bug 48228.
12828 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
12829
7f650bb9
PE
12830 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
12831 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
12832 (validate_x_resource_name): Simplify count usage.
12833 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 12834
37dd57d1
PE
12835 * fileio.c (Fcopy_file): Report error if fchown or fchmod
12836 fail (Bug#8306).
81e56e61 12837
699979fc 12838 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 12839
401bf9b4
PE
12840 * process.c (Fmake_network_process): Use socklen_t, not int,
12841 where POSIX says socklen_t is required in portable programs.
12842 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 12843 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
12844 (Fmake_network_process, server_accept_connection):
12845 (wait_reading_process_output, read_process_output):
12846 Likewise.
12847
b93aacde
PE
12848 * process.c: Rename or move locals to avoid shadowing.
12849 (list_processes_1, Fmake_network_process):
12850 (read_process_output_error_handler, exec_sentinel_error_handler):
12851 Rename or move locals.
4dc343ee 12852 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 12853 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 12854 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 12855 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 12856 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 12857
af8a867c 12858 Make tparam.h and terminfo.c consistent.
44f230aa
SM
12859 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
12860 Include tparam.h instead, since it declares them.
af8a867c
PE
12861 * cm.h (PC): Remove extern decl; tparam.h now does this.
12862 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
12863 * terminfo.c: Include tparam.h, to check interfaces.
12864 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
12865 (tparam): Adjust signature to match interface in tparam.h;
12866 this removes some undefined behavior. Check that outstring and len
12867 are zero, which they always are with Emacs.
12868 * tparam.h (PC, BC, UP): New extern decls.
12869
0248044d 12870 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 12871 (xftfont_open): Rename locals to avoid shadowing.
0248044d 12872
8ff096c1 12873 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
12874 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
12875 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 12876 (ftfont_list): Remove unused local.
49eaafba
PE
12877 (get_adstyle_property, ftfont_pattern_entity):
12878 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
12879 Rename locals to avoid shadowing.
8ff096c1 12880
e2be39f6
PE
12881 * xfont.c (xfont_list_family): Mark var as initialized.
12882
c9735e30
PE
12883 * xml.c (make_dom): Now static.
12884
8f5201ae
PE
12885 * composite.c (composition_compute_stop_pos): Rename local to
12886 avoid shadowing.
b246f932
PE
12887 (composition_reseat_it): Remove unused locals.
12888 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 12889 (composition_update_it): Mark var as initialized.
11b61122
PE
12890 (find_automatic_composition): Mark vars as initialized,
12891 with a FIXME (Bug#8290).
8f5201ae 12892
760fbc2c
PE
12893 character.h: Rename locals to avoid shadowing.
12894 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
12895 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
12896 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
12897 (BUF_DEC_POS): Be more systematic about renaming local temporaries
12898 to avoid shadowing.
12899
ff08eb85
PE
12900 * textprop.c (property_change_between_p): Remove; unused.
12901
fc7bf025
PE
12902 * intervals.c (interval_start_pos): Now static.
12903
235d7abc
PE
12904 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
12905
44f230aa
SM
12906 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
12907 Rename locals to avoid shadowing.
3e7d6594 12908
50060332
PE
12909 * sound.c (wav_play, au_play, Fplay_sound_internal):
12910 Fix pointer signedness.
d01f234b 12911 (alsa_choose_format): Remove unused local var.
c83b8872
PE
12912 (wav_play): Initialize a variable to 0, to prevent undefined
12913 behavior (Bug#8278).
50060332 12914
c4fc4e30
PE
12915 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
12916
918436ed
PE
12917 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
12918
c939f91b
PE
12919 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
12920 clobbering (Bug#8298).
b9c7f648
PE
12921 * sysdep.c (sys_subshell): Likewise.
12922 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 12923
6bd8c144
PE
12924 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
12925 This should get cleaned up, so that child_setup has the
12926 same signature on all platforms.
12927
7710357c 12928 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 12929 (relocate_fd): Rename locals to avoid shadowing.
7710357c 12930
c59da222
CY
129312011-03-22 Chong Yidong <cyd@stupidchicken.com>
12932
12933 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
12934 not to be necessary, and produces flickering.
12935
66b87493
GM
129362011-03-20 Glenn Morris <rgm@gnu.org>
12937
12938 * config.in: Remove file.
12939
45b6f6d5
JB
129402011-03-20 Juanma Barranquero <lekktu@gmail.com>
12941
12942 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
12943 are now in src/globals.h.
12944 (syms_of_minibuf): Remove spurious & from previous change.
12945
cd394be1 129462011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
12947
12948 * minibuf.c (completing-read-function): New variable.
12949 (completing-read-default): Rename from completing-read.
12950 (completing-read): Call completing-read-function.
12951
b14e3e21
CY
129522011-03-19 Juanma Barranquero <lekktu@gmail.com>
12953
12954 * xfaces.c (Fx_load_color_file):
12955 Read color file from absolute filename (bug#8250).
12956
f2b726e6
JB
129572011-03-19 Juanma Barranquero <lekktu@gmail.com>
12958
12959 * makefile.w32-in: Update dependencies.
12960
09f6ff02
EZ
129612011-03-17 Eli Zaretskii <eliz@gnu.org>
12962
12963 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
12964
29a6015a
PE
129652011-03-17 Paul Eggert <eggert@cs.ucla.edu>
12966
a3a6c54e
PE
12967 Fix more problems found by GCC 4.5.2's static checks.
12968
b766f867
PE
12969 * process.c (make_serial_process_unwind, send_process_trap):
12970 (sigchld_handler): Now static.
12971
be02381c
PE
12972 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
12973 That way, the code declares only the vars that it needs.
12974 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
12975 * s/cygwin.h (PTY_ITERATION): Likewise.
12976 * s/darwin.h (PTY_ITERATION): Likewise.
12977 * s/gnu-linux.h (PTY_ITERATION): Likewise.
12978
57048744
PE
12979 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
12980 * process.c (allocate_pty): Don't declare stb unless it's needed.
12981
7914961c 12982 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
12983 (CONSTANTLIM): Remove; unused.
12984 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
12985 Define only if needed.
7914961c 12986
b3967b18
PE
12987 * unexelf.c (unexec): Name an expression,
12988 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
12989 Use a different way to cause a compilation error if anyone uses
12990 n rather than nn, a way that does not involve shadowing.
73366a00 12991 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 12992
29a6015a
PE
12993 * deps.mk (unexalpha.o): Remove; unused.
12994
43cfc33e 12995 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 12996 * unexec.h: New file.
ce701a33
PE
12997 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
12998 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
12999 Depend on unexec.h.
13000 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13001 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13002 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 13003 Change as necessary to match prototype in unexec.h.
ce701a33 13004
01f44d5a
PE
13005 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13006 shadowing.
4f63c6bb 13007 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 13008
a6670b0b
PE
13009 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13010 Rename locals to avoid shadowing.
13011
cef2010d 13012 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 13013 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 13014
d4d7173a
PE
13015 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13016
f08b802a
PE
13017 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13018 warning when compiling print.c.
13019
3ddb0639
PE
13020 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13021 instead of using an uninitialized var.
5ad03b97 13022 (font_sort_entities): Mark var as initialized.
3ddb0639 13023
170a2692
PE
13024 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13025
e663c700
PE
13026 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13027 pointers to constants.
89bc529a 13028 (font_parse_fcname): Remove unused vars.
7b81e2d0 13029 (font_delete_unmatched): Now static.
ea838e10 13030 (font_get_spec): Remove; unused.
13a547c6
PE
13031 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13032 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13033 Rename or move locals to avoid shadowing.
e663c700 13034
2a80c887 13035 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 13036 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 13037
1384fa33 13038 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 13039 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 13040
8b2c52e9
PE
13041 * alloc.c (mark_backtrace): Move decl from here ...
13042 * lisp.h: ... to here, so that it can be checked.
13043
475545b5 13044 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 13045 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
13046 (lisp_indirect_variable): Name an expression,
13047 to avoid gcc -Wbad-function-cast warning.
1faed8ae 13048 (Fdefvar): Rename locals to avoid shadowing.
475545b5 13049
b1349114 13050 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 13051 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 13052 Use const pointer when appropriate.
b1349114 13053
a2928364
PE
13054 * lisp.h (get_system_name, get_operating_system_release):
13055 Move decls here, to check interfaces.
13056 * process.c (get_operating_system_release): Move decl to lisp.h.
13057 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
13058 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
13059 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
13060 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
13061 (Fformat_time_string, Fencode_time, Finsert_char):
13062 (Ftranslate_region_internal, Fformat):
13063 Rename or remove local vars to avoid shadowing.
9710023e 13064 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 13065
a415e694
PE
13066 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
13067 avoid shadowing.
13068
8ef4622d
PE
13069 * lisp.h (eassert): Check that the argument compiles, even if
13070 ENABLE_CHECKING is not defined.
13071
946f9a5b
PE
13072 * data.c (Findirect_variable): Name an expression, to avoid
13073 gcc -Wbad-function-cast warning.
112396d6 13074 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 13075 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
13076 (Fmake_variable_buffer_local, Fmake_local_variable):
13077 Mark variables as initialized.
52746918 13078 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 13079
e5aab7e7 13080 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
13081 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
13082 Rename locals to avoid shadowing.
dff45157
PE
13083 (mark_stack): Move local variables into the #ifdef region where
13084 they're used.
7bc26fdb
PE
13085 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
13086 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
13087 needed otherwise.
13088 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
13089 (GC_STRING_CHARS): Remove; not used.
d40d4be1 13090 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 13091
e5aab7e7
PE
13092 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
13093 avoids undefined behavior in theory.
13094
4da60324
PE
13095 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
13096
88043301
PE
13097 Use functions, not macros, for up- and down-casing (Bug#8254).
13098 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13099 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
13100 to use the following functions instead of these macros.
13101 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
13102 EMACS_INT, since callers assume the returned value fits in int.
13103 (upcase1): Likewise, for UPCASE_TABLE.
13104 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13105 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13106 the race-condition problem in the old DOWNCASE.
88043301 13107
19ed5445
PE
13108 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13109 Rename locals to avoid shadowing.
13110 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13111 (regex_compile, re_search_2, re_match_2_internal):
13112 Remove unused local vars.
952db0d7
PE
13113 (FREE_VAR): Rewrite so as not to use empty "else",
13114 which gcc can warn about.
da053e48 13115 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13116 (RETALLOC_IF): Define only if needed.
13117 (WORDCHAR_P): Likewise. This one is never needed, but is used
13118 only in a comment talking about a compiler bug, so put inside
13119 the #if 0 of that comment.
13120 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13121 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13122 Remove; unused.
19ed5445 13123
1f3561e4 13124 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13125 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13126 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13127
ded6f8f7
PE
13128 * search.c (simple_search): Remove unused var.
13129
dbd37a95
PE
13130 * dired.c (compile_pattern): Move decl from here ...
13131 * lisp.h: ... to here, so that it can be checked.
13132 (struct re_registers): New forward decl.
13133
7e47afad
PE
13134 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13135
85f24f61
PE
13136 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13137 All uses changed.
13138 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13139 Rename locals to avoid shadowing.
5671df8f 13140 (Fvertical_motion): Mark locals as initialized.
85f24f61 13141
181aa2be 13142 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13143 (casify_region): Mark local as initialized.
181aa2be 13144
930d429c
PE
13145 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13146
7082eac6
PE
13147 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13148 New macros, so that the caller can use some names other than
13149 gcpro1, gcpro2, etc.
13150 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13151 of the new macros.
13152 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13153 argument, for consistency with GCPRO2_VAR, etc: it is now the
13154 prefix of the variable, not the variable itself. All uses
13155 changed.
38b2c076
PE
13156 * dired.c (directory_files_internal, file_name_completion):
13157 Rename locals to avoid shadowing.
13158
15206ed9
PE
13159 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13160 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13161 dired.c's scmp function, had undefined behavior.
13162 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13163 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13164 * buffer.h: ... to here, because these macros use current_buffer,
13165 and the new implementation with inline functions needs to have
13166 current_buffer in scope now, rather than later when the macros
13167 are used.
13168 (downcase, upcase1): New static inline functions.
13169 (DOWNCASE, UPCASE1): Reimplement using these functions.
13170 This avoids undefined behavior in expressions like
13171 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13172 from race conditions in accessing the global variables
13173 case_temp1 and case_temp2.
13174 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13175 * lisp.h (case_temp1, case_temp2): Remove their decls.
13176 * character.h (ASCII_CHAR_P): Move from here ...
13177 * lisp.h: ... to here, so that the inline functions mentioned
13178 above can use them.
13179
4a6bea26
PE
13180 * dired.c (directory_files_internal_unwind): Now static.
13181
f14b7e14
PE
13182 * fileio.c (file_name_as_directory, directory_file_name):
13183 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13184 Now static.
2893f146
PE
13185 (file_name_as_directory): Use const pointers when appropriate.
13186 (Fexpand_file_name): Likewise. In particular, newdir might
13187 point at constant storage, so make it a const pointer.
fd4ead52 13188 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13189 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13190 signedness issues.
f839df0c
PE
13191 (Fset_file_times, Finsert_file_contents, auto_save_error):
13192 Rename locals to avoid shadowing.
f14b7e14 13193
5716756e 13194 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13195 (Ftry_completion, Fall_completions): Rename or remove locals
13196 to avoid shadowing.
5716756e 13197
b4c3046a
PE
13198 * marker.c (bytepos_to_charpos): Remove; unused.
13199
b45db522
PE
13200 * lisp.h (verify_bytepos, count_markers): New decls,
13201 so that gcc does not warn that these functions aren't declared.
13202
85876d07
PE
13203 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13204 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13205 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13206 (copy_text): Remove unused local var.
85876d07 13207
03d78a21 13208 * filelock.c (within_one_second): Now static.
b3dd38ab 13209 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13210
5df8f01b
PE
13211 * buffer.c (fix_overlays_before): Mark locals as initialized.
13212 (fix_start_end_in_overlays): Likewise. This function should be
13213 simplified by using pointers-to-pointers, but that's a different
13214 matter.
b1d876f1 13215 (switch_to_buffer_1): Now static.
8f54f30a
PE
13216 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13217 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13218
a70072c9 13219 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13220 Fix pointer signedness issue.
edced198
PE
13221 (sys_subshell): Mark local as volatile if checking for lint,
13222 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13223 (MAXPATHLEN): Define only if needed.
a70072c9 13224
a0977c44
PE
13225 * process.c (serial_open, serial_configure): Move decls from here ...
13226 * systty.h: ... to here, so that they can be checked.
13227
a884fdcc
PE
13228 * fns.c (get_random, seed_random): Move extern decls from here ...
13229 * lisp.h: ... to here, so that they can be checked.
13230
604efe86 13231 * sysdep.c (reset_io): Now static.
b8950c94 13232 (wait_for_termination_signal): Remove; unused.
604efe86 13233
38fc62d9
PE
13234 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13235 (copy_keymap_item, append_key, push_text_char_description):
13236 Now static.
1004a21a 13237 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13238 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13239 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13240 (describe_map_tree):
13241 Rename locals to avoid shadowing.
38fc62d9 13242
2f2650da
PE
13243 * keyboard.c: Declare functions static if they are not used elsewhere.
13244 (echo_char, echo_dash, cmd_error, top_level_2):
13245 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
13246 (read_char, kbd_buffer_get_event, make_lispy_position):
13247 (make_lispy_event, make_lispy_movement, apply_modifiers):
13248 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13249 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13250 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 13251 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 13252 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 13253
a053e86c 13254 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
13255 (mark_kboards): Move decl here ...
13256 * alloc.c (mark_kboards): ... from here.
a053e86c 13257
4752793e
PE
13258 * lisp.h (force_auto_save_soon): New decl.
13259
74f10ca7 13260 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
13261 (DEFINE_DUMMY_FUNCTION): New macro.
13262 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13263 Use it.
c03cd23f
PE
13264 (main): Add casts to avoid warnings
13265 if GCC considers string literals to be constants.
74f10ca7 13266
022e70d4
PE
13267 * lisp.h (fatal_error_signal): Add decl, since it's exported.
13268
59d6fe83
PE
13269 * dbusbind.c: Pointer signedness fixes.
13270 (xd_signature, xd_append_arg, xd_initialize):
13271 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13272 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13273 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13274 (Fdbus_register_signal): Use SSDATA when the context wants char *.
13275
78320123
PE
13276 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13277 if GCC considers string literals to be constants.
49cebcca 13278 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 13279
35ac2a97
SM
132802011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
13281
fb103ca9
SM
13282 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13283 (print_preprocess, print_object): New macro to fix last change.
13284
35ac2a97
SM
13285 * print.c (print_preprocess): Don't forget font objects.
13286
62973b41
JB
132872011-03-16 Juanma Barranquero <lekktu@gmail.com>
13288
13289 * emacs.c (USAGE3): Doc fixes.
13290
0e48bb22
AS
132912011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13292
13293 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13294 structure.
13295
7684e57b
JB
132962011-03-14 Juanma Barranquero <lekktu@gmail.com>
13297
13298 * lisp.h (VWindow_system, Qfile_name_history):
13299 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13300 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13301 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13302
13303 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13304 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13305
13306 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13307 * w32console.c (detect_input_pending, read_input_pending)
13308 (encode_terminal_code):
13309 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13310 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13311 (w32_system_caret_y, Qfile_name_history):
13312 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13313 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13314 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13315 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13316 * w32proc.c (Qlocal, report_file_error):
13317 * w32term.c (Vwindow_system, updating_frame):
13318 * w32uniscribe.c (initialized, uniscribe_font_driver):
13319 Remove unneeded extern declarations.
13320
2aa46d6c
CY
133212011-03-14 Chong Yidong <cyd@stupidchicken.com>
13322
c96bbc66 13323 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13324
cffc6f3b
CY
133252011-03-13 Chong Yidong <cyd@stupidchicken.com>
13326
13327 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13328 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13329 These macros can no longer be used for assignment.
13330
44f230aa
SM
13331 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13332 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13333 (record_buffer_markers, fetch_buffer_markers): New functions for
13334 recording and fetching special buffer markers.
13335 (set_buffer_internal_1, set_buffer_temp): Use them.
13336
13337 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13338
13339 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13340
13341 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13342 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13343
13344 * xdisp.c (hscroll_window_tree):
13345 (reconsider_clip_changes): Use PT instead of BUF_PT.
13346
d251f04b
EZ
133472011-03-13 Eli Zaretskii <eliz@gnu.org>
13348
13349 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13350 $(EMACS_ROOT)/lib/intprops.h.
13351
f0c77cd1
PE
133522011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13353
3eca4629
PE
13354 Fix more problems found by GCC 4.5.2's static checks.
13355
7c86ee98
PE
13356 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13357 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13358 (xg_free_frame_widgets): Make it clear that a local variable is
13359 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13360 (gdk_window_get_screen): Make it clear that this macro is needed
13361 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13362 (int_gtk_range_get_value): New function, which avoids a diagnostic
13363 from gcc -Wbad-function-cast.
13364 (xg_set_toolkit_scroll_bar_thumb): Use it.
13365 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13366 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13367 (get_utf8_string, xg_get_file_with_chooser):
13368 Rename locals to avoid shadowing.
13369 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13370
41729b81
PE
13371 * xgselect.c (xg_select): Remove unused var.
13372
f0c77cd1
PE
13373 * image.c (four_corners_best): Mark locals as initialized.
13374 (gif_load): Initialize transparent_p to zero (Bug#8238).
13375 Mark another local as initialized.
ec6cf4c6 13376 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13377
ce0ad53d 13378 * image.c (clear_image_cache): Now static.
d5d5a617 13379 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13380 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13381 (x_edge_detection): Remove unnecessary cast that
13382 gcc -Wbad-function-cast diagnoses.
2037898d 13383 (gif_load): Fix pointer signedness.
6ae141d6
PE
13384 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13385 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13386
33383987 133872011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13388
d32df629
PE
13389 Improve quality of tests for time stamp overflow.
13390 For example, without this patch (encode-time 0 0 0 1 1
13391 1152921504606846976) returns the obviously-bogus value (-948597
13392 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13393 reports time overflow. See
13394 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13395 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13396 * editfns.c: Include limits.h and intprops.h.
13397 (TIME_T_MIN, TIME_T_MAX): New macros.
13398 (time_overflow): Move earlier, to before first use.
13399 (hi_time, lo_time): New functions, for an accurate test for
13400 out-of-range times.
13401 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13402 (Fget_internal_run_time): Don't assume time_t fits in int.
13403 (make_time): Use list2 instead of Fcons twice.
13404 (Fdecode_time): More accurate test for out-of-range times.
13405 (check_tm_member): New function.
13406 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13407 (lisp_time_argument): Don't rely on undefined left-shift and
13408 right-shift behavior when checking for time stamp overflow.
8be6f318 13409
fe31d94c
PE
13410 * editfns.c (time_overflow): New function, refactoring common code.
13411 (Fformat_time_string, Fdecode_time, Fencode_time):
13412 (Fcurrent_time_string): Use it.
13413
8be6f318
PE
13414 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13415 * dired.c (make_time): Move to ...
13416 * editfns.c (make_time): ... here.
13417 * systime.h: Note the move.
13418
09d9db2c 134192011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13420
126bc0dc
YM
13421 * fringe.c (update_window_fringes): Remove unused variables.
13422
c47cbdfd
YM
13423 * unexmacosx.c (copy_data_segment): Also copy __got section.
13424 (Bug#8223)
13425
7ac80be9
EZ
134262011-03-12 Eli Zaretskii <eliz@gnu.org>
13427
c96bbc66 13428 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13429 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13430 Constify `char *' arguments and their references according to
13431 prototypes in tparam.h.
13432
ecb0f94d 13433 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13434
7ac80be9
EZ
13435 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13436 Adapt all references accordingly.
13437
13438 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13439
ef1fd07e
TT
134402011-03-11 Tom Tromey <tromey@redhat.com>
13441
13442 * buffer.c (syms_of_buffer): Remove obsolete comment.
13443
7ef4b50c
EZ
134442011-03-11 Eli Zaretskii <eliz@gnu.org>
13445
13446 * termhooks.h (encode_terminal_code): Declare prototype.
13447
13448 * msdos.c (encode_terminal_code): Don't declare prototype.
13449
13450 * term.c (encode_terminal_code): Now external again, used by
13451 w32console.c and msdos.c.
13452
44f230aa
SM
13453 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13454 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13455
4b1ec863 134562011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13457
1714f52b 13458 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13459
4b1ec863
PE
13460 * fringe.c (update_window_fringes): Mark locals as initialized
13461 (Bug#8227).
13462 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13463
524c7aa6
PE
13464 * alloc.c (mark_fringe_data): Move decl from here ...
13465 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13466 to check its interface.
13467 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13468
a5c0af81 13469 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13470 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13471 (fontset_font): Mark local as initialized.
a9a06e0b 13472 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13473
b4716021
PE
13474 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13475
811e9bac 13476 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13477 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13478 (x_own_selection, Fx_disown_selection_internal): Rename locals
13479 to avoid shadowing.
13480 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13481
7e3ab302
PE
13482 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13483 so that the caller can use some name other than gcpro1.
13484 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13485 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13486 (Fx_backspace_delete_keys_p):
13487 Use them to avoid shadowing, and rename vars to avoid shadowing.
13488 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13489 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13490 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13491 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13492 Remove unused locals.
7e3ab302
PE
13493 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13494 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13495 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13496 macros.
f78faa98 13497
e2b13473
PE
13498 * xterm.h (x_mouse_leave): New decl.
13499
77f23912
PE
13500 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13501 Remove unused functions.
cdf4ba58
PE
13502 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13503 (x_calc_absolute_position): Now static.
7411c686 13504 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13505 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13506 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13507 unless they are used.
38d0b34a
PE
13508 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13509 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13510 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13511 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13512 (x_error_catcher, x_connection_closed, x_error_handler):
13513 (x_error_quitter, xembed_send_message, x_iconify_frame):
13514 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13515 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13516 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13517
44f230aa
SM
13518 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13519 Rename or move locals to avoid shadowing.
6b463e58 13520 (tty_defined_color, merge_face_heights): Now static.
5967d051 13521 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13522 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13523 does not deduce is never used uninitialized.
73719eba
PE
13524 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13525 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13526
426994c3 13527 * terminal.c (store_terminal_param): Now static.
5489860b 13528
032f1620 13529 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13530 (set_frame_menubar): Remove unused local.
d4323972 13531 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13532 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13533 since they might point to immutable storage.
281585b0
PE
13534 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13535 since it's unused otherwise.
032f1620 13536
367c19e5 13537 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13538 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13539 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13540 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13541 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13542 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13543 does not deduce are never used uninitialized.
70739cbe 13544
07b48fa9
PE
13545 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13546
8868a238 13547 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13548 * window.c (window_loop, size_window):
13549 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13550
7e5cf297 13551 * window.c (display_buffer): Now static.
d6550a9f
PE
13552 (size_window): Mark variables that gcc -Wuninitialized
13553 does not deduce are never used uninitialized.
a586633d
PE
13554 * window.h (check_all_windows): New decl, to forestall
13555 gcc -Wmissing-prototypes diagnostic.
5b555da1 13556 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13557
f6095868
PE
13558 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13559 shadowing.
13560 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13561 Include <limits.h>.
13562 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13563 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13564 (load_charset_map): Mark variables that gcc -Wuninitialized
13565 does not deduce are never used uninitialized.
53df7c11 13566 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13567
f38b440c
PE
13568 * coding.c (coding_set_source, coding_set_destination):
13569 Use "else { /* comment */ }" rather than "else /* comment */;"
13570 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
13571 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13572 a block, when the outer 'i' will do.
13573 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13574 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13575 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13576 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13577 (Fdecode_sjis_char, Fdefine_coding_system_internal):
13578 Rename locals to avoid shadowing.
13579 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
13580 * coding.c (emacs_mule_char, encode_invocation_designation):
13581 Now static, since they're not used elsewhere.
413bb2db 13582 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 13583 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
13584 (decode_coding_emacs_mule): Mark variables that gcc
13585 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
13586 (detect_coding_iso_2022): Initialize a local variable that might
13587 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 13588 this initialization is needed. (Bug#8211)
5f58e762
PE
13589 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13590 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13591 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13592 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13593 Remove unused macros.
f38b440c 13594
232b38b9 13595 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 13596 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 13597 * character.c (string_count_byte8): Likewise.
232b38b9 13598
fb90da1b
PE
13599 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13600 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13601
fb93dbc2
PE
13602 * chartab.c (copy_sub_char_table): Now static, since it's not used
13603 elsewhere.
5c156ace
PE
13604 (sub_char_table_ref_and_range, char_table_ref_and_range):
13605 Rename locals to avoid shadowing.
bbcd0949 13606 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 13607
7d3b3862 13608 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 13609 (BIDI_BOB): Remove unused macro.
7d3b3862 13610
6be7d3da
PE
13611 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13612 deduce are never used uninitialized.
c2ed9c8b 13613 * term.c (encode_terminal_code): Likewise.
6be7d3da 13614
75f8807f 13615 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 13616
50938595
PE
13617 * tparam.h: New file.
13618 * term.c, tparam.h: Include it.
13619 * deps.mk (term.o, tparam.o): Depend on tparam.h.
13620 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13621 Move these decls to tparam.h, and make them agree with what
13622 is actually in tparam.c. The previous trick of using incompatible
13623 decls in different modules does not conform to the C standard.
13624 All callers of tparam changed to use tparam's actual API.
13625 * tparam.c (tparam1, tparam, tgoto):
13626 Use const pointers where appropriate.
13627
fbceeba2
PE
13628 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13629 * cm.h (struct cm): Likewise.
13630 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13631 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13632 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13633 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13634 (turn_on_face, init_tty): Likewise.
13635 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 13636
7f3f1250
PE
13637 * term.c (term_mouse_position): Rename local to avoid shadowing.
13638
e6ca6543
PE
13639 * alloc.c (mark_ttys): Move decl from here ...
13640 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13641
c40f8d15
AS
136422011-03-11 Andreas Schwab <schwab@linux-m68k.org>
13643
13644 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13645
cfe0661d
JB
136462011-03-09 Juanma Barranquero <lekktu@gmail.com>
13647
13648 * search.c (compile_pattern_1): Remove argument regp, unused since
13649 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13650 (compile_pattern): Don't pass it.
13651
0afb4571
J
136522011-03-08 Jan Djärv <jan.h.d@swipnet.se>
13653
13654 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13655 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13656 for ! HAVE_GTK3.
13657 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13658
13659 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13660
13661 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
13662 gdk_window_get_screen, gdk_window_get_geometry,
13663 gdk_x11_window_lookup_for_display and GDK_KEY_g.
13664 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13665 (xg_get_pixbuf_from_pixmap): New function.
13666 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13667 to Pixmap, take frame as parameter, remove GdkColormap parameter.
13668 Call xg_get_pixbuf_from_pixmap instead of
13669 gdk_pixbuf_get_from_drawable.
13670 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13671 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13672 (xg_check_special_colors): Use GtkStyleContext and its functions
13673 for HAVE_GTK3.
13674 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13675 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13676 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
13677 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13678 Call gtk_widget_get_preferred_size.
0afb4571
J
13679 (xg_frame_resized): gdk_window_get_geometry only takes 5
13680 parameters.
44f230aa
SM
13681 (xg_win_to_widget, xg_event_is_for_menubar):
13682 Call gdk_x11_window_lookup_for_display.
0afb4571
J
13683 (xg_set_widget_bg): New function.
13684 (delete_cb): New function.
895009e1 13685 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 13686 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
13687 (xg_set_background_color): Call xg_set_widget_bg.
13688 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13689 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13690 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13691 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13692 if ! HAVE_GTK3.
13693 (update_frame_tool_bar): Call gtk_widget_hide.
13694 (xg_initialize): Use GDK_KEY_g.
13695
13696 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13697 if ! HAVE_GTK3
13698 (x_session_initialize): Call gdk_x11_set_sm_client_id.
13699
13700 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13701 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13702 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13703
1c2cc4ef
JB
137042011-03-08 Juanma Barranquero <lekktu@gmail.com>
13705
13706 * w32xfns.c (select_palette): Check success of RealizePalette against
13707 GDI_ERROR, not zero.
13708
33383987 13709See ChangeLog.11 for earlier changes.
aac0c6e3
MR
13710
13711;; Local Variables:
13712;; coding: utf-8
aac0c6e3
MR
13713;; End:
13714
2f097256 13715 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
13716
13717 This file is part of GNU Emacs.
13718
13719 GNU Emacs is free software: you can redistribute it and/or modify
13720 it under the terms of the GNU General Public License as published by
13721 the Free Software Foundation, either version 3 of the License, or
13722 (at your option) any later version.
13723
13724 GNU Emacs is distributed in the hope that it will be useful,
13725 but WITHOUT ANY WARRANTY; without even the implied warranty of
13726 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13727 GNU General Public License for more details.
13728
13729 You should have received a copy of the GNU General Public License
13730 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.