Move GC_MARK_SECONDARY_STACK from src/s to configure
[bpt/emacs.git] / src / ChangeLog
CommitLineData
33d63ff4
GM
12012-07-13 Glenn Morris <rgm@gnu.org>
2
5b633342
GM
3 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
4
33d63ff4
GM
5 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
7
b55b9f85
JD
82012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9
0dc8cf50
JD
10 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
11 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
12 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
13 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
14 where appropriate.
15 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
16 as boolean expression.
17 (x_set_window_size): Remove unused variable toolbar.
18 (ns_get_color_default, ns_mod_to_lisp): Remove.
19 (ns_mouse_position): Remove unused variables xchar and ychar.
20 (ns_compute_glyph_string_overhangs): Remove unused variable face.
21 (ns_set_vertical_scroll_bar): Remove unused variable count.
22 (ns_delete_terminal): Remove unused variable i.
23 (ns_term_init): Remove unused variables r, g and b.
24 (mouseDown): Remove unused variable window.
25 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
26 (initFrameFromEmacs): Remove unused variable vbextra.
27 (mouseEntered): Remove unused variables p and dpyinfo.
28 (mouseExited): Remove unused variables p and r.
29 (ns_define_frame_cursor, ns_clear_frame_area)
30 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
31 (menuDown): Assign [sender tag] to variable and cast the variable.
32
33 * nsterm.h (menuDown): Add id as type to argument sender.
34 (ns_display_info_for_name): Add Lisp_Object argument.
35 (ns_term_init): Add Lisp_Object argument.
36 (ns_map_event_to_object): Add void argument.
37 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
38 prototype with arguments and only declare if __OBJC__.
39 (nxatoms_of_nsselect): Add void argument.
40 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
41 (ns_alloc_autorelease_pool): Add void argument.
42 (ns_release_autorelease_pool): Add void* argument.
43 (ns_get_defaults_value): Add const char* argument.
44
45 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
46 (initFromContents): Use SSDATA where appropriate.
47 (ns_update_menubar): Add braces to ambigous if-else.
48 (initWithTitle): Put () around assignment in if statement.
49 (ns_menu_show): Remove unused variables window and keymap.
50 (update_frame_tool_bar): Remove unused variable selected_p.
51 (initWithContentRect): Remove unused variable this_cmd_name.
52
53 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
54 appropriate.
55 (setXBMColor): Remove unused variable len.
56 (setPixmapData): Put () around assignment in loop statement.
57
58 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
59 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
60 where appropriate.
61 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
62 around assignment in loop statement.
63 (nsfont_open): Remove unused variable i.
64 (nsfont_open): Remove unused variable len.
65 (nsfont_draw): Remove unused variable cs.
66
67 * nsfns.m (x_set_icon_name, ns_set_name_internal)
68 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
69 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
70 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
71 (Fns_font_name, Fns_perform_service)
72 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
73 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
74 (ns_set_name): Remove unused variable view.
75 (x_set_menu_bar_lines): Remove unused variable olines.
76 (x_set_tool_bar_lines): Remove unused variable root_window.
77 (Fns_list_colors): Put () around assignment in while statement.
78 (Fns_perform_service): Remove unused variable len.
79 (Fns_display_usable_bounds): Remove unused variable top.
80 (syms_of_nsfns): Remove unused variable i.
81
b55b9f85
JD
82 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
83 memcpy (Bug#11907).
84
2277de02
JD
852012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
86
87 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
88 and free it with DestroyExceptionInfo (Bug#11558).
89
ef099b57
JB
902012-07-13 Juanma Barranquero <lekktu@gmail.com>
91
92 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
93 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
94 Set here, not in nt/config.nt.
95
ea814a5d
EZ
962012-07-13 Eli Zaretskii <eliz@gnu.org>
97
98 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
99 cursor overflow into the last glyph on display line when the right
100 fringe is off. (Bug#11832)
101
1a952767
PE
1022012-07-13 Paul Eggert <eggert@cs.ucla.edu>
103
104 * xdisp.c (produce_special_glyphs): Now static.
105 * dispextern.h (produce_special_glyphs): Remove decl.
106
983188fd
GM
1072012-07-13 Glenn Morris <rgm@gnu.org>
108
32fb4bb6
GM
109 * s/bsd-common, s/cygwin.h: Remove empty files.
110 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
111
983188fd
GM
112 * s/usg5-4-common.h (USG, USG5):
113 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
114 * s/sol2-6.h (SOLARIS2):
115 * s/irix6-5.h (IRIX6_5):
116 * s/hpux10-20.h (USG, USG5, HPUX):
117 * s/gnu-linux.h (USG, GNU_LINUX):
118 * s/freebsd.h (BSD_SYSTEM):
119 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
120 * s/cygwin.h (CYGWIN):
121 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
122 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
123
d1e68667 1242012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
125
126 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 127
6de0e799
GM
1282012-07-13 Glenn Morris <rgm@gnu.org>
129
739ae010
GM
130 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
131
dbee5793
GM
132 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
133
6de0e799
GM
134 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
135 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
136
b82da769
GM
1372012-07-12 Glenn Morris <rgm@gnu.org>
138
4fae5a7a 139 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
140
141 * process.c (init_process_emacs): Rename from init_process.
142 The old name is also the name of a Mach system call.
143 * lisp.h, emacs.c: Update for this name change.
144 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
145 longer needed.
146
5a979817
EZ
1472012-07-12 Eli Zaretskii <eliz@gnu.org>
148
149 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
150 memmove call that removes glyphs covered by the left truncation
151 glyph. Improve commentary.
152 (display_line): Fix display of continuation glyphs on GUI frames
153 when the right fringe is turned off and variable-size fonts are
154 used in the window. Move the code that appends a stretch glyph to
155 produce_special_glyphs, so that it could be used for truncation
156 and continuation glyphs alike.
157 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
158 glyph of a suitably computed width, to align the special glyphs at
159 the window margin. Code moved from display_line. (Bug#11832)
160
3e91a053
GM
1612012-07-12 Glenn Morris <rgm@gnu.org>
162
ba9e4b84
GM
163 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
164
165 * s/gnu-linux.h, s/hpux10-20.h:
166 Do not unconditionally define HAVE_XRMSETDATABASE.
167
3e91a053
GM
168 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
169
b300b1f4
PE
1702012-07-12 Paul Eggert <eggert@cs.ucla.edu>
171
172 Fix typos that broke OS X build.
173 Reported by Randal L. Schwartz in
174 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
175 * nsterm.m (ns_timeout): Add missing local decl.
176 (ns_get_color): snprintf -> sprintf, to fix typo.
177
6e777848
GM
1782012-07-12 Glenn Morris <rgm@gnu.org>
179
3f922c37
GM
180 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
181 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
182 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
183 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
184
0ab7b23a
GM
185 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
186 Move PTY_OPEN to configure.
187
6e777848
GM
188 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
189 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
190 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
191
4a7edc24
DA
1922012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
193
194 Use empty_unibyte_string where applicable.
195 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
196 * lread.c (read1): Likewise.
197 * xsettings.c (syms_of_xsettings): Likewise.
198
308aab79
GM
1992012-07-12 Glenn Morris <rgm@gnu.org>
200
42bd1719
GM
201 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
202 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
203 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
204 * s/hpux10-20.h (RUN_TIME_REMAP):
205 * s/bsd-common.h (TABDLY): Move to configure.
206
207 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
208
209 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
210
ea0bbd17 211 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 212 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
213
214 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 215
308aab79
GM
216 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
217 * s/template.h: Move NARROWPROTO to configure.
218
ee1cf5cf
GM
2192012-07-11 Glenn Morris <rgm@gnu.org>
220
30fe9bf4
GM
221 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
222 unused since 2011-01-17 change to systty.h.
223
ee1cf5cf
GM
224 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
225 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
226 Move HAVE_PTYS and HAVE_SOCKETS to configure.
227
63e47e07
PE
2282012-07-11 Paul Eggert <eggert@cs.ucla.edu>
229
230 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
231
c43fb4c3
GM
2322012-07-11 Glenn Morris <rgm@gnu.org>
233
234 * s/darwin.h, s/gnu-linux.h, s/template.h:
235 Move INTERRUPT_INPUT to configure.
236
e8df9267
DA
2372012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
238
239 Minor adjustments to interning code.
240 * lisp.h (intern, intern_c_string): Redefine as static inline
241 wrappers for intern_1 and intern_c_string_1, respectively.
242 (intern_1, intern_c_string_1): Rename prototypes.
2bce5643
DA
243 * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
244 Vobarray checking.
e8df9267
DA
245 * font.c (font_intern_prop): Likewise. Adjust comment.
246 * w32font.c (intern_font_name): Likewise.
247
34348bd4
AS
2482012-07-11 Andreas Schwab <schwab@linux-m68k.org>
249
d96a1e0c
AS
250 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
251
34348bd4
AS
252 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
253 of Fcar/Fcdr if possible.
254 * font.c (check_otf_features): Likewise.
255 * fontset.c (Fnew_fontset): Likewise.
256 * gnutls.c (Fgnutls_boot): Likewise.
257 * minibuf.c (read_minibuf): Likewise.
258 * msdos.c (IT_set_frame_parameters): Likewise.
259 * xmenu.c (Fx_popup_dialog): Likewise.
260 * w32menu.c (Fx_popup_dialog): Likewise.
261
c8add24e
GM
2622012-07-11 Glenn Morris <rgm@gnu.org>
263
4b575b3c
GM
264 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
265 since nothing has defined it on these platforms.
266
09f4e3b0
GM
267 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
268 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
269
172bedef
GM
270 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
271 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
272 Move CLASH_DETECTION to configure.
273
249685df
GM
274 * s/gnu.h: Remove file, which is now empty.
275
c8add24e
GM
276 * s/gnu.h, s/gnu-linux.h:
277 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
278
b41253a3
JW
2792012-07-11 John Wiegley <johnw@newartisans.com>
280
281 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
282 function attribute, so we only use it if it exists in the
283 compiler.
284
d923b542
DA
2852012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
286
287 Avoid call to strlen in fast_c_string_match_ignore_case.
288 * search.c (fast_c_string_match_ignore_case): Change to use
289 length argument. Adjust users accordingly.
290 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
291
5ebbef1d
PE
2922012-07-11 Paul Eggert <eggert@cs.ucla.edu>
293
bb352260
PE
294 Assume mkdir, rmdir.
295 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
296 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
297
57054ddd
PE
298 Assume rename.
299 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
300
b747d3f7
PE
301 Assume perror.
302 * s/hpux10-20.h (HAVE_PERROR): Remove.
303 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
304 Remove dummy definition, as this problem was obsolete long ago.
305
5ebbef1d
PE
306 Assume strerror.
307 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
308
984e7f30
DA
3092012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
310
311 Avoid calls to strlen in font processing functions.
312 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 313 (font_open_by_name): Change to use length argument. Adjust
984e7f30 314 users accordingly.
d923b542
DA
315 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
316 Adjust prototypes.
317 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
318 Change to return ptrdiff_t.
984e7f30
DA
319 (xfont_list_pattern, xfont_match): Use length returned by
320 xfont_decode_coding_xlfd.
321 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
322
20e94fdd
GM
3232012-07-11 Glenn Morris <rgm@gnu.org>
324
9d596af3
GM
325 * s/darwin.h, s/freebsd.h, s/netbsd.h:
326 Move DONT_REOPEN_PTY to configure.
327
20e94fdd
GM
328 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
329 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
330
e99a530f
PE
3312012-07-10 Paul Eggert <eggert@cs.ucla.edu>
332
22ffb973
PE
333 Remove "#define unix" that is no longer needed (Bug#11905).
334 * s/aix4-2.h (unix): Remove; no longer needed.
335
e9a9ae03
PE
336 EMACS_TIME simplification (Bug#11875).
337 This replaces macros (which typically do not work in GDB)
338 with functions, typedefs and enums, making the code easier to debug.
339 The functional style also makes code easier to read and maintain.
340 * systime.h: Include <sys/time.h> on all hosts, not just if
341 WINDOWSNT, since 'struct timeval' is needed in general.
342 (EMACS_TIME): Now a typedef, not a macro.
343 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
344 not macros.
345 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
346 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
347 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
348 (EMACS_TIME_LE): Now functions, not macros.
349 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
350 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
351 which are not functions. All uses rewritten to use:
352 (make_emacs_time): New function.
353 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
354 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
355 not functions. All uses rewritten to use the following, respectively:
356 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
357 (add_emacs_time, sub_emacs_time): New functions.
358 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
359 * fileio.c (Fcopy_file):
360 * xterm.c (XTflash): Get the current time closer to when it's used.
361 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
362
ffacb126
PE
363 * bytecode.c (targets): Suppress -Woverride-init warnings.
364
e99a530f
PE
365 Simplify by avoiding confusing use of strncpy etc.
366 * doc.c (Fsnarf_documentation):
367 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
368 * frame.c (Fmake_terminal_frame):
369 * gtkutil.c (get_utf8_string):
370 * lread.c (openp):
371 * nsmenu.m (ns_update_menubar):
372 * regex.c (regerror):
373 Prefer memcpy to strncpy and strncat when either will do.
374 * fileio.c (Fsubstitute_in_file_name):
375 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
376 (menu_separator_name_p):
377 * nsmenu.m (ns_update_menubar):
378 Prefer memcmp to strncmp when either will do.
379 * nsterm.m: Include <ftoastr.h>.
380 (ns_get_color):
381 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
382 Prefer snprintf to strncpy.
383 * nsterm.m (ns_term_init):
384 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
385 * nsterm.m (ns_term_init):
386 Avoid the need for strncpy, by using build_string or
387 make_unibyte_string directly. Use dtoastr, not snprintf.
388 * process.c (Fmake_network_process): Diagnose service names that
389 are too long, rather than silently truncating them or creating
390 non-null-terminated names.
391 (Fnetwork_interface_info): Likewise, for interface names.
392 * sysdep.c (system_process_attributes) [GNU_LINUX]:
393 Prefer sprintf to strncat.
394 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
395 Prefer vsnprintf to vsprintf + strncpy.
396
c59592b3
GM
3972012-07-10 Glenn Morris <rgm@gnu.org>
398
399 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
400 Clarify fallback case.
401
7d7bbefd
DA
4022012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
403
404 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
405 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
406 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 407 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
408 where argument type is known to be a Lisp_Cons.
409
3a4c8000
TT
4102012-07-10 Tom Tromey <tromey@redhat.com>
411
412 * bytecode.c (BYTE_CODE_THREADED): New macro.
413 (BYTE_CODES): New macro. Replaces all old byte-code defines.
414 (enum byte_code_op): New type.
415 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
416 (exec_byte_code): Use them. Use token threading when applicable.
417
2a0213a6
DA
4182012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
419
420 Optimize pure C strings initialization.
421 * lisp.h (make_pure_string): Fix prototype.
422 (build_pure_c_string): New function, defined as static inline. This
423 provides a better opportunity to optimize away calls to strlen when
424 the function is called with compile-time constant argument.
425 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
426 argument, adjust users accordingly. Use build_pure_c_string where
427 appropriate.
428 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
429 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
430 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
431
cb1caeaf
DA
4322012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
433
434 Avoid calls to strlen in miscellaneous functions.
435 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
436 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
437 * lread.c (openp): Likewise.
438
c293e30c
DA
4392012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
440
441 Avoid calls to strlen in path processing functions.
442 * fileio.c (file_name_as_directory): Add comment. Change to add
443 srclen argument and return the length of result. Adjust users
444 accordingly.
445 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 446 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
447 users accordingly.
448 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
449
9e059e3f
GM
4502012-07-10 Glenn Morris <rgm@gnu.org>
451
d02eb359
GM
452 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
453 Move PENDING_OUTPUT_COUNT definition to configure.
454
882cf227
GM
455 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
456 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
457 * s/gnu.h (DATA_START): Move definitions to configure.
458
af6e839f
GM
459 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
460 We include usg5-4-common.h, which defines them both.
461
40289a12
GM
462 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
463 O_RDONLY already includes it).
464
9e059e3f
GM
465 Stop ns builds setting the EMACSLOADPATH environment variable.
466 * nsterm.m (ns_load_path): Rename from ns_init_paths.
467 Now it does not set EMACSLOADPATH, just returns the load-path string.
468 * nsterm.h: Update accordingly.
469 * lread.c [HAVE_NS]: Include nsterm.h.
470 (init_lread) [HAVE_NS]: Use ns_load_path.
471 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
472
7c4e8ec0
GM
4732012-07-09 Glenn Morris <rgm@gnu.org>
474
d4f600ff
GM
475 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
476 since the included bsd-common.h does so.
477
cbb31951
GM
478 Stop ns builds setting the EMACSPATH environment variable.
479 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
480 (ns_init_paths): Do not set EMACSPATH.
481 * nsterm.h (ns_exec_path): Add it.
482 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
483 Use ns_exec_path.
484
7c4e8ec0
GM
485 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
486
26bccfae
PE
4872012-07-09 Paul Eggert <eggert@cs.ucla.edu>
488
a0bee46f
PE
489 * process.c (wait_reading_process_output): 'waitchannels' was unset
490 when read_kbd || !NILP (wait_for_cell); fix this.
491
5994c183
PE
492 Add GCC-style 'const' attribute to functions that can use it.
493 * character.h (char_resolve_modifier_mask):
494 * keyboard.h (make_ctrl_char):
495 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
496 (init_character_once, next_almost_prime, init_fns, init_image)
497 (flush_pending_output, init_sound):
498 * mem-limits.h (start_of_data):
499 * menu.h (finish_menu_items):
500 Add ATTRIBUTE_CONST.
501 * emacs.c (DEFINE_DUMMY_FUNCTION):
502 Declare the dummy function with ATTRIBUTE_CONST.
503 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
504 Add decls with ATTRIBUTE_CONST.
505
26bccfae
PE
506 Minor improvements to make_formatted_string.
507 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
508 where int is good enough, as vsprintf returns an int.
509 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
510
a8290ec3
DA
5112012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
512
513 Use make_formatted_string to avoid double length calculation.
514 * lisp.h (make_formatted_string): New prototype.
515 * alloc.c (make_formatted_string): New function.
516 * buffer.c (Fgenerate_new_buffer_name): Use it.
517 * dbus.c (syms_of_dbusbind): Likewise.
518 * editfns.c (Fcurrent_time_zone): Likewise.
519 * filelock.c (get_boot_time): Likewise.
520 * frame.c (make_terminal_frame, set_term_frame_name)
521 (x_report_frame_params): Likewise.
522 * image.c (gs_load): Likewise.
523 * minibuf.c (get_minibuffer): Likewise.
524 * msdos.c (dos_set_window_size): Likewise.
525 * process.c (make_process): Likewise.
526 * xdisp.c (ensure_echo_area_buffers): Likewise.
527 * xsettings.c (apply_xft_settings): Likewise.
528
d01ba2f1
GM
5292012-07-09 Glenn Morris <rgm@gnu.org>
530
531 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
532 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
533 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
534 * nsterm.h (ns_etc_directory): Add it.
535 * callproc.c [HAVE_NS]: Include nsterm.h.
536 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
537
f1f924b6
DA
5382012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
539
540 Move marker debugging code under MARKER_DEBUG.
541 * marker.c (MARKER_DEBUG): Move marker debugging code under
542 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
543 for bootstrap with --enable-checking (~3x slowdown reported
544 by Juanma Barranquero <lekktu@gmail.com>).
545 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
546
ab531b66
PE
5472012-07-08 Paul Eggert <eggert@cs.ucla.edu>
548
549 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
550 See <http://bugs.gnu.org/11825#29>.
551
c4b3bc8a
EZ
5522012-07-08 Eli Zaretskii <eliz@gnu.org>
553
554 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
555 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
556 (display_line): Add commentary about displaying truncation glyphs
557 on GUI frames.
558 (produce_special_glyphs): Move here from term.c.
559
560 * term.c (produce_special_glyphs): Move to xdisp.c.
561
562 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
563 section.
c4b3bc8a 564
b676b881
AS
5652012-07-07 Andreas Schwab <schwab@linux-m68k.org>
566
f17c5273
AS
567 * xdisp.c (display_line): Avoid warning about implicit declaration
568 of FRAME_FONT.
569
298819b9
AS
570 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
571
b676b881
AS
572 * lisp.h: Remove empty conditional.
573
6045c4fd
PE
5742012-07-07 Paul Eggert <eggert@cs.ucla.edu>
575
b3350bf9
PE
576 * lread.c (load_path_check): Now static.
577
6045c4fd
PE
578 Fix some minor --with-ns problems found by static checking.
579 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
580 (x_set_font) [!HAVE_X_WINDOWS]:
581 * image.c (xpm_load_image) [HAVE_NS]:
582 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
583 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
584 Remove unused local.
585 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
586 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
587 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
588 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
589 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
590 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
591 Fix pointer signedness problem.
592 * xfaces.c (FRAME_X_FONT_TABLE):
593 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
594
929e7845
GM
5952012-07-07 Glenn Morris <rgm@gnu.org>
596
597 * lread.c (load_path_check): New function, split from init_lread.
598 (init_lread): Reorganize. Motivation:
599 If EMACSLOADPATH is set, check/warn about that rather than the
600 defaults, which we are not going to use. Hence we can remove
601 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
602 Don't warn if site-lisp directories are missing.
603 If not installed, start from a blank load-path, since
604 PATH_LOADSEARCH refers to the eventual installation directories.
605
58dd0aa4
EZ
6062012-07-07 Eli Zaretskii <eliz@gnu.org>
607
608 Support truncation and continuation glyphs on GUI frames, when
609 fringes are disabled. (Bug#11832)
610 * xdisp.c (init_iterator): Get dimensions of truncation and
611 continuation glyphs even if on GUI frames. Adjust
612 it->last_visible_x on GUI frames when the left or right fringes,
613 or both, are absent.
614 (start_display, move_it_in_display_line_to): Handle the case of a
615 GUI frame without a fringe to display continuation or truncation
616 glyphs.
617 (insert_left_trunc_glyphs): Support GUI frames: make sure
618 truncation glyphs overwrite enough glyphs from the current line to
619 have sufficient space in pixels.
620 (display_line): Support truncation and continuation glyphs on GUI
621 frames. If some spare pixels are left on the line after inserting
622 the truncation glyphs, fill that space with a stretch glyph of a
623 suitably computed width.
624
625 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
626 produce_glyphs, to support GUI sessions.
627
31571fd7
PE
6282012-07-07 Paul Eggert <eggert@cs.ucla.edu>
629
5a16b9bc
PE
630 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
631
f3047c75
PE
632 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
633
31571fd7
PE
634 Do not require float-time's arg to fit in time_t (Bug#11825).
635 This works better on hosts where time_t is unsigned, and where
636 float-time is applied to the (negative) difference between two times.
637 * editfns.c (decode_time_components): Last arg is now double *,
638 not int *, and means to store all the result as a double, without
639 worrying about whether the seconds part fits in time_t.
640 All callers changed.
641 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
642 All callers changed.
643 (Ffloat_time): Do not fail merely because the specified time falls
644 outside of time_t range.
645
4516fbef
GM
6462012-07-07 Glenn Morris <rgm@gnu.org>
647
648 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
649 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
650 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
651
07adc2c6
JB
6522012-07-07 Juanma Barranquero <lekktu@gmail.com>
653
654 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
655 Update dependencies.
656
657 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
658
fd573f31
PE
6592012-07-06 Paul Eggert <eggert@cs.ucla.edu>
660
fee5959d
PE
661 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
662 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
663 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
664 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
665 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
666 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
667
fd573f31
PE
668 * xfont.c (compare_font_names): Redo to omit the need for casts.
669
ddadbc0e
AS
6702012-07-06 Andreas Schwab <schwab@linux-m68k.org>
671
fca8d6b6
AS
672 * xfns.c (Fx_change_window_property): Doc fix.
673 * w32fns.c (Fx_change_window_property): Doc fix.
674
ddadbc0e
AS
675 * w32fns.c (Fx_window_property): Accept the same arguments as the
676 X Windows version. Doc fix.
677 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
678
f247498e
JB
6792012-07-06 Juanma Barranquero <lekktu@gmail.com>
680 Eli Zaretskii <eliz@gnu.org>
681
682 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
683 Windows-specific code from nt/config.nt moved here.
684 Obsolete settings removed.
685
216ee680
PE
6862012-07-06 Paul Eggert <eggert@cs.ucla.edu>
687
688 * process.c: Avoid unnecessary calls to gettime.
689 (wait_reading_process_output): Don't get the time of day
690 when gobbling data immediately and not waiting, as there's no need
691 for it in that case. This removes a FIXME.
692
bdd091e4
JD
6932012-07-06 Jan Djärv <jan.h.d@swipnet.se>
694
695 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
696 is defined (Bug#11768).
697
9d44f8ce
DA
6982012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
699
700 Fix marker debugging code.
701 * marker.c (byte_char_debug_check): Do not perform the check
702 if buffer is not multibyte.
090bd7cb
JB
703 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
704 Call byte_char_debug_check with correct arguments.
9d44f8ce 705
90fc4786
DA
7062012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
707
708 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
709 * marker.c (byte_char_debug_check, count_markers):
710 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
711 (byte_debug_flag): Remove.
712 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
713 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
714
7b7ae965
DA
7152012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
716
4e57b342
DA
717 Avoid code repetition in marker-related functions.
718 * marker.c (attach_marker): New function.
719 (Fset_marker, set_marker_restricted, set_marker_both)
720 (set_marker_restricted_both): Use it.
721 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
722 Consistently rename charno to charpos.
723 (marker_position): Add eassert.
724 (marker_byte_position): Convert to eassert.
725
7262012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
727
728 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 729 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 730 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 731
657924ff
DA
7322012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
733
734 Introduce fast path for the widely used marker operation.
735 * alloc.c (build_marker): New function.
736 * lisp.h (build_marker): New prototype.
737 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
738 * composite.c (autocmp_chars): Likewise.
739 * editfns.c (buildmark): Remove.
740 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
741 (save_restriction_save): Use build_marker.
742 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
743 * window.c (save_window_save): Likewise.
744
041a49a6
DA
7452012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
746
747 Do not use Fdelete_overlay in delete_all_overlays
748 to avoid redundant calls to unchain_overlay.
749 * buffer.c (drop_overlay): New function.
750 (delete_all_overlays, Fdelete_overlay): Use it.
751 * minibuf.c (get_minibuffer): Fix comment.
752
7dca65a4
PE
7532012-07-06 Paul Eggert <eggert@cs.ucla.edu>
754
755 Port to OpenBSD 5.1 amd64.
756 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
757 This is needed for OpenBSD, and should be harmless on all BSD systems.
758 Also, include <sys/sysctl.h>, as it should be available on all
759 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
760 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
761 use p_pid member, not kp_proc.pid.
762
8eb876e2
GM
7632012-07-06 Glenn Morris <rgm@gnu.org>
764
765 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
766
38182d90
PE
7672012-07-05 Paul Eggert <eggert@cs.ucla.edu>
768
769 More xmalloc and related cleanup.
770 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
771 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
772 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
773 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
774 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
775 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
776 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
777 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
778 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
779 * xterm.c:
780 Omit needless casts involving void * pointers and allocation.
781 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
782 as the former is more robust if P's type is changed.
783 Prefer xzalloc to xmalloc + memset 0.
784 Simplify malloc-or-realloc to realloc.
785 Don't worry about xmalloc returning a null pointer.
786 Prefer xstrdup to xmalloc + strcpy.
787 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
788 growing it.
789 * keyboard.c (apply_modifiers_uncached): Prefer local array to
790 alloca of a constant.
791
6dd5a677
EZ
7922012-07-05 Eli Zaretskii <eliz@gnu.org>
793
794 * xdisp.c (display_line): Fix horizontal pixel coordinates when
795 hscroll is larger than the line width. Fixes long and futile
796 looping inside extend_face_to_end_of_line (on a TTY) producing
797 glyphs that are not needed and thrown away.
798
6b312f0f
DA
7992012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
800
801 * marker.c (set_marker_restricted_both): Simplify by using
802 clip_to_bounds.
803
f520ef9b
PE
8042012-07-05 Paul Eggert <eggert@cs.ucla.edu>
805
806 * editfns.c (region_limit): Simplify by using clip_to_bounds.
807
383b7c95
JD
8082012-07-05 Jan Djärv <jan.h.d@swipnet.se>
809
810 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
811 not defined (Bug#11768).
812 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
813 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
814 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
815 followed by gtk_box_set_homogeneous (Bug#11768).
816 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
817 (update_theme_scrollbar_width, xg_create_scroll_bar):
818 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
819 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
820 (is_box_type): New function (Bug#11768).
821 (xg_tool_item_stale_p): Call is_box_type.
5293d758 822 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
823 with default display (Bug#11768).
824
d6e7bf45
EZ
8252012-07-05 Eli Zaretskii <eliz@gnu.org>
826
827 * xdisp.c (window_hscroll_limited): New function.
828 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
829 coordinates when window's hscroll is set to insanely large
830 values. (Bug#11857)
831
431391ec
JB
8322012-07-05 Juanma Barranquero <lekktu@gmail.com>
833
834 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
835 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
836
23f86fce
DA
8372012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
838
839 Cleanup xmalloc.
840 * lisp.h (xzalloc): New prototype. Omit needless casts.
841 * alloc.c (xzalloc): New function. Omit needless casts.
842 * charset.c: Omit needless casts. Convert all calls to
843 xmalloc with following memset to xzalloc.
844 * dispnew.c: Likewise.
845 * fringe.c: Likewise.
846 * image.c: Likewise.
847 * sound.c: Likewise.
848 * term.c: Likewise.
849 * w32fns.c: Likewise.
850 * w32font.c: Likewise.
851 * w32term.c: Likewise.
852 * xfaces.c: Likewise.
853 * xfns.c: Likewise.
854 * xterm.c: Likewise.
855 * atimer.c: Omit needless casts.
856 * buffer.c: Likewise.
857 * callproc.c: Likewise.
858 * ccl.c: Likewise.
859 * coding.c: Likewise.
860 * composite.c: Likewise.
861 * doc.c: Likewise.
862 * doprnt.c: Likewise.
863 * editfns.c: Likewise.
864 * emacs.c: Likewise.
865 * eval.c: Likewise.
866 * filelock.c: Likewise.
867 * fns.c: Likewise.
868 * gtkutil.c: Likewise.
869 * keyboard.c: Likewise.
870 * lisp.h: Likewise.
871 * lread.c: Likewise.
872 * minibuf.c: Likewise.
873 * msdos.c: Likewise.
874 * print.c: Likewise.
875 * process.c: Likewise.
876 * region-cache.c: Likewise.
877 * search.c: Likewise.
878 * sysdep.c: Likewise.
879 * termcap.c: Likewise.
880 * terminal.c: Likewise.
881 * tparam.c: Likewise.
882 * w16select.c: Likewise.
883 * w32.c: Likewise.
884 * w32reg.c: Likewise.
885 * w32select.c: Likewise.
886 * w32uniscribe.c: Likewise.
887 * widget.c: Likewise.
888 * xdisp.c: Likewise.
889 * xmenu.c: Likewise.
890 * xrdb.c: Likewise.
891 * xselect.c: Likewise.
892
0497dc44
PE
8932012-07-05 Paul Eggert <eggert@cs.ucla.edu>
894
895 * fileio.c (time_error_value): Check the right error number.
896 Problem reported by Troels Nielsen in
897 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
898
356e7178
PE
8992012-07-04 Paul Eggert <eggert@cs.ucla.edu>
900
4e71fd89
PE
901 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
902 This should be fixed in a better way; see Eli Zaretskii in
903 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
904 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
905
f0941253
PE
906 * fileio.c (time_error_value): Rename from special_mtime.
907 The old name's problems were noted by Eli Zaretskii in
908 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
909
065c9eb4
PE
910 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
911 This variable's comment says Emacs needs at least one GDB-visible
912 symbol of type enum pvec_type, to work around GDB problems.
913 The symbol's value doesn't matter.
914
356e7178
PE
915 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
916 that causes compilation to fail on pre-C99 compilers.
917
95f61aa2
JB
9182012-07-04 Juanma Barranquero <lekktu@gmail.com>
919
920 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
921 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
922
3884d954
DA
9232012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
924
d209e2fb 925 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
926 headers for buffer_defaults and buffer_local_symbols.
927 Reported by Juanma Barranquero <lekktu@gmail.com>.
928
ee28be33
SM
9292012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
930
931 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
932 * lisp.h (enum pvec_type): Use fewer bits.
933 (PSEUDOVECTOR_SIZE_BITS): New constant.
934 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
935 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
936 change in pvec_type.
937 (PSEUDOVECTOR_TYPEP): New macro.
938 (TYPED_PSEUDOVECTORP): Use it.
939 * fns.c (internal_equal): Adapt code to extract pvectype.
940 * emacs.c (gdb_pvec_type): Update type.
941 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
942 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
943 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
944 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
945 (sweep_vectors): Use it. Use local var `total_bytes' instead of
946 abusing vector->header.next.nbytes.
947 (live_vector_p): Use PVEC_TYPE.
948 (mark_object): Adapt code to extract pvectype. Use switch.
949
c7f2cd7f
PE
9502012-07-04 Paul Eggert <eggert@cs.ucla.edu>
951
952 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
953 Tighten new eassert a bit.
954
8ce70ed2
DA
9552012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
956
957 Fix compilation with --enable-gcc-warnings and -O1
958 optimization level.
959 * doprnt.c (doprnt): Change type of tem to int, initialize
960 to avoid compiler warning. Add eassert.
961 * search.c (simple_search): Initialize match_byte to avoid
962 compiler warning. Add eassert.
963
dea7f1e5
PE
9642012-07-04 Paul Eggert <eggert@cs.ucla.edu>
965
24a212eb
PE
966 Avoid weird behavior with large horizontal scrolls.
967 Without this change, for example, large hscroll values would
968 mess up Emacs's display on Fedora 15 x86, presumably due to
969 overflows in int calculations in the display code.
970 Also, if buffers had long lines, Emacs would freeze.
971 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
972 (set_window_hscroll): New function, containing the old guts of
973 Fset_window_hscroll. Return the clipped value.
974 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
975 This avoids the need to check against PTRDIFF_MAX.
976
dea7f1e5
PE
977 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
978
76046526
DA
9792012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
980
981 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
982
39adff0d
PE
9832012-07-04 Paul Eggert <eggert@cs.ucla.edu>
984
63807d47
PE
985 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
986 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
987 since GCC 4.4.6 issues a bogus warning for them.
988
39adff0d
PE
989 Fix bugs in file timestamp newness comparisons.
990 * fileio.c (Ffile_newer_than_file_p):
991 * lread.c (Fload): Use full timestamp resolution of files,
992 not just the 1-second resolution, so that files that are only
993 slightly newer still count as newer.
994 * fileio.c (Ffile_newer_than_file_p): Don't assume file
995 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
996
dbeed9a6
PE
9972012-07-03 Paul Eggert <eggert@cs.ucla.edu>
998
999 * fileio.c: Improve handling of file time marker. (Bug#11852)
1000 (special_mtime): New function.
1001 (Finsert_file_contents, Fverify_visited_file_modtime):
1002 Use it to set special mtime values consistently.
1003
636334d6
AS
10042012-07-03 Andreas Schwab <schwab@linux-m68k.org>
1005
1006 * fileio.c (Finsert_file_contents): Properly handle st_mtime
1007 marker for non-existing file. (Bug#11852)
1008
e2017fe2
GM
10092012-07-03 Glenn Morris <rgm@gnu.org>
1010
1011 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
1012 and did not make it into globals.h).
1013
404dbd37
TT
10142012-07-03 Tom Tromey <tromey@redhat.com>
1015
1016 * window.c (Fset_window_margins, Fset_window_fringes)
1017 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
1018 * textprop.c (Fprevious_property_change): No longer static.
1019 * syntax.c (Fsyntax_table_p): No longer static.
1020 * process.c (Fget_process, Fprocess_datagram_address): No longer
1021 static.
1022 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
1023 * keyboard.c (Fcommand_execute): No longer static.
1024 Remove EXFUN.
1025 * insdel.c (Fcombine_after_change_execute): No longer static.
1026 * image.c (Finit_image_library): No longer static.
1027 * fileio.c (Fmake_symbolic_link): No longer static.
1028 * eval.c (Ffetch_bytecode): No longer static.
1029 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
1030 * doc.c (Fdocumentation_property, Fsnarf_documentation):
1031 No longer static.
404dbd37
TT
1032 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
1033 static.
1034 * dired.c (Ffile_attributes): No longer static.
1035 * composite.c (Fcomposition_get_gstring): No longer static.
1036 * callproc.c (Fgetenv_internal): No longer static.
1037
1038 * ccl.h: Remove EXFUNs.
1039 * buffer.h: Remove EXFUNs.
1040 * dispextern.h: Remove EXFUNs.
1041 * intervals.h: Remove EXFUNs.
1042 * fontset.h: Remove EXFUN.
1043 * font.h: Remove EXFUNs.
1044 * dosfns.c (system_process_attributes): Remove EXFUN.
1045 * keymap.h: Remove EXFUNs.
1046 * lisp.h: Remove EXFUNs.
1047 * w32term.h: Remove EXFUNs.
1048 * window.h: Remove EXFUNs.
1049 * xsettings.h: Remove EXFUN.
1050 * xterm.h: Remove EXFUN.
1051
8e4fd1e1
GM
10522012-07-03 Glenn Morris <rgm@gnu.org>
1053
1054 * lisp.h (Frandom): Make it visible to C.
1055 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
1056 buffer for invisible buffers. (Bug#1229)
1057
ca95b3eb
DA
10582012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1059
1060 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
1061 values which aren't power of 2.
1062 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
1063 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
1064 accordingly.
1065
7555c33f
SM
10662012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
1067
1068 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
1069
1070 * alloc.c (mark_object): Revert part of last patch to use `switch'.
1071
d12e8f5a
DA
10722012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1073
1074 * alloc.c (allocate_vector_block): Remove redundant
1075 calls to mallopt if DOUG_LEA_MALLOC is defined.
1076 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
1077 avoid calls to mallopt if zero_vector is returned.
1078
296094c3
DA
10792012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1080
1081 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
1082 is enabled, avoid dereferencing NULL current_sblock if
1083 running undumped.
1084
36429c89
DA
10852012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
1086
1087 Cleanup basic buffer management.
1088 * buffer.h (struct buffer): Change layout to use generic vector
1089 marking code. Fix some comments. Change type of 'clip_changed'
1090 to bitfield. Remove unused #ifndef old.
1091 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
1092 (GET_OVERLAYS_AT): Fix indentation.
1093 (for_each_per_buffer_object_at): New macro.
1094 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
1095 (Fbuffer_local_variables): Use it.
1096 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
1097 * alloc.c (allocate_buffer): Adjust to match new layout of
1098 struct buffer. Fix comment.
1099 (mark_overlay): New function.
1100 (mark_buffer): Use it. Use mark_vectorlike to mark normal
1101 Lisp area of struct buffer.
1102 (mark_object): Use it. Adjust marking of misc objects
1103 and related comments.
1104
3b3e4cac
PE
11052012-07-02 Paul Eggert <eggert@cs.ucla.edu>
1106
1107 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
1108 wrapper that is not needed because the wrapped code is a no-op (zero
1109 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
1110 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
1111
cf5c0175
DA
11122012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
1113
1114 * alloc.c (mark_buffer): Simplify. Remove prototype.
1115 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 1116 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
1117 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
1118 redundant calls to mark_vectorlike for bool vectors.
1119
ca26824c
GM
11202012-06-30 Glenn Morris <rgm@gnu.org>
1121
2e4c5312
GM
1122 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
1123
ca26824c
GM
1124 * epaths.in (PATH_SITELOADSEARCH): New.
1125 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
1126 This is rather than relying on --enable-locallisppath elements
1127 having "site-lisp" in their names. (Bug#10208#25, 11658)
1128
0d23c240
EZ
11292012-06-30 Eli Zaretskii <eliz@gnu.org>
1130
c9240d7a
EZ
1131 * w32proc.c (sys_select): Accept and ignore one more argument.
1132
1133 * w32.c (emacs_gnutls_pull): Call select with one more argument.
1134
0d23c240 1135 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 1136 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
1137
1138 * sysdep.c: Don't include dos.h and dosfns.h.
1139
1140 * process.c (sys_select):
1141 * msdos.c (sys_select): Accept one more argument and ignore it.
1142
1143 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
1144 adapt data types and code to that.
1145
1146 * dosfns.c:
1147 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
1148 which clashes with the gnulib function of the same name.
1149
af5a5a98
AS
11502012-06-30 Andreas Schwab <schwab@linux-m68k.org>
1151
c5e4379c
AS
1152 * font.c (font_style_to_value, font_style_symbolic)
1153 (font_prop_validate_style): Add type checks for values in
1154 font_style_table.
1155
af5a5a98
AS
1156 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
1157 argument.
1158 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
1159 uses.
1160
8d38f461
EZ
11612012-06-29 Eli Zaretskii <eliz@gnu.org>
1162
2e5a6631
EZ
1163 * xdisp.c (try_window_id): Undo last change.
1164
8d38f461
EZ
1165 * w32.c (getwd): Adjust commentary about startup_dir.
1166 (init_environment): Always call sys_access, even in non-MSVC
1167 builds. Don't chdir to the directory of the Emacs executable.
1168 This undoes code from 1997 which was justified by the need to
1169 "avoid conflicts when removing and renaming directories". But its
1170 downside was that every relative file name was being interpreted
1171 relative to the directory of the Emacs executable, which can never
1172 be TRT. In particular, it broke sys_access when called with
1173 relative file names.
1174 (sys_access): Map GetLastError to errno.
1175
2af3565e
DA
11762012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1177
1178 * window.h (struct window): Change type of 'fringes_outside_margins'
1179 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 1180 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
1181 Adjust comment.
1182 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
1183 to ptrdiff_t.
1184
c8d3a25c 11852012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 1186
c8d3a25c
GM
1187 * gnutls.c (emacs_gnutls_handshake):
1188 Add QUIT to make the loop interruptible.
57570cd3 1189
c8d3a25c 11902012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 1191
c8d3a25c
GM
1192 * charset.c (init_charset): Make lack of etc/charsets fatal.
1193
3e984ee8
DA
11942012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1195
1196 * editfns.c (region_limit): Fix type mismatch.
1197
ef884f23
DA
11982012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
1199
1200 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
1201 undefined. Convert from xassert to eassert.
1202 * nsmenu.m: Convert from xassert to eassert.
1203 * nsterm.m: Likewise.
1204
7d7e0027
SM
12052012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
1206
1207 * editfns.c (region_limit): Clip to narrowing (bug#11770).
1208
aa754e6a
PE
12092012-06-28 Paul Eggert <eggert@cs.ucla.edu>
1210
1211 Avoid integer overflow on scroll-left and scroll-right.
1212 * window.c (HSCROLL_MAX): New macro.
1213 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
1214 overflow when requested scroll falls outside ptrdiff_t range.
1215
80b00b08
DA
12162012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1217
1218 * window.h (struct window): Change type of 'hscroll',
1219 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
1220 'last_modified' and 'last_overlay_modified' to EMACS_INT.
1221 Adjust users accordingly.
1222 * xdisp.c (try_cursor_movement): Replace type check with eassert.
1223 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1224 from EMACS_INT to ptrdiff_t.
1225 (make_window): Omit redundant initialization.
1226
62b2bcf6
JB
12272012-06-28 Juanma Barranquero <lekktu@gmail.com>
1228
1229 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1230
45942c7d
DA
12312012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1232
1233 * window.h (struct window): Change type of 'use_time' and
1234 'sequence_number' from Lisp_Object to int.
1235 * frame.c (make_frame): Adjust users accordingly.
1236 * print.c (print_object): Likewise.
1237 * window.c (select_window, Fwindow_use_time, make_parent_window)
1238 (make_window): Likewise.
1239
e509cfa6
DA
12402012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1241
1242 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1243 enabled with --enable-checking=[all,glyphs] configure option.
1244 Fix GLYPH_DEBUG usage assuming that it may be undefined,
1245 adjust comments accordingly.
1246 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1247 undefined, adjust comments accordingly.
1248 * image.c: Likewise.
1249 * scroll.c: Likewise.
1250 * w32fns.c: Likewise.
1251 * w32term.c: Likewise.
1252 * xdisp.c: Likewise.
1253 * xfaces.c: Likewise.
1254 * xfns.c: Likewise.
1255 * xterm.c: Likewise.
1256
a54e2c05
DA
12572012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
1258
1259 Generalize run-time debugging checks.
1260 * dispextern.h (XASSERTS): Remove.
1261 * fontset.c (xassert): Remove.
1262 Convert from xassert to eassert.
1263 * alloc.c: Convert from xassert to eassert.
1264 * bidi.c: Likewise.
1265 * dispnew.c: Likewise.
1266 * fns.c: Likewise.
1267 * fringe.c: Likewise.
1268 * ftfont.c: Likewise.
1269 * gtkutil.c: Likewise.
1270 * image.c: Likewise.
1271 * keyboard.c: Likewise.
1272 * menu.c: Likewise.
1273 * process.c: Likewise.
1274 * scroll.c: Likewise.
1275 * sound.c: Likewise.
1276 * term.c: Likewise.
1277 * w32console.c: Likewise.
1278 * w32fns.c: Likewise.
1279 * w32term.c: Likewise.
1280 * window.c: Likewise.
1281 * xdisp.c: Likewise.
1282 * xfaces.c: Likewise.
1283 * xfns.c: Likewise.
1284 * xselect.c: Likewise.
1285 * xterm.c: Likewise.
1286
1ec4b7b2
SM
12872012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1288
1289 * fns.c (maybe_resize_hash_table): Output message when growing the
1290 purify-hashtable.
1291
2014308a
DA
12922012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1293
1294 * alloc.c (allocate_string_data): Remove dead code.
1295 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1296 avoid GCC warning about unused macro.
1297
246155eb
DA
12982012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1299
1300 * alloc.c (allocate_string): Omit intervals initialization.
1301 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1302 as in make_pure_string and make_pure_c_string.
1303
43184b7b
DA
13042012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1305
d209e2fb 1306 * alloc.c (allocate_string): Fix last change.
43184b7b 1307
3fe6dd74
DA
13082012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1309
d209e2fb 1310 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1311 to memset, add explicit initialization where appropriate.
1312
1ba6038a
GM
13132012-06-27 Glenn Morris <rgm@gnu.org>
1314
1315 * lisp.mk (lisp): Remove paths.elc.
1316
c89926a5
CY
13172012-06-27 Chong Yidong <cyd@gnu.org>
1318
1319 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1320
ed6b3510
JW
13212012-06-26 John Wiegley <johnw@newartisans.com>
1322
1ec4b7b2 1323 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1324 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1325
ed6b3510
JW
1326 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1327 when building with Clang.
1328
8edd4a2b
SM
13292012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1330
1331 * eval.c (Fapply): Allow calling it with a single argument.
1332
f6f62d1b
EZ
13332012-06-26 Eli Zaretskii <eliz@gnu.org>
1334
1335 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1336 _stricmp and _strnicmp.
1337 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1338
62efea5e
DA
13392012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1340
1341 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1342 allocated window.
1343 (allocate_process): Likewise for new process.
8edd4a2b 1344 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1345 (allocate_frame): Likewise.
1346 * frame.c (make_frame): Omit redundant initialization.
1347 * window.c (make_parent_window): Use memset.
1348 (make_window): Omit redundant initialization.
1349 * process.c (make_process): Omit redundant initialization.
1350 * terminal.c (create_terminal): Likewise.
1351
42997f4d
DA
13522012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1353
1354 * term.c (delete_tty): Remove redundant call to memset.
1355
1130ecfc
DA
13562012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1357
1358 * alloc.c: Remove build_string.
1359 * lisp.h: Define build_string as static inline. This provides
1360 a better opportunity to optimize away calls to strlen when the
1361 function is called with compile-time constant argument.
1362 * image.c (imagemagick_error): Convert to build_string.
1363 * w32proc.c (sys_spawnve): Likewise.
1364 * xterm.c (x_term_init): Likewise.
1365
cf38a720
PE
13662012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1367
99027bdd
PE
1368 Use sprintf return value instead of invoking strlen on result.
1369 In the old days this wasn't portable, since some sprintf
1370 implementations returned char *. But they died out years ago and
1371 Emacs already assumes sprintf returns int.
1372 Similarly for float_to_string.
1373 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1374 * ccl.c (ccl_driver):
1375 * character.c (string_escape_byte8):
1376 * data.c (Fnumber_to_string):
1377 * doprnt.c (doprnt):
1378 * print.c (print_object):
1379 * xdisp.c (message_dolog):
1380 * xfns.c (syms_of_xfns):
1381 Use sprintf or float_to_string result to avoid need to call strlen.
1382 * data.c (Fnumber_to_string):
1383 Use make_unibyte_string, since the string must be ASCII.
1384 * lisp.h, print.c (float_to_string): Now returns int length.
1385 * term.c (produce_glyphless_glyph):
1386 Use sprintf result rather than recomputing it.
1387
cf38a720
PE
1388 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1389 * Makefile.in (ALL_CFLAGS):
1390 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1391 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1392
3511c784
DA
13932012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1394
0a08eb21 1395 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1396 strcasecmp if available.
1397 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1398
fb7da12e
AS
13992012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1400
1401 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1402 Avoid comma operator.
1403 * menu.c (push_submenu_start, push_submenu_end)
1404 (push_left_right_boundary, push_menu_pane): Likewise.
1405 * msdos.c (dos_rawgetc): Likewise.
1406
afa2ffd8
DA
14072012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1408
1409 * xfns.c (xic_create_fontsetname): Remove redundant calls
1410 to memset.
1411
b3b4476b
PE
14122012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1413
4495ff38
PE
1414 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1415 sprintf already null-terminates its output.
1416
b3b4476b
PE
1417 * xfns.c (x_window): Remove redundant cast.
1418
b00876c9
DA
14192012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1420
1421 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1422 `const char *' to `char *' to avoid compiler warning.
1423
d188e26b
PE
14242012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1425
885d1d74
PE
1426 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1427 instead of truncating it to 63 (admittedly a generous limit).
1428
d188e26b
PE
1429 * process.c: Fix spelling and caps in comments.
1430
e2f560b1
DN
14312012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1432
e86db54b 1433 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1434 * sysdep.c (setpgrp): Remove definition, not used in this file.
1435
7583a3a1
JB
14362012-06-24 Juanma Barranquero <lekktu@gmail.com>
1437
1438 * makefile.w32-in: Update dependencies.
1439
696056c2
EZ
14402012-06-24 Eli Zaretskii <eliz@gnu.org>
1441
1442 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1443 (SYSTIME_H): Add nt/inc/sys/time.h.
1444
1445 * systime.h [WINDOWSNT]: Include sys/time.h.
1446
1447 * s/ms-w32.h (struct timespec): Definition moved from
1448 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1449
845ca893
PE
14502012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1451
1452 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1453 * buffer.h (buffer_slot_type_mismatch):
1454 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1455 * eval.c (unwind_to_catch):
1456 * image.c (my_png_error, my_error_exit):
1457 * keyboard.c (quit_throw_to_read_char, user_error)
1458 (Fexit_recursive_edit, Fabort_recursive_edit):
1459 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1460 (wrong_type_argument, buffer_overflow, __executable_start)
1461 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1462 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1463 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1464 (fatal):
1465 (child_setup) [!DOS_NT]:
1466 * lread.c (end_of_file_error, invalid_syntax):
1467 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1468 * puresize.h (pure_write_error):
1469 * search.c (matcher_overflow):
1470 * sound.c (sound_perror, alsa_sound_perror):
1471 * sysdep.c, syssignal.h (croak):
1472 * term.c (maybe_fatal, vfatal):
1473 * textprop.c (text_read_only):
1474 * undo.c (user_error):
1475 * unexmacosx.c (unexec_error):
1476 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1477 Use _Noreturn rather than NO_RETURN.
1478 No need for separate decl merely because of _Noreturn.
1479 * sound.c (sound_warning, parse_sound):
1480 Remove unnecessary forward decls.
1481
f1dd8073
PE
14822012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1483
1484 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1485 * lisp.h (WAIT_READING_MAX): New macro.
1486 * dispnew.c (Fsleep_for, sit_for):
1487 * keyboard.c (kbd_buffer_get_event):
1488 * process.c (Faccept_process_output):
1489 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1490 This improves on the previous patch, which introduced a bug
1491 when time_t is unsigned and as wide as intmax_t.
1492 See <http://bugs.gnu.org/9000#51>.
1493
b82c1755
EZ
14942012-06-23 Eli Zaretskii <eliz@gnu.org>
1495
1496 * dispnew.c (sit_for, Fsleep_for):
1497 * keyboard.c (kbd_buffer_get_event):
1498 * process.c (Faccept_process_output): Avoid compiler warnings when
1499 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1500
ca300656
JB
15012012-06-23 Juanma Barranquero <lekktu@gmail.com>
1502
049ec95b
JB
1503 * makefile.w32-in: Update dependencies.
1504
ca300656
JB
1505 * w32.c (ltime): Add return type and declare static.
1506 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1507
db7b8d06
PE
15082012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1509
1510 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1511 Privately reported by Herbert J. Skuhra.
1512 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1513 All uses changed.
1514 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1515 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1516
0bd8297f
EZ
15172012-06-23 Eli Zaretskii <eliz@gnu.org>
1518
96512555
EZ
1519 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1520 last argument of make_unibyte_string.
1521
0bd8297f
EZ
1522 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1523 language ID in the event parameters.
1524
1525 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1526 event.code, not the obscure "character set ID".
1527
63def6b6
CY
15282012-06-23 Chong Yidong <cyd@gnu.org>
1529
1530 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1531
e8a02204
EZ
15322012-06-23 Eli Zaretskii <eliz@gnu.org>
1533
388cdec0
EZ
1534 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1535 * w32.c (fdutimens): New function.
1536
1537 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1538
1539 * s/ms-w32.h (pselect): Redirect to sys_select.
1540
1541 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1542
e8a02204
EZ
1543 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1544 in the logic of incrementing and decrementing the value of
1545 use_relocatable_buffers.
1546
d054f3fb
PE
15472012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1548
1549 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1550 Privately reported by Herbert J. Skuhra.
1551 [__FreeBSD__]: Remove "*/" typo after "#include".
1552 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1553 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1554 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1555 Don't assume EMACS_TIME and struct timeval are the same type.
1556
d35af63c
PE
15572012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1558
1559 Support higher-resolution time stamps (Bug#9000).
1560 The time stamps are only nanosecond-resolution at the C level,
1561 since that's the best that any real-world system supports now.
1562 But they are picosecond-resolution at the Lisp level, as that's
1563 easy, and leaves room for future OS improvements.
1564
1565 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1566 (LIBES): Use it.
1567
1568 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1569 Don't get current time unless it's needed.
1570
1571 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1572 now provides it if it's absent.
1573 (start_atimer): Port to higher-res time stamps.
1574 Check for time stamp overflow. Don't get current time more
1575 often than is needed.
1576
1577 * buffer.h (struct buffer): Buffer modtime now has high resolution.
1578 Include systime.h, not time.h.
1579 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1580
1581 * dired.c: Include stat-time.h.
1582 (Ffile-attributes): File times now have higher resolution.
1583
1584 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1585 (struct image): Timestamp now has higher resolution.
1586
1587 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1588 has at least microseconds now. All uses removed.
1589 (update_frame, update_single_window, update_window, update_frame_1)
1590 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1591
1592 * editfns.c (time_overflow): Now extern.
1593 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1594 (float-time, Fformat_time_string, Fcurrent_time_string)
1595 (Fcurrent_time_zone): Accept and generate higher-resolution
1596 time stamps.
1597 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1598 (decode_time_components, lisp_seconds_argument): New functions.
1599 (make_time): Now static.
1600 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
1601 Report an error if the time is invalid, rather than having the caller
1602 do that.
1603
1604 * fileio.c: Include <stat-time.h>
1605 (Fcopy_file): Copy higher-resolution time stamps.
1606 Prefer to set the time stamp via a file descriptor if that works.
1607 (Fset_file_times, Finsert_file_contents, Fwrite_region)
1608 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1609 (Fvisited_file_modtime, Fset_visited_file_modtime):
1610 Support higher-resolution time stamps.
1611
1612 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1613
1614 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1615
1616 * image.c (prepare_image_for_display, clear_image_cache)
1617 (lookup_image): Port to higer-resolution time stamps.
1618
1619 * keyboard.c (start_polling, bind_polling_period):
1620 Check for time stamp overflow.
1621 (read_char, kbd_buffer_get_event, timer_start_idle)
1622 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1623 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1624 Port to higher-resolution time stamps. Do not assume time_t is signed.
1625 (decode_timer): New function. Timers are now vectors of length 9,
1626 not 8, to accommodate the picosecond component.
1627 (timer_check_2): Use it.
1628
1629 * nsterm.m (select_timeout, timeval_subtract): Remove.
1630 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1631 as they're a bit more accurate and handle overflow better.
1632 (ns_select): Change prototype to be compatible with pselect.
1633 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1634 * nsterm.h (ns_select): Adjust prototype.
1635
1636 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1637 us-resolution time stamps.
1638 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1639
1640 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1641
1642 * lisp.h (time_overflow): New decl.
1643 (wait_reading_process_output): First arg is now intmax_t, not int,
1644 to accommodate larger waits.
1645
1646 * process.h (struct Lisp_Process.read_output_delay):
1647 Now counts nanoseconds, not microseconds.
1648 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1649 EMACS_HAS_USECS.
1650 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1651 (wait_reading_process_output):
1652 Port to ns-resolution time stamps.
1653 (Faccept_process_output, wait_reading_process_output):
1654 Check for time stamp overflow. Do not assume time_t is signed.
1655 (select_wrapper): Remove; we now use pselect.
1656 (Fprocess_attributes): Now generates ns-resolution time stamps.
1657
1658 * sysdep.c: Include utimens.h. Don't include utime.h
1659 or worry about struct utimbuf; gnulib does that for us now.
1660 (gettimeofday): Remove; gnulib provides a substitute.
1661 (make_timeval): New function.
1662 (set_file_times): Now sets ns-resolution time stamps.
1663 New arg FD; all uses changed.
1664 (time_from_jiffies, ltime_from_jiffies, get_up_time)
1665 (system_process_attributes):
1666 Now returns ns-resolution time stamp. All uses changed.
1667 Check for time stamp overflow.
1668
1669 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1670 provides a substitute now.
1671
1672 * systime.h: Include timespec.h rather than sys/time.h and time.h,
1673 since it guarantees struct timespec.
1674 (EMACS_TIME): Now struct timespec, so that we can support
1675 ns-resolution time stamps.
1676 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1677 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1678 (EMACS_USECS): Remove.
1679 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1680 so multiply the arg by 1000 before storing it.
1681 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1682 New macros.
1683 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1684 Port to ns-resolution time stamps.
1685 (EMACS_TIME_NEG_P): Remove; replaced by....
1686 (EMACS_TIME_SIGN): New macro.
1687 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1688 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1689 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1690 (make_timeval, make_lisp_time, decode_time_components): New decls.
1691 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1692 that it mishandled time_t overflow. You can't compare by subtracting!
1693 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1694 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1695
1696 * term.c: Include <sys/time.h>.
1697 (timeval_to_Time): New function, for proper overflow wraparound.
1698 (term_mouse_position, term_mouse_click): Use it.
1699
1700 * undo.c (record_first_change): Support higher-resolution time stamps
1701 in the undo buffer.
1702 (Fprimitive_undo): Use them when restoring time stamps.
1703
1704 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1705 (w32_get_internal_run_time):
1706 Port to higher-resolution Emacs time stamps.
1707 (ltime): Now accepts single 64-bit integer, as that's more convenient
1708 for callers.
1709
1710 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1711
1712 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1713 for compatibility with pselect. Support ns-resolution time stamps.
1714
1715 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1716
1717 * xselect.c (wait_for_property_change, x_get_foreign_selection):
1718 Check for time stamp overflow, and support ns-resolution time stamps.
1719
1720 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1721 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1722 (timeval_subtract): Remove; no longer needed.
1723 (XTflash, XTring_bell, x_wait_for_event):
1724 Port to ns-resolution time stamps. Don't assume time_t is signed.
1725
b6a92dfe
CY
17262012-06-22 Chong Yidong <cyd@gnu.org>
1727
1728 * xdisp.c (x_consider_frame_title): Revert last change.
1729
d251c37c
EZ
17302012-06-22 Eli Zaretskii <eliz@gnu.org>
1731
1732 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
1733 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1734 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
1735 staticidx goes up to 1597 out of 1600 = 0x640.)
1736
f10deafb
PE
17372012-06-20 Paul Eggert <eggert@cs.ucla.edu>
1738
1739 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1740 Otherwise, the umask might be mistakenly 0 while handling input signals.
1741
ec6de1e2
SM
17422012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
1743
1744 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
1745
28be1ada
DA
17462012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
1747
1748 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
1749 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
1750 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
1751 access to `contents' member of Lisp_Vector objects with AREF and ASET
1752 where appropriate.
1753
c6bf3022
CY
17542012-06-19 Chong Yidong <cyd@gnu.org>
1755
1756 * frame.c (delete_frame): When selecting a frame on a different
1757 text terminal, do not alter the terminal's top-frame.
1758
1759 * xdisp.c (format_mode_line_unwind_data): Record the target
1760 frame's selected window and its terminal's top-frame.
1761 (unwind_format_mode_line): Restore them.
1762 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
1763 Callers changed.
1764 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
1765 since tty frames can be explicitly named.
1766 (prepare_menu_bars): Likewise.
1767
1768 * term.c (Ftty_top_frame): New function.
1769
defd4196
PE
17702012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1771
1772 Port byte-code-meter to modern targets.
1773 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
1774 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 1775 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
1776 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
1777 (METER_1, METER_2): Simplify.
1778
1053a871
SM
17792012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
1780
1781 * data.c (Fdefalias): Return `symbol' (bug#11686).
1782
b7e8d081
MR
17832012-06-18 Martin Rudalics <rudalics@gmx.at>
1784
1785 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
1786 gets killed during executing of this function (Bug#11665).
1787 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
1788 (Vkill_buffer_query_functions): In doc-string say that functions
1789 run by this hook should not change the current buffer.
1790
7ea2b339
PE
17912012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1792
1793 Fix recently-introduced process.c problems found by static checking.
1794 * process.c (write_queue_push, write_queue_pop, send_process):
1795 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
1796 (write_queue_pop): Fix pointer signedness problem.
1797 (send_process): Remove unused local.
1798
96a313a1
CY
17992012-06-17 Chong Yidong <cyd@gnu.org>
1800
1801 * xdisp.c (redisplay_internal): No need to redisplay terminal
1802 frames that are not on top.
1803
20ca2e94
TN
18042012-06-17 Troels Nielsen <bn.troels@gmail.com>
1805
1806 * process.c (make_process): Initialize write_queue.
1807 (write_queue_push, write_queue_pop): New functions.
1808 (send_process): Use them to maintain correct ordering of process
1809 writes (Bug#10815).
1810
9a900ca9
PE
18112012-06-17 Paul Eggert <eggert@cs.ucla.edu>
1812
310fbfa8
PE
1813 * lisp.h (eassert): Assume C89 or later.
1814 This removes the need for CHECK.
1815 (CHECK): Remove. Its comments about always evaluating its
1816 argument were confusing, as 'eassert' typically does not evaluate
1817 its argument.
1818
27bb1ca4
PE
1819 * coding.c (produce_chars): Use ptrdiff_t, not int.
1820
9a900ca9
PE
1821 * xterm.c (x_draw_underwave): Check for integer overflow.
1822 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
1823
41b7f8bc 18242012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
1825
1826 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
1827 referenced (Bug#11583).
1828
9b0e3eba
AA
18292012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
1830
1831 Implement wave-style variant of underlining.
1832 * dispextern.h (face_underline_type): New enum.
1833 (face): Add field for underline type.
1834 * nsterm.m (ns_draw_underwave): New function.
1835 (ns_draw_text_decoration): Use it.
1836 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
1837 New functions.
1838 (x_draw_glyph_string): Use them.
1839 * xfaces.c (Qline, Qwave): New Lisp objects.
1840 (check_lface_attrs, merge_face_ref)
1053a871
SM
1841 (Finternal_set_lisp_face_attribute, realize_x_face):
1842 Handle wave-style underline face attributes.
9b0e3eba
AA
1843 * xterm.c (x_draw_underwave): New function.
1844 (x_draw_glyph_string): Use it.
1845
0fb52f11
JB
18462012-06-16 Juanma Barranquero <lekktu@gmail.com>
1847
1848 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
1849 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
1850 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
1851 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
1852 ($(BLD)/w32select.$(O)): Update dependencies.
1853
e5560ff7
AS
18542012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1855
1856 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
1857 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
1858 * character.c (_fetch_multibyte_char_p): Remove.
1859 * alloc.c: Include "character.h" before "buffer.h".
1860 * bidi.c: Likewise.
1861 * buffer.c: Likewise.
1862 * bytecode.c: Likewise.
1863 * callint.c: Likewise.
1864 * callproc.c: Likewise.
1865 * casefiddle.c: Likewise.
1866 * casetab.c: Likewise.
1867 * category.c: Likewise.
1868 * cmds.c: Likewise.
1869 * coding.c: Likewise.
1870 * composite.c: Likewise.
1871 * dired.c: Likewise.
1872 * dispnew.c: Likewise.
1873 * doc.c: Likewise.
1874 * dosfns.c: Likewise.
1875 * editfns.c: Likewise.
1876 * emacs.c: Likewise.
1877 * fileio.c: Likewise.
1878 * filelock.c: Likewise.
1879 * font.c: Likewise.
1880 * fontset.c: Likewise.
1881 * fringe.c: Likewise.
1882 * indent.c: Likewise.
1883 * insdel.c: Likewise.
1884 * intervals.c: Likewise.
1885 * keyboard.c: Likewise.
1886 * keymap.c: Likewise.
1887 * lread.c: Likewise.
1888 * macros.c: Likewise.
1889 * marker.c: Likewise.
1890 * minibuf.c: Likewise.
1891 * nsfns.m: Likewise.
1892 * nsmenu.m: Likewise.
1893 * print.c: Likewise.
1894 * process.c: Likewise.
1895 * regex.c: Likewise.
1896 * region-cache.c: Likewise.
1897 * search.c: Likewise.
1898 * syntax.c: Likewise.
1899 * term.c: Likewise.
1900 * textprop.c: Likewise.
1901 * undo.c: Likewise.
1902 * unexsol.c: Likewise.
1903 * w16select.c: Likewise.
1904 * w32fns.c: Likewise.
1905 * w32menu.c: Likewise.
1906 * window.c: Likewise.
1907 * xdisp.c: Likewise.
1908 * xfns.c: Likewise.
1909 * xmenu.c: Likewise.
1910 * xml.c: Likewise.
1911 * xselect.c: Likewise.
1912
2f07e6af
EZ
19132012-06-16 Eli Zaretskii <eliz@gnu.org>
1914
1053a871
SM
1915 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
1916 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 1917 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
1918 row.
1919 (handle_face_prop): Use chunk-relative overlay string index when
1920 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
1921 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
1922 the rightmost. (Bug#11720)
2f07e6af 1923
29b83cec
AS
19242012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1925
1926 * category.h (CHAR_HAS_CATEGORY): Define as inline.
1927 (CATEGORY_MEMBER): Enforce 1/0 value.
1928 * category.c (_temp_category_set): Remove.
1929
4c5501e9
EZ
19302012-06-16 Eli Zaretskii <eliz@gnu.org>
1931
1932 * window.c (Fdelete_other_windows_internal)
1933 (Fdelete_window_internal): Don't access frame's mouse highlight
1934 info of the initial frame. (Bug#11677)
1935
2b570124
PE
19362012-06-14 Paul Eggert <eggert@cs.ucla.edu>
1937
e93864f9
PE
1938 * .gdbinit (xgetint): Fix recently-introduced paren typo.
1939 Assume USE_2_TAGS_FOR_INTS.
1940 (xreload): Adjust $tagmask width to match recent lisp.h change.
1941
2b570124
PE
1942 Simplify lisp.h in minor ways that should not affect code.
1943 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
1944 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
1945 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
1946 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
1947 (INTTYPEBITS): New macro, for clarity.
1948 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
1949 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
1950 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
1951 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
1952 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
1953
81755f69
JB
19542012-06-13 Juanma Barranquero <lekktu@gmail.com>
1955
1956 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
1957
16192a57
GM
19582012-06-13 Glenn Morris <rgm@gnu.org>
1959
1960 * s/bsd-common.h (BSD4_3):
1961 * s/usg5-4-common.h (USG5_4): No longer define; unused.
1962
646b5f55
AS
19632012-06-13 Andreas Schwab <schwab@linux-m68k.org>
1964
1965 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
1966 instead of union.
1967 (XLI, XIL): Define.
1053a871
SM
1968 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
1969 Use them.
1970 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 1971 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 1972 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
1973 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
1974 * frame.c (delete_frame): Remove outdated comment.
1975 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
1976 USE_LISP_UNION_TYPE.
1977 (Fw32_unregister_hot_key): Likewise.
1978 (Fw32_toggle_lock_key): Likewise.
1979 * w32menu.c (add_menu_item): Likewise.
1980 (w32_menu_display_help): Use XIL instead of checking
1981 USE_LISP_UNION_TYPE.
1982 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
1983 (init_heap): Likewise.
1984 * w32term.c (w32_read_socket): Update comment.
1985
1d3823c9
GM
19862012-06-13 Glenn Morris <rgm@gnu.org>
1987
c62ff706
GM
1988 * s/usg5-4-common.h, src/s/unixware.h:
1989 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
1990
1d3823c9
GM
1991 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
1992
bfe3e0a2
PE
19932012-06-13 Paul Eggert <eggert@cs.ucla.edu>
1994
1995 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
1996 * alloc.c (make_number) [!defined make_number]:
1997 Remove, as lisp.h always defines this now.
1998 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
1999 (roundup_size): Verify that it is a power of 2.
2000 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
2001 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
2002 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
2003 -DUSE_LSB_TAG=0, to override the automatically-selected default.
2004 USE_LSB_TAG now is always defined to be either 0 or 1.
2005 All uses changed.
2006 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
2007 code works fine either way, and efficiency is not a concern here,
2008 as the union type is for debugging, not for production.
2009 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
2010 Use an inline function on all platforms when using the union type,
2011 since this is simpler and 'static inline' can be used portably
2012 within Emacs now.
2013 (LISP_INITIALLY_ZERO): New macro.
2014 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
2015 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
2016
45fa9c0f
GM
20172012-06-12 Glenn Morris <rgm@gnu.org>
2018
b4492cba
GM
2019 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
2020
2021 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 2022
45fa9c0f
GM
2023 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
2024 Move BROKEN_SIGIO to configure.
2025
2026 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
2027 Move NO_TERMIO to configure.
2028
0e25d334
CY
20292012-06-12 Chong Yidong <cyd@gnu.org>
2030
2031 * image.c (imagemagick_load_image): Use MagickFlattenImage if
2032 MagickMergeImageLayers is undefined. Use pixel pusher loop if
2033 MagickExportImagePixels is undefined.
2034
43682bb6
PE
20352012-06-12 Paul Eggert <eggert@cs.ucla.edu>
2036
2037 * image.c (imagemagick_load_image): Remove unused label.
2038
a9be7d2b
GM
20392012-06-11 Glenn Morris <rgm@gnu.org>
2040
2041 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2042 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
2043 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
2044 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
2045
3017f87f
SM
20462012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
2047
2048 * alloc.c (make_byte_code): New function.
2049 (Fmake_byte_code): Use it. Don't purify here.
2050 * lread.c (read1): Use it as well to avoid extra allocation.
2051
1b9b4cf4
CY
20522012-06-11 Chong Yidong <cyd@gnu.org>
2053
2054 * image.c (imagemagick_load_image): Implement transparency.
2055
95988fcf
AS
20562012-06-10 Andreas Schwab <schwab@linux-m68k.org>
2057
2058 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
2059 account for preceding backslashes. (Bug#11663)
2060
cd4eb164
CY
20612012-06-09 Chong Yidong <cyd@gnu.org>
2062
2063 * term.c: Support italics in capable terminals (Bug#9652).
2064 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
2065 (turn_on_face): Output using TS_enter_italic_mode if available.
2066 Don't handle unused blinking and alt-charset cases.
2067 (turn_off_face): Handle italic case; discard unused tty_blinking_p
2068 and tty_alt_charset_p cases.
2069 (tty_capable_p, init_tty): Support italics.
2070
2071 * termchar.h (struct tty_display_info): Add field for italics.
2072 Remove unused blink field.
2073
2074 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
2075 Handle slant.
2076
2077 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
2078 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
2079 tty_alt_charset_p. Add tty_italic_p.
2080
ff88beb8
MA
20812012-06-09 Michael Albinus <michael.albinus@gmx.de>
2082
2083 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
2084 dbus_type_is_basic if available.
2085 (xd_extract_signed, xd_extract_unsigned): Rename from
2086 extract_signed and extract_unsigned, respectively. Adapt callers.
2087
44286096
CY
20882012-06-09 Chong Yidong <cyd@gnu.org>
2089
1682701f
CY
2090 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
2091
44286096
CY
2092 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
2093 case (Bug#9752).
2094
d86feb17
PE
20952012-06-08 Paul Eggert <eggert@cs.ucla.edu>
2096
2097 * xdisp.c (vmessage): Treat frame message as multibyte.
2098 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
2099 would generate the diagnostic "Making \302\247 buffer-local while
2100 let-bound!".
2101
d5c20fe8
EZ
21022012-06-08 Eli Zaretskii <eliz@gnu.org>
2103
2104 * dispnew.c (showing_window_margins_p): Undo last change, which
2105 was done due to an inadvertent commit.
2106 (adjust_frame_glyphs_for_frame_redisplay): Do call
2107 showing_window_margins_p.
2108
513749ee
SM
21092012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2110
2111 * eval.c (Fmake_var_non_special): New primitive.
2112 (syms_of_eval): Defsubr it.
2113 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
2114
d4a8f5c1
JB
21152012-06-08 Juanma Barranquero <lekktu@gmail.com>
2116
2117 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
2118 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
2119
8bbbc977
EZ
21202012-06-08 Eli Zaretskii <eliz@gnu.org>
2121
2122 * alloc.c (allocate_vectorlike): Fix last change.
2123
f3372c87
DA
21242012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
2125
2126 Block-based vector allocation of small vectors.
2127 * lisp.h (struct vectorlike_header): New field `nbytes',
2128 adjust comment accordingly.
2129 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
2130 to denote vector blocks. Adjust users (live_vector_p,
2131 mark_maybe_pointer, valid_lisp_object_p) accordingly.
2132 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
2133 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
2134 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
2135 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
2136 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
2137 (roundup_size): New constant.
2138 (struct vector_block): New data type.
2139 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 2140 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
2141 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
2142 (sweep_vectors): New functions.
2143 (allocate_vectorlike): Return `zero_vector' as the only vector of
2144 0 items. Allocate new vector from block if vector size is less than
2145 or equal to VBLOCK_BYTES_MAX.
2146 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
2147 (init_alloc_once): Add call to init_vectors.
2148
4f18a4ed
SM
21492012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
2150
2151 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
2152
86f158bc
PE
21532012-06-07 Paul Eggert <eggert@cs.ucla.edu>
2154
2155 * doprnt.c (doprnt): Truncate multibyte char correctly.
2156 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
2157 would mishandle a string argument "Xc" if X was a multibyte
2158 character of length 2: it would truncate after X's first byte
2159 rather than including all of X.
2160
c5cfcbe0
CY
21612012-06-06 Chong Yidong <cyd@gnu.org>
2162
2163 * buffer.c (word_wrap): Doc fix.
2164
c05cf390
PE
21652012-06-04 Paul Eggert <eggert@cs.ucla.edu>
2166
2167 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
2168
0c3461de
GM
21692012-06-03 Glenn Morris <rgm@gnu.org>
2170
2171 * xdisp.c (tool-bar-style): Doc fix.
2172
c71232db
UM
21732012-06-03 Ulrich Müller <ulm@gentoo.org>
2174
2175 * Makefile.in (PAXCTL): Define.
2176 (temacs$(EXEEXT)): Disable memory randomization for the temacs
2177 binary via PaX flags if the paxctl utility is available.
2178 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
2179 Restore PaX flags to their default. (Bug#11398)
2180
383f7350
CY
21812012-06-03 Chong Yidong <cyd@gnu.org>
2182
2183 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
2184 buffer (Bug#11226).
2185
5f2c76c6
CY
21862012-06-03 Chong Yidong <cyd@gnu.org>
2187
2188 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
2189 (note_mode_line_or_margin_highlight): If there is no help echo,
2190 use mode-line-default-help-echo. Handle the case where the mouse
2191 position is past the end of the mode line string.
2192
2193 * buffer.c (buffer_local_value_1): New function, split from
2194 Fbuffer_local_value; can return Qunbound.
2195 (Fbuffer_local_value): Use it.
2196 (Vmode_line_format): Docstring tweaks.
2197
773d47f6
PE
21982012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2199
2200 * sysdep.c (system_process_attributes): Improve comment.
2201
f2d6a3df
SM
22022012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
2203
2204 * keyboard.c: Export real-this-command to Elisp.
2205 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
2206 and DEFVAR it. Update all users.
2207
63810350
PE
22082012-06-02 Paul Eggert <eggert@cs.ucla.edu>
2209
7bd5c1f4
PE
2210 * minibuf.c (Fassoc_string): Remove duplicate declaration.
2211
63810350
PE
2212 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
2213 Convert pctcpu and pctmem to Lisp float properly.
2214 Let the compiler fold better, as 100.0/0x8000 is exact.
2215
a2821611
AS
22162012-06-02 Andreas Schwab <schwab@linux-m68k.org>
2217
2218 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
2219 cons_block.
2220
5fceba1d
PE
22212012-06-01 Paul Eggert <eggert@cs.ucla.edu>
2222
2223 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2224
c98ff5dd
DA
22252012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
2226
2227 For a 'struct window', replace some Lisp_Object fields to
2228 bitfields where appropriate, remove unused fields.
2229 * window.h (struct window): Remove unused 'last_mark_x' and
2230 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
2231 change it's type from Lisp_Object to bitfield.
2232 Change type of 'force_start', 'optional_new_start',
2233 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2234 fields from Lisp_Object to bitfield. Adjust users accordingly.
2235
ca34e0be
PE
22362012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2237
2238 Pacify gcc -Wdouble-precision when using Xaw.
2239 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2240 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2241 Use 'float' consistently, rather than 'float' in most places
2242 and 'double' in a couple of places.
2243
efc00ab1 22442012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
2245
2246 * xdisp.c (handle_stop): Detect whether we have overlay strings
2247 loaded by testing it->current.overlay_string_index to be
2248 non-negative, instead of checking whether n_overlay_strings is
2249 positive. (Bug#11587)
2250
efc00ab1 22512012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
2252
2253 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2254
2255 * doc.c (Fsubstitute_command_keys): Doc fix.
2256
efc00ab1 22572012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
2258
2259 * search.c (search_buffer): Remove calls to
2260 r_alloc_inhibit_buffer_relocation, as it is now called by
2261 maybe_unify_char, which was the cause of relocation of buffer text
2262 in bug#11519.
2263
efc00ab1 22642012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
2265
2266 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2267 for the duration of call to load_charset, to avoid problems with
2268 callers of maybe_unify_char that access buffer text through C
2269 pointers.
2270
2271 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2272 decrement the inhibition flag, instead of just setting or
2273 resetting it.
2274
ba93a187
PE
22752012-05-31 Paul Eggert <eggert@cs.ucla.edu>
2276
2277 Remove obsolete '#define static' cruft.
2278 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2279 This #undef was "temporary" in 2000; it is no longer needed
2280 now that '#define static' has gone away.
2281 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2282 (gray_bitmap_bits): Remove; no longer needed.
2283 All uses replaced with definiens.
2284 * xterm.c: Include "bitmaps/gray.xbm".
2285
9e4bf381
PE
22862012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2287
2288 Clean up __executable_start, monstartup when --enable-profiling.
2289 The following changes affect the code only when profiling.
2290 * dispnew.c (__executable_start): Rename from safe_bcopy.
2291 Define only on platforms that need it.
2292 * emacs.c: Include <sys/gmon.h> when profiling.
2293 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2294 (__executable_start): Remove decl, since lisp.h does it now.
2295 (safe_bcopy): Remove decl; no longer has that name.
2296 (main): Coalesce #if into single bit of code, for simplicity.
2297 Cast pointers to uintptr_t, since standard libraries want integers
2298 and not pointers.
2299 * lisp.h (__executable_start): New decl.
2300
32d72c2f
GM
23012012-05-31 Glenn Morris <rgm@gnu.org>
2302
2303 * image.c (Fimagemagick_types): Doc fix.
2304
baac5bc7
JM
23052012-05-30 Jim Meyering <meyering@redhat.com>
2306
2307 * callproc.c (Fcall_process_region): Include directory component
2308 in mkstemp error message (Bug#11586).
2309
72cb32cf
PE
23102012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2311
2312 * alloc.c, lisp.h (make_pure_vector): Now static.
2313
61b108cc
SM
23142012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2315
2316 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2317 Move to byte-run.el.
2318 (Fautoload): Do the hash-doc more carefully.
2319 * data.c (Fdefalias): Purify definition, except for keymaps.
2320 (Qdefun): Move from eval.c.
2321 * lisp.h (Qdefun): Remove.
2322 * lread.c (read1): Tiny simplification.
2323
471fe23d
TN
23242012-05-29 Troels Nielsen <bn.troels@gmail.com>
2325
934f3f58 2326 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2327 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2328 Bug#9642, but explicitly check that the buffer the overlay would
2329 be moved to is live and rearrange lines to make sure that errors
2330 will not put the overlay in an inconsistent state.
2331 (Fdelete_overlay): Cosmetics.
2332
85d0efd1
EZ
23332012-05-28 Eli Zaretskii <eliz@gnu.org>
2334
2335 * w32term.c (my_bring_window_to_top): New function.
2336 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2337 could be different from the original one.
2338 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2339 (Bug#11513)
2340
2341 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2342 by calling BringWindowToTop.
2343
2344 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2345 (WM_EMACS_END): Increase by one.
2346
da92a98c
PE
23472012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2348
2349 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2350 This avoids undefined behavior that might cause the eassert
2351 to not catch an out-of-range value.
2352
74d1f848
JB
23532012-05-28 Juanma Barranquero <lekktu@gmail.com>
2354
2355 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2356 Update dependencies.
2357
9e1a06fc
EZ
23582012-05-27 Eli Zaretskii <eliz@gnu.org>
2359
2360 * bidi.c (bidi_mirror_char): Fix last change.
2361
f3dd7312
AS
23622012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2363
2364 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2365 when referring to sectname field in printf format.
2366
81899c91
PE
23672012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2368
57b81a9f
PE
2369 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2370 Only r_alloc_inhibit_buffer_relocation needed to be added;
2371 the others were already declared.
2372
81899c91
PE
2373 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2374 before checking whether it's out of range. Put the check inside
2375 eassert. See
2376 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2377
33017faf 23782012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2379
2380 * callproc.c (Fcall_process): Restore a line that was accidentally
2381 commented out in the 2011-02-13 change (bug#11547).
2382
33017faf 23832012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2384
2385 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2386 defined on ralloc.c.
2387
2388 * buffer.c [REL_ALLOC]: Remove prototypes of
2389 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2390 they are now on lisp.h.
2391
2392 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2393
2394 * search.c (search_buffer): Use it to inhibit relocation of buffer
2395 text while re_search_2 is doing its job, because re_search_2 is
2396 passed C pointers to buffer text. (Bug#11519)
2397
23415acf
EZ
2398 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2399 Update value to 24.
2400
44e27368
EZ
2401 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2402 state after an additional call to move_it_in_display_line_to, keep
2403 the values of it->max_ascent and it->max_descent found for the
2404 entire line.
2405 (pos_visible_p): Revert the comparison against bottom_y to what it
2406 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2407 (Bug#11464)
2408
c1892f11
PE
24092012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2410
2411 Fix coding-related core dumps with gcc -ftrapv.
2412 The code was computing A - B, where A and B are pointers, and B is
2413 random garbage. This can lead to core dumps on platforms that
2414 have special pointer registers, and it also leads to core dumps on
2415 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2416 A - B only when B is initialized properly.
2417 * coding.c (coding_set_source, coding_set_destination): Return void.
2418 (coding_change_source, coding_change_destinations): New functions,
2419 with the old behaviors of coding_set_source and coding_set_destination.
2420 All callers that need an offset changed to use these new functions.
2421
eb7afdad
GM
24222012-05-26 Glenn Morris <rgm@gnu.org>
2423
2424 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2425
f12fdf02
EZ
24262012-05-26 Eli Zaretskii <eliz@gnu.org>
2427
53a63be6 2428 Extend mouse support on W32 text-mode console.
61b108cc
SM
2429 * xdisp.c (draw_row_with_mouse_face):
2430 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2431
eb3f6f01 2432 * w32console.c: Include window.h.
61b108cc
SM
2433 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2434 New functions.
eb3f6f01
EZ
2435 (initialize_w32_display): Initialize mouse-highlight data.
2436
53a63be6
EZ
2437 * w32inevt.c: Include termchar.h and window.h.
2438 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2439 moves, call note_mouse_highlight. If help_echo changed, call
2440 gen_help_event to produce help-echo message in the echo area.
2441 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2442 highlight info.
2443
4cfd81f6
PE
24442012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2445
2446 * lread.c (read1): Simplify slightly to avoid an overflow warning
2447 with GCC 4.7.0 on x86-64.
2448
4446092a
EZ
24492012-05-26 Eli Zaretskii <eliz@gnu.org>
2450
2451 * bidi.c (bidi_mirror_char): Revert last change: an int is
2452 definitely wide enough here.
2453
42b2a986 24542012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2455
42b2a986 2456 Fix integer width and related bugs (Bug#9874).
eb106a49 2457 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2458 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2459 (string_bytes, check_sblock, allocate_string_data):
2460 (compact_small_strings, Fmake_bool_vector, make_string)
2461 (make_unibyte_string, make_multibyte_string)
2462 (make_string_from_bytes, make_specified_string)
2463 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2464 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2465 (mark_vectorlike):
2466 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2467 (allocate_pseudovector):
2468 Use int, not EMACS_INT, where int is wide enough.
2469 (inhibit_garbage_collection, Fgarbage_collect):
2470 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2471 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2472 int might not be wide enough.
2473 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2474 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2475 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2476 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2477 (bidi_level_of_next_char, bidi_move_to_visually_next):
2478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2479 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2480 (Fkill_buffer, Fset_buffer_major_mode)
2481 (advance_to_char_boundary, Fbuffer_swap_text)
2482 (Fset_buffer_multibyte, overlays_at, overlays_in)
2483 (overlay_touches_p, struct sortvec, record_overlay_string)
2484 (overlay_strings, recenter_overlay_lists)
2485 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2486 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2487 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2488 (Foverlay_recenter, last_overlay_modification_hooks_used)
2489 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2491 (validate_region): Omit unnecessary test for b <= e,
2492 since that's guaranteed by the previous test.
d311d28c
PE
2493 (adjust_overlays_for_delete): Avoid pos + length overflow.
2494 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2495 (report_overlay_modification):
2496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2497 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2498 Omit pointer cast, which isn't needed anyway, and doesn't work
2499 after the EMACS_INT -> ptrdiff_t change.
02481186 2500 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2501 * buffer.h: Adjust decls to match defn changes elsewhere.
2502 (struct buffer_text, struct buffer):
2503 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2504 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2505 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2506 not int, to avoid needless 32-bit limit on 64-bit hosts.
2507 (exec_byte_code): Use tighter memory-full test, one that checks
2508 for alloca overflow. Don't compute the address of the object just
2509 before an array, as that's not portable. Use EMACS_INT, not
2510 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2511 * callint.c (Fcall_interactively):
2512 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2513 * callproc.c (call_process_kill, Fcall_process):
2514 Don't assume pid_t fits into an Emacs fixnum.
2515 (call_process_cleanup, Fcall_process, child_setup):
2516 Don't assume pid_t fits into int.
2517 (call_process_cleanup, Fcall_process, delete_temp_file)
2518 (Fcall_process_region):
2519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2520 (Fcall_process): Simplify handling of volatile integers.
2521 Use int, not EMACS_INT, where int will do.
2522 * casefiddle.c (casify_object, casify_region, operate_on_word)
2523 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2525 (casify_object): Avoid integer overflow when overallocating buffer.
2526 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2527 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2528 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2529 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2530 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2531 integers are now checked earlier. All uses replaced with XINT.
2532 (ccl_driver):
2533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2534 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2535 (ccl_driver, Fregister_code_conversion_map):
2536 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2537 (resolve_symbol_ccl_program): Check that vector header is in range.
2538 Always copy the vector, so that we can check its contents reliably
2539 now rather than having to recheck each instruction as it's being
2540 executed. Check that vector words fit in 'int'.
2541 (ccl_get_compiled_code, Fregister_ccl_program)
2542 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2543 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2544 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2545 contents are in range.
2546 (Fccl_execute_on_string): Check that status is in range.
2547 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2548 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2549 Accept and return EMACS_INT, not int, because callers can pass values
2550 out of 'int' range.
2551 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2552 (multibyte_chars_in_text, parse_str_as_multibyte)
2553 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2554 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2555 (string_escape_byte8, Fget_byte):
2556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2557 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2558 avoid mishandling large integers.
2559 * character.h: Adjust decls to match defn changes elsewhere.
2560 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2561 (Ffind_charset_region):
2562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2563 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2564 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2565 Don't assume fixnum fits in int.
d311d28c
PE
2566 (load_charset_map_from_vector, Fmap_charset_chars):
2567 Remove now-unnecessary CHECK_NATNUMs.
2568 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2569 Don't rely on undefined behavior with signed left shift overflow.
2570 Don't assume unsigned int fits into fixnum, or that fixnum fits
2571 into unsigned int. Don't require max_code to be a valid fixnum;
2572 that's not true for gb10830 4-byte on a 32-bit host. Allow
2573 invalid_code to be a cons, for the same reason. Require code_offset
2574 to be a character. Avoid int overflow if max_char is close
2575 to INT_MAX.
2576 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2577 this is intended anyway and avoids some undefined behavior.
2578 (load_charset_map): Pass unsigned, not int, as 2nd arg of
2579 INDEX_TO_CODE_POINT, as that's what it expects.
2580 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
2581 * charset.h (DECODE_CHAR): Return int, not unsigned;
2582 this is what was intended anyway, and it avoids undefined behavior.
2583 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2584 integer-overflow issues.
2585 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2586 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2587 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
2588 * chartab.c (Fmake_char_table, Fset_char_table_range)
2589 (uniprop_get_decoder, uniprop_get_encoder):
2590 Don't assume fixnum fits in int.
2591 * cmds.c (move_point): New function, that does the gist of
2592 Fforward_char and Fbackward_char, but does so while checking
2593 for integer overflow more accurately.
c96e5d6a 2594 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
2595 (Fforward_line, Fend_of_line, internal_self_insert)
2596 (internal_self_insert):
2597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2598 Fix a FIXME, by checking for integer overflow when calculating
2599 target_clm and actual_clm.
2600 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 2601 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
2602 (ASSURE_DESTINATION, coding_alloc_by_realloc)
2603 (coding_alloc_by_making_gap, alloc_destination)
2604 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2605 (encode_coding_utf_16, detect_coding_emacs_mule)
2606 (decode_coding_emacs_mule, encode_coding_emacs_mule)
2607 (detect_coding_iso_2022, decode_coding_iso_2022)
2608 (encode_invocation_designation, encode_designation_at_bol)
2609 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2610 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2611 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2612 (encode_coding_ccl, encode_coding_raw_text)
2613 (detect_coding_charset, decode_coding_charset)
2614 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2615 (produce_composition, produce_charset, produce_annotation)
2616 (decode_coding, handle_composition_annotation)
2617 (handle_charset_annotation, consume_chars, decode_coding_gap)
2618 (decode_coding_object, encode_coding_object, detect_coding_system)
2619 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2620 (code_convert_region, code_convert_string)
8f50130c
PE
2621 (Fdefine_coding_system_internal)
2622 (coding_set_source, coding_set_destination):
d311d28c
PE
2623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2624 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2625 (Fdefine_coding_system_internal):
2626 Don't assume fixnums fit in int.
2627 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 2628 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
2629 (Funencodable_char_position, Fcheck_coding_systems_region)
2630 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 2631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 2632 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 2633 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 2634 Don't access memory outside of the args array.
d311d28c 2635 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
2636 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2637 result of ENCODE_CHAR.
d311d28c
PE
2638 * coding.h: Adjust decls to match defn changes elsewhere.
2639 (struct coding_system):
2640 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2641 * composite.c (get_composition_id, find_composition)
2642 (run_composition_function, update_compositions)
2643 (compose_text, composition_gstring_put_cache)
2644 (composition_gstring_p, composition_gstring_width)
2645 (fill_gstring_header, fill_gstring_body, autocmp_chars)
2646 (composition_compute_stop_pos, composition_reseat_it)
2647 (composition_update_it, struct position_record)
2648 (find_automatic_composition, composition_adjust_point)
2649 (Fcomposition_get_gstring, Ffind_composition_internal):
2650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2651 (update_compositions):
2652 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2653 * composite.h: Adjust decls to match defn changes elsewhere.
2654 (struct composition):
2655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2656 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2657 Do not attempt to compute the address of the object just before a
2658 buffer; this is not portable.
2659 (Faref, Faset):
2660 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2661 (Faset): Use int, not EMACS_INT, where int is wide enough.
2662 (Fstring_to_number): Don't assume fixnums fit in int.
2663 (Frem): Don't assume arg is nonnegative.
2664 * dbusbind.c (xd_append_arg): Check for integers out of range.
2665 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 2666 (extract_signed, extract_unsigned): New functions.
243e0530
PE
2667 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2668 (xd_get_connection_references): Return ptrdiff_t, not int.
2669 All uses changed.
2670 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2671 (xd_read_message_1):
2672 Use int, not unsigned, where the dbus API uses int.
2673 (Fdbus_message_internal): Don't overflow mtype.
2674 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
2675 * dired.c (directory_files_internal, file_name_completion, scmp)
2676 (file_name_completion_stat):
2677 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2678 (file_name_completion): Don't overflow matchcount.
2679 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2680 * dispextern.h: Adjust decls to match defn changes elsewhere.
2681 (struct text_pos, struct glyph, struct bidi_saved_info)
2682 (struct bidi_string_data, struct bidi_it, struct composition_it)
2683 (struct it):
2684 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2685 (struct display_pos, struct composition_it, struct it):
2686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2687 * dispnew.c (increment_matrix_positions)
2688 (increment_row_positions, mode_line_string)
2689 (marginal_area_string):
2690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 2691 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
2692 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2693 (duration_to_sec_usec): New function, to check for overflow better.
2694 (Fsleep_for, sit_for): Use it.
2695 * doc.c (get_doc_string, store_function_docstring):
2696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2697 (get_doc_string, Fsnarf_documentation):
2698 Use int, not EMACS_INT, where int is wide enough.
2699 (get_doc_string):
2700 Use SAFE_ALLOCA, not alloca.
2701 Check for overflow when converting EMACS_INT to off_t.
2702 * doprnt.c (doprnt):
2703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2704 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2705 Don't assume uid_t fits into fixnum.
2706 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2707 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2708 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2709 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2710 (general_insert_function)
2711 (Finsert_char, make_buffer_string, make_buffer_string_both)
2712 (update_buffer_properties, Fbuffer_substring)
2713 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2714 (Fsubst_char_in_region, check_translation)
2715 (Ftranslate_region_internal, save_restriction_restore, Fformat)
2716 (transpose_markers, Ftranspose_regions):
2717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2718 (clip_to_bounds): Move to lisp.h as an inline function).
2719 (Fconstrain_to_field): Don't assume integers are nonnegative.
2720 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2721 (Fsubst_char_in_region, Fsave_restriction):
2722 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2723 (Femacs_pid): Don't assume pid_t fits into fixnum.
2724 (lo_time): Use int, not EMACS_INT, when int suffices.
2725 (lisp_time_argument): Check for usec out of range.
2726 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
2727 (Fuser_login_name, Fuser_full_name): Signal an error
2728 if a uid argument is out of range, rather than relying on
2729 undefined behavior.
c8d5c857
PE
2730 (Fformat_time_string): Remove now-unnecessary check.
2731 lisp_time_argument checks for out-of-range usec now.
243e0530 2732 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
2733 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2734 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2735 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2736 (init_cmdargs, Fdump_emacs):
2737 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2738 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2739 the bottom (typically) 32 bits of the fixnum.
2740 * eval.c (specpdl_size, call_debugger):
2741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2742 (when_entered_debugger, Fbacktrace_debug):
2743 Don't assume fixnum can fit in int.
2744 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
2745 the object just before a buffer; this is not portable.
2746 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
2747 (grow_specpdl, unbind_to):
2748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2749 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
2750 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 2751 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
2752 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2753 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2754 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2755 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2756 (a_write, e_write):
2757 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2758 (Fcopy_file, non_regular_nbytes, read_non_regular)
2759 (Finsert_file_contents):
2760 Use int, not EMACS_INT, where int is wide enough.
2761 (READ_BUF_SIZE): Verify that it fits in int.
2762 (Finsert_file_contents): Check that counts are in proper range,
2763 rather than assuming fixnums fit into ptrdiff_t etc.
2764 Don't assume fixnums fit into int.
125b3835 2765 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
2766 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
2767 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
2768 (string_char_to_byte, string_byte_to_char)
2769 (string_make_multibyte, string_to_multibyte)
2770 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
2771 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
2772 (substring_both, Fdelete, internal_equal, Ffillarray)
2773 (Fclear_string, mapcar1)
2774 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
2775 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
2776 (larger_vector, make_hash_table, maybe_resize_hash_table)
2777 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
2778 (Fmaphash, secure_hash):
2779 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2780 (concat): Check for string index and length overflow.
2781 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
2782 (Frequire):
2783 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2784 (larger_vector): New API (vec, incr_min, size_max) replaces old
2785 one (vec, new_size, init). This catches size overflow.
2786 INIT was removed because it was always Qnil.
2787 All callers changed.
2788 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
2789 the upper bound on a hash table index size.
2790 (make_hash_table, maybe_resize_hash_table): Use it.
2791 (secure_hash): Computer start_byte and end_byte only after
2792 they're known to be in ptrdiff_t range.
2793 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
2794 (Ffont_get_glyphs, Ffont_at):
2795 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2796 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
2797 (Flist_fonts, Fopen_font):
2798 Don't assume fixnum can fit in int.
2799 (check_gstring): Don't assume index can fit in int.
2800 (font_match_p): Check that fixnum is a character, not a nonnegative
2801 fixnum, since the later code needs to stuff it into an int.
2802 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
2803 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
2804 conversion overflow issues.
2805 (Fopen_font): Check for integer out of range.
2806 (Ffont_get_glyphs): Don't assume index can fit in int.
2807 * font.h: Adjust decls to match defn changes elsewhere.
2808 * fontset.c (reorder_font_vector): Redo score calculation to avoid
2809 integer overflow.
2810 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
2811 printmax_t, where ptrdiff_t is wide enough.
2812 (Finternal_char_font):
2813 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2814 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
2815 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
2816 (Fset_frame_position, x_set_frame_parameters)
2817 (x_set_line_spacing, x_set_border_width)
2818 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
2819 Check that fixnums are in proper range for system types.
2820 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
2821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2822 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
2823 Use SAFE_ALLOCA_LISP, not alloca.
2824 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
2825 intptr_t is wide enough.
2826 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
2827 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
2828 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
2829 Check for fixnum out of range.
2830 * ftfont.c (ftfont_list): Don't assume index fits in int.
2831 Check that fixnums are in proper range for system types.
2832 (ftfont_shape_by_flt):
2833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
2834 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2835 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2836 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
2837 Check that fixnums are in proper range for system types.
2838 * gnutls.h: Adjust decls to match defn changes elsewhere.
2839 * gtkutil.c (xg_dialog_run):
2840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2841 (update_frame_tool_bar):
2842 Check that fixnums are in proper range for system types.
2843 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 2844 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
2845 * indent.c (last_known_column, last_known_column_point):
2846 (current_column_bol_cache):
2847 (skip_invisible, current_column, check_display_width):
2848 (check_display_width, scan_for_column, current_column_1)
2849 (Findent_to, Fcurrent_indentation, position_indentation)
2850 (indented_beyond_p, Fmove_to_column, compute_motion):
2851 (Fcompute_motion, Fvertical_motion):
2852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2853 (last_known_column_modified): Use EMACS_INT, not int.
2854 (check_display_width):
2855 (Fcompute_motion):
2856 Check that fixnums and floats are in proper range for system types.
2857 (compute_motion): Don't assume index or fixnum fits in int.
2858 (compute_motion, Fcompute_motion):
2859 Use int, not EMACS_INT, when it is wide enough.
2860 (vmotion): Omit local var start_hpos that is always 0; that way
2861 we don't need to worry about overflow in expressions involving it.
2862 * indent.h: Adjust decls to match defn changes elsewhere.
2863 (struct position):
2864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2865 Use int, not EMACS_INT, where int is wide enough.
2866 Remove unused members ovstring_chars_done and tab_offset;
2867 all uses removed.
2868 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
2869 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
2870 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
2871 (make_gap, copy_text, insert, insert_and_inherit)
2872 (insert_before_markers, insert_before_markers_and_inherit)
2873 (insert_1, count_combining_before, count_combining_after)
2874 (insert_1_both, insert_from_string)
2875 (insert_from_string_before_markers, insert_from_string_1)
2876 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
2877 (adjust_after_replace, adjust_after_insert, replace_range)
2878 (replace_range_2, del_range, del_range_1, del_range_byte)
2879 (del_range_both, del_range_2, modify_region)
2880 (prepare_to_modify_buffer, signal_before_change)
2881 (signal_after_change, Fcombine_after_change_execute):
2882 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2883 * intervals.c (traverse_intervals, rotate_right, rotate_left)
2884 (balance_an_interval, split_interval_right, split_interval_left)
2885 (find_interval, next_interval, update_interval)
2886 (adjust_intervals_for_insertion, delete_node, delete_interval)
2887 (interval_deletion_adjustment, adjust_intervals_for_deletion)
2888 (static_offset_intervals, offset_intervals)
2889 (merge_interval_right, merge_interval_left, make_new_interval)
2890 (graft_intervals_into_buffer, temp_set_point_both)
2891 (temp_set_point, set_point, adjust_for_invis_intang)
2892 (set_point_both, move_if_not_intangible, get_property_and_range)
2893 (get_local_map, copy_intervals, copy_intervals_to_string)
2894 (compare_string_intervals, set_intervals_multibyte_1):
2895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2896 * intervals.h: Adjust decls to match defn changes elsewhere.
2897 (struct interval):
2898 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2899 * keyboard.c (this_command_key_count, this_single_command_key_start)
2900 (before_command_key_count, before_command_echo_length, echo_now)
2901 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
2902 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
2903 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
2904 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
2905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2906 (last_non_minibuf_size, last_point_position, echo_truncate)
2907 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
2908 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
2909 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
2910 (stuff_buffered_input):
2911 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2912 (last_auto_save, command_loop_1, read_char):
2913 Use EMACS_INT, not int, to avoid integer overflow.
2914 (record_char): Avoid overflow in total_keys computation.
2915 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
2916 * keyboard.h: Adjust decls to match defn changes elsewhere.
2917 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
2918 (Fkey_description, Fdescribe_vector, Flookup_key):
2919 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2920 (click_position): New function, to check that positions are in range.
2921 (Fcurrent_active_maps):
2922 (describe_command):
2923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2924 (Faccessible_keymaps, Fkey_description):
2925 (preferred_sequence_p):
2926 Don't assume fixnum can fit into int.
2927 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
2928 Check for integer overflow in size calculations.
2929 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
2930 avoid mishandling large integers.
2931 * lisp.h: Adjust decls to match defn changes elsewhere.
2932 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
2933 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
2934 (struct Lisp_Marker):
2935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2936 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
2937 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
2938 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
2939 All callers changed.
2940 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
2941 Assume the arg has valid form, since it always does.
2942 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
2943 unsigned integer system type.
2944 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
2945 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
2946 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2947 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
2948 (duration_to_sec_usec): New decl.
2949 * lread.c (read_from_string_index, read_from_string_index_byte)
2950 (read_from_string_limit, readchar, unreadchar, openp)
2951 (read_internal_start, read1, oblookup):
2952 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2953 (Fload, readevalloop, Feval_buffer, Feval_region):
2954 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2955 (openp): Check for out-of-range argument to 'access'.
2956 (read1): Use int, not EMACS_INT, where int is wide enough.
2957 Don't assume fixnum fits into int.
6efdadfd 2958 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
2959 (read_filtered_event): Use duration_to_sec_usec
2960 to do proper overflow checking on durations.
d311d28c
PE
2961 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
2962 in size calculation.
2963 (Fexecute_kbd_macro):
2964 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2965 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
2966 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
2967 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
2968 (set_marker_both, set_marker_restricted_both, marker_position)
2969 (marker_byte_position, Fbuffer_has_markers_at):
2970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2971 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 2972 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
2973 It now merely ensures that the menu is large enough, without
2974 necessarily growing it, as this avoids some integer overflow issues.
2975 All callers changed.
2976 (keymap_panes, parse_single_submenu, Fx_popup_menu):
2977 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2978 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
2979 Use SAFE_ALLOCA_LISP, not alloca.
2980 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
2981 to EMACS_INT. Check that fixnums are in proper range for system types.
2982 * minibuf.c (minibuf_prompt_width, string_to_object)
2983 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
2984 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
2985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2986 (get_minibuffer, read_minibuf_unwind):
2987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2988 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
2989 this simplifies overflow checking. All callers changed.
2990 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
2991 (Ftest_completion):
2992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2993 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
2994 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
2995 Check that fixnums are in proper range for system types.
2996 (Fx_create_frame, Fx_show_tip):
2997 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2998 * nsfont.m (ns_findfonts, nsfont_list_family):
2999 Don't assume fixnum fits in long.
3000 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
3001 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3002 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
3003 wide enough.
17fdb222 3004 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
3005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3006 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
3007 (PRINTDECLARE, PRINTPREPARE):
3008 (strout, print_string):
3009 (print, print_preprocess, print_check_string_charset_prop)
3010 (print_object):
3011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3012 (PRINTDECLARE):
3013 (temp_output_buffer_setup, Fprin1_to_string, print_object):
3014 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3015 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 3016 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 3017 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
3018 (print_error_message): Use SAFE_ALLOCA, not alloca.
3019 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
3020 (print_depth, new_backquote_output, print_number_index):
3021 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
3022 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
3023 (Fset_process_window_size, Fformat_network_address)
3024 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 3025 (sigchld_handler):
d311d28c 3026 Check that fixnums are in proper range for system types.
d44287d4 3027 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
3028 Check for process-ids out of pid_t range rather than relying on
3029 undefined behavior.
e4d81efc 3030 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
3031 (Fformat_network_address, read_process_output, send_process)
3032 (Fprocess_send_region, status_notify):
3033 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3034 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
3035 (wait_reading_process_output, read_process_output, exec_sentinel):
3036 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3037 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
3038 (Faccept_process_output): Use duration_to_sec_usec to do proper
3039 overflow checking on durations.
dde14581
PE
3040 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
3041 Don't assume pid_t fits in int.
02481186
PE
3042 * process.h (struct Lisp_Process): Members tick and update_tick
3043 are now of type EMACS_INT, not int.
b62b53e8
PE
3044 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
3045 configured --with-wide-int.
d311d28c
PE
3046 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
3047 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
3048 * search.c (looking_at_1, string_match_1):
3049 (fast_string_match, fast_c_string_match_ignore_case)
3050 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
3051 (scan_newline, find_before_next_newline, search_command)
3052 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
3053 (set_search_regs, wordify):
3054 (Freplace_match):
3055 (Fmatch_data):
3056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3057 (string_match_1, search_buffer, set_search_regs):
3058 (Fmatch_data):
3059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3060 (wordify): Check for overflow in size calculation.
3061 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
3062 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
3063 Check that fixnums are in proper range for system types.
3064 * sound.c (struct sound_device)
3065 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
3066 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3067 (Fplay_sound_internal):
3068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 3069 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
3070 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
3071 (Fparse_partial_sexp):
3072 Don't assume fixnums can fit in int.
3073 (struct lisp_parse_state, find_start_pos, find_start_value)
3074 (find_start_value_byte, find_start_begv)
3075 (update_syntax_table, char_quoted, dec_bytepos)
3076 (find_defun_start, prev_char_comend_first, back_comment):
3077 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
3078 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
3079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3080 (Finternal_describe_syntax_value): Check that match_lisp is a
3081 character, not an integer, since the code stuffs it into int.
3082 (scan_words, scan_sexps_forward):
3083 Check that fixnums are in proper range for system types.
3084 (Fforward_word):
3085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3086 (scan_sexps_forward):
3087 Use CHARACTERP, not INTEGERP, since the value must fit into int.
3088 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
3089 * syntax.h: Adjust decls to match defn changes elsewhere.
3090 (struct gl_state_s):
3091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
3092 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
3093 MOST_POSITIVE_FIXNUM.
d311d28c
PE
3094 * sysdep.c (wait_for_termination_1, wait_for_termination)
3095 (interruptible_wait_for_termination, mkdir):
3096 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
3097 (emacs_read, emacs_write):
3098 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
3099 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
3100 and double all fit in int.
d311d28c
PE
3101 * term.c (set_tty_color_mode):
3102 Check that fixnums are in proper range for system types.
3103 * termhooks.h (struct input_event):
3104 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3105 * textprop.c (validate_interval_range, interval_of)
3106 (Fadd_text_properties, set_text_properties_1)
3107 (Fremove_text_properties, Fremove_list_of_text_properties)
3108 (Ftext_property_any, Ftext_property_not_all)
3109 (copy_text_properties, text_property_list, extend_property_ranges)
3110 (verify_interval_modification):
3111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3112 (Fnext_single_char_property_change)
3113 (Fprevious_single_char_property_change):
3114 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
3115 (copy_text_properties):
3116 Check for integer overflow in index calculation.
d311d28c
PE
3117 * undo.c (last_boundary_position, record_point, record_insert)
3118 (record_delete, record_marker_adjustment, record_change)
3119 (record_property_change):
3120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3121 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
3122 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3123 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3124 (Fx_hide_tip, Fx_file_dialog):
3125 * w32menu.c (set_frame_menubar):
3126 Use ptrdiff_t, not int, for consistency with rest of code.
3127 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
3128 (select_window, Fdelete_other_windows_internal)
3129 (window_scroll_pixel_based, window_scroll_line_based)
3130 (Frecenter, Fset_window_configuration):
3131 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3132 (Fset_window_hscroll, run_window_configuration_change_hook)
3133 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 3134 (Fscroll_other_window, Frecenter):
d311d28c
PE
3135 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3136 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
3137 Don't assume fixnum fits in int.
3138 (Fset_window_scroll_bars):
3139 Check that fixnums are in proper range for system types.
3140 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
3141 (string_pos, c_string_pos, number_of_chars, init_iterator)
3142 (in_ellipses_for_invisible_text_p, init_from_display_pos)
3143 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
3144 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
3145 (face_before_or_after_it_pos, handle_invisible_prop)
3146 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
3147 (display_prop_intangible_p, string_buffer_position_lim)
3148 (string_buffer_position, handle_composition_prop, load_overlay_strings)
3149 (get_overlay_strings_1, get_overlay_strings)
3150 (iterate_out_of_display_property, forward_to_next_line_start)
3151 (back_to_previous_visible_line_start, reseat, reseat_to_string)
3152 (get_next_display_element, set_iterator_to_next)
3153 (get_visually_first_element, compute_stop_pos_backwards)
3154 (handle_stop_backwards, next_element_from_buffer)
3155 (move_it_in_display_line_to, move_it_in_display_line)
3156 (move_it_to, move_it_vertically_backward, move_it_by_lines)
3157 (add_to_log, message_dolog, message_log_check_duplicate)
3158 (message2, message2_nolog, message3, message3_nolog
3159 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
3160 (current_message_1, truncate_echo_area, truncate_message_1)
3161 (set_message, set_message_1, store_mode_line_noprop)
3162 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
3163 (text_outside_line_unchanged_p, check_point_in_composition)
3164 (reconsider_clip_changes)
3165 (redisplay_internal, set_cursor_from_row, try_scrolling)
3166 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
3167 (redisplay_window, find_last_unchanged_at_beg_row)
3168 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
3169 (trailing_whitespace_p, find_row_edges, display_line)
3170 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
3171 (display_mode_element, store_mode_line_string)
3172 (pint2str, pint2hrstr, decode_mode_spec)
3173 (display_count_lines, display_string, draw_glyphs)
3174 (x_produce_glyphs, x_insert_glyphs)
3175 (rows_from_pos_range, mouse_face_from_buffer_pos)
3176 (fast_find_string_pos, mouse_face_from_string_pos)
3177 (note_mode_line_or_margin_highlight, note_mouse_highlight):
3178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3179 (safe_call, init_from_display_pos, handle_fontified_prop)
3180 (handle_single_display_spec, load_overlay_strings)
3181 (with_echo_area_buffer, setup_echo_area_for_printing)
3182 (display_echo_area, echo_area_display)
3183 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
3184 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
3185 (redisplay_window, dump_glyph_row, display_mode_line)
3186 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 3187 (handle_display_spec, display_prop_string_p):
d311d28c
PE
3188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3189 (handle_single_display_spec, build_desired_tool_bar_string)
3190 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
3191 (get_specified_cursor_type):
3192 Check that fixnums are in proper range for system types.
3193 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
3194 (Flookup_image_map):
3195 Don't assume fixnums fit in int.
3196 (compare_overlay_entries):
3197 Avoid mishandling comparisons due to subtraction overflow.
3198 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
3199 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
3200 (handle_tool_bar_click):
3201 Use int, not unsigned, since we prefer signed and the signedness
3202 doesn't matter here.
3203 (get_next_display_element, next_element_from_display_vector):
3204 Use int, not EMACS_INT, when int is wide enough.
3205 (start_hourglass): Use duration_to_sec_usec to do proper
3206 overflow checking on durations.
3207 * xfaces.c (Fbitmap_spec_p):
3208 Check that fixnums are in proper range for system types.
3209 (compare_fonts_by_sort_order):
3210 Avoid mishandling comparisons due to subtraction overflow.
3211 (Fx_family_fonts, realize_basic_faces):
3212 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3213 (Fx_family_fonts):
3214 Don't assume fixnum fits in int.
3215 Use SAFE_ALLOCA_LISP, not alloca.
3216 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
3217 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
3218 (face_at_buffer_position, face_for_overlay_string)
3219 (face_at_string_position):
3220 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3221 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3222 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3223 (Fx_show_tip):
3224 Check that fixnums are in proper range for system types.
3225 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3226 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3227 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3228 (Fx_change_window_property): Don't assume fixnums fit in int.
3229 * xfont.c (xfont_chars_supported):
3230 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3231 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3232 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3233 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3234 * xml.c (parse_region):
3235 * xrdb.c (magic_file_p):
3236 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3237 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3238 (x_get_local_selection, x_reply_selection_request)
3239 (x_handle_selection_request, wait_for_property_change):
3240 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3241 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3242 short is wide enough.
3243 (x_send_client_event): Don't assume fixnum fits in int.
3244 * xterm.c (x_x_to_emacs_modifiers):
3245 Don't assume EMACS_INT overflows nicely into int.
3246 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3247 may come from Lisp.
3248 (handle_one_xevent): NATNUMP can eval its arg twice.
3249 (x_connection_closed):
3250 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3251 * xterm.h: Adjust decls to match defn changes elsewhere.
3252 (struct scroll_bar): Use struct vectorlike_header
3253 rather than rolling our own approximation.
3254 (SCROLL_BAR_VEC_SIZE): Remove; not used.
3255
c6574eb5
GM
32562012-05-25 Glenn Morris <rgm@gnu.org>
3257
3258 * lisp.mk (lisp): Update for more files being compiled now.
3259
e8d32c7e
SM
32602012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
3261
48def666
SM
3262 * lread.c: Remove `read_pure' which makes no difference.
3263 (read_pure): Remove var.
3264 (unreadpure): Remove function.
3265 (readevalloop): Don't call read_list with -1 flag.
3266 (read1, read_vector): Don't test read_pure any more.
3267 (read_list): Simplify.
3268
e8d32c7e
SM
3269 * fileio.c, character.h: Minor style tweaks.
3270
4b2addb7
DA
32712012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
3272
3273 * window.h (clip_changed): Remove useless declaration.
3274
584461b2
JB
32752012-05-22 Juanma Barranquero <lekktu@gmail.com>
3276
3277 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3278 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3279
34374650
PE
32802012-05-22 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 Remove src/m/*.
3283 This directory predates autoconf and is no longer needed nowadays.
3284 Move its few remaining bits of functionality to where they're needed.
3285 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3286 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3287 * m/template.h: Remove.
3288 * Makefile.in (M_FILE): Remove. All uses removed.
3289 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3290 * lisp.h (USE_LSB_TAG):
3291 * mem-limits.h (EXCEEDS_LISP_PTR):
3292 Use VAL_MAX, not VALBITS, in #if.
3293 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3294 (EMACS_UINT): Define unconditionally now.
3295 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3296 (BITS_PER_EMACS_INT): New constants, replacing
3297 what used to be in config.h, but not useful in #if.
3298 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3299 define them any more.
3300 (VAL_MAX): New macro.
3301 (VALMASK): Use it.
3302 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3303 BITS_PER_EMACS_INT, in #if.
3304 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3305 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3306 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3307 * s/ms-w32.h (DATA_START):
3308 Move here from removed file m/intel386.h.
3309 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3310 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3311
261cb4bb
PE
33122012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3313
3314 Assume C89 or later.
3315 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3316 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3317 (xrealloc):
3318 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3319 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3320 * textprop.c, tparam.c (NULL): Remove.
3321 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3322 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3323 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3324 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3325 * xterm.c (input_signal_count): Assume volatile works.
3326
ff23cd9f
KB
33272012-05-21 Ken Brown <kbrown@cornell.edu>
3328
3329 * xgselect.c (xg_select): Fix first argument in call to 'select'
3330 (bug#11508).
3331
1b170bc6
KB
33322012-05-20 Ken Brown <kbrown@cornell.edu>
3333
3334 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3335 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3336
b2f4d39f
KB
33372012-05-19 Ken Brown <kbrown@cornell.edu>
3338
3339 * xfns.c (x_in_use): Remove `static' qualifier.
3340 * xterm.h (x_in_use): Declare.
3341 * xgselect.c: Include xterm.h.
3342 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3343 and `display_arg' (bug#9754).
3344
003fdae2
PE
33452012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3346
9232a6d9
PE
3347 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3348
003fdae2
PE
3349 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3350 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3351
784b56e2
EZ
33522012-05-18 Eli Zaretskii <eliz@gnu.org>
3353
3354 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3355
3356 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3357 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3358
3359 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3360 reference to image_cache->refcount.
3361 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3362
a0a79cde
JL
33632012-05-17 Juri Linkov <juri@jurta.org>
3364
3365 * search.c (Fword_search_regexp, Fword_search_backward)
3366 (Fword_search_forward, Fword_search_backward_lax)
3367 (Fword_search_forward_lax): Move functions to isearch.el
3368 (bug#10145, bug#11381).
3369
b0572523
PE
33702012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3371
3372 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3373
9660f5fc
SM
33742012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3375
3376 * lread.c (init_obarray): Declare Qt and Qnil as special.
3377
4374de83
GM
33782012-05-14 Glenn Morris <rgm@gnu.org>
3379
3380 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3381 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3382
dc44c39a
PE
33832012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3384
078c97cb
PE
3385 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3386
dc44c39a
PE
3387 * unexaix.c: Port to more-recent AIX compilers.
3388 (report_error, report_error_1, make_hdr, copy_sym)
3389 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3390 Make arguments const char *, not char *, to avoid violations of C
3391 standard and to fix some AIX warnings reported by Gilles Pion.
3392
e18afed7 33932012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3394
3395 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3396 already have overlays loaded.
3397 (handle_single_display_spec): Before returning without displaying
3398 fringe bitmap, synchronize the bidi iterator with the main display
3399 iterator, by calling iterate_out_of_display_property.
3400 (iterate_out_of_display_property): Detect buffer iteration by
3401 testing that it->string is a Lisp string.
3402 (get_next_display_element): When the current object is exhausted,
3403 and there's something on it->stack, call set_iterator_to_next to
3404 proceed with what's on the stack, instead of returning zero.
3405 (set_iterator_to_next): If called at the end of a Lisp string,
3406 proceed to consider_string_end without incrementing string
3407 position. Don't increment display vector index past the end of
3408 the display vector. (Bug#11417)
c8fb9dc6
EZ
3409 (pos_visible_p): Don't report a position visible when move_it_to
3410 stopped at the last line of window, which happens to be scanned
3411 backwards by the bidi iteration. (Bug#11464)
ac268e67 3412
e18afed7 34132012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3414
3415 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3416 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3417 are on a TTY, and thus unable to display on the fringes.
3418 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3419 so we need to signal to the caller that this is a "replacing"
3420 display spec. This fixes display when the spec is invalid or we
3421 are on a TTY.
3422
e18afed7 34232012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3424
3425 * unexaix.c (make_hdr): Fix typo in prototype.
3426 This bug broke the build on AIX. Problem reported by Gilles Pion.
3427
9d0a235a
MA
34282012-05-14 Michael Albinus <michael.albinus@gmx.de>
3429
3430 * keyboard.c (kbd_buffer_get_event): Read special events also in
3431 batch mode. (Bug#11415)
3432
9e6b06ed
GM
34332012-05-12 Glenn Morris <rgm@gnu.org>
3434
3435 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3436
c1a1d7a3
EZ
34372012-05-12 Eli Zaretskii <eliz@gnu.org>
3438
3439 * lisp.mk (lisp): Add newcomment.elc.
3440
3fe7cdc8
GM
34412012-05-12 Glenn Morris <rgm@gnu.org>
3442
3443 * Makefile.in (MKDIR_P): New, set by configure.
3444 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3445
53f7d2c0
PE
34462012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3447
3448 Remove unused function hourglass_started.
3449 * dispextern.h (hourglass_started):
3450 * w32fns.c (hourglass_started):
3451 * xdisp.c (hourglass_started): Remove.
3452
75aafb17
JB
34532012-05-10 Juanma Barranquero <lekktu@gmail.com>
3454
3455 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3456 Update dependencies.
3457
12959e8e
PE
34582012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3459
97107e2e
PE
3460 * xgselect.c (xg_select): Put maxfds+1 into a var.
3461 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3462
12959e8e
PE
3463 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3464
836d29b3
DA
34652012-05-10 Dave Abrahams <dave@boostpro.com>
3466
3467 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3468 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3469
5cb67954
MA
34702012-05-09 Michael Albinus <michael.albinus@gmx.de>
3471
3472 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3473 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3474 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3475 Initialize xd_registered_buses.
3476
3478ec45
PE
34772012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3478
b263a6b0
PE
3479 Untag more efficiently if USE_LSB_TAG.
3480 This is based on a proposal by YAMAMOTO Mitsuharu in
3481 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3482 For an admittedly artificial (nth 8000 longlist) benchmark on
3483 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3484 Emacs's overall text size by 1%.
3485 * lisp.h (XUNTAG): New macro.
3486 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3487 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3488 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3489 * eval.c (Fautoload):
3490 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3491 * frame.h (XFRAME): Use XUNTAG.
3492
3478ec45
PE
3493 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3494 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3495 Remove unportable assumptions about print widths of types like
3496 dbus_uint32_t.
3497 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3498 intptr_t when converting between pointer and integer, to avoid GCC
3499 warnings about wrong width.
3500
666b903b 35012012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3502
3503 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3504 stack for each reader_thread, instead of defaulting to 8MB
3505 determined by the linker. This avoids failures in creating
3506 subprocesses on Windows 7, see the discussion in this thread:
3507 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3508
b120cc17
JC
35092012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3510
3511 Fix up display of the *Minibuf-0* buffer in the mini window.
3512 * keyboard.c (read_char): Don't clear the echo area if there's no
3513 message to clear.
3514 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3515 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3516
9a4b36f8
MA
35172012-05-07 Michael Albinus <michael.albinus@gmx.de>
3518
3519 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3520 batch mode.
3521
e5f9458f
CY
35222012-05-06 Chong Yidong <cyd@gnu.org>
3523
3524 * lisp.mk (lisp): Update.
3525
eceeb5fc 35262012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3527
3528 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3529
71873e2b
SM
35302012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3531
3532 * data.c (PUT_ERROR): New macro.
3533 (syms_of_data): Use it. Add new error type `user-error'.
3534 * undo.c (user_error): New function.
3535 (Fprimitive_undo): Use it.
3536 * print.c (print_error_message): Adjust print style for `user-error'.
3537 * keyboard.c (user_error): New function.
3538 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3539
ab0fa4e4
PE
35402012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3541
3542 Do not limit current-time-string to years 1000..9999.
3543 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3544 (Fcurrent_time_string): Support any year that is supported by the
3545 underlying localtime representation. Don't use asctime, as it
3546 has undefined behavior for years outside the range -999..9999.
3547
7ed806a7
PE
35482012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3549
3550 Fix race conditions involving setenv, gmtime, localtime, asctime.
3551 Without this fix, interrupts could mess up code that uses these
3552 nonreentrant functions, since setting TZ invalidates existing
3553 tm_zone or tzname values, and since most of these functions return
3554 pointers to static storage.
3555 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3556 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3557 Grow the critical sections to include not just invoking
3558 localtime/gmtime, but also accessing these functions' results
3559 including their tm_zone values if any, and any related TZ setting.
3560 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3561 so that the struct tm is saved in the critical section.
3562 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3563 motivated by the fact that memory allocation needs to be outside
3564 the critical section.
3565
0c16dfed
DA
35662012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3567
3568 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3569 with RESET_INTERVAL.
3570
3571 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3572 Remove duplicated buffer name initialization.
3573
3f83ace8
JM
35742012-05-02 Jim Meyering <jim@meyering.net>
3575
3576 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3577
c7b8541e
JM
3578 * xfns.c (x_window): Use xstrdup (Bug#11375).
3579
90207a15 35802012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
3581
3582 * xdisp.c (pos_visible_p): If already at a newline from the
3583 display string before the 'while' loop, don't walk back the glyphs
3584 from it3.glyph_row. Solves assertion violation when the display
3585 string begins with a newline (egg.el). (Bug#11367)
3586
b593d6a9
AH
35872012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
3588
3589 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3590 Move to simple.el.
3591
4737362e
GM
35922012-05-01 Glenn Morris <rgm@gnu.org>
3593
99cf43f9
GM
3594 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3595 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3596 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3597 All were removed before 23.1.
3598
9311dcff
GM
3599 * dispnew.c: Remove HAVE_LIBNCURSES test;
3600 it is always true on relevant platforms.
3601
4d5c6349
GM
3602 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3603 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3604
4737362e
GM
3605 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3606
74dd3a6b
AS
36072012-04-30 Andreas Schwab <schwab@linux-m68k.org>
3608
3609 * .gdbinit (xpr): Remove checks for no longer existing misc types.
3610 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3611 Remove.
3612
13c379ee
PE
36132012-04-28 Paul Eggert <eggert@cs.ucla.edu>
3614
3615 Do not avoid creating empty evaporating overlays (Bug#9642).
3616 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3617 That is, do not delete an evaporating overlay if it becomes
3618 empty after its bounds are adjusted to fit within its buffer.
3619 This fix caused other problems, and I'm reverting it until we get
3620 to the bottom of them.
3621
a8e7d6d7 36222012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
3623
3624 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3625
a8e7d6d7 36262012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
3627
3628 * xdisp.c (pos_visible_p): If the window start position is beyond
3629 ZV, start the display from buffer beginning. Prevents assertion
3630 violation in init_iterator when the minibuffer window is scrolled
3631 via the scroll bar.
3632
3633 * window.c (window_scroll_pixel_based): Likewise.
3634
a8e7d6d7 36352012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
3636
3637 * keymap.c (where_is_internal): Doc fix (Bug#10872).
3638
a8e7d6d7 36392012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
3640
3641 * fileio.c (Fcopy_file, Fset_file_selinux_context):
3642 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
3643
a8e7d6d7 36442012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 3645
b593d6a9
AH
3646 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3647 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 3648
1c6900d9
EZ
36492012-04-26 Eli Zaretskii <eliz@gnu.org>
3650
4c3fa1d9
EZ
3651 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3652 display element, check also the underlying string or buffer
3653 character. (Bug#11341)
3654
1c6900d9
EZ
3655 * w32menu.c: Include w32heap.h.
3656 (add_menu_item): If the call to AppendMenuW (via
3657 unicode_append_menu) fails, disable Unicode menus only if we are
3658 running on Windows 9X/Me.
3659
42bf8205
AS
36602012-04-24 Andreas Schwab <schwab@linux-m68k.org>
3661
3662 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3663 (xgetint): Add missing shift for LSB tags.
3664
b1bac16e
MR
36652012-04-24 Martin Rudalics <rudalics@gmx.at>
3666
3667 * keyboard.c (read_char): Don't wipe echo area for select window
3668 events: These might get delayed via `mouse-autoselect-window'
3669 (Bug#11304).
3670
d69621cc
JB
36712012-04-24 Juanma Barranquero <lekktu@gmail.com>
3672
3673 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3674 manipulation of :loaded-from data.
3675
02fd101b
JB
36762012-04-23 Juanma Barranquero <lekktu@gmail.com>
3677
3678 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3679 now a cons (bug#11311).
3680
888bec30
PE
36812012-04-23 Paul Eggert <eggert@cs.ucla.edu>
3682
89a438bd
PE
3683 Do not create empty overlays with the evaporate property (Bug#9642).
3684 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3685 if it becomes empty after its bounds are adjusted to fit within
3686 its buffer. Without this fix, in a nonempty buffer (let ((o
3687 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3688 yields an empty overlay that has the evaporate property, which is
3689 not supposed to happen.
3690
1068fe4d
PE
3691 Fix minor GTK3 problems found by static checking.
3692 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3693 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3694 (struct _EmacsFixedClass, emacs_fixed_get_type):
3695 Move decls here from emacsgtkfixed.h, since they needn't be public.
3696 (emacs_fixed_get_type): Now static.
3697 (emacs_fixed_class_init): Omit unused local.
3698 (emacs_fixed_child_type): Remove; unused.
3699 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3700 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3701 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3702 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3703 (EMACS_FIXED_GET_CLASS): Remove; unused.
3704 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3705
888bec30
PE
3706 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3707 Problem reported by Juanma Barranquero for Windows -Wunused-function.
3708
de85e130
PE
37092012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3710
d0baac98 3711 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 3712 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
3713 (__malloc_size_t, __malloc_ptrdiff_t):
3714 Remove. All uses removed, replaced by the definiens if needed,
3715 since we can assume C89 or better now.
3716 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3717 (protect_malloc_state, align, get_contiguous_space)
3718 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3719 (malloc_atfork_handler_child, malloc_enable_thread)
3720 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3721 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3722 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3723 (special_realloc, _realloc_internal_nolock, _realloc_internal)
3724 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3725 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3726 Define using prototypes, not old style.
3727 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3728 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3729 (align): Don't assume that signed integer overflow wraps around.
3730 Omit unused local var.
3731 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3732 (_free_internal_nolock, memalign, mallochook, reallochook):
3733 Omit no-longer-needed casts.
3734 (valloc): Use getpagesize, not __getpagesize.
3735 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3736 (struct hdr): The 'magic' member is now size_t, not unsigned long.
3737
de85e130
PE
3738 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3739
dcbf5805
MA
37402012-04-22 Michael Albinus <michael.albinus@gmx.de>
3741
3742 Move functions from C to Lisp. Make non-blocking method calls
3743 the default. Implement further D-Bus standard interfaces.
3744
3745 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
3746 (QCdbus_request_name_allow_replacement)
3747 (QCdbus_request_name_replace_existing)
3748 (QCdbus_request_name_do_not_queue)
3749 (QCdbus_request_name_reply_primary_owner)
3750 (QCdbus_request_name_reply_in_queue)
3751 (QCdbus_request_name_reply_exists)
3752 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3753 (QCdbus_registered_serial, QCdbus_registered_method)
3754 (QCdbus_registered_signal): New Lisp objects.
3755 (XD_DEBUG_MESSAGE): Use sizeof.
3756 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3757 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3758 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3759 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3760 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3761 (xd_signature, xd_append_arg): Allow float for integer types.
3762 (xd_get_connection_references): New function.
b593d6a9
AH
3763 (xd_get_connection_address): Rename from xd_initialize.
3764 Return cached address.
dcbf5805
MA
3765 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
3766 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
3767 level.
3768 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 3769 Return number of refcounts.
dcbf5805
MA
3770 (Fdbus_get_unique_name): Make stronger parameter check.
3771 (Fdbus_message_internal): New defun.
3772 (Fdbus_call_method, Fdbus_call_method_asynchronously)
3773 (Fdbus_method_return_internal, Fdbus_method_error_internal)
3774 (Fdbus_send_signal, Fdbus_register_service)
3775 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
3776 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
3777 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
3778 (Vdbus_compiled_version, Vdbus_runtime_version)
3779 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
3780 (Vdbus_message_type_method_return, Vdbus_message_type_error)
3781 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
3782 (Vdbus_registered_buses, Vdbus_registered_objects_table):
3783 Adapt docstring.
dcbf5805 3784
52828e02
PE
37852012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3786
da05bc4c
PE
3787 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
3788 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
3789 Do not assume ptrdiff_t is the same width as 'int'.
3790
52828e02
PE
3791 * alloc.c: Handle unusual debugging option combinations.
3792 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
3793 since the two debugging options are incompatible.
3794 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
3795 is defined.
3796 (mem_init, mem_insert, mem_insert_fixup):
3797 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
3798 (NEED_MEM_INSERT): Remove; no longer needed.
3799
f01769f9
LL
38002012-04-22 Leo Liu <sdl.web@gmail.com>
3801
3802 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
3803
5790543d
PE
38042012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 * sysdep.c [__FreeBSD__]: Minor cleanups.
3807 (list_system_processes, system_process_attributes) [__FreeBSD__]:
3808 Use Emacs indenting style more consistently. Avoid some casts.
3809 Use 'double' consistently rather than mixing 'float' and 'double'.
3810
b91b7e4d
EW
38112012-04-21 Eduard Wiebe <usenet@pusto.de>
3812
b593d6a9
AH
3813 * sysdep.c (list_system_processes, system_process_attributes):
3814 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 3815
6114eb15
AS
38162012-04-21 Andreas Schwab <schwab@linux-m68k.org>
3817
3818 * lisp.mk (lisp): Update.
3819
2f38dff7
PE
38202012-04-20 Paul Eggert <eggert@cs.ucla.edu>
3821
3822 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
3823 It is never used otherwise.
3824
4ae29f89
SM
38252012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
3826
3827 * print.c (print_preprocess): Only check print_depth if print-circle
3828 is nil.
3829 (print_object): Check for cycles even when print-circle is nil and
3830 print-gensym is t, but only check print_depth if print-circle is nil.
3831
f30d612a
CY
38322012-04-20 Chong Yidong <cyd@gnu.org>
3833
3834 * process.c (wait_reading_process_output): If EIO occurs on a pty,
3835 set the status to "failed" and ensure that sentinel is run.
3836
c07a4c0b 38372012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
3838
3839 * process.c (Fset_process_inherit_coding_system_flag)
3840 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 3841 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 3842
c07a4c0b 38432012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
3844
3845 * xdisp.c (string_buffer_position_lim): Limit starting position to
3846 BEGV.
3847 (set_cursor_from_row): If called for a mode-line or header-line
3848 row, return zero immediately.
3849 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
3850 farther than the first row after the header line, if any.
3851 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
3852 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
3853
c07a4c0b 38542012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3855
4ae29f89
SM
3856 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
3857 (bug#11238).
ad3a2b41 3858
c07a4c0b 38592012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 38602012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
3861
3862 configure: new option --enable-gcc-warnings (Bug#11207)
3863 * Makefile.in (C_WARNINGS_SWITCH): Remove.
3864 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
3865 (ALL_CFLAGS): Use new macros rather than old.
3866 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
3867 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
3868 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
3869 -Wunused-result, -Wunused-variable. This should go away once
3870 the Emacs and Gnulib regex code is merged.
3871 (xmalloc, xrealloc): Now static.
3872
aba027e8
PE
38732012-04-17 Paul Eggert <eggert@cs.ucla.edu>
3874
3875 * dired.c (Fsystem_groups): Remove unused local.
3876
e5a36063
GM
38772012-04-17 Glenn Morris <rgm@gnu.org>
3878
3879 * dired.c (Fsystem_users): Doc fix.
3880
316411f0
DA
38812012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
3882
3883 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
3884 (syms_of_dired): Add them.
3885
9426aba4
PE
38862012-04-16 Paul Eggert <eggert@cs.ucla.edu>
3887
b62a57be
PE
3888 Fix minor alloc.c problems found by static checking.
3889 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
3890 New extern decls, to avoid calling undeclared functions.
3891 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
3892 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
3893 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
3894 (NEED_MEM_INSERT): New macro.
3895 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 3896 Remove one incorrect comment and fix another.
b62a57be 3897
3539f31f
PE
3898 Fix minor ralloc.c problems found by static checking.
3899 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3900 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
3901 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
3902 (r_alloc_sbrk): Now static.
3903
a041960a
PE
3904 Improve ralloc.c interface checking.
3905 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3906 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
3907 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
3908 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
3909 [REL_ALLOC]: ... to here, to check interface.
3910 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
3911 Remove decls. This fixes an "It stinks!".
3912
9426aba4
PE
3913 * alloc.c (which_symbols): Fix alignment issue / type clash.
3914
d55c12ed
AS
39152012-04-15 Andreas Schwab <schwab@linux-m68k.org>
3916
3917 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
3918 (struct Lisp_Misc_Any): Likewise.
3919 (struct Lisp_Free): Likewise.
3920 * alloc.c (union aligned_Lisp_Symbol): Define.
3921 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
3922 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
3923 (union aligned_Lisp_Misc): Define.
3924 (MARKER_BLOCK_SIZE, struct marker_block): Use union
3925 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 3926 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 3927
b948ce8b
PE
39282012-04-14 Paul Eggert <eggert@cs.ucla.edu>
3929
3930 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
3931 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
3932 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
3933 * s/netbsd.h, s/sol2-6.h:
3934 Remove definition of GC_MARK_STACK, since the default now works.
3935 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
3936 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
3937 no longer the default.
3938 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
3939
35dc09a1 39402012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3941
35dc09a1
GM
3942 * lread.c (lisp_file_lexically_bound_p):
3943 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 3944
35dc09a1
GM
39452012-04-14 Eli Zaretskii <eliz@gnu.org>
3946
3947 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
3948 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
3949
39502012-04-14 Jan Djärv <jan.h.d@swipnet.se>
3951
3952 * nsterm.m (constrainFrameRect): Always constrain when there is only
3953 one screen (Bug#10962).
3954
bcd86815
KB
39552012-04-13 Ken Brown <kbrown@cornell.edu>
3956
3957 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
3958
c25df26e
RT
39592012-04-13 Reuben Thomas <rrt@sc3d.org>
3960
3961 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
3962
0fc59f1e
DC
39632012-04-11 Daniel Colascione <dancol@dancol.org>
3964
3965 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
3966 against is gone. It's better to use vfork now so that when Cygwin
3967 gains a new, working vfork, we use it automatically (bug#10398).
3968
de8c03dc
SM
39692012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3970
3971 * window.c (save_window_save): Obey window-point-insertion-type.
3972
2f097256
GM
39732012-04-11 Glenn Morris <rgm@gnu.org>
3974
3975 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
3976
453b951e
SM
39772012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3978
3979 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
3980
75f1671a 39812012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
3982
3983 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
3984 (force_quit_count): New var.
3985 (handle_interrupt): Use it.
3986
2a8ce227
JB
39872012-04-10 Juanma Barranquero <lekktu@gmail.com>
3988
3989 * w32.c (w32_delayed_load): Record the full path of the library
3990 being loaded (bug#10424).
3991
935396c0
GM
39922012-04-09 Glenn Morris <rgm@gnu.org>
3993
05920a43
GM
3994 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
3995 not just in the obarray, before snarfing them. (Bug#11036)
3996
935396c0
GM
3997 * Makefile.in ($(leimdir)/leim-list.el):
3998 Pass EMACS rather than BUILT_EMACS.
3999
a18ecafa
TZ
40002012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
4001
4002 * process.c (make_process):
4003 * process.h: Add integer `gnutls_handshakes_tried' member to
4004 process struct.
4005
6bbef4e5
JC
4006 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
4007 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
4008
4009 * gnutls.c (gnutls_log_function2i): Convenience log function.
4010 (emacs_gnutls_read): Use new log functions,
4011 `gnutls_handshakes_tried' process member, and
4012 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
4013 attempts per process (connection).
4014
b4d3bc10
CY
40152012-04-09 Chong Yidong <cyd@gnu.org>
4016
4017 * eval.c (Fuser_variable_p, user_variable_p_eh)
4018 (lisp_indirect_variable): Functions deleted.
4019 (Fdefvar): Caller changed.
4020
4021 * callint.c (Finteractive, Fcall_interactively):
4022 * minibuf.c (Fread_variable): Callers changed.
4023
70f4d973
EZ
40242012-04-09 Eli Zaretskii <eliz@gnu.org>
4025
4026 * xdisp.c (set_cursor_from_row): If the display string appears in
4027 the buffer at position that is closer to point than the position
4028 after the display string, display the cursor on the first glyph of
4029 the display string. Fixes cursor display when a 'display' text
4030 property immediately follows invisible text. (Bug#11094)
4031
cb3c2e3e
PE
40322012-04-09 Paul Eggert <eggert@cs.ucla.edu>
4033
4034 composite.c: use 'double' consistently
4035 * composite.c (get_composition_id): Use 'double' consistently
4036 instead of converting 'float' to 'double' and vice versa; this is
4037 easier to understand and avoids a GCC warning.
4038
fd06db5d
GM
40392012-04-09 Glenn Morris <rgm@gnu.org>
4040
50fe702a
GM
4041 * Makefile.in: Generate leim-list with bootstrap-emacs, in
4042 preparation for dumping it with emacs. (Bug#4789)
4043 (leimdir): New variable.
4044 ($(leimdir)/leim-list.el): New rule.
4045 (emacs$(EXEEXT)): Depend on leim-list.el.
4046
fd06db5d
GM
4047 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
4048 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
4049 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
4050
55c131ee
AS
40512012-04-08 Andreas Schwab <schwab@linux-m68k.org>
4052
4053 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
4054 proper alignment.
4055
9209588f
JB
40562012-04-07 Juanma Barranquero <lekktu@gmail.com>
4057
4058 * xml.c (init_libxml2_functions) [WINDOWSNT]:
4059 Remove unused local variable.
4060
e3fb2efb
PE
40612012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4062
4063 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
4064 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
4065 (mark_memory): Mark Lisp_Objects only if pointers might hide in
4066 objects, as mark_maybe_pointer will catch them otherwise.
4067 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
4068 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
4069
b5385551
PE
40702012-04-07 Paul Eggert <eggert@cs.ucla.edu>
4071
4072 Fix typo that broke non-Windows builds.
4073 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
4074
9078ead6
EZ
40752012-04-07 Eli Zaretskii <eliz@gnu.org>
4076
4077 Support building on MS-Windows with libxml2.
4078
4079 * makefile.w32-in (OBJ2): Add xml.$(O).
4080 (GLOBAL_SOURCES): Add xml.c.
4081 ($(BLD)/xml.$(O)): New dependency list.
4082
4083 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
4084 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
4085 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
4086 [!WINDOWSNT]: New macros.
4087 (init_libxml2_functions, libxml2_loaded_p): New functions.
4088 (parse_region): Call fn_xmlCheckVersion instead of using the macro
4089 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
4090 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
4091 Calls xmlCleanupParser only if libxml2 was loaded (or statically
4092 linked in).
6bbef4e5
JC
4093 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
4094 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
4095 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
4096
4097 * emacs.c: Don't include libxml/parser.h.
4098 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
4099 xmlCleanupParser directly.
4100
4101 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
4102
3811fdf3
EZ
41032012-04-07 Eli Zaretskii <eliz@gnu.org>
4104
4105 * indent.c (Fvertical_motion): If there is a display string at
4106 point, use it.vpos to compute how many lines to backtrack after
4107 move_it_to point. (Bug#11133)
4108
2f8e16b2
EZ
41092012-04-06 Eli Zaretskii <eliz@gnu.org>
4110
4111 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
4112 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
4113 about subtle differences between FETCH_CHAR* and STRING_CHAR*
4114 macros related to unification of CJK characters. For the details,
4115 see the discussion following the message here:
4116 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
4117
3d439cd1
CY
41182012-04-04 Chong Yidong <cyd@gnu.org>
4119
4120 * keyboard.c (Vdelayed_warnings_list): Doc fix.
4121
8bc53d00
EZ
41222012-04-01 Eli Zaretskii <eliz@gnu.org>
4123
4124 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
4125 instead of alloca. (Bug#11138)
4126
3b0512a3
AS
41272012-04-01 Andreas Schwab <schwab@linux-m68k.org>
4128
4129 * w32menu.c (is_simple_dialog): Properly check lisp types.
4130 (Bug#11141)
4131
8427ddd2
EZ
41322012-03-31 Eli Zaretskii <eliz@gnu.org>
4133
979022ef
EZ
4134 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
4135 position we get to after a call to move_it_to fails the
4136 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
4137 only if we wind up in a string from display property. (Bug#11063)
4138
a6b1c7cc
EZ
4139 * window.c (Fdelete_other_windows_internal): Invalidate the row
4140 and column information about mouse highlight, so that redisplay
4141 restores it after reallocating the glyph matrices. (Bug#7464)
4142
8427ddd2
EZ
4143 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
4144 string comes from a `display' text property, use the buffer
4145 position of that property as if we actually saw that position in
4146 the row's glyphs.
697ba24b
EZ
4147 (move_it_by_lines): Remove the assertion that
4148 "it->current_x == 0 && it->hpos == 0" which can be legitimately
4149 violated when there's a before-string at the beginning of a line.
4150 (Bug#11063)
8427ddd2 4151
65a0a738
EZ
41522012-03-30 Eli Zaretskii <eliz@gnu.org>
4153
4154 * xdisp.c (append_space_for_newline): If the default face was
4155 remapped, use the remapped face for the appended newline.
4156 (extend_face_to_end_of_line): Use the remapped default face for
4157 extending the face to the end of the line.
4158 (display_line): Call extend_face_to_end_of_line when the default
4159 face was remapped. (Bug#11068)
4160
581355cc
EZ
41612012-03-29 Eli Zaretskii <eliz@gnu.org>
4162
4163 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
4164
e8fc049f
SM
41652012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4166
4167 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
4168
4fb9a543
GM
41692012-03-27 Glenn Morris <rgm@gnu.org>
4170
4171 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
4172 Doc fixes.
4173
679910f1
KH
41742012-03-26 Kenichi Handa <handa@m17n.org>
4175
4176 * dispextern.h (struct glyph): Fix previous change. Change the
4177 bit length of glyphless.ch to 25 (Bug#11082).
4178
90d49b7f
CY
41792012-03-26 Chong Yidong <cyd@gnu.org>
4180
4181 * keyboard.c (Vselection_inhibit_update_commands): New variable.
4182 (command_loop_1): Use it; inhibit selection update for
4183 handle-select-window too (Bug#8996).
4184
f514f6f0
FP
41852012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
4186
e8fc049f 4187 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 4188
bf43fa51
KH
41892012-03-25 Kenichi Handa <handa@m17n.org>
4190
4191 * dispextern.h (struct glyph): Change the bit length of
4192 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
4193
8a0c01dd
EZ
41942012-03-24 Eli Zaretskii <eliz@gnu.org>
4195
4196 * s/ms-w32.h (tzname): Include time.h before redirecting to
4197 _tzname. Fixes the MSVC build. (Bug#9960)
4198
7d1c3a76
AS
41992012-03-24 Andreas Schwab <schwab@linux-m68k.org>
4200
8ed79523
AS
4201 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
4202 characters.
4203
7d1c3a76
AS
4204 * xterm.c (XTread_socket): Only modify handling_signal if
4205 !SYNC_INPUT. (Bug#11080)
4206
e99a9b8b
EZ
42072012-03-23 Eli Zaretskii <eliz@gnu.org>
4208
4209 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
4210 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
4211 when fetching a multibyte character consumes more bytes than
4212 CHAR_BYTES returns, due to unification of CJK characters in
4213 string_char. (Bug#11073)
4214
5063c0e1
TN
42152012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
4216
4217 * process.c (wait_reading_process_output): Handle pty disconnect
4218 by refraining from sending oneself a SIGCHLD (bug#10933).
4219
9f851fbd
CY
42202012-03-22 Chong Yidong <cyd@gnu.org>
4221
4222 * dispextern.h (struct it): New member string_from_prefix_prop_p.
4223
5063c0e1 4224 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
4225 Mark string as coming from a prefix property.
4226 (handle_face_prop): Use default face for prefix strings (Bug#4281).
4227 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4228
fb5b8aca
CY
42292012-03-21 Chong Yidong <cyd@gnu.org>
4230
4231 * xfaces.c (Vface_remapping_alist): Doc fix.
4232
62356a1b
EZ
42332012-03-20 Eli Zaretskii <eliz@gnu.org>
4234
4235 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
4236 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4237 Doc fixes.
62356a1b 4238
025de85b
CY
42392012-03-20 Chong Yidong <cyd@gnu.org>
4240
4241 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4242 to reflect default non-nil value of redisplay-dont-pause.
4243
4827f94e
KH
42442012-03-19 Kenichi Handa <handa@m17n.org>
4245
4246 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4247 it fit in a valid range (Bug#11003).
4248
e50a24a2
EZ
42492012-03-18 Eli Zaretskii <eliz@gnu.org>
4250
4251 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4252 that is not from display property, accept the row as a "cursor
4253 row" if one of the string's character has a non-nil `cursor'
4254 property. Fixes cursor positioning when there are newlines in
4255 overlay strings, e.g. in icomplete.el. (Bug#11035)
4256
9af5ed87
PE
42572012-03-12 Paul Eggert <eggert@cs.ucla.edu>
4258
4259 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4260
d1f55f16
CY
42612012-03-12 Chong Yidong <cyd@gnu.org>
4262
4263 * eval.c (inhibit_lisp_code): Rename from
4264 inhibit_window_configuration_change_hook; move from window.c.
4265
4266 * xfns.c (unwind_create_frame_1, Fx_create_frame):
4267 * window.c (run_window_configuration_change_hook)
4268 (syms_of_window): Callers changed.
4269
66c5eebd
CY
42702012-03-11 Chong Yidong <cyd@gnu.org>
4271
413df973
CY
4272 * keymap.c (Fkey_description): Doc fix (Bug#9700).
4273
66c5eebd
CY
4274 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4275
1de11f56
CY
42762012-03-10 Chong Yidong <cyd@gnu.org>
4277
4278 * frame.c (other_visible_frames): Don't assume the selected frame
4279 is visible (Bug#10955).
4280
cae07000
SM
42812012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
4282
4283 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4284
89c94350
JD
42852012-03-08 Jan Djärv <jan.h.d@swipnet.se>
4286
4287 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4288 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4289 zero (Bug#10954).
4290
999dd333
GM
42912012-03-03 Glenn Morris <rgm@gnu.org>
4292
01a6dcc8 4293 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4294
de0100f2
EZ
42952012-03-02 Eli Zaretskii <eliz@gnu.org>
4296
4297 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4298 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4299 (redisplay_window, next_element_from_string): Fix typos in
4300 comments.
3e441275
EZ
4301 (redisplay_window): Pass to move_it_vertically the margin in
4302 pixels, not in screen lines.
de0100f2 4303
96a72ee9
GM
43042012-03-02 Glenn Morris <rgm@gnu.org>
4305
4306 * buffer.c (buffer-list-update-hook): Doc fix.
4307
312508d7
EZ
43082012-02-29 Eli Zaretskii <eliz@gnu.org>
4309
4310 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4311 push_it before setting up the iterator for the first overlay
4312 string, even if we have an empty string loaded.
4313 (next_overlay_string): If there's an empty string on the iterator
4314 stack, pop the stack. (Bug#10903)
4315
27f3c637
PE
43162012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4317
4318 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4319 Suggested by Stefan Monnier in
4320 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4321 * alloc.c (widen_to_Lisp_Object): New static function.
4322 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4323 and widening them to Lisp_Objects. This would work even if
4324 USE_LSB_TAG is defined and wide integers are used, which might
4325 happen in a future version of Emacs.
4326
3c9dfce6
CY
43272012-02-25 Chong Yidong <cyd@gnu.org>
4328
fa74b241
CY
4329 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4330 Doc fix.
4331
3c9dfce6
CY
4332 * xselect.c (Fx_selection_exists_p): Doc fix.
4333 (x_clipboard_manager_save_all): Print an informative message
4334 before saving to clipboard manager.
4335
9486df08
CY
43362012-02-24 Chong Yidong <cyd@gnu.org>
4337
4338 * keyboard.c (process_special_events): Handle all X selection
4339 requests in kbd_buffer, not just the next one (Bug#8869).
4340
f01d3321
CY
43412012-02-23 Chong Yidong <cyd@gnu.org>
4342
4343 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4344 call when setting menu-bar-lines and tool-bar-lines parameters.
4345 (unwind_create_frame_1): New helper function.
4346
4347 * window.c (inhibit_window_configuration_change_hook): New var.
4348 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4349 (syms_of_window): Initialize it.
f01d3321 4350
86b847b6
CY
43512012-02-22 Chong Yidong <cyd@gnu.org>
4352
4353 * xterm.c (x_draw_image_relief): Add missing type check for
4354 Vtool_bar_button_margin (Bug#10743).
4355
a59225b1
CY
43562012-02-21 Chong Yidong <cyd@gnu.org>
4357
4358 * fileio.c (Vfile_name_handler_alist): Doc fix.
4359
4360 * buffer.c (Fget_file_buffer): Protect against invalid file
4361 handler return value.
4362
310f5bd4
PE
43632012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4364
cb3a28cc
PE
4365 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4366 when computing $valmask.
4367
310f5bd4
PE
4368 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4369 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4370 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4371 It's useless in that case, and it can cause problems on hosts
4372 that allocate halves of EMACS_INT values separately.
4373 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4374 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4375 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4376 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4377 it avoids undefined behavior on hosts where shifting right by more
4378 than the word width has undefined behavior.
4379
2375c96a
CY
43802012-02-19 Chong Yidong <cyd@gnu.org>
4381
4382 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4383 (Funhandled_file_name_directory, Ffile_name_as_directory)
4384 (Fdirectory_file_name, Fexpand_file_name)
4385 (Fsubstitute_in_file_name): Protect against invalid file handler
4386 return values (Bug#10845).
4387
3eb49e71
EZ
43882012-02-18 Eli Zaretskii <eliz@gnu.org>
4389
4390 * .gdbinit (pitx): Fix incorrect references to fields of the
4391 iterator stack.
4392
7b926f3f
CY
43932012-02-17 Chong Yidong <cyd@gnu.org>
4394
4395 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4396
11273115
PE
43972012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4398
4399 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4400 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4401
c3a70e2b
CY
44022012-02-15 Chong Yidong <cyd@gnu.org>
4403
4404 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4405 marked as special. Also, starting docstrings with * is obsolete.
4406
0ca43699
AS
44072012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4408
4409 * gnutls.c (emacs_gnutls_write): Fix last change.
4410
2e8f3c56
LI
44112012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4412
4413 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4414 send_process.
4415
af70074f
SM
44162012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4417
4418 * keymap.c (Fsingle_key_description): Handle char ranges.
4419
95986d52
CY
44202012-02-12 Chong Yidong <cyd@gnu.org>
4421
afd83bd1
CY
4422 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4423 as that creates a dangerous corner case.
4424
95986d52
CY
4425 * window.c (Fdelete_window_internal): Invalidate the mouse
4426 highlight (Bug#9904).
4427
bd7da63e
GM
44282012-02-12 Glenn Morris <rgm@gnu.org>
4429
4430 * xselect.c (Fx_own_selection_internal)
4431 (Fx_get_selection_internal, Fx_disown_selection_internal)
4432 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4433 * nsselect.m (Fx_own_selection_internal)
4434 (Fx_disown_selection_internal, Fx_selection_exists_p)
4435 (Fx_selection_owner_p, Fx_get_selection_internal):
4436 Sync docs and argument specs with the xselect.c versions.
4437
77abcbc2
LI
44382012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4439
4440 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4441
90b671e2
EZ
44422012-02-11 Eli Zaretskii <eliz@gnu.org>
4443
1c0ca0b7
EZ
4444 * w32select.c (Fx_selection_exists_p): Sync doc string and
4445 argument list with xselect.c. (Bug#10783)
4446
4447 * w16select.c (Fx_selection_exists_p): Sync doc string and
4448 argument list with xselect.c. (Bug#10783)
90b671e2 4449
49241268
GM
44502012-02-10 Glenn Morris <rgm@gnu.org>
4451
4452 * fns.c (Fsecure_hash): Doc fix.
4453
f998bbe7 44542012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4455
4456 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4457
0992bd9c
CY
44582012-02-07 Chong Yidong <cyd@gnu.org>
4459
4460 * buffer.c (Fbuffer_local_variables)
4461 (buffer_lisp_local_variables): Handle unbound vars correctly;
4462 don't let Qunbound leak into Lisp.
4463
af008560
GM
44642012-02-07 Glenn Morris <rgm@gnu.org>
4465
dd605cc4
GM
4466 * image.c (Fimagemagick_types): Doc fix.
4467
af008560
GM
4468 * image.c (imagemagick-render-type): Change it from a lisp object
4469 to an integer. Move the doc here from the lisp manual.
4470 Treat all values not equal to 0 the same.
4471
1449fa1d
CY
44722012-02-06 Chong Yidong <cyd@gnu.org>
4473
4474 * doc.c (store_function_docstring): Avoid applying docstring of
4475 alias to base function (Bug#2603).
4476
3723ec07
AS
44772012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4478
4479 * .gdbinit (pp1, pv1): Remove redundant defines.
4480 (pr): Use pp.
4481
79c1cc1e
CY
44822012-02-04 Chong Yidong <cyd@gnu.org>
4483
4484 * nsterm.m: Declare a global (Bug#10694).
4485
d7f29f8e
EZ
44862012-02-04 Eli Zaretskii <eliz@gnu.org>
4487
cae07000
SM
4488 * w32.c (get_emacs_configuration_options):
4489 Include --enable-checking, if specified, in the return value.
d7f29f8e 4490
3b95a6f9
MR
44912012-02-04 Martin Rudalics <rudalics@gmx.at>
4492
4493 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4494 after rounding frame sizes. (Bug#9723)
4495
d6fa96a6
EZ
44962012-02-04 Eli Zaretskii <eliz@gnu.org>
4497
4498 * keyboard.c (adjust_point_for_property): Don't position point
4499 before BEGV. (Bug#10696)
4500
df0b2940
PE
45012012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4502
4503 Handle overflow when computing char display width (Bug#9496).
4504 * character.c (char_width): Return EMACS_INT, not int.
4505 (char_width, c_string_width): Check for overflow when
4506 computing the width; this is possible now that individual
4507 characters can have unbounded width. Problem introduced
4508 by merge from Emacs 23 on 2012-01-19.
4509
6bee44d6
MA
45102012-02-02 Michael Albinus <michael.albinus@gmx.de>
4511
4512 * dbusbind.c (Fdbus_register_method): Mention the return value
4513 :ignore in the docstring.
4514
44f92739
GM
45152012-02-02 Glenn Morris <rgm@gnu.org>
4516
1b9f60cc
GM
4517 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4518
44f92739
GM
4519 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4520 Unconditionally set to t. (Bug#10673)
4521 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4522 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4523 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4524
c5d3843c
KH
45252012-02-02 Kenichi Handa <handa@m17n.org>
4526
4527 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4528 0, do not call append_composite_glyph.
4529
159462d4 45302012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4531
4532 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4533 NULL (Bug#6988).
4534 (x_produce_glyphs): If the component of a composition is a null
4535 string, set it->pixel_width to 1 to avoid zero-width glyph.
4536
78cef877
EZ
45372012-02-01 Eli Zaretskii <eliz@gnu.org>
4538
4539 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4540 first 2 arguments are identical. This makes inserting large
4541 output from a subprocess an order of magnitude faster on
4542 MS-Windows, where all sbrk'ed memory is always contiguous.
4543
97897668
GM
45442012-01-31 Glenn Morris <rgm@gnu.org>
4545
4546 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4547 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4548 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4549
31fd3586
GM
45502012-01-29 Glenn Morris <rgm@gnu.org>
4551
4552 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4553
0e24a8b2
CY
45542012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4555
4556 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4557
cc0adcb0
CY
45582012-01-28 Chong Yidong <cyd@gnu.org>
4559
4560 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4561
acc28cb9
CY
45622012-01-26 Chong Yidong <cyd@gnu.org>
4563
9c69cfb7
CY
4564 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4565
acc28cb9
CY
4566 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4567 repeat counts (Bug#10507).
4568
48da7392
GM
45692012-01-26 Glenn Morris <rgm@gnu.org>
4570
4571 * lread.c (syms_of_lread): Doc fix.
4572
14af5f7f
CY
45732012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
4574
4575 * coding.c (encode_designation_at_bol): Change return value to
4576 EMACS_INT.
4577
0b21c100
CY
45782012-01-25 Chong Yidong <cyd@gnu.org>
4579
4580 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4581
3c2907f7
CY
45822012-01-21 Chong Yidong <cyd@gnu.org>
4583
4584 * floatfns.c (Fcopysign): Make the second argument non-optional,
4585 since nil is not allowed anyway.
4586
959ad23f
AS
45872012-01-21 Andreas Schwab <schwab@linux-m68k.org>
4588
4589 * process.c (read_process_output): Use p instead of XPROCESS (proc).
4590 (send_process): Likewise.
4591
34a02f46
MR
45922012-01-19 Martin Rudalics <rudalics@gmx.at>
4593
4594 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
4595 (Vwindow_persistent_parameters): Do not use Qstate.
4596 Rewrite doc-strings.
34a02f46 4597
1259009a 45982012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
4599
4600 * character.c (char_width): New function.
70d4fdf6
GM
4601 (Fchar_width, c_string_width, lisp_string_width):
4602 Use char_width (Bug#9496).
25ed9e61 4603
6a6ee00d
MR
46042012-01-16 Martin Rudalics <rudalics@gmx.at>
4605
4606 * window.c (Vwindow_persistent_parameters): New variable.
4607 (Fset_window_configuration, save_window_save): Handle persistent
4608 window parameters.
4609
c85efaf7
EZ
46102012-01-14 Eli Zaretskii <eliz@gnu.org>
4611
4612 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4613 thrashing the stack of the thread. (Bug#9087)
4614
5944709e
PE
46152012-01-12 Paul Eggert <eggert@cs.ucla.edu>
4616
4617 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4618
e71f5d99
EZ
46192012-01-11 Eli Zaretskii <eliz@gnu.org>
4620
4621 * xdisp.c (rows_from_pos_range): Handle the case where the
4622 highlight ends on a newline. (Bug#10464)
4623 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4624 he end column for display of highlight that ends on a newline
4625 before a R2L line.
4626
ce316182
GM
46272012-01-11 Glenn Morris <rgm@gnu.org>
4628
4629 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4630 from load-path also when installation-directory is nil. (Bug#10208)
4631
5b43da69
GM
46322012-01-10 Glenn Morris <rgm@gnu.org>
4633
74cc8ff9
GM
4634 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4635
7d8d6e4e
GM
4636 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4637 Update template values to be closer to their typical values these days.
5b43da69 4638
a0db8d43
EZ
46392012-01-09 Eli Zaretskii <eliz@gnu.org>
4640
4641 * xdisp.c (rows_from_pos_range): Accept additional argument
4642 DISP_STRING, and accept any glyph in a row whose object is that
4643 string as eligible for mouse highlight. Fixes mouse highlight of
4644 display strings from overlays. (Bug#10464)
4645
9a0115ab 46462012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 4647
b9110d6a 4648 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
4649 * fileio.c (auto_saving_dir_umask): New static var.
4650 (Fmake_directory_internal): Use it.
4651 (do_auto_save_make_dir): Set it, instead of invoking chmod after
4652 creating the directory. The old code temporarily assigns
4653 too-generous permissions to the directory.
4654 (do_auto_save_eh): Clear it.
b9110d6a 4655 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
4656 that the var is always cleared.
4657
6c1bd3f3
EZ
46582012-01-07 Eli Zaretskii <eliz@gnu.org>
4659
4660 * search.c (scan_buffer): Pass character positions to
4661 know_region_cache, not byte positions. (Bug#6540)
4662
069d2b50
L
46632012-01-07 LynX <_LynX@bk.ru> (tiny change)
4664
4665 * w32.c (sys_rename): Report EXDEV when rename of a directory
4666 fails because the target is on another logical disk. (Bug#10284)
4667
75bf0d33
DB
46682012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
4669
4670 * xterm.c (x_embed_request_focus): New function.
4671
4672 * xterm.h: Add prototype.
4673
4674 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4675
1c6e5a32
GM
46762012-01-05 Glenn Morris <rgm@gnu.org>
4677
4678 * emacs.c (emacs_copyright): Update short copyright year to 2012.
4679
651e947e
EZ
46802012-01-01 Eli Zaretskii <eliz@gnu.org>
4681
4682 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4683 Load gnutls_transport_set_lowat only if GnuTLS version is below
4684 2.11.1.
4685 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4686 GnuTLS versions below 2.11.1.
4687
3778cdd8
AL
46882011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4689
4690 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4691 to the doc string advising against its use for altering the way
4692 windows are scrolled.
4693
0e5317f7
KH
46942011-12-28 Kenichi Handa <handa@m17n.org>
4695
4696 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4697 coding-system ASCII compatible only when it does not produce BOM
4698 on encoding (Bug#10383).
4699
93d5ca1f
JD
47002011-12-26 Jan Djärv <jan.h.d@swipnet.se>
4701
4702 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4703 can scroll.
4704 (create_and_show_popup_menu): Always use menu_position_func for
4705 Gtk3 (Bug#10361).
4706
ca22b785
AS
47072011-12-24 Andreas Schwab <schwab@linux-m68k.org>
4708
4709 * callint.c (Fcall_interactively): Don't truncate prompt string.
4710
d048e1e6
EZ
47112011-12-23 Eli Zaretskii <eliz@gnu.org>
4712
4713 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4714 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 4715 resumed from there (after widening). (Bug#10360)
d048e1e6 4716
5ccaba1f
JD
47172011-12-22 Jan Djärv <jan.h.d@swipnet.se>
4718
4719 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4720
204ee57f
JD
47212011-12-21 Jan Djärv <jan.h.d@swipnet.se>
4722
b81d40f0
JB
4723 * nsterm.m (x_free_frame_resources):
4724 Release f->output_data.ns->miniimage.
204ee57f
JD
4725 (ns_index_color): Fix indentation. Do not retain
4726 color_table->colors[i].
4727
4728 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4729 before returning.
4730
4731 * nsfns.m (x_set_background_color): Assign return value from
4732 ns_index_color to face-background instead of NSColor*.
4733 (ns_implicitly_set_icon_type): Fix indentation.
4734 Change assignment in for loop to comparison.
4735
4736 * emacs.c (ns_pool): New variable.
4737 (main): Assign ns_pool.
4738 (Fkill_emacs): Call ns_release_autorelease_pool.
4739
4740 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4741 autorelease fdesc, release fdAttrs and tdict.
4742 (ns_get_covering_families): Release charset.
4743 (ns_findfonts): Release NSFontDescriptor created with new.
4744 (ns_uni_to_glyphs): Fix indentation.
4745 (setString): Release attrStr before assigning new value.
4746
c803b2b7
JD
47472011-12-18 Jan Djärv <jan.h.d@swipnet.se>
4748
678f4426
JD
4749 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
4750 and NS_IMPL_COCOA.
4751 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4752 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4753
cd394be1 47542011-12-18 David Reitter <reitter@cmu.edu>
678f4426 4755
5fecd5fc
JD
4756 * nsterm.m (ns_term_init): Subscribe for notifications
4757 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4758 to method trackingNotification in EmacsMenu.
4759
4760 * nsmenu.m (trackingMenu): New variable.
3771cb17 4761 (trackingNotification): New method (from Aquamacs).
5fecd5fc 4762 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 4763 from Aquamacs (Bug#7030).
678f4426
JD
4764
47652011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 4766
c803b2b7
JD
4767 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
4768 (symbol_to_nsstring): Fix indentation.
4769 (ns_symbol_to_pb): New function.
cae07000
SM
4770 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
4771 (Fns_rotate_cut_buffers_internal): Remove.
4772 (Fns_store_selection_internal): Rename from
c803b2b7
JD
4773 Fns_store_cut_buffer_internal.
4774 (ns_get_foreign_selection, Fx_own_selection_internal)
4775 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
4776 (Fns_get_selection_internal, Fns_store_selection_internal):
4777 Use ns_symbol_to_pb and check if return value is nil.
4778 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
4779 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
4780 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
4781 renamed to Sns_store_selection_internal.
4782 (ns_handle_selection_request): Move code to Fx_own_selection_internal
4783 and remove this function.
4784 (ns_handle_selection_clear): Remove, never used.
4785 (Fx_own_selection_internal): Move code from ns_handle_selection_request
4786 here.
4787
e1b01a3a
KB
47882011-12-17 Ken Brown <kbrown@cornell.edu>
4789
4790 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
4791 GID is unknown (Bug#10257).
4792
2adb6e85
PE
47932011-12-17 Paul Eggert <eggert@cs.ucla.edu>
4794
4795 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
4796 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
4797 which caused a build failure on GNU/Linux IA-64. This problem was
4798 introduced by my 2011-10-07 patch.
4799
d1d7b339
JL
48002011-12-15 Juri Linkov <juri@jurta.org>
4801
4802 * image.c (imagemagick_error): New function. (Bug#10112)
4803 (imagemagick_load_image): Comment out `MagickSetResolution' call.
4804 Use `imagemagick_error' where ImageMagick functions return
4805 `MagickFalse'.
4806 (Fimagemagick_types): Add `Fnreverse' to return the list in the
4807 proper order.
4808
100d5755
KH
48092011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4810
4811 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
4812 fill background (Bug#8992).
4813
454592a6
MR
48142011-12-13 Martin Rudalics <rudalics@gmx.at>
4815
4816 * window.c (Vwindow_combination_resize)
4817 (Vwindow_combination_limit): Use t instead of non-nil in
4818 doc-strings.
61d4b438
MR
4819 (Vrecenter_redisplay): Add first sentence of doc-string on
4820 separate line.
53524d93 4821 (Frecenter): Fix doc-string typo.
454592a6 4822
3633e3aa
KH
48232011-12-11 Kenichi Handa <handa@m17n.org>
4824
4825 * coding.c (Funencodable_char_position): Pay attention to the
4826 buffer text relocation (Bug#9389).
4827
7b9d523a 48282011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 4829
7b9d523a
JD
4830 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
4831 gtk_init (Bug#10100).
4832
b73189c6
EZ
48332011-12-10 Eli Zaretskii <eliz@gnu.org>
4834
4835 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
4836 IT->string is nil. (Bug#10263)
4837
f7dfe5d6
JD
48382011-12-10 Jan Djärv <jan.h.d@swipnet.se>
4839
83faebb4
JD
4840 * nsterm.h (x_free_frame_resources): Declare.
4841
f7dfe5d6
JD
4842 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
4843 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
4844
4845 * nsterm.h (ns_get_defaults_value): Declare.
4846
4847 * nsterm.m (ns_default): Call ns_get_defaults_value.
4848
7cd4e72c
EZ
48492011-12-09 Eli Zaretskii <eliz@gnu.org>
4850
4851 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
4852 (Bug#10170)
4853
b34d7317
YM
48542011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4855
4856 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
4857 that where the value of an _OBJC_* symbol points to is in the .bss
4858 section (Bug#10240).
4859
76470ad1
KH
48602011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4861
4862 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 4863 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 4864
745fff94
KH
48652011-12-08 Kenichi Handa <handa@m17n.org>
4866
4867 * ftfont.c (get_adstyle_property): Fix previous change
4868 (Bug#10233).
4869
6e44397c
JB
48702011-12-07 Juanma Barranquero <lekktu@gmail.com>
4871
4872 * w32.c (init_environment): If no_site_lisp, remove site-lisp
4873 dirs from the default value of EMACSLOADPATH (bug#10208).
4874
7efa6272
GM
48752011-12-07 Glenn Morris <rgm@gnu.org>
4876
4877 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
4878 installation and source directories as well. (Bug#10208)
4879
f6fc4d87
CY
48802011-12-06 Chong Yidong <cyd@gnu.org>
4881
4882 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
4883
2bf26180
GM
48842011-12-06 Glenn Morris <rgm@gnu.org>
4885
4886 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
4887 as an error, not just -1. (Bug#10217)
4888
3a6ad4f0
CY
48892011-12-05 Chong Yidong <cyd@gnu.org>
4890
4891 * keyboard.c (process_special_events): New function.
4892 (swallow_events, Finput_pending_p): Use it (Bug#10195).
4893
75a3b399
PE
48942011-12-05 Paul Eggert <eggert@cs.ucla.edu>
4895
4896 * coding.c (encode_designation_at_bol): Don't use uninitialized
4897 local variable (Bug#9318).
4898
c3c9e25e
KH
48992011-12-05 Kenichi Handa <handa@m17n.org>
4900
4901 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
4902 return Qnil (Bug#8046, Bug#10193).
4903
5eb05ea3
KH
49042011-12-05 Kenichi Handa <handa@m17n.org>
4905
4906 * coding.c (encode_designation_at_bol): New args charbuf_end and
4907 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
4908 (coding_set_source): Return how many bytes coding->source was
4909 relocated.
4910 (coding_set_destination): Return how many bytes
4911 coding->destination was relocated.
4912 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 4913 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
4914
49152011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4916
4917 * coding.c (CODING_CHAR_CHARSET_P): New macro.
4918 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
4919 macro (Bug#9318).
4920
49212011-12-05 Andreas Schwab <schwab@linux-m68k.org>
4922
4923 The following changes are to fix Bug#9318.
4924
a79703f5 4925 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
4926 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
4927 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 4928 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 4929
7dbda6df
JB
49302011-12-05 Juanma Barranquero <lekktu@gmail.com>
4931
4932 * lisp.h (process_quit_flag): Fix external declaration.
4933
6d5eb5b0
SM
49342011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
4935
4936 Don't macro-inline non-performance-critical code.
4937 * eval.c (process_quit_flag): New function.
4938 * lisp.h (QUIT): Use it.
4939
a0c3fad0
JD
49402011-12-04 Jan Djärv <jan.h.d@swipnet.se>
4941
4942 * nsfns.m (get_geometry_from_preferences): New function.
4943 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
4944
6c07aac2
AS
49452011-12-04 Andreas Schwab <schwab@linux-m68k.org>
4946
4947 * emacs.c (Qkill_emacs): Define.
4948 (syms_of_emacs): Initialize it.
4949 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
4950 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
4951 (quit_throw_to_read_char): Add parameter `from_signal'.
4952 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
4953 * lisp.h (QUIT): Call Fkill_emacs if requested.
4954
c052ead4
JD
49552011-12-03 Jan Djärv <jan.h.d@swipnet.se>
4956
4957 * widget.c (update_wm_hints): Return if wmshell is null.
4958 (widget_update_wm_size_hints): New function.
4959
4960 * widget.h (widget_update_wm_size_hints): Declare.
4961
4962 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
4963 widget_update_wm_size_hints (Bug#10104).
4964
9e49252b
EZ
49652011-12-03 Eli Zaretskii <eliz@gnu.org>
4966
4967 * xdisp.c (handle_invisible_prop): If the invisible text ends just
4968 before a newline, prepare the bidi iterator for consuming the
4969 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 4970 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 4971
02b16839
JL
49722011-12-02 Juri Linkov <juri@jurta.org>
4973
4974 * search.c (Fword_search_regexp): New Lisp function created from
4975 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
4976 (Fword_search_backward, Fword_search_forward)
4977 (Fword_search_backward_lax, Fword_search_forward_lax):
4978 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
4979 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
4980
0068070e
SM
49812011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
4982
4983 * fileio.c (Finsert_file_contents): Move after-change-function call
4984 to before the "handled:" label, since all "goto handled" appear in
4985 cases where the *-change-functions have already been properly called
4986 (bug#10117).
4987
3360a3fc
AS
49882011-12-01 Andreas Schwab <schwab@linux-m68k.org>
4989
4990 * keyboard.c (interrupt_signal): Don't call kill-emacs when
4991 waiting for input. (Bug#10169)
4992
73d6c093
EZ
49932011-11-30 Eli Zaretskii <eliz@gnu.org>
4994
4995 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
4996 verifies glyph row's hash code--we have just reallocated the
4997 glyphs, so their contents can be complete garbage. (Bug#10164)
4998
febe6bea
JB
49992011-11-30 Juanma Barranquero <lekktu@gmail.com>
5000
5001 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
5002
801a4313
EZ
50032011-11-30 Eli Zaretskii <eliz@gnu.org>
5004
5005 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
5006 attributes are tested _before_ calling verify_row_hash, to protect
5007 against GCC re-ordering of the tests. (Bug#10164)
5008
2b56b87e
JD
50092011-11-29 Jan Djärv <jan.h.d@swipnet.se>
5010
5011 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
5012
5013 * xterm.c (handle_one_xevent): Only set async_visible and friends
5014 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 5015 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
5016 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
5017
dbf31225
PE
50182011-11-28 Paul Eggert <eggert@cs.ucla.edu>
5019
5020 Remove GCPRO-related macros that exist only to avoid shadowing locals.
5021 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
5022 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
5023 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5024 All uses changed to use GCPRO1 etc.
5025 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
5026 Revert to old implementation (i.e., before 2011-03-11).
5027
1305621b
YM
50282011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5029
5030 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
5031 of scroll runs so as to avoid assigning disabled bogus rows and
5032 unnecessary graphics copy operations.
5033
8c9afb46
EZ
50342011-11-27 Eli Zaretskii <eliz@gnu.org>
5035
5036 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
5037 (snprintf) [_MSC_VER]: Redirect to _snprintf.
5038 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
5039 (malloc, free, realloc, calloc): Redirect to e_* only when
5040 compiling Emacs.
5041
5042 * lisp.h (GCTYPEBITS): Move before first use.
5043 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
5044 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
5045 this macro definition.
5046
5047 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
5048 _MSC_VER.
5049
54e9e3bf
JD
50502011-11-27 Jan Djärv <jan.h.d@swipnet.se>
5051
6d5eb5b0
SM
5052 * gtkutil.c (xg_create_frame_widgets):
5053 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
5054 present with Gtk+ 2.0.
5055
83aca1cb
PE
50562011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5057
5058 * fileio.c (Finsert_file_contents): Undo previous change; see
5059 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
5060
5b76caa4
PE
50612011-11-26 Paul Eggert <eggert@cs.ucla.edu>
5062
5063 Rename locals to avoid shadowing.
5064 * fileio.c (Finsert_file_contents):
5065 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
5066 * process.c (wait_reading_process_output):
5067 Rename inner 'proc' to 'p' to avoid shadowing.
5068 Indent for consistency with usual Emacs style.
5069
8c535114
EZ
50702011-11-25 Eli Zaretskii <eliz@gnu.org>
5071
5072 * xdisp.c (redisplay_window): If cursor row is not fully visible
5073 after recentering, and scroll-conservatively is set to a large
5074 number, scroll window by a few more lines to make the cursor fully
5075 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
5076 (start_display): Don't move to the next line if the display should
5077 start at a newline that is part of a display vector or an overlay
5078 string. (Bug#10119)
8c535114 5079
fa4fdb5c
JL
50802011-11-24 Juri Linkov <juri@jurta.org>
5081
5082 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
5083 after the `MagickPingImage' call. (Bug#10112)
5084
90ec88df
CY
50852011-11-23 Chong Yidong <cyd@gnu.org>
5086
5087 * window.c (Fcoordinates_in_window_p): Accept only live windows.
5088
56e2e794
MR
50892011-11-23 Martin Rudalics <rudalics@gmx.at>
5090
5091 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
5092 making another buffer current. (Bug#10114)
5093
b6e64c41
GM
50942011-11-23 Glenn Morris <rgm@gnu.org>
5095
5096 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
5097
6b21de18
CY
50982011-11-23 Chong Yidong <cyd@gnu.org>
5099
5100 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
5101 using it (Bug#5984).
5102
b12cd789
EZ
51032011-11-22 Eli Zaretskii <eliz@gnu.org>
5104
5105 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
5106 and header-lines, as they don't have one computed for them.
5107 (Bug#10098)
5108
5109 * .gdbinit (prow): Make displayed values more self-explaining.
5110 Add row's hash code.
5111
261b6fd4
LMI
51122011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
5113
5114 * process.c (wait_reading_process_output): Fix asynchrounous
5115 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 5116 (wait_reading_process_output): Add comment and URL.
261b6fd4 5117
e7cfd277
JD
51182011-11-21 Jan Djärv <jan.h.d@swipnet.se>
5119
5120 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
5121
a9b9b7f5
CY
51222011-11-21 Chong Yidong <cyd@gnu.org>
5123
5124 * window.c (Fnext_window, Fprevious_window): Doc fix.
5125
b0d15b4f
SM
51262011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5127
5128 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
5129
fe7a3057
JB
51302011-11-20 Juanma Barranquero <lekktu@gmail.com>
5131
5132 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
5133
d2999b1a
MR
51342011-11-20 Martin Rudalics <rudalics@gmx.at>
5135
5136 * window.c (Fset_window_combination_limit): Rename argument
5137 STATUS to LIMIT.
5138 (Vwindow_combination_limit): Remove "status" from doc-string.
5139
d5ff9cd0
AS
51402011-11-20 Andreas Schwab <schwab@linux-m68k.org>
5141
5142 * m/ibms390.h: Remove.
5143 * m/ibms390x.h: Don't include "ibms390.h".
5144
a5bb9bd3
SM
51452011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
5146
5147 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
5148 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
5149
cd1181db
JB
51502011-11-20 Juanma Barranquero <lekktu@gmail.com>
5151
5152 * casetab.c (Fset_case_table):
5153 * charset.c (Fcharset_after): Fix typos.
5154
615a3b8d 51552011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 5156
17e845af
PE
5157 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
5158 Otherwise, valgrind does not work on some platforms.
5159 Problem reported by Andreas Schwab in
6a0bf43d
PE
5160 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
5161 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
5162 is set, removing the need for VIRT_ADDRESS_VARIES.
5163 (PURE_P): Use a more-efficient implementation that needs just one
5164 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
5165 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
5166 to 4 (xorl, subq, cmpq, setbe).
5167 * alloc.c (pure): Always extern now, since that's the
5168 VIRT_ADDR_VARIES behavior.
5169 (PURE_POINTER_P): Use a single comparison, not two, for
5170 consistency with the new puresize.h.
5171 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
5172 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
5173 Remove VIRT_ADDR_VARIES no longer needed.
5174
f8fe6f96
EZ
51752011-11-19 Eli Zaretskii <eliz@gnu.org>
5176
5177 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
5178 (erase_phys_cursor, update_window_cursor, show_mouse_face)
5179 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
5180 behave as if the cursor position were at the window margin.
5181
5182 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
5183 and the cursor position is out of bounds, behave as if the cursor
5184 position were at the window margin. (Bug#10075)
5185
df05a53c
CY
51862011-11-18 Chong Yidong <cyd@gnu.org>
5187
5188 * window.c (Fwindow_combination_limit): Make first argument
5189 non-optional, since it is meaningless for live windows like the
5190 selected window.
61ccba97 5191
2071918e
DA
51922011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
5193
5194 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
5195
b50a28de
SM
51962011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
5197
5198 * intervals.c: Fix grafting over the whole buffer (bug#10071).
5199 (graft_intervals_into_buffer): Simplify.
5200
015137db
EZ
52012011-11-18 Eli Zaretskii <eliz@gnu.org>
5202
5203 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
5204 hash values of the two rows.
5205 (copy_row_except_pointers): Preserve the used[] arrays and the
5206 hash values of the two rows. (Bug#10035)
68c95424 5207 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
5208
5209 * xdisp.c (row_hash): New function, body extracted from
5210 compute_line_metrics.
5211 (compute_line_metrics): Call row_hash, instead of computing the
5212 hash code inline.
5213
5214 * dispnew.c (verify_row_hash): Call row_hash for computing the
5215 hash code of a row, instead of duplicating code from xdisp.c.
5216
5217 * dispextern.h (row_hash): Add prototype.
5218
a2addb04
TH
52192011-11-18 Tassilo Horn <tassilo@member.fsf.org>
5220
5221 * frame.c (delete_frame): Don't delete the terminal when the last
5222 X frame is closed if emacs is built with GTK toolkit.
5223
df85d315
JB
52242011-11-17 Juanma Barranquero <lekktu@gmail.com>
5225
5226 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5227
a0c2d0ae
MR
52282011-11-17 Martin Rudalics <rudalics@gmx.at>
5229
5230 * window.c (Vwindow_splits): Rename to
5231 Vwindow_combination_resize. Suggested by Juri Linkov.
5232 (Fsplit_window_internal): Use Vwindow_combination_resize instead
5233 of Vwindow_splits.
5234
58179cce
JB
52352011-11-16 Juanma Barranquero <lekktu@gmail.com>
5236
7877f373
JB
5237 * nsfns.m (Fns_font_name):
5238 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 5239
b6f67890
MR
52402011-11-16 Martin Rudalics <rudalics@gmx.at>
5241
5242 * window.h (window): Rename slot "nest" to "combination_limit".
5243 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5244 (Fset_window_nest): Rename to Fset_window_combination_limit.
5245 (Vwindow_nest): Rename to Vwindow_combination_limit.
5246 (recombine_windows, make_parent_window, make_window)
5247 (Fsplit_window_internal, saved_window)
5248 (Fset_window_configuration, save_window_save): Rename all
5249 occurrences of window_nest to window_combination_limit.
5250
c7015153
JB
52512011-11-15 Juanma Barranquero <lekktu@gmail.com>
5252
5253 * image.c (imagemagick_load_image): Fix typo.
5254
322ad6ec
EZ
52552011-11-14 Eli Zaretskii <eliz@gnu.org>
5256
5257 * xdisp.c (display_line): Move the call to
5258 highlight_trailing_whitespace before the call to
5259 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
5260 faces of all the glyphs to compute ROW's hash value.
5261 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 5262
f067b8ec
JB
52632011-11-14 Juanma Barranquero <lekktu@gmail.com>
5264
5265 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5266 just return (bug#10044).
5267
1e5b2111
EZ
52682011-11-12 Eli Zaretskii <eliz@gnu.org>
5269
7ef3cbd5
EZ
5270 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5271 with user-defined heap size. Bump the default size of the temacs
5272 heap to 27MB, to avoid memory warning when running temacs.
5273 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5274
1e5b2111
EZ
5275 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5276 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
5277 (verify_row_hash) [XASSERTS]: New function.
5278 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5279 that the hash value of glyph rows is correct.
1e5b2111 5280
89d61221
MR
52812011-11-12 Martin Rudalics <rudalics@gmx.at>
5282
5283 * window.h (window): Remove splits slot.
5284 * window.c (Fwindow_splits, Fset_window_splits): Remove.
5285 (Fdelete_other_windows_internal, make_parent_window)
5286 (make_window, Fsplit_window_internal, Fdelete_window_internal)
5287 (Fset_window_configuration, save_window_save): Don't deal with
5288 split status of windows.
5289 (saved_window): Remove splits slot.
5290 (Vwindow_splits): Rewrite doc-string.
5291
97f18cc8
JD
52922011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5293
5294 * xfns.c (unwind_create_frame):
5295 * nsfns.m (unwind_create_frame):
5296 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5297 Vframe_list (Bug#9999).
5298
22a648b4
DA
52992011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5300
0b381c7e 5301 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5302
659afede
KH
53032011-11-11 Kenichi Handa <handa@m17n.org>
5304
5305 * callproc.c (Fcall_process): Set the member dst_multibyte of
5306 process_coding.
5307
9ac0394b
KH
53082011-11-11 Johan Bockgård <bojohan@gnu.org>
5309
5310 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5311 avoid a crash (bug#9496).
5312
2fbdc249
CY
53132011-11-09 Chong Yidong <cyd@gnu.org>
5314
5315 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5316 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5317
ac6b1f81
PE
53182011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5319
5320 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5321
09db192c
PE
53222011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 Avoid some portability problems by eschewing 'extern inline' functions.
5325 The trivial performance wins aren't worth the portability hassles; see
5326 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5327 et seq.
5328 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5329 (window_box_width, window_box_left, window_box_left_offset)
5330 (window_box_right, window_box_right_offset): Undo previous change,
5331 by removing the "extern"s.
5332 * intervals.c (adjust_intervals_for_insertion)
5333 (adjust_intervals_for_deletion): Undo previous change,
5334 making these static again.
5335 (offset_intervals, temp_set_point_both, temp_set_point)
5336 (copy_intervals_to_string): No longer inline.
5337 * xdisp.c (window_text_bottom_y, window_box_width)
5338 (window_box_height, window_box_left_offset)
5339 (window_box_right_offset, window_box_left, window_box_right)
5340 (window_box): No longer inline.
5341
105216ed
CY
53422011-11-08 Chong Yidong <cyd@gnu.org>
5343
5344 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5345 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5346 Signal an error if not a live window.
105216ed
CY
5347 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5348 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5349
ae9e237f
JB
53502011-11-07 Juanma Barranquero <lekktu@gmail.com>
5351
5352 * lisp.h (syms_of_abbrev): Remove declaration.
5353 Reported by CHENG Gao <chenggao@royau.me>.
5354
c7aa8333
EZ
53552011-11-07 Eli Zaretskii <eliz@gnu.org>
5356
5357 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5358 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5359 of temacs in GUI mode.
5360
be7f5545
MR
53612011-11-07 Martin Rudalics <rudalics@gmx.at>
5362
5363 * window.h: Declare delete_all_child_windows instead of
5364 delete_all_subwindows.
5365 * window.c (Fwindow_nest, Fset_window_nest)
5366 (Fset_window_new_total, Fset_window_new_normal)
5367 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5368 (delete_all_subwindows): Rename to delete_all_child_windows.
5369 (Fdelete_other_windows_internal, Fset_window_configuration):
5370 Call delete_all_child_windows instead of delete_all_subwindows.
5371 * frame.c (delete_frame): Call delete_all_child_windows instead
5372 of delete_all_subwindows.
5373
ca78dc43
PE
53742011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5375
5376 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5377 This is also needed for porting to any host where GC_MARK_STACK is
5378 not GC_MAKE_GCPROS_NOOPS.
5379 (which_symbols): Use it.
5380
a0241d01
KH
53812011-11-07 Kenichi Handa <handa@m17n.org>
5382
5383 * coding.c (coding_set_destination): Check coding->src_pos only
5384 when coding->src_object is a buffer (bug#9910).
5385
5386 * process.c (send_process): Set the member src_multibyte of coding
5387 to 0 (bug#9911) when sending a unibyte text.
5388
5389 * callproc.c (Fcall_process): Set the member src_multibyte of
5390 process_coding to 0 (bug#9912).
5391
a64bfdfa 53922011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5393
5394 * xmenu.c (cleanup_widget_value_tree): New function.
5395 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5396 calling free_menubar_widget_value_tree directly (Bug#9830).
5397
cb41b32a
PE
53982011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5399
5400 Fix some portability problems with 'inline'.
5401 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5402 (window_box_width, window_box_left, window_box_left_offset)
5403 (window_box_right, window_box_right_offset): Declare extern.
5404 Otherwise, these inline functions do not conform to C99 and
5405 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5406 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5407 * intervals.c (adjust_intervals_for_insertion)
5408 (adjust_intervals_for_deletion): Now extern, because otherwise the
5409 extern inline functions 'offset_intervals' couldn't refer to it.
5410 (static_offset_intervals): Remove.
5411 (offset_intervals): Rewrite using the old contents of
5412 static_offset_intervals. The old version didn't conform to C99
5413 because an extern inline function contained a reference to an
5414 identifier with static linkage.
5415
b7041366
AS
54162011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5417
5418 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5419 GC.
5420
88a37c4d
EZ
54212011-11-06 Eli Zaretskii <eliz@gnu.org>
5422
5423 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5424 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5425 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5426 return Qleft_to_right.
5427
49745b39
CY
54282011-11-06 Chong Yidong <cyd@gnu.org>
5429
5430 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5431 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5432 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5433 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5434 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5435 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5436 (Fwindow_vscroll): Doc fix.
5437 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5438 argument, since it makes no sense to pass a live window and for
5439 consistency with window-child.
5440
1f05cd82
CS
54412011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5442
5443 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5444 support MSVC.
5445
22610910
JR
54462011-11-05 Jason Rumney <jasonr@gnu.org>
5447
5448 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5449 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5450 fonts (Bug#6029).
5451 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5452 bitwise arithmetic preventing use of unicode-sip and non-truetype
5453 opentype fonts.
5454
a06776b2
EZ
54552011-11-05 Eli Zaretskii <eliz@gnu.org>
5456
3ad924ba
EZ
5457 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5458 "emacs"-only part.
5459
a06776b2
EZ
5460 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5461 initialization code to keep similarity to xfns.c after changes
5462 from 2011-11-05.
5463
c9e7db78
JD
54642011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5465
a97f8f3f
JD
5466 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5467 (unwind_create_frame): New function (Bug#9943).
5468 (Fx_create_frame): Restructure code to be more similar to the one in
5469 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5470 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5471 Move terminal->reference_count++ just before making the frame official
5472 (Bug#9943).
5473
5474 * nsterm.m (x_free_frame_resources): New function.
5475 (x_destroy_window): Move code to x_free_frame_resources.
5476
c9e7db78 5477 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5478 (Fx_create_frame, x_create_tip_frame):
5479 Move terminal->reference_count++ just before making the frame
75f1671a 5480 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5481 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5482
a6fc3b5c
EZ
54832011-11-05 Eli Zaretskii <eliz@gnu.org>
5484
5485 Support MSVC build with newer versions of Visual Studio.
5486 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5487 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5488 nt/gmake.defs.
5489
5490 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5491 which are not supported by MSVC.
5492 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5493 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5494 bitfields.
5495 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5496 types in bitfields.
5497 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5498
5499 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5500
58179cce 55012011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5502
5503 Support MSVC build with newer versions of Visual Studio.
5504 * w32.c: Don't include w32api.h for MSVC.
5505 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5506
5507 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5508 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5509 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5510 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5511 e_* cousins.
5512 (alloca) [_MSC_VER]: Define to _alloca.
5513
5514 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5515
5516 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5517
a58c13ed
EZ
55182011-11-04 Eli Zaretskii <eliz@gnu.org>
5519
5520 * xdisp.c (note_mouse_highlight): If either of
5521 previous/next-single-property-change returns nil, treat that as
5522 the beginning or the end of the buffer. (Bug#9955)
5523
fe0b6370
JD
55242011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5525
a58c13ed 5526 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5527 label is not null (Bug#9951).
5528 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5529 may be NULL.
5530
89bd5ee1
EZ
55312011-11-04 Eli Zaretskii <eliz@gnu.org>
5532
5533 * window.c (Fwindow_body_size): Mention in the doc string that the
5534 return value is in frame's canonical units. (Bug#9949)
5535
84c3edb9
EZ
55362011-11-03 Eli Zaretskii <eliz@gnu.org>
5537
4e2fb5c7
EZ
5538 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5539
84c3edb9 5540 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5541 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5542 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5543
bc17a887
EZ
55442011-11-01 Eli Zaretskii <eliz@gnu.org>
5545
5546 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5547 Don't stop backward scan on the continuation glyph, even though
5548 its CHARPOS is positive.
6d5eb5b0
SM
5549 (mouse_face_from_buffer_pos, note_mouse_highlight):
5550 Rename cover_string to disp_string.
bc17a887 5551
4ee88440
MR
55522011-11-01 Martin Rudalics <rudalics@gmx.at>
5553
5554 * window.c (temp_output_buffer_show): Don't use
5555 Vtemp_buffer_show_specifiers.
5556 (Vtemp_buffer_show_specifiers): Remove unused variable.
5557
c2ff3c02
EZ
55582011-10-30 Eli Zaretskii <eliz@gnu.org>
5559
5560 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5561 past the beginning of the current glyph matrix.
5562
58179cce 55632011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5564
5565 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5566 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5567 HAVE_GTK3 (Bug#9869).
b77a6a7f 5568
3b574623
JD
5569 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5570 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5571
b77a6a7f
JD
5572 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5573
5574 * xterm.c: Declare x_handle_net_wm_state to return int.
5575 (handle_one_xevent): Check if we are iconified but don't have
5576 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
5577 (get_current_wm_state): Return non-zero if not hidden,
5578 check for _NET_WM_STATE_HIDDEN (Bug#9893).
5579 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5580 (x_handle_net_wm_state): Return what get_current_wm_state returns.
5581 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5582
196e41e4
PE
55832011-10-29 Paul Eggert <eggert@cs.ucla.edu>
5584
5585 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5586 so that this new function doesn't get optimized away by a
5587 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
5588
021f2e1a
AS
55892011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5590
5591 * frame.h (MOUSE_HL_INFO): Remove excess parens.
5592
8b058d44
EZ
55932011-10-29 Eli Zaretskii <eliz@gnu.org>
5594
5595 Fix the `xbytecode' command.
5596 * .gdbinit (xprintbytestr): New command.
b50a28de 5597 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
5598 (xbytecode): Print the byte-code string as well.
5599
4452fb80
EZ
56002011-10-29 Kim Storm <storm@cua.dk>
5601
8b058d44
EZ
5602 * alloc.c (which_symbols): New function.
5603
21b72067
AS
56042011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5605
5606 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5607 line. (Bug#9903)
5608
83ed7b5c
GM
56092011-10-29 Glenn Morris <rgm@gnu.org>
5610
5611 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5612 Not clear what it was for, and it causes various bugs. (Bug#9839)
5613
5a7a728b
EZ
56142011-10-28 Eli Zaretskii <eliz@gnu.org>
5615
5616 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5617 possible random value that matches one of those tested as
5618 condition to clear the mouse face.
5619
d3d0842f
CY
56202011-10-28 Chong Yidong <cyd@gnu.org>
5621
5622 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5623
31b39d13
DN
56242011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
5625
5626 * window.c (make_window): Initialize phys_cursor_on_p.
5627
9aba6043
SM
56282011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5629
5630 * lisp.h (struct Lisp_Symbol): Update comments.
5631
c20992f4
JB
56322011-10-28 Juanma Barranquero <lekktu@gmail.com>
5633
5634 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5635
db4f02f2
EZ
56362011-10-28 Eli Zaretskii <eliz@gnu.org>
5637
5638 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
5639 <oslsachem@gmail.com> for helping to debug this.
5640
5641 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5642 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5643 (g_b_init_get_glyph_outline_w): New static variables.
5644 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5645 (GetGlyphOutlineW_Proc): New typedefs.
5646 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
5647 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5648 New functions.
5649 (w32font_open_internal, compute_metrics):
5650 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
5651 instead of calling the "wide" APIs directly.
5652
5653 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5654
5655 * w32.h (syms_of_w32font): Add prototype.
5656
87e68db4
JB
56572011-10-27 Juanma Barranquero <lekktu@gmail.com>
5658
5659 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5660 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5661 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5662 (Fmove_to_window_line): Doc fix.
5663
435c1d67
CY
56642011-10-27 Chong Yidong <cyd@gnu.org>
5665
5666 * process.c (make_process): Set gnutls_state to NULL.
5667
5668 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5669 non-NULL, regardless of GNUTLS_INITSTAGE.
5670 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
5671 an error. Set process slots as soon as we allocate them.
5672
5673 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5674
9c6c6f49
CY
56752011-10-27 Chong Yidong <cyd@gnu.org>
5676
9aba6043
SM
5677 * gnutls.c (emacs_gnutls_deinit): New function.
5678 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
5679 (Fgnutls_deinit, Fgnutls_boot): Use it.
5680
5681 * process.c (make_process): Initialize GnuTLS credentials to NULL.
5682 (deactivate_process): Call emacs_gnutls_deinit.
5683
657d08d3
JB
56842011-10-27 Juanma Barranquero <lekktu@gmail.com>
5685
5686 * image.c (x_create_x_image_and_pixmap):
5687 * w32.c (sys_rename, w32_delayed_load):
5688 * w32font.c (fill_in_logfont):
5689 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5690
5430d399
JB
56912011-10-26 Juanma Barranquero <lekktu@gmail.com>
5692
5693 * w32fns.c (w32_default_color_map): New function,
5694 extracted from Fw32_default_color_map.
a7ef684b 5695 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 5696
fe0055fa
PE
56972011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5698
5699 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5700
e6346438
SM
57012011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
5702
5703 * keyboard.c (test_undefined): New function (bug#9751).
5704 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5705
e112cc37
ET
57062011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
5707
5708 * sysdep.c (init_sys_modes): Fix the check for the controlling
5709 terminal (Bug#6649).
5710
7b5d6677
EZ
57112011-10-20 Eli Zaretskii <eliz@gnu.org>
5712
5713 * dispextern.h (struct bidi_it): New member next_en_type.
5714
5715 * bidi.c (bidi_line_init): Initialize the next_en_type member.
5716 (bidi_resolve_explicit_1): When next_en_pos is valid for the
5717 current character, check also for next_en_type being WEAK_EN.
5718 (bidi_resolve_weak): Don't enter the expensive loop if the current
5719 position is before next_en_pos. Record the bidi type of the first
5720 non-ET, non-BN character we find, in addition to its position.
5721 (bidi_level_of_next_char): Invalidate next_en_type when
5722 next_en_pos is over-stepped.
5723
7da0b018
PE
57242011-10-20 Paul Eggert <eggert@cs.ucla.edu>
5725
5726 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5727 * editfns.c: Rewrite current-time-zone so that it invokes
5728 the equivalent of (format-time-string "%Z") to get the time zone name.
5729 This fixes a bug when the time zone name contains characters that
5730 need converting from the system time locale to Emacs internal format.
5731 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5732 that patch fixed format-time-string to do the conversion, but
5733 I forgot to fix current-time-zone.
5734 (format_time_string): New function, containing most of
5735 what Fformat_time_string used to contain.
5736 (Fformat_time_string): Rewrite in terms of format_time_string.
5737 This doesn't change this function's behavior.
5738 (current-time-zone): Rewrite to use format_time_string.
5739 This fixes the bug reported by Michael Schierl in
5740 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5741 Jason Rumney's 2007-06-07 change worked around this bug, but
5742 didn't fix it.
5743 * systime.h (tzname, timezone): Remove no-longer-used declarations.
5744
8547b010
EZ
57452011-10-19 Eli Zaretskii <eliz@gnu.org>
5746
5747 * xdisp.c (start_display): If the character at POS is displayed
5748 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
5749 (try_window_reusing_current_matrix): If a line ends in a display
5750 vector or the next line starts in a display vector, continue
5751 redrawing the window even though the character position of
5752 start_row was reached.
8547b010
EZ
5753 (Bug#9771, part 2)
5754
4e948d15
CY
57552011-10-18 Chong Yidong <cyd@gnu.org>
5756
5757 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5758 with nobreak-char-display too.
5759
4787455f
EZ
57602011-10-18 Eli Zaretskii <eliz@gnu.org>
5761
5762 Fix part 3 of bug#9771.
5763 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
5764 (bidi_resolve_neutral): Don't enter the expensive loop looking for
5765 non-neutral characters if the current character is a paragraph
5766 separator (a.k.a. Newline). This avoids running the same
5767 expensive loop twice, once when we consume the preceding newline
5768 and the other time when the line actually needs to be displayed.
5769 Avoid the loop when we see neutrals on the base embedding level
5770 following a character whose directionality is the same as the
5771 paragraph's. This avoids running the expensive loop when a line
5772 ends in a long sequence of neutrals, like control characters.
5773 Add assertion against STRONG_AL type. Slightly rearrange code
5774 that determines the type of a neutral given the first non-neutral
5775 that follows it.
5776 (bidi_level_of_next_char): Set next_en_pos to zero when
5777 invalidating its info.
5778
2c91f553
EZ
57792011-10-17 Eli Zaretskii <eliz@gnu.org>
5780
5781 * xdisp.c (push_display_prop): Determine whether to record string
5782 or buffer position by IT->string, not by IT->method. Allow
5783 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
5784 (move_it_vertically_backward): Don't look for character position
5785 immediately after the newline when in a continuation line.
5786 (Bug#9771, part 1)
2c91f553 5787
c7b08b0d
MR
57882011-10-15 Martin Rudalics <rudalics@gmx.at>
5789
5790 * window.c (coordinates_in_window): Rewrite and delabelize
5791 vertical border check. (Bug#5357) (Bug#9618)
5792
6b02f655
SM
57932011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
5794
5795 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
5796 errors in XSetWindowBorder (bug#9310).
5797
81d40c92
DA
57982011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
5799
5800 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
5801 avoid crash when xmalloc overrun checking is enabled.
5802
d4172c3b
EZ
58032011-10-13 Eli Zaretskii <eliz@gnu.org>
5804
5805 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
5806 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
5807 cursor motion with <left> and <right> arrow keys.
5808
5809 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
5810 some callers set that themselves.
5811
b00eea75
EZ
58122011-10-12 Eli Zaretskii <eliz@gnu.org>
5813
5814 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
5815 display string and the previous row comes from the same string and
5816 is empty. (Bug#9739) (Bug#9738)
5817
8fe012c4
SM
58182011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5819
5820 * doc.c (get_doc_string): Encode file name (bug#9735).
5821
0074aef2
EZ
58222011-10-12 Eli Zaretskii <eliz@gnu.org>
5823
79beb178
EZ
5824 * bidi.c (bidi_level_of_next_char):
5825 * xdisp.c (get_visually_first_element): Remove old incorrect
5826 comments regarding the Unicode Line Separator character.
5827
0074aef2
EZ
5828 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
5829
6e4b3fbe
DA
58302011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
5831
5832 * alloc.c (Fgc_status): Do not access beyond zombies array
5833 boundary if nzombies > MAX_ZOMBIES.
5834 * alloc.c (dump_zombies): Add missing format specifier.
5835
0324f3af
PE
58362011-10-12 Paul Eggert <eggert@cs.ucla.edu>
5837
b5525cac
PE
5838 * xdisp.c (set_cursor_from_row): Simplify conditionals,
5839 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
5840
0324f3af
PE
5841 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
5842 Some packages use them to denote characters with modifiers.
5843
e9b5f888
AS
58442011-10-11 Andreas Schwab <schwab@linux-m68k.org>
5845
5846 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
5847 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
5848 matching a pp-number. Rename parameter var to var1.
5849
127827c0
SM
58502011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5851
5852 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
5853
c8fd3bd0
GM
58542011-10-08 Glenn Morris <rgm@gnu.org>
5855
5856 * callint.c (Fcall_interactively): Give a more explicit error for the
5857 'c' case with a non-character input. (Bug#8479)
5858
352ec8ff
EZ
58592011-10-08 Eli Zaretskii <eliz@gnu.org>
5860
03669ccb
EZ
5861 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
5862 lines.
7061c986
EZ
5863 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
5864 lines that are hscrolled on the left.
03669ccb 5865
352ec8ff
EZ
5866 * dispnew.c (buffer_posn_from_coords): Account for a possible
5867 presence of header-line. (Bug#4426)
5868
a66cfb1c
SM
58692011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
5870
6b02f655
SM
5871 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
5872 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 5873
7c5ee88e
PE
58742011-10-07 Paul Eggert <eggert@cs.ucla.edu>
5875
5876 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
5877 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
5878 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
5879 this makes Emacs dump core during garbage collection on rare
5880 occasions. sizeof is obviously inferior to offsetof here, so
5881 stick with offsetof.
5882 (GC_POINTER_ALIGNMENT): New macro.
5883 (mark_memory): Omit 3rd (offset) arg; caller changed.
5884 Don't assume EMACS_INT alignment is the same as pointer alignment.
5885
df1bbe5b
SM
58862011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
5887
5888 * keyboard.c (read_key_sequence_remapped): New var.
5889 (read_key_sequence): Compute remapping in the right buffer.
5890 (command_loop_1): Use read_key_sequence's remapping directly.
5891
51553db6
SM
58922011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5893
32c1fffd
SM
5894 * dired.c (file_name_completion): Don't expand file name.
5895 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
5896 before checking file name handler.
5897
51553db6
SM
5898 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
5899 they've been requested explicitly (bug#9591).
5900
b6bd1599 59012011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
5902
5903 * keymap.c (Fsingle_key_description): Use make_specified_string
5904 instead of build_string to build string from push_key_description.
5905 (Bug#5193)
5906
f701dc2a
PE
59072011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5908
4222c55d
PE
5909 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
5910 This fixes a Y2038 bug on 64-bit hosts.
5911 * buffer.c (reset_buffer):
5912 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
5913 (Fclear_buffer_auto_save_failure):
5914 Use 0, not -1, to represent an unset failure time, since time_t
5915 might not be signed.
5916
f701dc2a
PE
5917 Remove dependency on glibc malloc internals.
5918 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5919 Move back here from lisp.h, but with their new implementations.
5920 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5921 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
5922 * charset.c (charset_table_init): New static var.
5923 (syms_of_charset): Use it instead of xmalloc. This removes a
5924 dependency on glibc malloc internals. See Eli Zaretskii's comment in
5925 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
5926 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5927 Move back to alloc.c.
5928 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5929 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
5930
9ceebf39
JD
59312011-09-30 Jan Djärv <jan.h.d@swipnet.se>
5932
5933 * nsterm.m (windowDidResize): Call x_set_window_size only when
5934 ns_in_resize is true. Otherwise set pixelwidth/height and
5935 call change_frame_size (Bug#9628).
5936
cb993c58
PE
59372011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5938
3930c88b
PE
5939 Port --enable-checking=all to Fedora 14 x86-64.
5940 * charset.c (syms_of_charset): Also account for glibc malloc's
5941 internal overhead when calculating the initial malloc maximum.
5942
cb993c58
PE
5943 Port --enable-checking=all to Fedora 14 x86.
5944 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5945 Move to lisp.h.
5946 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
5947 (overrun_check_realloc, overrun_check_free):
5948 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
5949 That way, xmalloc returns a properly-aligned pointer even if
5950 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
5951 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
5952 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
5953 into account when calculating the initial malloc maximum.
5954 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5955 Move here from alloc.c, so that charset.c can use it too.
5956 Properly align; the old code wasn't right for common 32-bit hosts
5957 when configured with --enable-checking=all.
5958 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5959 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
5960
31bed486
EZ
59612011-09-29 Eli Zaretskii <eliz@gnu.org>
5962
04c70788 5963 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
5964 use EDOM.
5965
fbcaa2f3
EZ
59662011-09-28 Eli Zaretskii <eliz@gnu.org>
5967
5968 * xdisp.c (compute_display_string_end): If there's no display
5969 string at CHARPOS, return -1.
5970
5971 * bidi.c (bidi_fetch_char): When compute_display_string_end
5972 returns a negative value, treat the character as a normal
5973 character not covered by a display string. (Bug#9624)
5974
a239d4e9
JB
59752011-09-28 Juanma Barranquero <lekktu@gmail.com>
5976
5977 * lread.c (Fread_from_string): Fix typo in docstring.
5978
88652fd5
EZ
59792011-09-27 Eli Zaretskii <eliz@gnu.org>
5980
5981 * xdisp.c (handle_invisible_prop): If invisible text ends on a
5982 newline, reseat the iterator instead of bidi-iterating there one
5983 character at a time. (Bug#9610)
32c1fffd
SM
5984 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
5985 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 5986
ed497dd4
AS
59872011-09-27 Andreas Schwab <schwab@linux-m68k.org>
5988
5989 * lread.c (readevalloop): Use correct code for NBSP.
5990 (read1): Likewise. (Bug#9608)
5991
b2bf61aa
MA
59922011-09-25 Michael Albinus <michael.albinus@gmx.de>
5993
5994 * dbusbind.c (Fdbus_register_signal): When service is not
5995 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
5996
32bbb17c
GM
59972011-09-25 Glenn Morris <rgm@gnu.org>
5998
5999 * buffer.c (truncate-lines): Doc fix.
6000
94e0933e
CY
60012011-09-24 Chong Yidong <cyd@stupidchicken.com>
6002
6003 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
6004 (Fset_window_next_buffers): Doc fix.
6005
cddde921
GM
60062011-09-24 Glenn Morris <rgm@gnu.org>
6007
6008 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
6009
1260aef1
PE
60102011-09-24 Paul Eggert <eggert@cs.ucla.edu>
6011
25b4bfa0
PE
6012 Fix minor problems found by static checking.
6013 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
6014 * indent.c (Fvertical_motion): Fix == vs = typo.
6015
e3cbd34b
EZ
60162011-09-24 Eli Zaretskii <eliz@gnu.org>
6017
a66cfb1c
SM
6018 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
6019 Default value is now t. Doc fix.
6bf7006f 6020
e3cbd34b 6021 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 6022 logic when moving up, not only when moving down. Fix the
e3cbd34b 6023 confusing name and values of the it_overshoot_expected variable;
32c1fffd 6024 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
6025
6026 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
6027 CHARPOS is covered by a display string which includes newlines.
6028 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
6029 is covered by a display string with embedded newlines.
6030
a3de0cbd
MA
60312011-09-24 Michael Albinus <michael.albinus@gmx.de>
6032
6033 * dbusbind.c (Fdbus_register_signal): Add match rule to
6034 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
6035 (Fdbus_register_method, Vdbus_registered_objects_table):
6036 Fix docstring.
a3de0cbd 6037
b260039d
JM
60382011-09-24 Jim Meyering <meyering@redhat.com>
6039
32c1fffd 6040 do not ignore write error for any output size
b260039d
JM
6041 The previous change was incomplete.
6042 While it makes emacs --batch detect the vast majority of stdout
6043 write failures, errors were still ignored whenever the output size is
6044 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
6045 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
6046 && echo FAIL: ignored write error
6047 FAIL: ignored write error
6048 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
6049 && echo FAIL: ignored write error
6050 FAIL: ignored write error
6051 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
6052
8eca8a7c
AS
60532011-09-23 Andreas Schwab <schwab@linux-m68k.org>
6054
6055 * emacs.c (Fkill_emacs): In noninteractive mode exit
6056 non-successfully if a write error occurred on stdout. (Bug#9574)
6057
3341db62
EZ
60582011-09-21 Eli Zaretskii <eliz@gnu.org>
6059
6060 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
6061 the xassert test.
6062
6063 * dispextern.h (struct it): Update the comment documenting what
6064 can it->OBJECT be.
6065
8c203dbf
EZ
60662011-09-20 Eli Zaretskii <eliz@gnu.org>
6067
6068 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
6069 a display string, extend search for cursor position to end of row.
6070 (find_row_edges): If the row ends in a newline from a display
6071 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
6072 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
6073 (Fcurrent_bidi_paragraph_direction): Fix search for previous
6074 non-empty line. Fixes confusing cursor motion with arrow keys at
6075 the beginning of a line that starts with whitespace.
8c203dbf 6076
a4824228
LMI
60772011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6078
6079 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
6080 (bug#9493).
6081
33ed493b
CY
60822011-09-18 Chong Yidong <cyd@stupidchicken.com>
6083
6084 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
6085 boolean (Bug#9154).
6086
56cd55c8
EZ
60872011-09-18 Eli Zaretskii <eliz@gnu.org>
6088
6089 * xdisp.c (display_line): Record maximum and minimum buffer
6090 positions even if no glyphs were produced (e.g., by a zero-width
6091 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
6092 buffer positions that will be removed from the glyph row because
6093 they don't fit.
c02dcedf
EZ
6094 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
6095 column is beyond frame width: don't subtract 1 "pixel" when
6096 computing width of the stretch.
3e62b7e0
EZ
6097 (reseat_at_next_visible_line_start): Undo the change made on
6098 2011-09-17 that saved paragraph information and restored it after
6099 the call to `reseat'. (Bug#9545)
56cd55c8 6100
5ed99d36 61012011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
6102
6103 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
6104 and turn window cursor on if cleared (Bug#9415).
6105
5ed99d36 61062011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
6107
6108 * search.c (boyer_moore): Take unibyte characters from pattern
6109 literally. (Bug#9458)
6110
9bade7b2
EZ
61112011-09-18 Eli Zaretskii <eliz@gnu.org>
6112
6113 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
6114
e5e9d610
PE
61152011-09-18 Paul Eggert <eggert@cs.ucla.edu>
6116
87e4427a
PE
6117 Fix minor problem found by static checking.
6118 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
6119 initialized, to pacify gcc -Wuninitialized.
6120
e5e9d610
PE
6121 * fileio.c: Report proper errno when syscall falls.
6122 (Finsert_file_contents): Save and restore errno,
6123 so that report_file_error outputs the correct diagnostic.
6124 (Fwrite_region) [CLASH_DETECTION]: Likewise.
6125
a1674f0b
EZ
61262011-09-18 Eli Zaretskii <eliz@gnu.org>
6127
6128 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
6129
fbfb6dd4
EZ
61302011-09-17 Eli Zaretskii <eliz@gnu.org>
6131
6132 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
6133 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
6134
bb187662
EZ
61352011-09-17 Eli Zaretskii <eliz@gnu.org>
6136
1137e8b8 6137 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 6138 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
6139
6140 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
6141 (bidi_find_paragraph_start): Search back for paragraph beginning
6142 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
6143 (bidi_move_to_visually_next): Only trigger paragraph-related
6144 computations when the last character is a newline or at EOB, not
6145 just any NEUTRAL_B. (Bug#9470)
6146
bb187662
EZ
6147 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
6148 truncated lines if point is covered by a display string. (Bug#9524)
6149
2e621251
PE
61502011-09-16 Paul Eggert <eggert@cs.ucla.edu>
6151
6152 * xselect.c: Relax test for outgoing X longs (Bug#9498).
6153 (cons_to_x_long): New function.
6154 (lisp_data_to_selection_data): Use it. Correct the test for
6155 short-versus-long data; it was negated. Break out of vector
6156 loop, for efficiency, when a long datum is discovered.
6157
91a15bc6
SM
61582011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
6159
6160 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
6161
b41c3a35
EZ
61622011-09-16 Eli Zaretskii <eliz@gnu.org>
6163
6164 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
6165 GCC PR/17406) by declaring this function with external scope.
6166
7812ba2d
PE
61672011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6168
6169 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
6170 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
6171
cf7edc2a
AS
61722011-09-15 Andreas Schwab <schwab@linux-m68k.org>
6173
6174 * editfns.c (Fformat): Correctly handle text properties on "%%".
6175
bd01620e
EZ
61762011-09-15 Eli Zaretskii <eliz@gnu.org>
6177
6178 * xterm.c (x_draw_composite_glyph_string_foreground):
6179 * w32term.c (x_draw_composite_glyph_string_foreground):
6180 * term.c (encode_terminal_code):
6181 * composite.c (composition_update_it, get_composition_id):
6182 * xdisp.c (get_next_display_element)
6183 (fill_composite_glyph_string): Add comments about special meaning
6184 of TAB characters in a composition.
6185
a02719a3
PE
61862011-09-15 Paul Eggert <eggert@cs.ucla.edu>
6187
6188 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
6189 This occurs when processing a multibyte format.
6190 Problem reported by Wolfgang Jenker.
a02719a3 6191
72589a3c
JB
61922011-09-15 Johan Bockgård <bojohan@gnu.org>
6193
6194 * xdisp.c (try_cursor_movement): Only check for exact match if
6195 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
6196
1c14176c
PE
61972011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6198
6199 Remove unused external symbols.
6200 * dispextern.h (calc_pixel_width_or_height): Remove decl.
6201 * xdisp.c (calc_pixel_width_or_height): Now static.
6202 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
6203 * indent.c (check_display_width):
6204 * w32term.c: Fix comment to match code.
6205 * xterm.c, xterm.h (x_catching_errors): Remove.
6206
d2eea5b5
PE
62072011-09-14 Paul Eggert <eggert@cs.ucla.edu>
6208
6209 * xselect.c: Use signed conversions more consistently (Bug#9498).
6210 (selection_data_to_lisp_data): Assume incoming selection data are
6211 signed integers, not unsigned. This is to be consistent with
6212 outgoing selection data, which was modified to use signed integers
6213 in as part of the fix to Bug#9196 in response to Jan D.'s comment
6214 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
6215 expects long, not unsigned long.
6216
46888499
EZ
62172011-09-14 Eli Zaretskii <eliz@gnu.org>
6218
6219 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
6220 computation of loop end. Reported by Johan Bockgård
6221 <bojohan@gnu.org>.
6222
ef8ef9fb
CY
62232011-09-13 Chong Yidong <cyd@stupidchicken.com>
6224
6225 * frame.c (Fother_visible_frames_p): Function deleted.
6226
fa819fed
EZ
62272011-09-12 Eli Zaretskii <eliz@gnu.org>
6228
6229 * indent.c (compute_motion): Process display vector front to back
6230 rather than the other way around. (Bug#2496)
6231
2ba8e008
SM
62322011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6233
6234 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6235
20f53c69
CY
62362011-09-11 Chong Yidong <cyd@stupidchicken.com>
6237
6238 * minibuf.c (Fread_from_minibuffer): Doc fix.
6239
d562d7a4
EZ
62402011-09-11 Eli Zaretskii <eliz@gnu.org>
6241
6242 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6243 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
6244
1c4d7f3d
LMI
62452011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6246
6247 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6248 value for non-existent files.
6249
b885bf36
EZ
62502011-09-11 Eli Zaretskii <eliz@gnu.org>
6251
6252 * fileio.c (Finsert_file_contents): If the file cannot be opened,
6253 set its "size" to -1. This will set the modtime_size field of
6254 the corresponding buffer to -1, which is what
6255 verify-visited-file-modtime expects for files that do not exist.
6256 (Bug#9139)
6257
6612f0bf
PE
62582011-09-11 Paul Eggert <eggert@cs.ucla.edu>
6259
6260 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6261 here ...
6262 * lisp.h: ... from here. push_key_description is no longer
6263 defined in keyboard.c, so its declaration should not be in
6264 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6265 logically belongs with push_key_description.
6266
dfb3f755
PE
62672011-09-10 Paul Eggert <eggert@cs.ucla.edu>
6268
6269 * buffer.h: Include <sys/types.h> instead of <time.h>.
6270 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6271 Problem reported by Herbert J. Skuhra.
6272
3134906c
LMI
62732011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
6274
6275 * xml.c (parse_region): Make the parsing work for
6276 non-comment-starting XML files again (bug#9144).
6277
8d903f4e
AS
62782011-09-10 Andreas Schwab <schwab@linux-m68k.org>
6279
6280 * image.c (gif_load): Fix calculation of bottom and right corner.
6281 (Bug#9468)
6282
80ad64f4
EZ
62832011-09-10 Eli Zaretskii <eliz@gnu.org>
6284
6285 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
6286 redisplay in small windows.
6287
208a048d
EZ
62882011-09-09 Eli Zaretskii <eliz@gnu.org>
6289
6290 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6291
9b1c252e
MR
62922011-09-08 Martin Rudalics <rudalics@gmx.at>
6293
6294 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6295 Operate on live windows only.
6296
2949f33b
JB
62972011-09-08 Juanma Barranquero <lekktu@gmail.com>
6298
6299 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6300
e08dcafd
EZ
63012011-09-07 Eli Zaretskii <eliz@gnu.org>
6302
6303 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6304 only under bidi iteration.
6305
115b96bd
JD
63062011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6307
6308 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6309
c8199d0f
PE
63102011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6311
6312 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6313 Without this fix, the command to link temacs failed due to an
6314 undefined symbol __builtin_isnan. This is because
6315 /usr/include/iso/math_c99.h #defines isnan(x) to
6316 __builtin_isnan(x), but the bundled gcc, which identifies itself
6317 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6318 a __builtin_isnan.
6319 * floatfns.c (isnan): #undef, and then #define to a clone of
6320 what's in data.c.
6321 (Fisnan): Always define, since it's always available now.
6322 (syms_of_floatfns): Always define isnan at the Lisp level.
6323
e39b275c 63242011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6325
6326 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6327
b2db44d9 63282011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6329
f4af5137 6330 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6331 The previous code assumed that file offsets (off_t values) fit in
6332 EMACS_INT variables, which is not true on typical 32-bit hosts.
6333 The code messed up by falsely reporting buffer overflow in cases
6334 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6335 when "big" contains more than 2**29 bytes, even though this
6336 inserts just one byte and does not overflow the buffer.
6337 (Finsert_file_contents): Store file offsets as off_t
6338 values, not as EMACS_INT values. Check for overflow when
6339 converting between EMACS_INT and off_t. When checking for
6340 buffer overflow or for overlap, take the offsets into account.
6341 Don't use EMACS_INT for small values where int suffices.
6342 When checking for overlap, fix a typo: ZV was used where
6343 ZV_BYTE was intended.
6344 (Fwrite_region): Don't assume off_t fits into 'long'.
6345 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6346
ecfc0a49
MA
63472011-09-05 Michael Albinus <michael.albinus@gmx.de>
6348
6349 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6350
6511acf2 63512011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6352
0999621a 6353 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6354
6355 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6356 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6357 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6358 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6359 (modify_event_symbol): Do not assume that the length of
6360 name_alist_or_stem is safe to alloca and fits in int.
6361 (Fexecute_extended_command): Likewise for function name and binding.
6362 (Frecursion_depth): Wrap around reliably on integer overflow.
6363 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6364 since some callers pass EMACS_INT values.
6365 (Fsingle_key_description): Don't crash if symbol name contains more
6366 than MAX_ALLOCA bytes.
6367 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6368 (get_minibuffer): Arg is now EMACS_INT, not int.
6369 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6370 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6371 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6372
2be7d702
PE
6373 * dbusbind.c (signature_cat): New function.
6374 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6375 Do not overrun buffer; instead, report string overflow.
6376
9d1df220
PE
6377 * dispnew.c (add_window_display_history): Don't overrun buffer.
6378 Truncate instead; this is OK since it's just a log.
6379
33ef5c64
PE
6380 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6381 even if the time zone offset is outlandishly large.
6382 Don't mishandle offset == INT_MIN.
6383
66c6fdd5
PE
6384 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6385 when creating daemon; the previous buffer-overflow check was incorrect.
6386
d749b01b
PE
6387 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6388 which has the guts of the old verror function.
6389
b5cd1905
PE
6390 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6391 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6392
6e1a67fb
PE
6393 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6394 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6395 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6396 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6397 length of string rather than counting it via multiple sprintfs;
6398 that's simpler and more reliable.
c21721cc
PE
6399 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6400 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6401 sprintf, in case result does not fit in int.
6402
c57b67fc
PE
6403 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6404 (fontset_from_font): Print it.
6405
8a401434
PE
6406 * frame.c (tty_frame_count): Now printmax_t, not int.
6407 (make_terminal_frame, set_term_frame_name): Print it.
6408 (x_report_frame_params): In X, window IDs are unsigned long,
6409 not signed long, so print them as unsigned.
6410 (validate_x_resource_name): Check for implausibly long names,
6411 and don't assume name length fits in 'int'.
6412 (x_get_resource_string): Don't blindly alloca invocation name;
6413 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6414 not fit in int.
6415
6e1a67fb
PE
6416 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6417 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6418 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6419
0df02bf3
PE
6420 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6421 Use esprintf, not sprintf, in case result does not fit in int.
6422
48e30793
PE
6423 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6424 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6425 it as a large positive number.
6426 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6427 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6428
a66ff6d8
PE
6429 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6430 in case result does not fit in int.
6431
aca216ff
PE
6432 * print.c (float_to_string): Detect width overflow more reliably.
6433 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6434 buffer overrun. Don't assume list length fits in 'int'. Treat
6435 print length of 0 as 0, not as infinity; to be consistent with other
6436 uses of print length in this function. Don't overflow print length
6437 index. Don't assume hash table size fits in 'long', or that
6438 vectorlike size fits in 'unsigned long'.
6439
31c286f7
PE
6440 * process.c (make_process): Use printmax_t, not int, to format
6441 process-name gensyms.
6442
55e5faa1
PE
6443 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6444
80f2e268
PE
6445 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6446 to avoid potential buffer overrun.
6447
670741ab
PE
6448 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6449 if X resource line is longer than 512 bytes.
6450
b7163a50
PE
6451 * xfns.c (x_window): Make sprintf buffer a bit bigger
6452 to avoid potential buffer overrun.
6453
ae58ff1f
PE
6454 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6455
c43c8a6a
PE
6456 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6457
3f8236f4
PE
64582011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6459
53e9fe90 6460 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6461 Without these, Emacs silently mishandles large integers sometimes.
6462 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6463 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6464
6511acf2
PE
6465 * xdisp.c (try_window_id): Check Emacs fixnum range before
6466 converting to 'int'.
806add1d 6467
6511acf2 6468 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6469 Check that an Emacs fixnum is in range before assigning it to 'int'.
6470 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6471 values converted from Emacs fixnums.
6472 (Frecenter): Don't wrap around a line count if it is out of 'int'
6473 range; instead, treat it as an extreme value.
6474 (Fset_window_configuration, compare_window_configurations):
6475 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6476
6511acf2
PE
6477 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6478 that can exceed INT_MAX. Check that EMACS_INT value is in range
6479 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6480 (match_limit): Don't assume that a fixnum can fit in 'int'.
6481
6511acf2 6482 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6483 exceed INT_MAX.
6484
6511acf2 6485 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6486 (Fvertical_motion): Don't wrap around LINES values that don't fit
6487 in 'int'. Instead, treat them as extreme values. This is good
6488 enough for windows, which can't have more than INT_MAX lines anyway.
6489
fcb901a7
LMI
64902011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6491
0f2f6b6d
LMI
6492 * Require libxml/parser.h to avoid compilation warning.
6493
fcb901a7
LMI
6494 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6495
6496 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6497 since this reportedly can destroy thread storage.
6498
6e20a0d4
CY
64992011-08-30 Chong Yidong <cyd@stupidchicken.com>
6500
6501 * syntax.c (find_defun_start): Update all cache variables if
6502 exiting early (Bug#9401).
6503
148ae00e
EZ
65042011-08-30 Eli Zaretskii <eliz@gnu.org>
6505
f6cfbd8f
EZ
6506 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6507
148ae00e
EZ
6508 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6509 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6510 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6511
6512 * term.c (tty_append_glyph): New function.
6513 (produce_stretch_glyph): Static function and its prototype deleted.
6514
a66cfb1c
SM
6515 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6516 Add prototypes.
148ae00e 6517
c4a07a4c
PE
65182011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6519
6520 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6521 when checking :margin (Bug#9390).
6522 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6523 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6524 so that the name doesn't mislead. All uses changed.
6525
6bc8cd65
JB
65262011-08-28 Johan Bockgård <bojohan@gnu.org>
6527
6528 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6529 set_tty_hooks.
6530
dca4927e
EZ
65312011-08-27 Eli Zaretskii <eliz@gnu.org>
6532
6533 * xdisp.c (move_it_to): Don't bail out early when reaching
6534 position beyond to_charpos, if we are scanning backwards.
6535 (move_it_vertically_backward): When DY == 0, make sure we get to
6536 the first character in the line after the newline.
6537
f2cad773
PE
65382011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6539
6540 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6541 (ccl_driver): Do not generate an out-of-range pointer.
6542 (Fccl_execute_on_string): Remove unnecessary check for
6543 integer overflow, noted by Stefan Monnier in
6544 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6545 Remove a FIXME that didn't need fixing.
6546 Simplify the newly-introduced buffer reallocation code.
6547
0cae2cdb
JB
65482011-08-27 Juanma Barranquero <lekktu@gmail.com>
6549
6550 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6551
5fc295a4 65522011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6553
70c60eb2 6554 Integer and memory overflow issues (Bug#9196).
726e0ab1 6555
d31850da
PE
6556 * doc.c (get_doc_string): Rework so that
6557 get_doc_string_buffer_size is the actual buffer size, rather than
6558 being 1 less than the actual buffer size; this makes xpalloc more
6559 convenient.
6560
a69fbedb
PE
6561 * image.c (x_allocate_bitmap_record, cache_image):
6562 * xselect.c (Fx_register_dnd_atom):
6563 Simplify previous changes by using xpalloc.
6564
fe5c5d37
PE
6565 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6566 since either will do and ptrdiff_t is convenient with xpalloc.
6567
0065d054
PE
6568 * charset.c (charset_table_size)
6569 (struct charset_sort_data.priority): Now ptrdiff_t.
6570 (charset_compare): Don't overflow if priorities differ greatly.
6571 (Fsort_charsets): Don't assume list length fits in int.
6572 Check for size-calculation overflow when allocating sort data.
6573 (syms_of_charset): Allocate an initial charset table that is
6574 just under 64 KiB, to avoid problems with glibc malloc and mmap.
6575
6576 * cmds.c (internal_self_insert): Check for size-calculation overflow.
6577
6578 * composite.h (struct composition.glyph_len): Now int, not unsigned.
6579 The actual value is always <= INT_MAX, and leaving it unsigned made
6580 overflow checking harder.
6581
6582 * dispextern.h (struct glyph_matrix.rows_allocated)
6583 (struct face_cache.size): Now ptrdiff_t, for convenience in use
6584 with xpalloc. The values are still always <= INT_MAX.
6585
6586 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6587
6588 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6589 (SAFE_NALLOCA): New macro.
6590
6591 * region-cache.c (struct boundary.pos, find_cache_boundary)
6592 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6593 (set_cache_region, invalidate_region_cache)
6594 (revalidate_region_cache, know_region_cache, region_cache_forward)
6595 (region_cache_backward, pp_cache):
6596 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
6597 so that ptrdiff_t * can be passed to xpalloc.
6598 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6599 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6600 (pp_cache): Don't assume cache_len fits in int.
6601 * region-cache.h: Adjust extern decls to match.
6602
6603 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6604 EMACS_INT, since either will do, for xpalloc.
6605
6606 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6607 (xnmalloc, xnrealloc, xpalloc): New functions.
6608
726e0ab1
PE
6609 * bidi.c (bidi_shelve_header_size): New constant.
6610 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6611 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6612
51f30bc5 6613 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
6614 * buffer.c (overlays_at, overlays_in, record_overlay_string)
6615 (overlay_strings):
6616 Don't update size of array until after memory allocation succeeds,
6617 because xmalloc/xrealloc may not return.
0065d054
PE
6618 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6619 now that we have proper integer overflow checking.
6620 (record_overlay_string, overlay_strings): Catch overflows when
6621 calculating size of overlay_str_buf.
726e0ab1 6622
0065d054
PE
6623 * callproc.c (Fcall_process): Check for size overflow when
6624 calculating size of args2.
6625 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6626 Normally we prefer signed values, but sticking with ptrdiff_t would
6627 require adding more-complicated checks.
726e0ab1
PE
6628
6629 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6630 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6631 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 6632 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
6633
6634 * character.c (Fstring): Check for size-calculation overflow.
6635
6636 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6637 unnecessary integer overflow. Check for size overflow.
6638 (encode_coding_object): Don't update size until xmalloc succeeds.
6639
6640 * composite.c (get_composition_id): Check for overflow in glyph
6641 length calculations.
6642
6643 Integer and memory overflow fixes for display code.
6644 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6645 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6646 (scrolling_window): Check for overflow in size calculations.
6647 (line_draw_cost, realloc_glyph_pool, add_row_entry):
6648 Don't assume glyph table len fits in int.
6649 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6650 (row_table_size): Now ptrdiff_t, not int.
6651 (scrolling_window): Avoid overflow in size calculations.
6652 Don't update size until allocation succeeds.
6653 * fns.c (concat): Check for overflow in size calculations.
6654 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6655 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6656 (NEXT_ALMOST_PRIME_LIMIT): New constant.
6657
6658 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6659 (get_doc_string): Check for size calculation overflow.
6660 Don't update size until allocation succeeds.
6661 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6662 EMACS_INT, where ptrdiff_t will do.
6663 (Fsubstitute_command_keys): Check for string overflow.
6664
6665 * editfns.c (set_time_zone_rule): Don't assume environment length
6666 fits in int.
6667 (message_length): Now ptrdiff_t, not int.
6668 (Fmessage_box): Don't update size until allocation succeeds.
6669 Don't assume message length fits in int.
6670 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6671
0065d054
PE
6672 * emacs.c (main): Do not reallocate argv, since there is a null at
6673 the end that can be overwritten, and this way there's no need to
6674 worry about size-calculation overflow.
6675 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
6676
6677 * eval.c (init_eval_once, grow_specpdl): Don't update size until
6678 alloc succeeds.
6679 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6680
6681 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6682 (x_set_scroll_bar_width, x_figure_window_size):
6683 Check for integer overflow.
6684 (x_set_alpha): Do not assume XINT fits in int.
6685
6686 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6687 This is for the members text_lines, text_cols, total_lines, total_cols,
6688 where the system imposes an 'int' limit.
6689
6690 * fringe.c (Fdefine_fringe_bitmap):
6691 Don't update size until alloc works.
6692
6693 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6694 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6695
6696 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6697 Check for size-calculation overflow.
6698 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6699 do, as we prefer signed integers.
6700 (id_to_widget.max_size, id_to_widget.used)
6701 (xg_store_widget_in_map, xg_remove_widget_from_map)
6702 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6703 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6704 Use and return ptrdiff_t, not int.
6705 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6706 * gtkutil.h: Change prototypes to match the above.
6707
6708 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6709 are duplicate now that they've been promoted to lisp.h.
6710 (x_allocate_bitmap_record, x_alloc_image_color)
6711 (make_image_cache, cache_image, xpm_load):
6712 Don't update size until alloc is done.
6713 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6714 (x_detect_edges):
3256efce 6715 Check for size calculation overflow.
726e0ab1
PE
6716 (ct_colors_allocated_max): New constant.
6717 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6718 overflow.
3256efce 6719
726e0ab1
PE
6720 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6721 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6722 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6723 Use ptrdiff_t, not int, to count maps.
6724 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
6725 calculations. Don't update size until allocation succeeds.
6726 Redo calculations to avoid overflow.
726e0ab1
PE
6727 * keyboard.h: Change prototypes to match the above.
6728
6729 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6730 to count maps.
6731 (current_minor_maps): Check for size calculation overflow.
6732 * keymap.h: Change prototypes to match the above.
6733
6734 * lread.c (read1, init_obarray): Don't update size until alloc done.
6735
6736 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6737 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6738
726e0ab1
PE
6739 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6740 Now ptrdiff_t, not int.
6741 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6742 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6743
6744 * process.c (Fnetwork_interface_list): Check for overflow
6745 in size calculation.
6746
6747 * region-cache.c (move_cache_gap): Check for size calculation overflow.
6748
6749 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
6750 overflow. Don't bother calling xmalloc when xrealloc will do.
6751
6752 * search.c (Freplace_match): Check for size calculation overflow.
6753 (Fset_match_data): Don't assume list lengths fit in 'int'.
6754
6755 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6756 for command line length. Do not attempt to address one before the
6757 beginning of an array, as that's not portable.
6758
6759 * term.c (max_frame_lines): Remove; unused.
6760 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6761 not int.
6762 (encode_terminal_code, calculate_costs): Check for size
6763 calculation overflow.
6764 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
6765 table lengths and related sizes. Don't update size until alloc
6766 done. Redo calculations to avoid overflow.
6767 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
6768
6769 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
6770 subtracting pointers.
6771 (gobble_line): Check for overflow more carefully. Don't update size
6772 until alloc done.
6773
6774 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
6775 Don't update size until alloc done.
6776 Redo size calculations to avoid overflow.
6777 Check for size calculation overflow.
0065d054 6778 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
6779
6780 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
6781 Use ptrdiff_t, not int, for sizes.
6782 (store_mode_line_noprop_char): Don't update size until alloc done.
6783
0065d054
PE
6784 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
6785 Use ptrdiff_t, not int, for sizes.
6786 (Finternal_make_lisp_face, cache_face):
6787 Check for size calculation overflow.
6788 (cache_face): Treat size calculation overflows as if they were
6789 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
6790
6791 * xfns.c (x_encode_text, x_set_name_internal)
6792 (Fx_change_window_property): Use ptrdiff_t, not int, to count
6793 sizes, since they can exceed INT_MAX in size. Check for size
6794 calculation overflow.
6795
0065d054
PE
6796 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
6797 (xg_select): Check for size calculation overflow.
726e0ab1
PE
6798 Don't update size until alloc done.
6799
0065d054 6800 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 6801 as sprintf is limited to int lengths.
1d526e2f 6802
252c5ee1
PE
6803 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
6804 (X_LONG_MIN): New macros.
864d7ce7
PE
6805 Use them to make the following changes clearer.
6806 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
6807 This change doesn't affect the value now, but it may help remind
6808 future maintainers not to raise the value too much later.
6809 (SELECTION_QUANTUM): Remove, replacing with ...
6810 (selection_quantum): ... new function, which avoids overflow.
6811 All uses changed.
6812 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
6813 assumption that selection length fits in 'int'.
6814 (x_reply_selection_request, x_handle_selection_request)
6815 (x_get_window_property, receive_incremental_selection)
6816 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
6817 (lisp_data_to_selection_data, clean_local_selection_data):
6818 Use ptrdiff_t, not int, to record length of selection.
6819 (x_reply_selection_request, x_get_window_property)
6820 (receive_incremental_selection, x_property_data_to_lisp):
6821 Redo calculations to avoid overflow.
6822 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 6823 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
6824 something.
6825 (x_get_window_property, receive_incremental_selection)
6826 (lisp_data_to_selection_data, x_property_data_to_lisp):
6827 Check for size-calculation overflow.
6828 (x_get_window_property, receive_incremental_selection)
6829 (lisp_data_to_selection_data, Fx_register_dnd_atom):
6830 Don't store size until memory allocation succeeds.
6831 (x_get_window_property): Plug memory leak on memory exhaustion.
6832 Don't double-block input; malloc is safe here. Don't assume 2**34
6833 - 4 fits in unsigned long. Add an xassert to check
6834 XGetWindowProperty overflow. Be more careful about overflow
6835 calculations, and distinguish size from memory overflow better.
6836 (receive_incremental_selection): When tracing, don't assume
6837 unsigned int is less than INT_MAX.
6838 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
6839 harmful) conversions of unsigned short to int.
6840 (lisp_data_to_selection_data): Don't assume that integers
6841 in the range -65535 through -1 fit in an X unsigned short.
6842 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
6843 result parameters unless successful. Rely on cons_to_unsigned
6844 to report problems with elements; the old code wasn't right anyway.
6845 (x_check_property_data): Check for int overflow; we cannot use
6846 a wider type due to X limits.
6847 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
6848
726e0ab1 6849 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 6850
0065d054
PE
6851 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
6852 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
6853 (x_color_cells): Don't store size until memory allocation succeeds.
6854 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 6855 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
6856 (x_term_init): Don't assume length fits in int (sprintf is limited
6857 to int size).
bc18e09d 6858
ebfa62c0
PE
6859 Use ptrdiff_t for composition IDs.
6860 * character.c (lisp_string_width):
6861 * composite.c (composition_table_size, n_compositions)
6862 (get_composition_id, composition_gstring_from_id):
6863 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
6864 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
6865 * window.c (Frecenter):
6866 Use ptrdiff_t, not int, for composition IDs.
6867 * composite.c (get_composition_id): Check for integer overflow.
6868 * composite.h: Adjust prototypes to match the above changes.
6869
d3411f89
PE
6870 Use ptrdiff_t for hash table indexes.
6871 * category.c (hash_get_category_set):
6872 * ccl.c (ccl_driver):
6873 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
6874 * coding.c (coding_system_charset_list, detect_coding_system):
6875 * coding.h (struct coding_system.id):
6876 * composite.c (get_composition_id, gstring_lookup_cache):
6877 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
6878 * image.c (xpm_get_color_table_h):
6879 * lisp.h (hash_lookup, hash_put):
6880 * minibuf.c (Ftest_completion):
6881 Use ptrdiff_t for hash table indexes, not int (which is too
6882 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
6883 32-bit --with-wide-int hosts).
6884
e097a6fa
PE
6885 * charset.c (Fdefine_charset_internal): Check for integer overflow.
6886 Add a FIXME comment about memory leaks.
6887 (syms_of_charset): Don't assume xmalloc returns.
6888
5637687f
PE
6889 Don't assume that stated character widths fit in int.
6890 * character.c (Fchar_width, c_string_width, lisp_string_width):
6891 * character.h (CHAR_WIDTH):
6892 * indent.c (MULTIBYTE_BYTES_WIDTH):
6893 Use sanitize_char_width to avoid undefined and/or bad behavior
6894 with outlandish widths.
a66cfb1c 6895 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
6896 now that we have two such functions. All uses changed.
6897 (sanitize_char_width): New inline function.
6898
a2271ba2
PE
6899 Don't assume that tab-width fits in int.
6900 * character.h (sanitize_width): New inline function.
6901 (SANE_TAB_WIDTH): New macro.
6902 (ASCII_CHAR_WIDTH): Use it.
6903 * indent.c (sane_tab_width): Remove. All uses replaced by
6904 SANE_TAB_WIDTH (current_buffer).
6905 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
6906
18c52557
PE
6907 * fileio.c: Integer overflow issues with file modes.
6908 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
6909
caeeedc1
PE
6910 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
6911 Remove unreachable code.
6912 (read_hex, load_charset_map_from_file): Check for integer overflow.
6913
6df6ae42 6914 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
6915 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
6916 (x_send_scroll_bar_event): Likewise. Check that the size does not
6917 exceed limits imposed by XClientMessageEvent, as well as the usual
6918 ptrdiff_t and size_t limits.
6919
b13995db
PE
6920 * keyboard.c: Overflow, signedness and related fixes.
6921 (make_lispy_movement): Use same integer type in forward decl
6922 that is used in the definition.
6923 (read_key_sequence, keyremap_step):
6924 Change bufsize argument back to int, undoing my 2011-03-30 change.
6925 We prefer signed types, and int is wide enough here.
6926 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
6927 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
6928 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
6929 length, not size_t. Use ptrdiff_t for index, not int.
6930 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
6931 possibility of integer overflow.
6932
13464394
PE
6933 Overflow, signedness and related fixes for images.
6934
6935 * dispextern.h (struct it.stack[0].u.image.image_id)
6936 (struct_it.image_id, struct image.id, struct image_cache.size)
6937 (struct image_cache.used, struct image_cache.ref_count):
6938 * gtkutil.c (update_frame_tool_bar):
6939 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
6940 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
6941 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
6942 * nsmenu.m (update_frame_tool_bar):
6943 * xdisp.c (calc_pixel_width_or_height):
6944 * xfns.c (image_cache_refcount):
6945 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
6946 on typical 64-bit hosts.
6947
6948 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6949 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
6950 Omit unnecessary casts to int.
6951 (parse_image_spec): Check that integers fall into 'int' range
6952 when the callers expect that.
6953 (image_ascent): Redo ascent calculation to avoid int overflow.
6954 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
6955 (lookup_image): Remove unnecessary tests.
6956 (xbm_image_p): Locals are now of int, not EMACS_INT,
6957 since parse_image_check makes sure they fit into int.
6958 (png_load, gif_load, svg_load_image):
6959 Prefer int to unsigned where either will do.
6960 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
6961 old tiff_error_handler and tiff_warning_handler.
6962 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
6963 stack buffer overflows. It uses only the features of vsnprintf
6964 that are common to both POSIX and native Microsoft.
6965 (tiff_error_handler, tiff_warning_handler): Use it.
6966 (tiff_load, gif_load, imagemagick_load_image):
6967 Don't assume :index value fits in 'int'.
6968 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
6969 (imagemagick_load_image): Check that crop parameters fit into
6970 the integer types that MagickCropImage accepts. Don't assume
6971 Vimagemagick_render_type has a nonnegative value. Don't assume
6972 size_t fits in 'long'.
6973 (gs_load): Use printmax_t to print the widest integers possible.
6974 Check for integer overflow when computing image height and width.
6975
c11821d4
EZ
69762011-08-26 Eli Zaretskii <eliz@gnu.org>
6977
6978 * xdisp.c (redisplay_window): Don't force window start if point
6979 will be invisible in the resulting window. (Bug#9324)
6980
0c95fcf7
EZ
69812011-08-25 Eli Zaretskii <eliz@gnu.org>
6982
6983 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
6984 the display spec is of the form `(space ...)'.
6985 (handle_display_spec): Return the value returned by
6986 handle_single_display_spec, not just 1 or zero.
6987 (handle_single_display_spec): If the display spec is of the form
6988 `(space ...)', and specifies display in the text area, return 2
6989 rather than 1.
fee65a97 6990 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
6991 accurately, and prefer exact match for point under bidi.
6992 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
6993
6994 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
6995 into disp_prop; all users changed.
6996
6997 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
6998 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
6999 for the text covered by the display property.
7000
e4ed06f1
CY
70012011-08-25 Chong Yidong <cyd@stupidchicken.com>
7002
7003 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
7004 Change return value to nil.
7005 (Frecord_buffer): Delete unused function.
7006
f67cdd7f
EZ
70072011-08-24 Eli Zaretskii <eliz@gnu.org>
7008
5980d4c6
EZ
7009 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
7010 buffers, return left-to-right.
8610fe8b
EZ
7011 (set_cursor_from_row): Consider candidate row a win if its glyph
7012 represents a newline and point is on that newline. Fixes cursor
7013 positioning on the newline at EOL of R2L text within L2R
7014 paragraph, and vice versa.
7015 (try_cursor_movement): Check continued rows, in addition to
7016 continuation rows. Fixes unwarranted scroll when point enters a
7017 continued line of R2L text within an L2R paragraph, or vice versa.
7018 (cursor_row_p): Consider the case of point being equal to
7019 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
7020 from the end of a short line to the beginning of a continued line
7021 of R2L text within L2R paragraph.
7022 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
7023 composed characters.
5980d4c6 7024
f67cdd7f
EZ
7025 * bidi.c (bidi_check_type): Use xassert.
7026 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
7027 members.
7028
bca633fb
EZ
70292011-08-23 Eli Zaretskii <eliz@gnu.org>
7030
7031 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
7032 a character.
7033
4a5885a7
CY
70342011-08-23 Chong Yidong <cyd@stupidchicken.com>
7035
7036 * nsfont.m (ns_otf_to_script): Fix typo.
7037
0902a04e
KH
70382011-08-22 Kenichi Handa <handa@m17n.org>
7039
7040 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
7041 extra slot even if the purpose is char-code-property-table.
7042
1a2e6670
EZ
70432011-08-23 Eli Zaretskii <eliz@gnu.org>
7044
8ddde651
EZ
7045 * xdisp.c (redisplay_window): When computing centering_position,
7046 account for the height of the header line. (Bug#8874)
7047
425cc014
EZ
7048 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
7049 instead of CHAR_TO_BYTE. Fixes a crash when a completion
7050 candidate is selected by the mouse, and that candidate has a
7051 composed character under the mouse.
7052
1a2e6670
EZ
7053 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
7054 coordinates reported by pos-visible-in-window-p for a composed
7055 character in column zero.
7056
8b76d6f8
SM
70572011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
7058
7059 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
7060
dac347dd
EZ
70612011-08-22 Eli Zaretskii <eliz@gnu.org>
7062
7063 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
7064 consider it a hit if to_charpos is anywhere in the range of the
7065 composed buffer positions.
7066
e013fb34
CY
70672011-08-22 Chong Yidong <cyd@stupidchicken.com>
7068
7069 * image.c (gif_load): Don't assume that each subimage has the same
7070 dimensions as the base image. Handle disposal method that is
7071 "undefined" by the gif spec (Bug#9335).
7072
bd1ba3e8
CY
70732011-08-20 Chong Yidong <cyd@stupidchicken.com>
7074
7075 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 7076 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 7077
54a1215b
EZ
70782011-08-19 Eli Zaretskii <eliz@gnu.org>
7079
823564e5
EZ
7080 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
7081 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
7082 from an Org mode buffer to a Speedbar frame.
7083
54a1215b
EZ
7084 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
7085 a composition, take its buffer position from IT->cmp_it.charpos.
7086 Fixes cursor positioning at the beginning of a line that begins
7087 with a composed character.
7088
9778ebcc
EZ
70892011-08-18 Eli Zaretskii <eliz@gnu.org>
7090
0be6ee06
EZ
7091 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
7092 character bidirectional type, use STRONG_L instead. Fixes crashes
7093 in a buffer produced by `describe-categories'.
7094
9778ebcc
EZ
7095 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
7096 members before the level stack, so they would be saved and
7097 restored when copying iterator state. Fixes incorrect reordering
7098 around TABs covered by display properties.
7099
156bffbe
AS
71002011-08-18 Andreas Schwab <schwab@linux-m68k.org>
7101
6b02f655 7102 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 7103
72ad093b
CY
71042011-08-17 Chong Yidong <cyd@stupidchicken.com>
7105
7106 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
7107 (internal_condition_case_2, internal_condition_case_n):
7108 Remove unnecessary aborts (Bug#9081).
72ad093b 7109
35774242
EZ
71102011-08-17 Eli Zaretskii <eliz@gnu.org>
7111
7112 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
7113 has no `load' handler, try opening the file locally. (Bug#9311)
7114
db76dd85
KB
71152011-08-16 Ken Brown <kbrown@cornell.edu>
7116
7117 * gmalloc.c: Expand comment.
7118
b215eee5
EZ
71192011-08-16 Eli Zaretskii <eliz@gnu.org>
7120
7121 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
7122 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
7123
a4579d33
KB
71242011-08-16 Ken Brown <kbrown@cornell.edu>
7125
7126 Fix memory allocation problems in Cygwin build (Bug#9273).
7127
7128 * unexcw.c ( __malloc_initialized): Declare external variable.
7129 (fixup_executable): Force the dumped emacs to reinitialize malloc.
7130
8b76d6f8
SM
7131 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
7132 New variables.
a4579d33
KB
7133 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
7134 dumped emacs.
7135 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
7136 in the static heap.
7137 [CYGWIN] (special_realloc): New function.
7138 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
7139 requests to realloc storage in the static heap.
7140
3ebec551
PE
71412011-08-15 Paul Eggert <eggert@cs.ucla.edu>
7142
7143 * bidi.c (bidi_initialize): Remove unused local.
7144
9fd8be00
EZ
71452011-08-15 Eli Zaretskii <eliz@gnu.org>
7146
6b02f655
SM
7147 * bidimirror.h:
7148 * biditype.h: Remove file.
7149 * makefile.w32-in ($(BLD)/bidi.$(O)):
7150 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
7151
7152 * dispextern.h: Fix a typo in the comment to bidi_type_t.
7153
7154 * chartab.c: Improve commentary for the uniprop_table API.
7155
32413314
EZ
7156 * bidi.c (bidi_paragraph_init): Support zero value of
7157 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
7158 (bidi_initialize): Use uniprop_table instead of including
7159 biditype.h and bidimirror.h.
32413314 7160
9fd8be00
EZ
7161 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
7162 coordinates of the iterator when restoring from ppos_it.
7163 (Bug#9296)
7164
5cf2b69b
KH
71652011-08-14 Kenichi Handa <handa@m17n.org>
7166
7167 * process.c (create_process): Call setup_process_coding_systems
72ad093b 7168 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 7169
daf17d00
EZ
71702011-08-14 Eli Zaretskii <eliz@gnu.org>
7171
7172 * xdisp.c (move_it_in_display_line_to): Don't invoke
7173 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
7174 ppos_it. Fixes vertical cursor motion when line beginning is
7175 covered by an image. (Bug#9296)
7176
08e3161a
JD
71772011-08-14 Jan Djärv <jan.h.d@swipnet.se>
7178
7179 * nsterm.h (ns_run_ascript): Declare.
7180 (NSAPP_DATA2_RUNASSCRIPT): Define.
7181
7182 * nsfns.m (as_script, as_result, as_status): New static variables.
7183 (ns_run_ascript): New function.
5e617bc2 7184 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
7185 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
7186 the event loop. Get status from as_status (Bug#7276).
7187
7188 * nsterm.m (sendEvent): If event is NSApplicationDefined and
7189 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
7190 the event loop (Bug#7276).
7191
a3720aa2
AS
71922011-08-14 Andreas Schwab <schwab@linux-m68k.org>
7193
7194 * gnutls.c (QCgnutls_bootprop_priority)
7195 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
7196 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
7197 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
7198 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
7199 (QCgnutls_bootprop_verify_hostname_error)
7200 (QCgnutls_bootprop_callbacks_verify): Rename from
7201 Qgnutls_bootprop_..., all uses changed.
7202
7203 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
7204 uses changed.
7205
0a0d27fb
PE
72062011-08-14 Paul Eggert <eggert@cs.ucla.edu>
7207
19d5c50c
PE
7208 * xfaces.c (Qframe_set_background_mode): Now static.
7209 * dispextern.h (Qframe_set_background_mode): Remove decl.
7210
0a0d27fb
PE
7211 * process.c (Fnetwork_interface_info): Declare local only if needed.
7212
377538cb
JD
72132011-08-13 Jan Djärv <jan.h.d@swipnet.se>
7214
7215 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
7216 (Fnetwork_interface_list): Allocate in increments of bytes instead
7217 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
7218 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
7219 sockaddr.
7220 (struct ifflag_def): notrailers is smart on OSX.
7221 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7222 Get hardware address with getifaddrs if available.
7223
08fff70c
EZ
72242011-08-12 Eli Zaretskii <eliz@gnu.org>
7225
7226 * xdisp.c (iterate_out_of_display_property): xassert that
7227 IT->position is set to within IT->object's boundaries. Break from
7228 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
7229 when IT->position is set up wrongly due to some bug.
7230 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
7231 (push_display_prop): Allow GET_FROM_STRING as IT->method on
7232 entry. Force push_it to save on the stack the current
7233 buffer/string position, to be restored by pop_it. Fix flags in
7234 the iterator structure wrt the object coming from a display
7235 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7236 properties. (Bug#9284)
7237
7be1c708 72382011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 7239
7be1c708
CY
7240 * fontset.c (fontset_get_font_group): Add proper type checks.
7241 (Bug#9172)
aac0c6e3 7242
7be1c708 72432011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 7244
7be1c708
CY
7245 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7246 and LC_VERSION_MIN_MACOSX.
7247 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7248 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 7249
97bb72a6
EZ
72502011-08-08 Eli Zaretskii <eliz@gnu.org>
7251
7252 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
7253 no-display-properties-and-no-overlays under bidi display.
7254 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 7255 properties and overlays.
97bb72a6 7256
d5617611
CY
72572011-08-08 Chong Yidong <cyd@stupidchicken.com>
7258
37e11a63
CY
7259 * editfns.c (Fset_time_zone_rule): Document relationship with the
7260 setenv function.
7261
d5617611
CY
7262 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7263 the font entity extracted from the cache (Bug#8109).
7264
58872834
CY
72652011-08-07 Chong Yidong <cyd@stupidchicken.com>
7266
7267 * composite.c (autocmp_chars): Don't reset point. That is done by
7268 restore_point_unwind (Bug#5984).
7269
75bfc667
JL
72702011-08-07 Juri Linkov <juri@jurta.org>
7271
7272 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7273 to show the arg `TIME' instead of `TIMEVAL'.
7274
d1410150
EZ
72752011-08-06 Eli Zaretskii <eliz@gnu.org>
7276
7277 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7278 display property strides EOL and includes a newline, as in
7279 longlines-mode. (Bug#9254)
75b771e4
EZ
7280 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7281 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
7282
7283 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7284 is non-zero, even if the data buffer is NULL. Fixes a crash in
7285 vertical-motion with longlines-mode. (Bug#9254)
7286
35928349
EZ
72872011-08-05 Eli Zaretskii <eliz@gnu.org>
7288
ec7cc85b
EZ
7289 * bidi.c <bidi_cache_total_alloc>: Now static.
7290 (bidi_initialize): Initialize bidi_cache_total_alloc.
7291
8b76d6f8 7292 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7293 cache. (Bug#9221)
7294
7295 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7296 amount allocated this far in `bidi_cache_total_alloc'.
7297 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7298 non-zero, only free the data buffer without restoring the cache
7299 contents. All callers changed.
7300
7301 * dispextern.h (bidi_unshelve_cache): Update prototype.
7302
7303 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7304 (move_it_in_display_line, move_it_to)
7305 (move_it_vertically_backward, move_it_by_lines): Replace the call
7306 to xfree to an equivalent call to bidi_unshelve_cache.
7307 (move_it_in_display_line_to): Fix logic of returning
412b6358 7308 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7309
e2e2423b
EZ
73102011-08-05 Eli Zaretskii <eliz@gnu.org>
7311
7312 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7313 came from a string character with a `cursor' property. (Bug#9229)
7314
ae9e757a
JD
73152011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7316
7317 * Makefile.in (LIB_PTHREAD): New variable.
7318 (LIBES): Add LIB_PTHREAD (Bug#9216).
7319
7320 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7321 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7322
213bd7f2
AS
73232011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7324
6b02f655 7325 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7326
99aaf75f
JD
73272011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7328
7329 * xterm.c (x_find_topmost_parent): New function.
7330 (x_set_frame_alpha): Find topmost parent window with
7331 x_find_topmost_parent and set the property there also (bug#9181).
7332 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7333
c74e9d86
PE
73342011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7335
7336 * callproc.c (Fcall_process): Avoid vfork clobbering
7337 the local vars buffer, coding_systems, current_dir.
7338
640c8776
SM
73392011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7340
7341 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7342
f26d0e4c
PE
73432011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7344
8a10d76c
PE
7345 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7346 so that it is not optimized away.
7347
f26d0e4c
PE
7348 * xdisp.c (compute_display_string_pos): Remove unused local.
7349
55439c61
EZ
73502011-08-02 Eli Zaretskii <eliz@gnu.org>
7351
7352 Fix slow cursor motion and scrolling in large buffers with
7353 selective display, like Org Mode buffers. (Bug#9218)
7354
7355 * dispextern.h (struct bidi_it): New member disp_prop_p.
7356
7357 * xdisp.c: Remove one-slot cache of display string positions.
7358 (compute_display_string_pos): Accept an additional argument
5e617bc2 7359 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7360 for a display string or property. If found, set DISP_PROP_P
7361 non-zero.
7362
7363 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7364 DISP_PROP_P, and pass it to compute_display_string_pos.
7365 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7366 non-zero. All callers of bidi_fetch_char changed.
7367
fb33fa43
SM
73682011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7369
7370 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7371
b099e063
DM
73722010-12-03 Don March <don@ohspite.net>
7373
7374 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7375 last character M-[char] is translated to ESC [char] (bug#7541).
7376
5cc7f7af
KH
73772011-08-02 Kenichi Handa <handa@m17n.org>
7378
d0fffa3f 7379 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7380
7381 * chartab.c (uniprop_table): Make it non-static.
7382
525d5e6e
EZ
73832011-08-01 Eli Zaretskii <eliz@gnu.org>
7384
7385 * xdisp.c (forward_to_next_line_start): Accept additional argument
7386 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7387 on the newline.
7388 (reseat_at_next_visible_line_start): Use the bidi iterator state
7389 returned by forward_to_next_line_start to restore the state of
7390 it->bidi_it after backing up to previous newline. (Bug#9212)
7391
31011111
AS
73922011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7393
7394 * regex.c (re_comp): Protoize.
7395 (re_exec): Fix return type.
7396 (regexec): Fix type of `ret'. (Bug#9203)
7397
476371c4
PE
73982011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7399
e5d76069
PE
7400 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7401 This is needed if max-image-size is a floating-point number.
7402
9a79b20c
AS
74032011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7404
7405 * print.c (print_object): Print empty symbol as ##.
7406
7407 * lread.c (read1): Read ## as empty symbol.
7408
d8c2fa78
AA
74092011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7410
7411 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7412 setting frame foreground color (Bug#9175).
7413 (x_set_background_color): Likewise.
7414
ffe57a7a
AA
7415 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7416 contents (Bug#9176).
7417 (EmacsTooltip -init): Remove bezels and add shadows to
7418 tooltip windows.
7419
bf3492a5
AA
7420 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7421 or scroll bar (Bug#8470).
7422
d55e9c53
AA
7423 * nsfont.m (nsfont_open): Remove assignment to voffset and
7424 unnecessary vars hshink, expand, hd, full_height, min_height.
7425 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7426
7427 * nsterm.h (nsfont_info): Remove voffset field.
7428
d8c2fa78 74292011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7430
7431 Implement strike-through and overline on NextStep (Bug#8863).
7432
7433 * nsfont.m (nsfont_open): Use underline position provided by font,
7434 instead of hard-coded value of 2.
7435 (nsfont_draw): Call ns_draw_text_decoration instead.
7436
7437 * nsterm.h: Add declaration for ns_draw_text_decoration.
7438
7439 * nsterm.m (ns_draw_text_decoration): New function for drawing
7440 underline, overline, and strike-through.
7441 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7442 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7443 accommodate underlining, etc.
4843aac3 7444
4cc60b9b
EZ
74452011-07-28 Eli Zaretskii <eliz@gnu.org>
7446
bc7ece87
EZ
7447 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7448 default.
4cc60b9b 7449
476371c4
PE
74502011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7451
66606eea
PE
7452 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7453 Without this fix, if a signal arrives just after memory fills up,
7454 'malloc' might be invoked reentrantly.
7455
476371c4
PE
7456 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7457 In other words, assume that every image size is allowed, on non-X
7458 hosts. This assumption is probably wrong, but it lets Emacs compile.
7459
f3fcc40d
AS
74602011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7461
7462 * regex.c (re_iswctype): Convert return values to boolean.
7463
350c992f
EZ
74642011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7465
7466 * xdisp.c (compute_display_string_pos): Don't use cached display
7467 string position if the buffer had its restriction changed.
7468 (Bug#9184)
7469
5266b4bb
PE
74702011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7471
7472 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7473
2573a837 74742011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7475
41f55ccd 7476 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7477
39e378da
PE
7478 * bidi.c: Integer size and overflow fixes.
7479 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7480 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7481 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7482 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7483 (bidi_find_other_level_edge):
7484 Use ptrdiff_t instead of EMACS_INT where either will do.
7485 This works better on 32-bit hosts configured --with-wide-int.
7486 (bidi_cache_ensure_space): Check for size-calculation overflow.
7487 Use % rather than repeated addition, for better worst-case speed.
7488 Don't set bidi_cache_size until after xrealloc returns, because it
7489 might not return.
7490 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7491 (bidi_cache_ensure_space): Also check that the bidi cache size
7492 does not exceed that of the largest Lisp string or buffer. See Eli
7493 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7494
5e927815
PE
7495 * alloc.c (__malloc_size_t): Remove.
7496 All uses replaced by size_t. See Andreas Schwab's note
7497 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7498
ca4aa935
PE
7499 * image.c: Improve checking for integer overflow.
7500 (check_image_size): Assume that f is nonnull, since
7501 it is always nonnull in practice. This is one less thing to
7502 worry about when checking for integer overflow later.
7503 (x_check_image_size): New function, which checks for integer
7504 overflow issues inside X.
7505 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7506 This removes the need for a memory_full check.
7507 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7508 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7509 (xbm_read_bitmap_data): Change locals back to 'int', since
7510 their values must fit in 'int'.
7511 (xpm_load_image, png_load, tiff_load):
7512 Invoke x_create_x_image_and_pixmap earlier,
7513 to avoid much needless work if the image is too large.
7514 (tiff_load): Treat overly large images as if
7515 x_create_x_image_and_pixmap failed, not as malloc failures.
7516 (gs_load): Use x_check_image_size.
7517
5f8f9cc2
PE
7518 * gtkutil.c: Omit integer casts.
7519 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7520 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7521
5adf60bc
PE
7522 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7523
c8907a93
PE
7524 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7525 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7526 would wrongly return t on a 64-bit host.
7527
e3c25c68
PE
7528 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7529 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7530 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7531 and therefore cause GCC to emit a bogus diagnostic in some cases.
7532
3f791afe
PE
7533 * image.c: Integer signedness and overflow and related fixes.
7534 This is not an exhaustive set of fixes, but it's time to
7535 record what I've got.
7536 (lookup_pixel_color, check_image_size): Remove redundant decls.
7537 (check_image_size): Don't assume that arbitrary EMACS_INT values
7538 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7539 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7540 (tiff_load, imagemagick_load_image):
7541 Check for overflow in size calculations.
7542 (x_create_x_image_and_pixmap): Remove unnecessary test for
7543 xmalloc returning NULL; that can't happen.
7544 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7545 (xpm_color_bucket): Use better integer hashing function.
7546 (xpm_cache_color): Don't possibly over-allocate memory.
7547 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7548 (gif_memory_source):
7549 Use ptrdiff_t, not int or size_t, to record sizes.
7550 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7551 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7552 either works, as we prefer signed integers.
7553 (tiff_read_from_memory, tiff_write_from_memory):
7554 Return tsize_t, not size_t, since that's what the TIFF API wants.
7555 (tiff_read_from_memory): Don't fail simply because the read would
7556 go past EOF; instead, return a short read.
7557 (tiff_load): Omit no-longer-needed casts.
7558 (Fimagemagick_types): Don't assume size fits into 'int'.
7559
3cc5a532
PE
7560 Improve hashing quality when configured --with-wide-int.
7561 * fns.c (hash_string): New function, taken from sxhash_string.
7562 Do not discard information about ASCII character case; this
7563 discarding is no longer needed.
7564 (sxhash-string): Use it. Change sig to match it. Caller changed.
7565 * lisp.h: Declare it.
7566 * lread.c (hash_string): Remove, since we now use fns.c's version.
7567 The fns.c version returns a wider integer if --with-wide-int is
7568 specified, so this should help the quality of the hashing a bit.
7569
b312a492
PE
7570 * emacs.c: Integer overflow minor fix.
7571 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
7572 Define only if GNU_LINUX.
7573 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7574
dfd153ae
PE
7575 * dispnew.c: Integer signedness and overflow fixes.
7576 Remove unnecessary forward decls, that were a maintenance hassle.
7577 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7578 All uses changed.
7579 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7580 (scrolling_window): Use ptrdiff_t, not int, for byte count.
7581 (prepare_desired_row, line_draw_cost):
7582 Use int, not unsigned, where either works.
7583 (save_current_matrix, restore_current_matrix):
7584 Use ptrdiff_t, not size_t, where either works.
7585 (init_display): Check for overflow more accurately, and without
7586 relying on undefined behavior.
7587
a81d11a3
PE
7588 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7589 Remove, replacing with the new symbols in lisp.h. All uses changed.
7590 * fileio.c (make_temp_name):
7591 * filelock.c (lock_file_1, lock_file):
7592 * xdisp.c (message_dolog):
7593 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7594 Use pMd etc. instead.
7595 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7596 replacing the pWIDE etc. symbols removed from editfns.c.
7597
3300e6fd
PE
7598 * keyboard.h (num_input_events): Now uintmax_t.
7599 This is (very slightly) less likely to mess up due to wraparound.
7600 All uses changed.
7601
fd05c7e9
PE
7602 * buffer.c: Integer signedness fixes.
7603 (alloc_buffer_text, enlarge_buffer_text):
7604 Use ptrdiff_t rather than size_t when either will do, as we prefer
7605 signed integers.
7606
903fe15d
PE
7607 * alloc.c: Integer signedness and overflow fixes.
7608 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7609 (__malloc_size_t): Default to size_t, not to int.
7610 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7611 (Fgarbage_collect, mark_object_loop_halt, mark_object):
7612 Prefer ptrdiff_t to size_t when either would do, as we prefer
7613 signed integers.
7614 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7615 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7616 Now const. Initialize with values that are in range even if char
7617 is signed.
7618 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7619 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
7620 These functions do the right thing with sizes > 2**32.
7621 (check_depth): Now ptrdiff_t, not int.
7622 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7623 Adjust to new way of storing sizes. Check for size overflow bugs
7624 in rest of code.
7625 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
7626 slightly wrong anyway, as it missed one instance of
7627 XMALLOC_OVERRUN_CHECK_OVERHEAD.
7628 (refill_memory_reserve): Omit needless cast to size_t.
7629 (mark_object_loop_halt): Mark as externally visible.
7630
ac82cc6a
PE
7631 * xselect.c: Integer signedness and overflow fixes.
7632 (Fx_register_dnd_atom, x_handle_dnd_message):
7633 Use ptrdiff_t, not size_t, since we prefer signed.
7634 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7635 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7636 x_dnd_atoms_size and x_dnd_atoms_length.
7637
c2d1e36d
PE
7638 * doprnt.c: Prefer signed to unsigned when either works.
7639 * eval.c (verror):
7640 * doprnt.c (doprnt):
7641 * lisp.h (doprnt):
7642 * xdisp.c (vmessage):
7643 Use ptrdiff_t, not size_t, when using or implementing doprnt,
7644 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7645 prefer signed arithmetic to avoid comparison confusion.
7646 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7647 but is a bit tricky.
7648
0e926e56
PE
7649 Assume freestanding C89 headers, string.h, stdlib.h.
7650 * data.c, doprnt.c, floatfns.c, print.c:
7651 Include float.h unconditionally.
7652 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7653 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
7654 * regex.c: Likewise for stddef.h, string.h.
7655 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
7656 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7657 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7658 (STDC_HEADERS): Remove obsolete defines.
7659 * sysdep.c: Include limits.h unconditionally.
7660
9cfdb3ec
PE
7661 Assume support for memcmp, memcpy, memmove, memset.
7662 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7663 * regex.c (memcmp, memcpy):
7664 Remove; we assume C89 now.
7665
7666 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7667 (__malloc_safe_bcopy): Remove; no longer needed.
7668
cf950e6b 7669 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
7670 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
7671 well either way, and we prefer signed to unsigned.
7672
dbf38e02
LMI
76732011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7674
7675 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7676 closes the connection while we're reading (bug#9182).
7677
d6f0886c 76782011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 7679
d6f0886c
JD
7680 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7681 are specified (Bug#9168).
24e0f6b1 7682
2eb1f9e6
PE
76832011-07-25 Paul Eggert <eggert@cs.ucla.edu>
7684
7685 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7686 Found by GCC static checking and --with-wide-int on a 32-bit host.
7687
22381272 76882011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
7689
7690 * xdisp.c (compute_display_string_pos): Fix logic of caching
7691 previous display string position. Initialize cached_prev_pos to
7692 -1. Fixes slow-down at the beginning of a buffer.
7693
f25e39b4
EZ
76942011-07-24 Eli Zaretskii <eliz@gnu.org>
7695
7696 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7697 for attrs[LFACE_FONTSET_INDEX].
7698
04c4b52e
PE
76992011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7700
7701 * xml.c (parse_region): Remove unused local
7702 that was recently introduced.
7703
c1734fbd
EZ
77042011-07-23 Eli Zaretskii <eliz@gnu.org>
7705
be18c5a5
EZ
7706 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7707 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7708
c1734fbd
EZ
7709 * xdisp.c (move_it_in_display_line_to): Record the best matching
7710 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
7711 exit if none of the characters scanned was an exact match.
7712 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
7713 when exact match is impossible due to invisible text, and the
7714 lines are truncated.
7715
a258d627
JD
77162011-07-23 Jan Djärv <jan.h.d@swipnet.se>
7717
7718 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7719 for OSX >= 10.7.
7720
b6d5a689
EZ
77212011-07-22 Eli Zaretskii <eliz@gnu.org>
7722
0f74f785
EZ
7723 Fix a significant slow-down of cursor motion with C-n, C-p,
7724 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7725 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 7726 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
7727 (next_element_from_buffer): Call compute_stop_pos_backwards to
7728 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
7729 base_level_stop.
7730 (reseat): Don't look for prev_stop, as that could mean a very long
7731 run.
7732 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7733 <cached_disp_overlay_modiff>: Cache for last found display string
7734 position.
551918c1 7735 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
7736 about the same buffer in the same area of character positions, and
7737 the buffer wasn't changed since the time the display string
7738 position was cached.
551918c1 7739
b2d0c91a
EZ
77402011-07-22 Eli Zaretskii <eliz@gnu.org>
7741
7742 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7743 is an integer, which is important for empty lines. (Bug#9149)
7744
043604ee
CY
77452011-07-22 Chong Yidong <cyd@stupidchicken.com>
7746
7747 * frame.c (Fmodify_frame_parameters): In tty case, update the
7748 default face if necessary (Bug#4238).
7749
da4adb04
CY
77502011-07-21 Chong Yidong <cyd@stupidchicken.com>
7751
7752 * editfns.c (Fstring_to_char): No need to explain what a character
7753 is in the docstring (Bug#6576).
7754
9abd0532
LMI
77552011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7756
7757 * xml.c (parse_region): Make sure we always return a tree.
7758
36881d16
HK
77592011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
7760
7761 * xml.c (parse_region): If a document contains only comments,
7762 return that, too.
7763
1e98674d
LMI
77642011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7765
7766 * xml.c (make_dom): Return comments, too.
7767
590bd467
PE
77682011-07-19 Paul Eggert <eggert@cs.ucla.edu>
7769
7770 Port to OpenBSD.
7771 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
7772 and the surrounding thread.
7773 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
7774 rather than fgets, and retry after EINTR. Otherwise, 'emacs
7775 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
7776 timer goes off.
7777 * s/openbsd.h (BROKEN_SIGIO): Define.
7778 * unexelf.c (unexec) [__OpenBSD__]:
7779 Don't update the .mdebug section of the Alpha COFF symbol table.
7780
f41628b2
LMI
77812011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7782
7783 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
7784 (bug#8460).
7785
b59b67c5
PE
77862011-07-18 Paul Eggert <eggert@cs.ucla.edu>
7787
15e3a074
PE
7788 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
7789 This fixes some race conditions on the permissions of any newly
7790 created file.
7791
41bed37d
PE
7792 * alloc.c (valid_pointer_p): Use pipe, not open.
7793 This fixes some permissions issues when debugging.
7794
b59b67c5
PE
7795 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
7796 If fchown fails to set both uid and gid, try to set just gid,
7797 as that is sometimes allowed. Adjust the file's mode to eliminate
7798 setuid or setgid bits that are inappropriate if fchown fails.
7799
925a6be7
SM
78002011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7801
7802 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
7803 to compare Lisp_Objects.
7804 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
7805 global_gnutls_log_level, don't mistake it for a Lisp_Object.
7806 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
7807
52968808
AS
78082011-07-17 Andreas Schwab <schwab@linux-m68k.org>
7809
0a6a104b
AS
7810 * lread.c (read_integer): Unread even EOF character.
7811 (read1): Likewise. Properly record start position of symbol.
7812
52968808
AS
7813 * lread.c (read1): Read `#:' as empty uninterned symbol if no
7814 symbol character follows.
7815
9e381cdd
PE
78162011-07-17 Paul Eggert <eggert@cs.ucla.edu>
7817
7818 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
7819 This works around a problem with the previous change to Fcopy_file.
7820 Recent glibc declares fchown with __attribute__((warn_unused_result)),
7821 and without this change, GCC might complain about discarding
7822 fchown's return value.
7823
b5641435
JB
78242011-07-16 Juanma Barranquero <lekktu@gmail.com>
7825
7826 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
7827
a8031457
PE
78282011-07-16 Paul Eggert <eggert@cs.ucla.edu>
7829
7830 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
7831
dd889327
LMI
78322011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
7833
750c33f7
LMI
7834 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
7835 it's used from the C level.
7836
dd889327
LMI
7837 * process.c: Use the same condition for POLL_FOR_INPUT in both
7838 keyboard.c and process.c (bug#1858).
7839
87e86684
LM
78402011-07-09 Lawrence Mitchell <wence@gmx.li>
7841
7842 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
7843 (Fgnutls_boot): Use it.
7844
64348f40
AS
78452011-07-15 Andreas Schwab <schwab@linux-m68k.org>
7846
7847 * doc.c (Fsubstitute_command_keys): Revert last change.
7848
1d698799
LMI
78492011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
7850
f863868c
LMI
7851 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
7852 quotes the next character, and doesn't affect other longer
7853 sequences (bug#8935).
7854
1d698799
LMI
7855 * lread.c (syms_of_lread): Clarify that is isn't only
7856 `eval-buffer' and `eval-defun' that's affected by
7857 `lexical-binding' (bug#8460).
7858
aa4b6df6
EZ
78592011-07-15 Eli Zaretskii <eliz@gnu.org>
7860
7861 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 7862 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 7863
5d856da6
PE
78642011-07-14 Paul Eggert <eggert@cs.ucla.edu>
7865
ad6042bb
PE
7866 Fix minor problems found by static checking.
7867 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
7868 (elsz): Now a signed constant, not a size_t var. We prefer signed
7869 types to unsigned, to avoid integer comparison confusion. Without
7870 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
7871 "cannot optimize loop, the loop counter may overflow", a symptom
7872 of the confusion.
f00bbb22 7873 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
7874 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
7875
6468f31c
LMI
78762011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7877
49080b10
LMI
7878 * search.c (Fre_search_backward): Mention `case-fold-search' in
7879 all the re_search_* functions (bug#8138).
7880
6468f31c
LMI
7881 * keyboard.c (Fopen_dribble_file): Document when the file is
7882 closed (bug#8056).
7883
c965adc5
EZ
78842011-07-14 Eli Zaretskii <eliz@gnu.org>
7885
df9733bf
EZ
7886 * bidi.c (bidi_dump_cached_states): Fix format of displaying
7887 bidi_cache_idx.
7888
0bb23927
EZ
7889 Support bidi reordering of display and overlay strings.
7890 * xdisp.c (compute_display_string_pos)
7891 (compute_display_string_end): Accept additional argument STRING.
7892 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
7893 (reseat_to_string): Initialize bidi_it->string.s and
7894 bidi_it->string.schars.
7895 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
7896 NULL (avoids a crash in bidi_paragraph_init).
7897 Initialize itb.string.lstring.
0bb23927
EZ
7898 (init_iterator): Call bidi_init_it only of a valid
7899 buffer position was specified. Initialize paragraph_embedding to
7900 L2R.
7901 (reseat_to_string): Initialize the bidi iterator.
7902 (display_string): If we need to ignore text properties of
7903 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
7904 original value of -1 will not work with bidi.)
7905 (compute_display_string_pos): First arg is now struct
7906 `text_pos *'; all callers changed. Support display properties on
7907 Lisp strings.
7908 (compute_display_string_end): Support display properties on Lisp
7909 strings.
7910 (init_iterator, reseat_1, reseat_to_string): Initialize the
7911 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
7912 when iterating on a string not from display properties).
640c8776
SM
7913 (compute_display_string_pos, compute_display_string_end):
7914 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
7915 arrow keys.
7916 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
7917 base_level_stop; instead, set base_level_stop to BEGV.
7918 Fixes crashes in vertical-motion.
0bb23927
EZ
7919 (next_element_from_buffer): Improve commentary for when
7920 the iterator is before prev_stop.
7921 (init_iterator): Initialize bidi_p from the default value of
7922 bidi-display-reordering, not from buffer-local value. Use the
7923 buffer-local value only if initializing for buffer iteration.
7924 (handle_invisible_prop): Support invisible properties on strings
7925 that are being bidi-reordered.
7926 (set_iterator_to_next): Support bidi reordering of C strings and
7927 Lisp strings.
7928 (next_element_from_string): Support bidi reordering of Lisp
7929 strings.
7930 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
7931 (display_string): Support display of R2L glyph rows.
7932 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
7933 (init_iterator): Don't initialize it->bidi_p for strings
7934 here.
7935 (reseat_to_string): Initialize it->bidi_p for strings here.
7936 (next_element_from_string, next_element_from_c_string)
7937 (next_element_from_buffer): Add xassert's for correspondence
7938 between IT's object being iterated and it->bidi_it.string
7939 structure.
7940 (face_before_or_after_it_pos): Support bidi iteration.
7941 (next_element_from_c_string): Handle the case of the first string
7942 character that is not the first one in the visual order.
7943 (get_visually_first_element): New function, refactored from common
7944 parts of next_element_from_buffer, next_element_from_string, and
7945 next_element_from_c_string.
7946 (tool_bar_lines_needed, redisplay_tool_bar)
7947 (display_menu_bar): Force left-to-right direction. Add a FIXME
7948 comment for making that be controlled by a user option.
7949 (push_it, pop_it): Save and restore the state of the
7950 bidi iterator. Save and restore the bidi_p flag.
7951 (pop_it): Iterate out of display property for string iteration as
7952 well.
7953 (iterate_out_of_display_property): Support iteration over strings.
7954 (handle_single_display_spec): Set up it->bidi_it for iteration
7955 over a display string, and call bidi_init_it.
7956 (handle_single_display_spec, next_overlay_string)
7957 (get_overlay_strings_1, push_display_prop): Set up the bidi
7958 iterator for displaying display or overlay strings.
7959 (forward_to_next_line_start): Don't use the shortcut if
7960 bidi-iterating.
7961 (back_to_previous_visible_line_start): If handle_display_prop
7962 pushed the iterator stack, restore the internal state of the bidi
7963 iterator by calling bidi_pop_it same number of times.
7964 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
7965 and we are bidi-iterating, don't decrement the iterator position;
7966 instead, set the first_elt flag in the bidi iterator, to produce
7967 the same effect.
7968 (reseat_1): Remove redundant setting of string_from_display_prop_p.
7969 (push_display_prop): xassert that we are iterating a buffer.
7970 (push_it, pop_it): Save and restore paragraph_embedding member.
7971 (handle_single_display_spec, next_overlay_string)
7972 (get_overlay_strings_1, reseat_1, reseat_to_string)
7973 (push_display_prop): Set up the `unibyte' member of bidi_it.string
7974 correctly. Don't assume unibyte strings are not bidi-reordered.
7975 (compute_display_string_pos)
7976 (compute_display_string_end): Fix handling the case of C string.
7977 (push_it, pop_it): Save and restore from_disp_prop_p.
7978 (handle_single_display_spec, push_display_prop): Set the
7979 from_disp_prop_p flag.
7980 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
7981 (pop_it): Call iterate_out_of_display_property only if we are
7982 popping after iteration over a string that came from a display
7983 property. Fix a typo in popping stretch info. Add an assertion
7984 for verifying that the iterator position is in sync with the bidi
7985 iterator.
7986 (handle_single_display_spec, get_overlay_strings_1)
7987 (push_display_prop): Fix initialization of paragraph direction for
7988 string when that of the parent object is not yet determined.
7989 (reseat_1): Call bidi_init_it to resync the bidi
7990 iterator with IT's position. (Bug#7616)
7991 (find_row_edges): If ROW->start.pos gives position
7992 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
7993 (handle_stop, back_to_previous_visible_line_start, reseat_1):
7994 Reset the from_disp_prop_p flag.
7995 (SAVE_IT, RESTORE_IT): New macros.
7996 (pos_visible_p, face_before_or_after_it_pos)
7997 (back_to_previous_visible_line_start)
7998 (move_it_in_display_line_to, move_it_in_display_line)
7999 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8000 (try_scrolling, redisplay_window, display_line): Use them when
8001 saving a temporary copy of the iterator and restoring it back.
8002 (back_to_previous_visible_line_start, reseat_1)
8003 (init_iterator): Empty the bidi cache "stack".
8004 (move_it_in_display_line_to): If iterator ended up at
8005 EOL, but we never saw any buffer positions smaller than
8006 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
8007 motion in bidi-reordered lines.
8008 (move_it_in_display_line_to): Record prev_method and prev_pos
8009 immediately before the call to set_iterator_to_next. Fixes cursor
8010 motion in bidi-reordered lines with stretch glyphs and strings
8011 displayed in margins. (Bug#8133) (Bug#8867)
8012 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
8013 TO_CHARPOS.
640c8776
SM
8014 (pos_visible_p): Support positions in bidi-reordered lines.
8015 Save and restore bidi cache.
0bb23927
EZ
8016
8017 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
8018 (bidi_paragraph_info): Delete unused struct.
8019 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
8020 (bidi_cache_start): New variable.
8021 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
8022 to zero.
8023 (bidi_cache_fetch_state, bidi_cache_search)
8024 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8025 (bidi_cache_find, bidi_peek_at_next_level)
8026 (bidi_level_of_next_char, bidi_find_other_level_edge)
8027 (bidi_move_to_visually_next): Compare cache index with
8028 bidi_cache_start rather than with zero.
8029 (bidi_fetch_char): Accept new argument STRING; all callers
8030 changed. Support iteration over a string. Support strings with
8031 display properties. Support unibyte strings. Fix the type of
8032 `len' according to what STRING_CHAR_AND_LENGTH expects.
8033 (bidi_paragraph_init, bidi_resolve_explicit_1)
8034 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
8035 (bidi_level_of_next_char, bidi_move_to_visually_next):
8036 Support iteration over a string.
0bb23927
EZ
8037 (bidi_set_sor_type, bidi_resolve_explicit_1)
8038 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
8039 can now be zero (for strings); special values 0 and -1 were
8040 changed to -1 and -2, respectively.
8041 (bidi_char_at_pos): New function.
8042 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
8043 Call it instead of FETCH_MULTIBYTE_CHAR.
8044 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
8045 initialized to valid values.
8046 (bidi_init_it): Don't initialize charpos and bytepos with invalid
8047 values.
8048 (bidi_level_of_next_char): Allow the sentinel "position" to pass
8049 the test for valid cached positions. Fix the logic for looking up
8050 the sentinel state in the cache. GCPRO the Lisp string we are
8051 iterating.
8052 (bidi_push_it, bidi_pop_it): New functions.
8053 (bidi_initialize): Initialize the bidi cache start stack pointer.
8054 (bidi_cache_ensure_space): New function, refactored from part of
8055 bidi_cache_iterator_state. Don't assume the required size is just
8056 one BIDI_CACHE_CHUNK away.
8057 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
8058 (bidi_count_bytes, bidi_char_at_pos): New functions.
8059 (bidi_cache_search): Don't assume bidi_cache_last_idx is
8060 always valid if bidi_cache_idx is valid.
8061 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
8062 is valid if it's going to be used.
8063 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
8064 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
8065 (bidi_cache_find_level_change, bidi_cache_ensure_space)
8066 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
8067 (bidi_find_other_level_edge, bidi_cache_start_stack):
8068 All variables related to cache indices are now EMACS_INT.
c965adc5 8069
0bb23927
EZ
8070 * dispextern.h (struct bidi_string_data): New structure.
8071 (struct bidi_it): New member `string'. Make flag members be 1-bit
8072 fields, and put them last in the struct.
640c8776
SM
8073 (compute_display_string_pos, compute_display_string_end):
8074 Update prototypes.
0bb23927
EZ
8075 (bidi_push_it, bidi_pop_it): Add prototypes.
8076 (struct iterator_stack_entry): New members bidi_p,
8077 paragraph_embedding, and from_disp_prop_p.
8078 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
8079 (bidi_shelve_cache, bidi_unshelve_cache):
8080 Declare prototypes.
0bb23927
EZ
8081
8082 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
8083 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
8084 and vector-like objects.
8085
8086 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
8087 cache around display iteration.
8088
8089 * window.c (Fwindow_end, window_scroll_pixel_based)
8090 (displayed_window_lines, Frecenter): Save and restore the bidi
8091 cache around display iteration.
8092
3bbd2265
LMI
80932011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8094
8095 * editfns.c (Fdelete_region): Clarify the use of the named
8096 parameters (bug#6788).
8097
adc47434
MR
80982011-07-14 Martin Rudalics <rudalics@gmx.at>
8099
8100 * indent.c (Fvertical_motion): Set and restore w->pointm when
8101 saving and restoring the window's buffer (Bug#9006).
8102
837c31f8
LMI
81032011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
8104
8105 * editfns.c (Fstring_to_char): Clarify just what is returned
8106 (bug#6576). Text by Eli Zaretskii.
8107
ac389d0c
JB
81082011-07-13 Juanma Barranquero <lekktu@gmail.com>
8109
8110 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
8111
0be0ce47
EZ
81122011-07-13 Eli Zaretskii <eliz@gnu.org>
8113
8114 * buffer.c (mmap_find): Fix a typo.
8115
cd18e7e3
JB
81162011-07-13 Johan Bockgård <bojohan@gnu.org>
8117
8118 Fix execution of x selection hooks.
8119 * xselect.c (Qx_lost_selection_functions)
8120 (Qx_sent_selection_functions): New vars.
8121 (syms_of_xselect): DEFSYM them.
8122 (x_handle_selection_request): Pass Qx_sent_selection_functions
8123 rather than Vx_sent_selection_functions to Frun_hook_with_args.
8124 (x_handle_selection_clear,x_clear_frame_selections):
8125 Pass Qx_lost_selection_functions rather than
8126 Vx_lost_selection_functions to Frun_hook_with_args.
8127
47ea7f44
PE
81282011-07-13 Paul Eggert <eggert@cs.ucla.edu>
8129
ac389d0c 8130 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
8131 The old code sometimes used this field without initializing it.
8132
47ea7f44
PE
8133 * alloc.c (gc_sweep): Don't read past end of array.
8134 In theory, the old code could also have corrupted Emacs internals,
8135 though it'd be very unlikely.
8136
bc985c87
AS
81372011-07-12 Andreas Schwab <schwab@linux-m68k.org>
8138
8139 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 8140 argument. (Bug#4026)
bc985c87 8141
0cf34688
LMI
81422011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
8143
b3dadd76
LMI
8144 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
8145 key" (bug#4257).
8146
0cf34688
LMI
8147 * window.c (Fset_window_start): Doc fix (bug#4199).
8148 (Fset_window_hscroll): Ditto.
8149
270768cd
PE
81502011-07-12 Paul Eggert <eggert@cs.ucla.edu>
8151
077e3dda 8152 Fix minor new problems caught by GCC 4.6.1.
270768cd 8153 * term.c (init_tty): Remove unused local.
490011a6 8154 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 8155 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 8156 not used otherwise.
270768cd 8157
b1f58454
CY
81582011-07-12 Chong Yidong <cyd@stupidchicken.com>
8159
8160 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
8161
22b9578d
LMI
81622011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8163
6e70ab07
LMI
8164 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
8165 are the mini-buffer and the echo area (bug#3320).
8166
22b9578d
LMI
8167 * term.c (init_tty): Remove support for supdup, c10 and perq
8168 terminals, which are no longer supported (bug#1482).
8169
8974cc9f
JB
81702011-07-10 Johan Bockgård <bojohan@gnu.org>
8171
8172 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
8173
a560d974
JD
81742011-07-10 Jan Djärv <jan.h.d@swipnet.se>
8175
8176 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
8177 for non-popups (Bug#3642).
8178
1dae0f0a
AS
81792011-07-10 Andreas Schwab <schwab@linux-m68k.org>
8180
268c2c36 8181 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 8182 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
8183 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
8184 * cm.c (losecursor): Likewise.
1dae0f0a
AS
8185 * data.c (fmod): Likewise.
8186 * dispnew.c (swap_glyphs_in_rows): Likewise.
8187 * emacs.c (memory_warning_signal): Likewise.
8188 * floatfns.c (float_error): Likewise.
8189 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
8190 (otf_open, font_otf_capability, generate_otf_features)
8191 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
8192 Likewise.
8193 * image.c (pbm_read_file): Likewise.
8194 * indent.c (string_display_width): Likewise.
8195 * intervals.c (check_for_interval, search_for_interval)
8196 (inc_interval_count, count_intervals, root_interval)
8197 (adjust_intervals_for_insertion, make_new_interval): Likewise.
8198 * lread.c (defalias): Likewise.
268c2c36 8199 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
8200 * regex.c (set_image_of_range_1, set_image_of_range)
8201 (regex_grow_registers): Likewise.
8202 * sysdep.c (strerror): Likewise.
8203 * termcap.c (valid_filename_p, tprint, main): Likewise.
8204 * tparam.c (main): Likewise.
8205 * unexhp9k800.c (run_time_remap, save_data_space)
8206 (update_file_ptrs, read_header, write_header, calculate_checksum)
8207 (copy_file, copy_rest, display_header): Likewise.
8208 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
8209 Likewise.
8210 * xdisp.c (check_it): Likewise.
8211 * xfaces.c (register_color, unregister_color, unregister_colors):
8212 Likewise.
8213 * xfns.c (print_fontset_result): Likewise.
8214 * xrdb.c (member, fatal, main): Likewise.
8215
99033785
PE
82162011-07-10 Paul Eggert <eggert@cs.ucla.edu>
8217
8218 Fix minor problems found by static checking (Bug#9031).
8219 * chartab.c (char_table_set_range, map_sub_char_table):
8220 Remove unused locals.
8221 (uniprop_table): Now static.
8222 * composite.c (_work_char): Remove unused static var.
8223
9cb2ac56
JB
82242011-07-09 Juanma Barranquero <lekktu@gmail.com>
8225
8226 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8227
f25661f0
JD
82282011-07-09 Jan Djärv <jan.h.d@swipnet.se>
8229
8230 * gtkutil.c (qttip_cb): Remove code without function.
8231
8278c4fe
EZ
82322011-07-09 Eli Zaretskii <eliz@gnu.org>
8233
8234 * w32.c (pthread_sigmask): New stub.
8235
1692ae2d 82362011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 8237
8a6ebd58 8238 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
8239 sigprocmask is portable only for single-threaded applications, and
8240 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
8241 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8242 (LIBES): Use it.
8243 * callproc.c (Fcall_process):
8244 * process.c (create_process):
8245 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8246 Use pthread_sigmask, not sigprocmask.
123403e4 8247
1b854618
JD
82482011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8249
8250 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8251 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8252 wrong (Bug#8591).
8253
3fe4b549
JD
82542011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8255
0ce7e563
JD
8256 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8257 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8258 (xg_hide_tooltip): Fix comment.
8259
3fe4b549
JD
8260 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8261 in registerServicesMenuSendTypes.
8262 (validRequestorForSendType): Don't check ns_return_types.
8263
8264 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8265 ns_return_type.
8266
5df75e47
JR
82672011-07-08 Jason Rumney <jasonr@gnu.org>
8268
22610910
JR
8269 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8270 SH_SHOW for hidden windows (Bug#5482).
8271
5df75e47
JR
8272 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8273 frame struct members of non-existent frames (Bug#6284).
8274
699c10bd
JD
82752011-07-08 Jan Djärv <jan.h.d@swipnet.se>
8276
4393663b
JD
8277 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8278 variable firstTime not needed on OSX >= 10.6.
8279 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8280 >= 10.5. Use setKnobProportion, setDoubleValue.
8281
8282 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8283 (MAC_OS_X_VERSION_10_5): Define if not defined.
8284 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8285 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8286 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8287
8288 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8289 cString and lossyCString on OSX >= 10.4.
4393663b 8290
58179cce 8291 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8292 sizeToFit on OSX >= 10.2.
8293
8294 * nsimage.m (allocInitFromFile): Don't use deprecated method
8295 bestRepresentationForDevice on OSX >= 10.6.
8296
8297 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8298 to avoid warning.
8299
8300 * emacs.c: Declare unexec_init_emacs_zone.
8301
a63e0781
JD
8302 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8303
699c10bd
JD
8304 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8305
8306 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8307 on svcsMenu (Bug#8842).
8308
8309 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8310 ns_return_types.
8311 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8312
8313 * nsterm.m (QUTF8_STRING): Declare.
8314 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8315 (validRequestorForSendType): Return type is (id).
8316 Change indexOfObjectIdenticalTo to indexOfObject.
8317 Check if we have local selection before returning self (Bug#8842).
8318 (writeSelectionToPasteboard): Put local selection into paste board
8319 if we have a local selection (Bug#8842).
8320 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8321
8322 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8323 (ns_get_local_selection): Declare.
8324
54e10184
LMI
83252011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8326
9888ff71
LMI
8327 * keymap.c (describe_map_tree): Don't insert a double newline at
8328 the end of the buffer (bug#1169) and return whether we inserted
8329 something.
8330
54e10184
LMI
8331 * callint.c (Fcall_interactively): Change "reading args" to
8332 "providing args" to try to clarify what it does (bug#1010).
8333
15fa4783
KH
83342011-07-07 Kenichi Handa <handa@m17n.org>
8335
8336 * composite.c (composition_compute_stop_pos): Ignore a static
8337 composition starting before CHARPOS (Bug#8915).
8338
8339 * xdisp.c (handle_composition_prop): Likewise.
8340
a8815b00
EZ
83412011-07-07 Eli Zaretskii <eliz@gnu.org>
8342
8343 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8344 (Bug#9015)
8345
ef7b981d 83462011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8347
8348 * character.h (unicode_category_t): New enum type.
8349
8350 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8351 (Qchar_code_property_table): New variable.
8352 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8353 (UNIPROP_COMPRESSED_FORM_P): New macros.
8354 (char_table_ascii): Uncompress the compressed values.
8355 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8356 Uncompress the compressed values.
ac389d0c 8357 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8358 (char_table_ref_and_range): Uncompress the compressed values.
8359 (sub_char_table_set): New arg is_uniprop. Callers changed.
8360 Uncompress the compressed values.
8361 (sub_char_table_set_range): Args changed. Callers changed.
8362 (char_table_set_range): Adjuted for the above change.
8363 (map_sub_char_table): Delete args default_val and parent. Add arg
8364 top. Give decoded values to a Lisp function.
640c8776 8365 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8366 values to a Lisp function. Gcpro more variables.
8367 (uniprop_table_uncompress)
8368 (uniprop_decode_value_run_length): New functions.
8369 (uniprop_decoder, uniprop_decoder_count): New variables.
8370 (uniprop_get_decoder, uniprop_encode_value_character)
8371 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8372 New functions.
8373 (uniprop_encoder, uniprop_encoder_count): New variables.
8374 (uniprop_get_encoder, uniprop_table)
8375 (Funicode_property_table_internal, Fget_unicode_property_internal)
8376 (Fput_unicode_property_internal): New functions.
8377 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8378 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8379 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8380 char-code-property-alist.
8381
640c8776 8382 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8383 Vunicode_category_table.
8384
640c8776 8385 * font.c (font_range): Adjust for the change of
c805dec0
KH
8386 Vunicode_category_table.
8387
76b397fb
DN
83882011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8389
8390 * m/iris4d.h: Remove file, move contents ...
8391 * s/irix6-5.h: ... here.
8392
22b4128e
PE
83932011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8394
8395 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8396 * alloc.c (mark_buffer):
8397 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8398 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8399 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8400 This isn't true in general, and it's particularly not true
8401 if Emacs is configured with --with-wide-int.
8402 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8403 New macros, used in the buffer.c change.
8404
869795d6
JD
84052011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8406
8407 * xsettings.c: Use both GConf and GSettings if both are available.
8408 (store_config_changed_event): Add comment.
8409 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8410 (store_tool_bar_style_changed): New functions.
5e617bc2 8411 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8412 (struct xsettings): Move font inside HAVE_XFT.
8413 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8414 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8415 Move inside HAVE_XFT.
640c8776 8416 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8417 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8418 also.
8419 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8420 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8421 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8422 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8423 (parse_settings): Move check for font inside HAVE_XFT.
8424 (read_settings, apply_xft_settings): Add comment.
8425 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8426 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8427 call store_font_name_changed.
8428 (xft_settings_event): Add comment.
8429 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8430 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8431 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8432 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8433 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8434 (xsettings_get_system_font, xsettings_get_system_normal_font):
8435 Add comment.
869795d6 8436
d8ed26bd
PE
84372011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8438
8439 Random fixes. E.g., (random) never returned negative values.
8440 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8441 subseconds part to the entropy, as that's a bit more random.
8442 Prefer signed to unsigned, since the signedness doesn't matter and
8443 in general we prefer signed. When given a limit, use a
8444 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8445 latter isn't right if USE_2_TAGS_FOR_INTS.
8446 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8447 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8448
cabf1cac
SM
84492011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8450
8451 * textprop.c (text_property_stickiness):
8452 Obey Vtext_property_default_nonsticky.
8453 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8454 * w32fns.c (syms_of_w32fns):
8455 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8456
6e9b2be9
PE
84572011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8458
8459 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8460 This is more efficient than Ffile_directory_p and avoids a minor race.
8461
90186c68
LMI
84622011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8463
7c301272
LMI
8464 * buffer.c (Foverlay_put): Say what the return value is
8465 (bug#7835).
8466
c4f2d8d4
LMI
8467 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8468 is a directory before asking whether to use the file name
8469 (bug#7564).
ad637907
LMI
8470 (barf_or_query_if_file_exists): Make the "File is a directory"
8471 error be more correct.
c4f2d8d4 8472
90186c68
LMI
8473 * fns.c (Frequire): Remove the mention of the .gz files, since
8474 that's installation-specific, but keep the mention of
8475 `get-load-suffixes'.
8476
da64016e
PE
84772011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8478
8479 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8480 Report string overflow if the output is too long.
8481
7d47b580
JB
84822011-07-04 Juanma Barranquero <lekktu@gmail.com>
8483
a555cb87
JB
8484 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8485 (syms_of_gnutls): Remove duplicate DEFSYM for
8486 Qgnutls_bootprop_verify_hostname_error, an error for
8487 Qgnutls_bootprop_verify_error (which is no longer used).
8488
7d47b580
JB
8489 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8490 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8491 Also (re)move comments that are misplaced or no longer relevant.
8492
1e49bfab
LMI
84932011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8494
8495 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8496
1485f4c0
CY
84972011-07-03 Chong Yidong <cyd@stupidchicken.com>
8498
8499 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8500 and background color parameters if they have been changed.
8501
a9ab721e
LMI
85022011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8503
8504 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8505
cf7cff57
PE
85062011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8507
2e13213d
PE
8508 * xsettings.c (SYSTEM_FONT): Define only when used.
8509 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8510
cf7cff57
PE
8511 * keymap.c (access_keymap_1): Now static.
8512
7a8e04f7
CY
85132011-07-02 Chong Yidong <cyd@stupidchicken.com>
8514
8515 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8516 leave any prefix arg for the up event (Bug#1586).
8517
61352f62
LMI
85182011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8519
69bb1ef7
LMI
8520 * lread.c (syms_of_lread): Mention single symbols defined by
8521 `defvar' or `defconst' (bug#7154).
8522
61352f62 8523 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8524 (Frequire): Mention get-load-suffixes.
61352f62 8525
28545e04
MR
85262011-07-02 Martin Rudalics <rudalics@gmx.at>
8527
8528 * window.h (window): Remove clone_number slot.
8529 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8530 Remove.
8531 (make_parent_window, make_window, saved_window)
8532 (Fset_window_configuration, save_window_save): Don't deal with
8533 clone numbers.
8534 * buffer.c (Qclone_number): Remove declaration.
8535 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8536
3349e122
SM
85372011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8538
8539 Add multiple inheritance to keymaps.
8540 * keymap.c (Fmake_composed_keymap): New function.
8541 (Fset_keymap_parent): Simplify.
8542 (fix_submap_inheritance): Remove.
8543 (access_keymap_1): New function extracted from access_keymap to handle
8544 embedded parents and handle lists of maps.
8545 (access_keymap): Use it.
8546 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8547 (Fcopy_keymap): Handle embedded parents.
8548 (Fcommand_remapping, define_as_prefix): Simplify.
8549 (Fkey_binding): Simplify.
8550 (syms_of_keymap): Move minibuffer-local-completion-map,
8551 minibuffer-local-filename-completion-map,
8552 minibuffer-local-must-match-map, and
8553 minibuffer-local-filename-must-match-map to Elisp.
8554 (syms_of_keymap): Defsubr make-composed-keymap.
8555 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8556 (parse_menu_item): Trivial simplification.
8557
3279eb87
GM
85582011-07-01 Glenn Morris <rgm@gnu.org>
8559
8560 * Makefile.in (SETTINGS_LIBS): Fix typo.
8561
4550efdf
KI
85622011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8563
8564 * coding.c (Fencode_coding_string): Record the last coding system
8565 used, as the function doc string says (bug#8738).
8566
0949d2b6
JD
85672011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8568
8569 * xsettings.c (store_monospaced_changed): Take new font as arg and
8570 check for change against current_mono_font.
8571 (EMACS_TYPE_SETTINGS): Remove this and related defines.
8572 (emacs_settings_constructor, emacs_settings_get_property)
8573 (emacs_settings_set_property, emacs_settings_class_init)
8574 (emacs_settings_init, gsettings_obj): Remove.
8575 (something_changedCB): New function for HAVE_GSETTINGS.
8576 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8577 with value as argument.
8578 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8579 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 8580 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
8581 "changed".
8582
8583 * xgselect.c: Add defined (HAVE_GSETTINGS).
8584 (xgselect_initialize): Ditto.
8585
8586 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8587 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8588 xg_select.
8589
bbc6b304
PE
85902011-07-01 Paul Eggert <eggert@cs.ucla.edu>
8591
8592 * eval.c (struct backtrace): Simplify and port the data structure.
8593 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8594 signed bit field, as this assumption is not portable and it makes
8595 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
8596 "char debug_on_exit : 1" as this is not portable either; instead,
8597 use the portable "unsigned int debug_on_exit : 1". Remove unused
8598 member evalargs. Remove obsolete comments about cc bombing out.
8599
9851bfc5
JD
86002011-06-30 Jan Djärv <jan.h.d@swipnet.se>
8601
51bb811f 8602 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
8603 Let HAVE_GSETTINGS override HAVE_GCONF.
8604 (store_monospaced_changed): New function.
8605 (EMACS_SETTINGS): A new type derived from GObject to handle
8606 GSettings notifications.
8607 (emacs_settings_constructor, emacs_settings_get_property)
8608 (emacs_settings_set_property, emacs_settings_class_init):
8609 New functions.
8610 (gsettings_client, gsettings_obj): New variables.
8611 (GSETTINGS_SCHEMA): New define.
8612 (something_changedCB): Call store_monospaced_changed.
8613 (init_gsettings): New function.
8614 (xsettings_initialize): Call init_gsettings.
8615 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8616 to NULL.
8617
640c8776 8618 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
8619 GCONF_CFLAGS/LIBS.
8620
5386012d
MR
86212011-06-29 Martin Rudalics <rudalics@gmx.at>
8622
8623 * window.c (resize_root_window, grow_mini_window)
8624 (shrink_mini_window): Rename Qresize_root_window to
8625 Qwindow_resize_root_window and Qresize_root_window_vertically to
8626 Qwindow_resize_root_window_vertically.
8627
f13e0b08
PE
86282011-06-28 Paul Eggert <eggert@cs.ucla.edu>
8629
8630 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8631
94515237
JB
86322011-06-27 Juanma Barranquero <lekktu@gmail.com>
8633
8634 * makefile.w32-in: Redesign dependencies so they reflect more
8635 clearly which files are directly included by each source file,
8636 and not through other includes.
8637
e43b6e43
MR
86382011-06-27 Martin Rudalics <rudalics@gmx.at>
8639
8640 * buffer.c (Qclone_number): Declare static and DEFSYM it.
8641 (sort_overlays, overlay_strings): When an overlay's clone number
8642 matches the window's clone number process the overlay even if
8643 the overlay's window property doesn't match the current window.
8644
d68443dc
MR
8645 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8646 (Fwindow_hchild): Rename to Fwindow_left_child.
8647 (Fwindow_next): Rename to Fwindow_next_sibling.
8648 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
8649 (resize_window_check): Rename to window_resize_check.
8650 (resize_window_apply): Rename to window_resize_apply.
8651 (Fresize_window_apply): Rename to Fwindow_resize_apply.
8652 (Fdelete_other_windows_internal, resize_frame_windows)
8653 (Fsplit_window_internal, Fdelete_window_internal)
8654 (grow_mini_window, shrink_mini_window)
8655 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 8656
c7e73be5
JD
86572011-06-26 Jan Djärv <jan.h.d@swipnet.se>
8658
8659 * emacsgtkfixed.h: State that this is only used with Gtk+3.
8660 (emacs_fixed_set_min_size): Remove.
8661 (emacs_fixed_new): Take frame as argument.
8662
8663 * emacsgtkfixed.c: State that this is only used with Gtk+3.
8664 (_EmacsFixedPrivate): Remove minwidth/height.
8665 Add struct frame *f.
8666 (emacs_fixed_init): Initialize priv->f.
8667 (get_parent_class, emacs_fixed_set_min_size): Remove.
8668 (emacs_fixed_new): Set priv->f to argument.
8669 (emacs_fixed_get_preferred_width)
8670 (emacs_fixed_get_preferred_height): Use min_width/height from
8671 frames size_hint to set minimum and natural (Bug#8919).
8672 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8673 and use min_width/height from frames size_hint to set
8674 min_width/height (Bug#8919).
8675
8676 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
8677 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8678 Fix indentation.
c7e73be5 8679
cf99dcf8
EZ
86802011-06-26 Eli Zaretskii <eliz@gnu.org>
8681
8682 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8683 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8684 called at ZV.
8685
029529ac
CY
86862011-06-26 Chong Yidong <cyd@stupidchicken.com>
8687
8688 * process.c (wait_reading_process_output): Bypass select if
8689 waiting for a cell while ignoring keyboard input, and input is
8690 pending. Suggested by Jan Djärv (Bug#8869).
8691
7a7ef429
PE
86922011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8693
8694 Use gnulib's dup2 module instead of rolling our own.
8695 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8696
11fdef7d 86972011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
8698
8699 * dispnew.c (scrolling_window): Before scrolling, turn off a
8700 mouse-highlight in the window being scrolled.
8701
cd3520a4
JB
87022011-06-24 Juanma Barranquero <lekktu@gmail.com>
8703
8704 Move DEFSYM to lisp.h and use everywhere.
8705
8706 * character.h (DEFSYM): Move declaration...
8707 * lisp.h (DEFSYM): ...here.
8708
8709 * gnutls.c:
8710 * minibuf.c:
8711 * w32menu.c:
8712 * w32proc.c:
8713 * w32select.c: Don't include character.h.
8714
8715 * alloc.c (syms_of_alloc):
8716 * buffer.c (syms_of_buffer):
8717 * bytecode.c (syms_of_bytecode):
8718 * callint.c (syms_of_callint):
8719 * casefiddle.c (syms_of_casefiddle):
8720 * casetab.c (init_casetab_once):
8721 * category.c (init_category_once, syms_of_category):
8722 * ccl.c (syms_of_ccl):
8723 * cmds.c (syms_of_cmds):
8724 * composite.c (syms_of_composite):
8725 * dbusbind.c (syms_of_dbusbind):
8726 * dired.c (syms_of_dired):
8727 * dispnew.c (syms_of_display):
8728 * doc.c (syms_of_doc):
8729 * editfns.c (syms_of_editfns):
8730 * emacs.c (syms_of_emacs):
8731 * eval.c (syms_of_eval):
8732 * fileio.c (syms_of_fileio):
8733 * fns.c (syms_of_fns):
8734 * frame.c (syms_of_frame):
8735 * fringe.c (syms_of_fringe):
8736 * insdel.c (syms_of_insdel):
8737 * keymap.c (syms_of_keymap):
8738 * lread.c (init_obarray, syms_of_lread):
8739 * macros.c (syms_of_macros):
8740 * msdos.c (syms_of_msdos):
8741 * print.c (syms_of_print):
8742 * process.c (syms_of_process):
8743 * search.c (syms_of_search):
8744 * sound.c (syms_of_sound):
8745 * syntax.c (init_syntax_once, syms_of_syntax):
8746 * terminal.c (syms_of_terminal):
8747 * textprop.c (syms_of_textprop):
8748 * undo.c (syms_of_undo):
8749 * w32.c (globals_of_w32):
8750 * window.c (syms_of_window):
8751 * xdisp.c (syms_of_xdisp):
8752 * xfaces.c (syms_of_xfaces):
8753 * xfns.c (syms_of_xfns):
8754 * xmenu.c (syms_of_xmenu):
8755 * xsettings.c (syms_of_xsettings):
8756 * xterm.c (syms_of_xterm): Use DEFSYM.
8757
4228cf16
TZ
87582011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
8759
cd3520a4 8760 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 8761
7fcccf1e
PE
87622011-06-23 Paul Eggert <eggert@cs.ucla.edu>
8763
7efb4e0e
PE
8764 Integer and buffer overflow fixes (Bug#8873).
8765
ff5844ad
PE
8766 * print.c (printchar, strout): Check for string overflow.
8767 (PRINTPREPARE, printchar, strout):
8768 Don't set size unless allocation succeeds.
8769
90532f02
PE
8770 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
8771 for sizes. Check for string overflow more accurately.
8772 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
8773
6d84508d
PE
8774 * macros.c: Integer and buffer overflow fixes.
8775 * keyboard.h (struct keyboard.kbd_macro_bufsize):
8776 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
8777 Use ptrdiff_t, not int, for sizes.
8778 Don't increment bufsize until after realloc succeeds.
8779 Check for size-calculation overflow.
8780 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
8781
437b2cb4
PE
8782 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
8783
8b9ac8b4
PE
8784 * lread.c: Integer overflow fixes.
8785 (read_integer): Radix is now EMACS_INT, not int,
8786 to improve quality of diagnostics for out-of-range radices.
8787 Calculate buffer size correctly for out-of-range radices.
8788 (read1): Check for integer overflow in radices, and in
8789 read-circle numbers.
82cb60d3
PE
8790 (read_escape): Avoid int overflow.
8791 (Fload, openp, read_buffer_size, read1)
8792 (substitute_object_recurse, read_vector, read_list, map_obarray):
8793 Use ptrdiff_t, not int, for sizes.
8794 (read1): Use EMACS_INT, not int, for sizes.
20270765 8795 Check for size overflow.
8b9ac8b4 8796
7fcccf1e
PE
8797 * image.c (cache_image): Check for size arithmetic overflow.
8798
bfbbd7e7
PE
8799 * lread.c: Integer overflow issues.
8800 (saved_doc_string_size, saved_doc_string_length)
8801 (prev_saved_doc_string_size, prev_saved_doc_string_length):
8802 Now ptrdiff_t, not int.
8803 (read1): Don't assume doc string length fits in int. Check for
8804 out-of-range doc string lengths.
8805 (read_list): Don't assume file position fits in int.
39019e54 8806 (read_escape): Check for hex character overflow.
bfbbd7e7 8807
4e323265
LL
88082011-06-22 Leo Liu <sdl.web@gmail.com>
8809
8810 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
8811 Move to minibuffer.el.
8812
85fece3e
PE
88132011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8814
20b84ce9 8815 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
8816 The following patches are for when GLYPH_DEBUG && !XASSERT.
8817 * dispextern.h (trace_redisplay_p, dump_glyph_string):
8818 * dispnew.c (flush_stdout):
8819 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
8820 Mark as externally visible.
8821 * dispnew.c (check_window_matrix_pointers): Now static.
8822 * dispnew.c (window_to_frame_vpos):
8823 * xfns.c (unwind_create_frame):
8824 * xterm.c (x_check_font): Remove unused local.
8825 * scroll.c (CHECK_BOUNDS):
8826 * xfaces.c (cache_fache): Rename local to avoid shadowing.
8827 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
8828 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
8829 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
8830 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
8831 Now static.
8832 (debug_method_add): Use va_list and vsprintf rather than relying
8833 on undefined behavior with wrong number of arguments.
8834 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
8835 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
8836 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
8837 since we're not interested in debugging glyphs with old libraries.
8838 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
8839 GCC 4.6.0's static checking.
8840
0766b489
PE
88412011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8842
31fd4b32
PE
8843 Integer overflow and signedness fixes (Bug#8873).
8844 A few related buffer overrun fixes, too.
8845
b79e8648
PE
8846 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
8847
0766b489
PE
8848 * dispextern.h (struct face.stipple):
8849 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
8850 (x_bitmap_mask, x_allocate_bitmap_record)
8851 (x_create_bitmap_from_data, x_create_bitmap_from_file)
8852 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
8853 (x_create_bitmap_from_xpm_data):
8854 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
8855 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
8856 (.bitmaps_last):
8857 * xfaces.c (load_pixmap):
8858 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
8859 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
8860 (.bitmaps_last, struct x_output.icon_bitmap):
8861 Use ptrdiff_t, not int, for bitmap indexes.
8862 (x_allocate_bitmap_record): Check for size overflow.
8863 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
8864
b081724f
PE
8865 Use ptrdiff_t, not int, for overlay counts.
8866 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
8867 * editfns.c (overlays_around, get_pos_property):
8868 * textprop.c (get_char_property_and_overlay):
8869 * xdisp.c (next_overlay_change, note_mouse_highlight):
8870 * xfaces.c (face_at_buffer_position):
21514da7
PE
8871 * buffer.c (OVERLAY_COUNT_MAX): New macro.
8872 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
8873 (Fnext_overlay_change, Fprevious_overlay_change)
8874 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 8875 Use ptrdiff_t, not int, for sizes.
21514da7 8876 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 8877
3de73e5e
PE
8878 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
8879
2606c57b
PE
8880 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
8881 (x_session_initialize): Do not assume string length fits in int.
8882
aaafe47a
PE
8883 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
8884 This is unlikely, but can occur if DPI is outlandish.
8885
2674ddc8 8886 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
8887 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
8888
28154962
PE
8889 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
8890 * xrdb.c (magic_file_p, search_magic_path):
8891 Omit last arg SUFFIX; it was always 0. All callers changed.
8892 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
8893
7de51af5
PE
8894 * xfont.c (xfont_match): Avoid need for strlen.
8895
25ed6cc3
PE
8896 * xfns.c: Don't assume strlen fits in int.
8897 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
8898
4eab31dd
PE
8899 * xdisp.c (message_log_check_duplicate): Return intmax_t,
8900 not unsigned long, as we prefer signed integers. All callers changed.
8901 Detect integer overflow in repeat count.
8902 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 8903 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 8904
171e2a58
PE
8905 * termcap.c: Don't assume sizes fit in int and never overflow.
8906 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
8907 (gobble_line): Check for size-calculation overflow.
8908
ad39faca 8909 * minibuf.c (Fread_buffer):
6e5bb2dc 8910 * lread.c (intern, intern_c_string):
74ca2eb3
PE
8911 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
8912 Don't assume string length fits in int.
8913
52c61c22 8914 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
8915 * gtkutil.c (style_changed_cb): Avoid need for strlen.
8916
b5b8c9e5
PE
8917 * font.c: Don't assume string length fits in int.
8918 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
8919 Use ptrdiff_t, not int.
ccd6111c
PE
8920 (font_intern_prop): Don't assume string length fits in int.
8921 Don't assume integer property fits in fixnum.
8922 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 8923
882f0d81 8924 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 8925 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
8926 Reformulate so as not to need the command string.
8927 Invoke gzip -cd rather than gunzip, as it's more portable.
8928 (lock_info_type, lock_file_1, lock_file):
8929 Don't assume pid_t and time_t fit in unsigned long.
8930 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
8931 (current_lock_owner): Prefer signed type for sizes.
8932 Use memcpy, not strncpy, where memcpy is what is really wanted.
8933 Don't assume (via atoi) that time_t and pid_t fit in int.
8934 Check for time_t and/or pid_t out of range, e.g., via a network share.
8935 Don't alloca where an auto var works fine.
8936
93f4cf88
PE
8937 * fileio.c: Fix some integer overflow issues.
8938 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
8939 Don't assume string length fits in int.
8940 (directory_file_name): Don't assume string length fits in long.
8941 (make_temp_name): Don't assume pid fits in int, or that its print
8942 length is less than 20.
8943
f3e92b69
PE
8944 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
8945
1bfdaf10
PE
8946 * coding.c (make_subsidiaries): Don't assume string length fits in int.
8947
35016e9a
PE
8948 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
8949
3d1e65a1
PE
8950 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
8951 We prefer signed integers, even for size calculations.
8952
0b963a93
PE
8953 * emacs.c: Don't assume string length fits in 'int'.
8954 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
8955 (main): Don't invoke strlen when not needed.
8956
573f4b54
PE
8957 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
8958 (XD_DEBUG_MESSAGE): Don't waste a byte.
8959
989f33ba
PE
8960 * callproc.c (getenv_internal_1, getenv_internal)
8961 (Fgetenv_internal):
965d34eb
PE
8962 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
8963
e4d29b33
PE
8964 * lread.c (invalid_syntax): Omit length argument.
8965 All uses changed. This doesn't fix a bug, but it simplifies the
8966 code away from its former Hollerith-constant appearance, and it's
8967 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 8968 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 8969
eb49b136
PE
8970 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
8971 This didn't break anything, but it didn't help either.
8972 It's confusing to put a bogus integer in a place where the actual
8973 value does not matter.
9f62aeb1 8974 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 8975 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 8976
15375a22
PE
8977 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
8978 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
8979 implementation.
b61cc01c
PE
8980 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
8981 We prefer signed types, and the value cannot exceed the EMACS_INT
8982 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
8983 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
8984 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
8985 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 8986
53b2623d
PE
8987 * indent.c (sane_tab_width): New function.
8988 (current_column, scan_for_column, Findent_to, position_indentation)
8989 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 8990 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 8991
51cab52b 8992 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 8993
f2ed8a70
PE
8994 * lisp.h (lint_assume): New macro.
8995 * composite.c (composition_gstring_put_cache):
8996 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
8997
abe80cc6
PE
8998 * editfns.c, insdel.c:
8999 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 9000
b02c740e
PE
9001 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
9002
ebc96716
PE
9003 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
9004
b4e50fa0 9005 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 9006 Use much-faster test for byte-length change.
311d5d7c 9007 Don't assume string byte-length fits in 'int'.
a4cf38e4 9008 Check that character arg fits in 'int'.
85461888 9009 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 9010
c0c1ee9f
PE
9011 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
9012
a498d7f4
PE
9013 * fns.c (concat): Catch string overflow earlier.
9014 Do not rely on integer wraparound.
9015
51cab52b
PE
9016 * dispextern.h (struct it.overlay_strings_charpos)
9017 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
9018 * xdisp.c (forward_to_next_line_start)
9019 (back_to_previous_visible_line_start)
9020 (reseat_at_next_visible_line_start, next_element_from_buffer):
9021 Don't arbitrarily truncate the value of 'selective' to int.
9022
76031fad
PE
9023 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
9024
5eb55db9
PE
9025 * composite.c: Don't truncate sizes to 'int'.
9026 (composition_gstring_p, composition_reseat_it)
9027 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
9028 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
9029 not EMACS_UINT, for indexes.
5eb55db9 9030
0703a717
PE
9031 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
9032
d6202519
PE
9033 * buffer.c: Include <verify.h>.
9034 (struct sortvec.priority, struct sortstr.priority):
8961a454 9035 Now EMACS_INT, not int.
c20998a7 9036 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
9037 (struct sortstr.size, record_overlay_string)
9038 (struct sortstrlist.size, struct sortlist.used):
9039 Don't truncate size to int.
9040 (record_overlay_string): Check for size-calculation overflow.
d6202519 9041 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 9042
d5a19415
JM
90432011-06-22 Jim Meyering <meyering@redhat.com>
9044
029529ac 9045 Don't leak an XBM-image-sized buffer
d5a19415
JM
9046 * image.c (xbm_load): Free the image buffer after using it.
9047
a9041e6c
PE
90482011-06-21 Paul Eggert <eggert@cs.ucla.edu>
9049
9050 Port to Sun C.
9051 * composite.c (find_automatic_composition): Omit needless 'return 0;'
9052 that Sun C diagnosed.
9053 * fns.c (secure_hash): Fix pointer signedness issue.
9054 * intervals.c (static_offset_intervals): New function.
9055 (offset_intervals): Use it.
9056
7f3f739f
LL
90572011-06-21 Leo Liu <sdl.web@gmail.com>
9058
9059 * deps.mk (fns.o):
9060 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
9061 sha512.h.
9062
9063 * fns.c (secure_hash): Rename from crypto_hash_function and change
9064 the first arg to accept symbols.
5b66d427 9065 (Fsecure_hash): New primitive.
7f3f739f
LL
9066 (syms_of_fns): New symbols.
9067
76147d94
DD
90682011-06-20 Deniz Dogan <deniz@dogan.se>
9069
9070 * process.c (Fset_process_buffer): Clarify return value in
9071 docstring.
9072
7d7d0045
CY
90732011-06-18 Chong Yidong <cyd@stupidchicken.com>
9074
9075 * dispnew.c (add_window_display_history): Use BVAR.
9076
9077 * xdisp.c (debug_method_add): Use BVAR.
9078 (check_window_end, dump_glyph_matrix, dump_glyph)
9079 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
9080
9081 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
9082 Likewise.
9083
9084 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
9085 check till after the cache is created in init_frame_faces.
9086
ff2bc410
SM
90872011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
9088
9089 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
9090
28177add
PE
90912011-06-16 Paul Eggert <eggert@cs.ucla.edu>
9092
dd3482fe
PE
9093 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
9094 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
9095 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
9096
393d71f3 9097 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
9098 * fileio.c (Finsert_file_contents):
9099 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
9100 Remove the old (too-loose) buffer overflow checks.
9101 They weren't needed, since make_gap checks for buffer overflow.
9102 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
9103 The old code merely checked for Emacs fixnum overflow, and relied
9104 on undefined (wraparound) behavior. The new code avoids undefined
9105 behavior, and also checks for ptrdiff_t and/or size_t overflow.
9106
2e6813b0 9107 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
9108 Tune. Don't use wider integers than needed. Don't use alloca.
9109 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 9110
599a9e4f
PE
9111 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
9112
99561444
PE
9113 * insdel.c, lisp.h (buffer_overflow): New function.
9114 (insert_from_buffer_1, replace_range, replace_range_2):
9115 * insdel.c (make_gap_larger):
9116 * editfns.c (Finsert_char):
9117 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
9118
28177add
PE
9119 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
9120
e69dafad
PE
91212011-06-15 Paul Eggert <eggert@cs.ucla.edu>
9122
4baa020d 9123 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 9124
b1c46f02
PE
9125 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
9126 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
9127
e69dafad
PE
9128 * fileio.c: Don't assume EMACS_INT fits in off_t.
9129 (emacs_lseek): New static function.
9130 (Finsert_file_contents, Fwrite_region): Use it.
9131 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
9132
566684ea
PE
9133 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
9134
e6966cd6
PE
9135 * fns.c: Don't overflow int when computing a list length.
9136 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
9137 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
9138 truncation on 64-bit hosts. Check for QUIT every
9139 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
9140 faster and is responsive enough.
9141 (Flength): Report an error instead of overflowing an integer.
9142 (Fsafe_length): Return a float if the value is not representable
9143 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 9144 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 9145 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 9146
dd0b0efb
PE
9147 * alloc.c: Check that resized vectors' lengths fit in fixnums.
9148 (header_size, word_size): New constants.
9149 (allocate_vectorlike): Don't check size overflow here.
9150 (allocate_vector): Check it here instead, since this is the only
9151 caller of allocate_vectorlike that could cause overflow.
9152 Check that the new vector's length is representable as a fixnum.
9153
86fe5cfe
PE
9154 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
9155 The previous code was bogus. For example, next_almost_prime (32)
9156 returned 39, which is undesirable as it is a multiple of 3; and
9157 next_almost_prime (24) returned 25, which is a multiple of 5 so
9158 why was the code bothering to check for multiples of 7?
9159
80e88859
PE
9160 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
9161
4a2f0ad6
PE
9162 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
9163
f66c7cf8
PE
9164 Variadic C functions now count arguments with ptrdiff_t.
9165 This partly undoes my 2011-03-30 change, which replaced int with size_t.
9166 Back then I didn't know that the Emacs coding style prefers signed int.
9167 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
9168 were being counted with int, which may truncate counts on 64-bit
9169 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
9170 * lisp.h (struct Lisp_Subr.function.aMANY)
9171 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
9172 Arg counts are now ptrdiff_t, not size_t.
9173 All variadic functions and their callers changed accordingly.
9174 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
9175 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
9176 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
9177 * callint.c (Fcall_interactively): Check arg count for overflow,
9178 to avoid potential buffer overrun. Use signed char, not 'int',
9179 for 'varies' array, so that we needn't bother to check its size
9180 calculation for overflow.
9181 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
9182 * eval.c (apply_lambda):
9183 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
9184 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
9185 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
9186
a1759b76
PE
9187 * callint.c (Fcall_interactively): Don't use index var as event count.
9188
d96be9fc
PE
9189 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
9190 * mem-limits.h (SIZE): Remove; no longer used.
9191
a690a978 9192 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 9193
578c21e6
PE
9194 Remove unnecessary casts.
9195 * xterm.c (x_term_init):
9196 * xfns.c (x_set_border_pixel):
9197 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
9198 These aren't needed now that we assume ANSI C.
9199
96f53c6c
PE
9200 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
9201 It's more likely to cause problems (due to unsigned overflow)
9202 than to cure them.
9203
83c77d31
PE
9204 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
9205
ee2079f1
PE
9206 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
9207
6da65536
PE
9208 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
9209
7147c4a4
PE
9210 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
9211
193e32d9
PE
9212 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
9213
e5533da6
PE
9214 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
9215
9910e595
PE
9216 GLYPH_CODE_FACE returns EMACS_INT, not int.
9217 * dispextern.h (merge_faces):
9218 * xfaces.c (merge_faces):
01103c44
PE
9219 * xdisp.c (get_next_display_element, next_element_from_display_vector):
9220 Don't assume EMACS_INT fits in int.
9910e595 9221
2638320e
PE
9222 * character.h (CHAR_VALID_P): Remove unused parameter.
9223 * fontset.c, lisp.h, xdisp.c: All uses changed.
9224
045eb8d9
PE
9225 * editfns.c (Ftranslate_region_internal): Omit redundant test.
9226
c1f134b5
PE
9227 * fns.c (concat): Minor tuning based on overflow analysis.
9228 This doesn't fix any bugs. Use int to hold character, instead
9229 of constantly refetching from Emacs object. Use XFASTINT, not
9230 XINT, for value known to be a character. Don't bother comparing
9231 a single byte to 0400, as it's always less.
9232
395fcb93 9233 * floatfns.c (Fexpt):
327eeec8
PE
9234 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9235
abbd3d23
PE
9236 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9237 for characters.
9238
684a03ef
PE
9239 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9240
0fed43f3
PE
9241 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9242 Without this fix, on a 64-bit host (aset S 0 4294967386) would
9243 incorrectly succeed when S was a string, because 4294967386 was
9244 truncated before it was used.
9245
8fd02eb7
PE
9246 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9247 Otherwise, an out-of-range integer could cause undefined behavior
9248 on a 64-bit host.
9249
f8c86b69
PE
9250 * composite.c: Use int, not EMACS_INT, for characters.
9251 (fill_gstring_body, composition_compute_stop_pos): Use int, not
9252 EMACS_INT, for values that are known to be in character range.
9253 This doesn't fix any bugs but is the usual style inside Emacs and
9254 may generate better code on 32-bit machines.
9255
34206dd2
PE
9256 Make sure a 64-bit char is never passed to ENCODE_CHAR.
9257 This is for reasons similar to the recent CHAR_STRING fix.
9258 * charset.c (Fencode_char): Check that character arg is actually
9259 a character. Pass an int to ENCODE_CHAR.
9260 * charset.h (ENCODE_CHAR): Verify that the character argument is no
9261 wider than 'int', as a compile-time check to prevent future regressions
9262 in this area.
9263
c5958d4c 9264 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
9265
9266 Make sure a 64-bit char is never passed to CHAR_STRING.
9267 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9268 by silently ignoring the top 32 bits, allowing some values
9269 that were far too large to be valid characters.
9270 * character.h: Include <verify.h>.
9271 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9272 arguments are no wider than unsigned, as a compile-time check
9273 to prevent future regressions in this area.
9274 * data.c (Faset):
01103c44 9275 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
9276 (Fsubst_char_in_region):
9277 * fns.c (concat):
9278 * xdisp.c (decode_mode_spec_coding):
9279 Adjust to CHAR_STRING's new requirement.
9280 * editfns.c (Finsert_char, Fsubst_char_in_region):
9281 * fns.c (concat): Check that character args are actually
9282 characters. Without this test, these functions did the wrong
9283 thing with wildly out-of-range values on 64-bit hosts.
9284
d37ca623
PE
9285 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9286 These casts should not be needed on 32-bit hosts, either.
9287 * keyboard.c (read_char):
9288 * lread.c (Fload): Remove casts to unsigned.
9289
ea204efb
PE
9290 * lisp.h (UNSIGNED_CMP): New macro.
9291 This fixes comparison bugs on 64-bit hosts.
9292 (ASCII_CHAR_P): Use it.
9293 * casefiddle.c (casify_object):
01103c44 9294 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9295 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9296 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9297 * dispextern.h (FACE_FROM_ID):
9298 * keyboard.c (read_char): Use UNSIGNED_CMP.
9299
41cb286c
PE
9300 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9301 not to EMACS_INT, to avoid GCC warning.
9302
4a1b9832
PE
9303 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9304
55daad71
PE
9305 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9306 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9307 isn't needed on 32-bit machines.
8f95c75c 9308
01103c44
PE
9309 * buffer.c (Fgenerate_new_buffer_name):
9310 Use EMACS_INT for count, not int.
0ceccced 9311 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9312
9313 * data.c (Qcompiled_function): Now static.
9314
c6f072e7
PE
9315 * window.c (window_body_lines): Now static.
9316
20ce5912
PE
9317 * image.c (gif_load): Rename local to avoid shadowing.
9318
9c4c5f81
PE
9319 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9320 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9321 * alloc.c (make_save_value): Integer argument is now of type
9322 ptrdiff_t, not int.
9323 (mark_object): Use ptrdiff_t, not int.
9324 * lisp.h (pD): New macro.
9325 * print.c (print_object): Use it.
9326
c0c5c8ae
PE
9327 * alloc.c: Use EMACS_INT, not int, to count objects.
9328 (total_conses, total_markers, total_symbols, total_vector_size)
9329 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9330 (total_free_floats, total_floats, total_free_intervals)
9331 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9332 Now EMACS_INT, not int. All uses changed.
9333 (Fgarbage_collect): Compute overall total using a double, so that
9334 integer overflow is less likely to be a problem. Check for overflow
9335 when converting back to an integer.
5a25e253
PE
9336 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9337 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9338 These were 'int' variables that could overflow on 64-bit hosts;
9339 they were never used, so remove them instead of repairing them.
211a0b2a 9340 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9341 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9342 Previously, this ceilinged at INT_MAX, but that doesn't work on
9343 64-bit machines.
e46bb31a 9344 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9345
c78baabf 9346 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9347 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9348 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9349 when a (possibly-narrower) signed value would do just as well.
9350 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9351
c9d624c6
PE
9352 * alloc.c: Catch some string size overflows that we were missing.
9353 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9354 for convenience in STRING_BYTES_MAX.
9355 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9356 The definition here is exact; the one in lisp.h was approximate.
9357 (allocate_string_data): Check for string overflow. This catches
9358 some instances we weren't catching before. Also, it catches
9359 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9360 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9361 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9362
c9d624c6
PE
9363 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9364 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9365 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9366
353032ce
PE
9367 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9368
2bccce07
PE
9369 * alloc.c (Fmake_string): Check for out-of-range init.
9370
0ac30604
SM
93712011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9372
9373 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9374
c195f2de
JD
93752011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9376
9377 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9378 xg_get_default_scrollbar_width.
9379
9380 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9381 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9382 (style_changed_cb): Call update_theme_scrollbar_width and call
9383 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9384 all frames (Bug#8505).
9385 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9386 Call gtk_window_set_resizable if HAVE_GTK3.
9387 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9388 and height if HAVE_GTK3 (Bug#8505).
9389 (scroll_bar_width_for_theme): New variable.
9390 (update_theme_scrollbar_width): New function.
9391 (xg_get_default_scrollbar_width): Move code to
9392 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9393 (xg_initialize): Call update_theme_scrollbar_width.
9394
9395 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9396
9397 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9398
e10ac9f1
MR
93992011-06-12 Martin Rudalics <rudalics@gmx.at>
9400
9401 * frame.c (make_frame): Call other_buffer_safely instead of
9402 other_buffer.
9403
9404 * window.c (temp_output_buffer_show): Call display_buffer with
9405 second argument Vtemp_buffer_show_specifiers and reset latter
9406 immediately after the call.
9407 (Vtemp_buffer_show_specifiers): New variable.
9408 (auto_window_vscroll_p, next_screen_context_lines)
9409 (Vscroll_preserve_screen_position): Remove leading asterisks from
9410 doc-strings.
9411
2d3c217e 94122011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9413
7b7f97e8 9414 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9415 * buffer.c (Qclone_number): Remove for now, as it's unused.
9416 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9417 (record_buffer): Remove unused local.
9418 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9419 (set_frame_buffer_list): Remove; unused.
9420 * frame.h (other_visible_frames): Remove decl.
9421 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9422 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9423 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9424 if HAVE_GPM.
9425 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9426 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9427 Define only if HAVE_GPM.
9428 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9429 (update_hints_inhibit): Remove; never set. All uses removed.
9430 * widgetprv.h (emacsFrameClassRec): Remove decl.
9431 * window.c (delete_deletable_window): Now returns void, since it
9432 wasn't returning anything.
9433 (compare_window_configurations): Remove unused locals.
9434 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9435 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9436 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9437 the same widths as pointers. This follows up on the 2011-05-06 patch.
9438 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9439 * xterm.h: Likewise.
9440 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9441
1384b89e
JB
94422011-06-12 Juanma Barranquero <lekktu@gmail.com>
9443
9444 * makefile.w32-in: Update dependencies.
9445 (LISP_H): Add lib/intprops.h.
9446
1100a63c
CY
94472011-06-11 Chong Yidong <cyd@stupidchicken.com>
9448
9449 * image.c (gif_load): Add animation frame delay to the metadata.
9450 (syms_of_image): Use DEFSYM. New symbol `delay'.
9451
6198ccd0
MR
94522011-06-11 Martin Rudalics <rudalics@gmx.at>
9453
9454 * window.c (delete_deletable_window): Re-add.
9455 (Fset_window_configuration): Rewrite to handle dead buffers and
9456 consequently deletable windows.
9457 (window_tree, Fwindow_tree): Remove. Supply functionality in
9458 window.el.
9459 (compare_window_configurations): Simplify code.
9460
b6e3633c
AS
94612011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9462
1ab0dee5
AS
9463 * image.c (imagemagick_load_image): Fix type mismatch.
9464 (Fimagemagick_types): Likewise.
9465
b6e3633c
AS
9466 * window.h (replace_buffer_in_windows): Declare.
9467
9397e56f
MR
94682011-06-11 Martin Rudalics <rudalics@gmx.at>
9469
9470 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9471 Qclone_number. Remove external declaration of Qdelete_window.
9472 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9473 code.
640c8776
SM
9474 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9475 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9476 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9477 buffer list implementation.
9478 (other_buffer_safely): New function.
9479 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9480 calls to replace_buffer_in_windows and
9481 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9482 if allowed.
9483 (record_buffer): Inhibit quitting and rewrite using quittable
9484 functions. Run Qbuffer_list_update_hook if allowed.
9485 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9486 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9487 Move switch-to-buffer to window.el.
9397e56f
MR
9488 (bury-buffer): Move to window.el.
9489 (Vbuffer_list_update_hook): New variable.
9490
9491 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9492 section.
9493
9494 * window.h (resize_frame_windows): Move up in code.
9495 (Fwindow_frame): Remove EXFUN.
9496 (replace_buffer_in_all_windows): Remove prototype.
9497 (replace_buffer_in_windows_safely): Add prototype.
9498
9499 * window.c: Declare Qdelete_window static again. Move down
9500 declaration of select_count.
9501 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9502 (Fother_window): Move to window.el.
9503 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9504 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9505 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9506 window.el.
9507 (replace_buffer_in_windows): Implement by calling
9508 Qreplace_buffer_in_windows.
9509 (replace_buffer_in_all_windows): Remove with some functionality
9510 moved into replace_buffer_in_windows_safely.
9511 (replace_buffer_in_windows_safely): New function.
9512 (select_window_norecord, select_frame_norecord): Move in front
9513 of run_window_configuration_change_hook. Remove now obsolete
9514 declarations.
640c8776
SM
9515 (Fset_window_buffer): Rewrite doc-string.
9516 Call Qrecord_window_buffer.
9397e56f
MR
9517 (keys_of_window): Move binding for other-window to window.el.
9518
b50691aa
CY
95192011-06-11 Chong Yidong <cyd@stupidchicken.com>
9520
9521 * dispextern.h (struct image): Replace data member, whose int_val
9522 and ptr_val fields were not used by anything, with a single
9523 lisp_val object.
9524
9525 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9526 (gif_clear_image, gif_load, imagemagick_load_image)
9527 (gs_clear_image, gs_load): Callers changed.
9528
3f754b86
PE
95292011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9530
cca69397
PE
9531 * buffer.h: Include <time.h>, for time_t.
9532 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9533
109e28d0
PE
9534 Fix minor problems found by static checking.
9535
60737f02
PE
9536 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9537
4b66faf3
PE
9538 Make identifiers static if they are not used in other modules.
9539 * data.c (Qcompiled_function, Qframe, Qvector):
9540 * image.c (QimageMagick, Qsvg):
9541 * minibuf.c (Qmetadata):
9542 * window.c (resize_window_check, resize_root_window): Now static.
9543 * window.h (resize_window_check, resize_root_window): Remove decls.
9544
109e28d0
PE
9545 * window.c (window_deletion_count, delete_deletable_window):
9546 Remove; unused.
46a4ce9e
PE
9547 (window_body_lines): Now static.
9548 (Fdelete_other_windows_internal): Mark vars as initialized.
9549 Make sure 'resize_failed' is initialized.
9550 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9551 (resize_window_apply): Remove unused local.
9552 * window.h (delete_deletable_window): Remove decl.
9553
109e28d0 9554 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9555 (imagemagick_load_image): Fix pointer signedness problem by changing
9556 last arg from unsigned char * to char *. All uses changed.
9557 Also, fix a local for similar reasons.
9558 Remove unused locals. Remove locals to avoid shadowing.
9559 (fn_rsvg_handle_free): Remove; unused.
9560 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9561 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9562
3f754b86
PE
9563 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9564
2547adb1
CY
95652011-06-10 Chong Yidong <cyd@stupidchicken.com>
9566
9567 * image.c (gif_load): Fix omitted cast error introduced by
9568 2011-06-06 change.
9569
2c8e37d4
MR
95702011-06-10 Martin Rudalics <rudalics@gmx.at>
9571
9572 * window.h (resize_proportionally, orig_total_lines)
9573 (orig_top_line): Remove from window structure.
9574 (set_window_height, set_window_width, change_window_heights)
9575 (Fdelete_window): Remove prototypes.
9576 (resize_frame_windows): Remove duplicate declaration.
9577
440a42e3
EZ
95782011-06-10 Eli Zaretskii <eliz@gnu.org>
9579
9580 * window.h (resize_frame_windows, resize_window_check)
9581 (delete_deletable_window, resize_root_window)
9582 (resize_frame_windows): Declare prototypes.
9583
9584 * window.c (resize_window_apply): Make definition be "static" to
9585 match the prototype.
9586
562dd5e9
MR
95872011-06-10 Martin Rudalics <rudalics@gmx.at>
9588
9589 * window.c: Remove declarations of Qwindow_size_fixed,
9590 window_min_size_1, window_min_size_2, window_min_size,
9591 size_window, window_fixed_size_p, enlarge_window, delete_window.
9592 Remove static from declaration of Qdelete_window, it's
9593 temporarily needed by Fbury_buffer.
9594 (replace_window): Don't assign orig_top_line and
9595 orig_total_lines.
9596 (Fdelete_window, delete_window): Remove. Window deletion is
9597 handled by window.el.
640c8776
SM
9598 (window_loop): Remove DELETE_OTHER_WINDOWS case.
9599 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
9600 (Fdelete_other_windows): Remove. Deleting other windows is
9601 handled by window.el.
9602 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
9603 handled in window.el.
9604 (window_min_size_2, window_min_size_1, window_min_size): Remove.
9605 Window minimum sizes are handled in window.el.
9606 (shrink_windows, size_window, set_window_height)
9607 (set_window_width, change_window_heights, window_height)
9608 (window_width, CURBEG, CURSIZE, enlarge_window)
9609 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9610 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
9611 handled in window.el.
9612 (make_dummy_parent): Rename to make_parent_window and give it a
9613 second argument horflag.
9614 (make_window): Don't set resize_proportionally any more.
9615 (Fsplit_window): Remove. Windows are split in window.el.
9616 (save_restore_action, save_restore_orig_size)
9617 (shrink_window_lowest_first, save_restore_orig_size): Remove.
9618 Resize mini windows in window.el.
9619 (grow_mini_window, shrink_mini_window): Implement by calling
9620 Qresize_root_window_vertically, resize_window_check and
9621 resize_window_apply.
640c8776
SM
9622 (saved_window, Fset_window_configuration, save_window_save):
9623 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
9624 resize_proportionally.
9625 (window_min_height, window_min_width): Move to window.el.
9626 (keys_of_window): Move bindings for delete-other-windows,
9627 split-window, delete-window and enlarge-window to window.el.
9628
9629 * buffer.c: Temporarily extern Qdelete_window.
9630 (Fbury_buffer): Temporarily call Qdelete_window instead of
9631 Fdelete_window (Fbury_buffer will move to window.el soon).
9632
9633 * frame.c (set_menu_bar_lines_1): Remove code handling
9634 orig_top_line and orig_total_lines.
9635
9636 * dispnew.c (adjust_frame_glyphs_initially): Don't use
9637 set_window_height but set heights directly.
9638 (change_frame_size_1): Use resize_frame_windows.
9639
9640 * xdisp.c (init_xdisp): Don't use set_window_height but set
9641 heights directly.
9642
640c8776
SM
9643 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9644 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
9645 run_window_configuration_change_hook.
9646
9647 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9648 instead of change_window_heights and run
9649 run_window_configuration_change_hook.
9650
1a13852e
MR
96512011-06-09 Martin Rudalics <rudalics@gmx.at>
9652
9653 * window.c (replace_window): Rename second argument REPLACEMENT to
9654 NEW. New third argument SETFLAG. Rewrite.
9655 (delete_window, make_dummy_parent): Call replace_window with
9656 third argument 1.
9657 (window_list_1): Move down in code.
9658 (run_window_configuration_change_hook): Move set_buffer part
9659 before select_frame_norecord part in order to unwind correctly.
9660 Rename count1 to count.
9661 (recombine_windows, delete_deletable_window, resize_root_window)
9662 (Fdelete_other_windows_internal)
9663 (Frun_window_configuration_change_hook, make_parent_window)
9664 (resize_window_check, resize_window_apply, Fresize_window_apply)
9665 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
9666 (Fdelete_window_internal, Fresize_mini_window_internal):
9667 New functions.
1a13852e
MR
9668 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9669
f3d1777e
MR
96702011-06-08 Martin Rudalics <rudalics@gmx.at>
9671
496e208e
MR
9672 * window.h (window): Add some new members to window structure -
9673 normal_lines, normal_cols, new_total, new_normal, clone_number,
9674 splits, nest, prev_buffers, next_buffers.
9675 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 9676 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 9677
f3d1777e
MR
9678 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9679 Remove.
496e208e
MR
9680 (make_dummy_parent): Set new members of windows structure.
9681 (make_window): Move down in code. Handle new members of window
9682 structure.
9683 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9684 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9685 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9686 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
9687 (Fset_window_next_buffers, Fset_window_clone_number):
9688 New functions.
496e208e
MR
9689 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9690 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9691 Doc-string fixes.
9692 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9693 Argument WINDOW can be now internal window too.
9694 (Fwindow_use_time): Move up in code.
9695 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9696 Rewrite doc-string.
9697 (Fset_window_configuration, saved_window)
9698 (Fcurrent_window_configuration, save_window_save): Handle new
9699 members of window structure.
b9e809c2
MR
9700 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9701 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9702 (syms_of_window): New Lisp objects Qrecord_window_buffer,
9703 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9704 Qget_mru_window, Qresize_root_window,
9705 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9706 Qauto_buffer_name; staticpro them.
f3d1777e 9707
abde8f8c
MR
97082011-06-07 Martin Rudalics <rudalics@gmx.at>
9709
9710 * window.c (Fwindow_total_size, Fwindow_left_column)
9711 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9712 (Fwindow_list_1): New functions.
9713 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
9714 (Fwindow_width, Fscroll_left, Fscroll_right):
9715 Use window_body_cols instead of window_box_text_cols.
9716 (delete_window, Fset_window_configuration):
9717 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
9718 (delete_all_subwindows): Take a window as argument and not a
9719 structure. Rewrite.
190b47e6
MR
9720 (window_loop): Remove handling of GET_LRU_WINDOW and
9721 GET_LARGEST_WINDOW.
9722 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
9723
9724 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
9725 window_box_text_cols. delete_all_subwindows now takes a
9726 Lisp_Object as argument.
abde8f8c 9727
640c8776
SM
9728 * indent.c (compute_motion, Fcompute_motion):
9729 Use window_body_cols instead of window_box_text_cols.
abde8f8c 9730
fa8a67e6
MR
9731 * frame.c (delete_frame): Call delete_all_subwindows with root
9732 window as argument.
9733
a54e3482
DC
97342011-06-07 Daniel Colascione <dan.colascione@gmail.com>
9735
9736 * fns.c (Fputhash): Document return value.
9737
60002bf5
CY
97382011-06-06 Chong Yidong <cyd@stupidchicken.com>
9739
9740 * image.c (gif_load): Implement gif89a spec "no disposal" method.
9741
0c671da6 97422011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 9743
b862a52a 9744 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 9745
be44ca6c
PE
9746 Check for overflow when converting integer to cons and back.
9747 * charset.c (Fdefine_charset_internal, Fdecode_char):
9748 Use cons_to_unsigned to catch overflow.
9749 (Fencode_char): Use INTEGER_TO_CONS.
9750 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
9751 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9752 * data.c (long_to_cons, cons_to_long): Remove.
9753 (cons_to_unsigned, cons_to_signed): New functions.
9754 These signal an error for invalid or out-of-range values.
9755 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9756 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9757 * font.c (Ffont_variation_glyphs):
9758 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9759 * lisp.h: Include <intprops.h>.
9760 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9761 (cons_to_signed, cons_to_unsigned): New decls.
9762 (long_to_cons, cons_to_long): Remove decls.
9763 * undo.c (record_first_change): Use INTEGER_TO_CONS.
9764 (Fprimitive_undo): Use CONS_TO_INTEGER.
9765 * xfns.c (Fx_window_property): Likewise.
9766 * xselect.c: Include <limits.h>.
9767 (x_own_selection, selection_data_to_lisp_data):
9768 Use INTEGER_TO_CONS.
9769 (x_handle_selection_request, x_handle_selection_clear)
9770 (x_get_foreign_selection, Fx_disown_selection_internal)
9771 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
9772 (lisp_data_to_selection_data): Use cons_to_unsigned.
9773 (x_fill_property_data): Use cons_to_signed.
9774 Report values out of range.
9775
d1f3d2af
PE
9776 Check for buffer and string overflow more precisely.
9777 * buffer.h (BUF_BYTES_MAX): New macro.
9778 * lisp.h (STRING_BYTES_MAX): New macro.
9779 * alloc.c (Fmake_string):
9780 * character.c (string_escape_byte8):
9781 * coding.c (coding_alloc_by_realloc):
9782 * doprnt.c (doprnt):
9783 * editfns.c (Fformat):
9784 * eval.c (verror):
9785 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
9786 since they may not be the same number.
9787 * editfns.c (Finsert_char):
9788 * fileio.c (Finsert_file_contents):
9789 Likewise for BUF_BYTES_MAX.
9790
dd52fcea
PE
9791 * image.c: Use ptrdiff_t, not int, for sizes.
9792 (slurp_file): Switch from int to ptrdiff_t.
9793 All uses changed.
9794 (slurp_file): Check that file size fits in both size_t (for
9795 malloc) and ptrdiff_t (for sanity and safety).
9796
7f9bbdbb
PE
9797 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
9798 if b->modtime has its maximal value.
9799
dfe18f82
PE
9800 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
9801
84acfcf0
PE
9802 Don't assume time_t can fit into int.
9803 * buffer.h (struct buffer.modtime): Now time_t, not int.
9804 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
9805 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
9806
ccd9a01a
PE
9807 Minor fixes for signed vs unsigned integers.
9808 * character.h (MAYBE_UNIFY_CHAR):
9809 * charset.c (maybe_unify_char):
9810 * keyboard.c (read_char, reorder_modifiers):
9811 XINT -> XFASTINT, since the integer must be nonnegative.
9812 * ftfont.c (ftfont_spec_pattern):
9813 * keymap.c (access_keymap, silly_event_symbol_error):
9814 XUINT -> XFASTINT, since the integer must be nonnegative.
9815 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
9816 since it makes no difference and we prefer signed.
9817 * keyboard.c (record_char): Use XUINT when all the neighbors do.
9818 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
9819 nonnegative.
9820
d6d100dd
SM
98212011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
9822
9823 * window.h (Fwindow_frame): Declare.
9824
2b6148e4
PE
98252011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9826
9827 * alloc.c: Simplify handling of large-request failures (Bug#8800).
9828 (SPARE_MEMORY): Always define.
9829 (LARGE_REQUEST): Remove.
9830 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
9831
f230ecc9
MR
98322011-06-06 Martin Rudalics <rudalics@gmx.at>
9833
727e958e
MR
9834 * lisp.h: Move EXFUNS for Fframe_root_window,
9835 Fframe_first_window and Fset_frame_selected_window to window.h.
9836
9837 * window.h: Move EXFUNS for Fframe_root_window,
9838 Fframe_first_window and Fset_frame_selected_window here from
9839 lisp.h.
9840
9841 * frame.c (Fwindow_frame, Fframe_first_window)
9842 (Fframe_root_window, Fframe_selected_window)
9843 (Fset_frame_selected_window): Move to window.c.
9844 (Factive_minibuffer_window): Move to minibuf.c.
9845 (Fother_visible_frames_p): New function.
9846
9847 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
9848
f230ecc9
MR
9849 * window.c (decode_window, decode_any_window): Move up in code.
9850 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
9851 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
9852 (Fwindow_buffer): Move up and rewrite doc-string.
9853 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
9854 (Fwindow_prev): New functions.
727e958e
MR
9855 (Fwindow_frame): Move here from frame.c. Accept any window as
9856 argument.
9857 (Fframe_root_window, Fframe_first_window)
9858 (Fframe_selected_window): Move here from frame.c. Accept frame
9859 or arbitrary window as argument. Update doc-strings.
9860 (Fminibuffer_window): Move up in code.
9861 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
9862 (Fset_frame_selected_window): Move here from frame.c.
9863 Marginal rewrite.
727e958e
MR
9864 (Fselected_window, select_window, Fselect_window): Move up in
9865 code. Minor doc-string fixes.
f230ecc9 9866
4d09bcf6
PE
98672011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9868
9869 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
9870 Do not assume that spare memory exists; that assumption is valid
9871 only if SYSTEM_MALLOC.
9872 (LARGE_REQUEST): New macro, so that the issue of large requests
9873 is separated from the issue of spare memory.
9874
810928a2
AS
98752011-06-05 Andreas Schwab <schwab@linux-m68k.org>
9876
172418ad
AS
9877 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
9878 format. (Bug#8806)
9879
43f862f7
AS
9880 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
9881
810928a2
AS
9882 * xfns.c (x_set_scroll_bar_default_width): Move declarations
9883 before statements.
9884
a059fe24
JD
98852011-06-05 Jan Djärv <jan.h.d@swipnet.se>
9886
9887 * gtkutil.c (xg_get_default_scrollbar_width): New function.
9888
9889 * gtkutil.h: Declare xg_get_default_scrollbar_width.
9890
9891 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
9892 min width by calling x_set_scroll_bar_default_width (Bug#8505).
9893
989bf368
JB
98942011-06-05 Juanma Barranquero <lekktu@gmail.com>
9895
9896 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
9897
4b80f674
CY
98982011-06-04 Chong Yidong <cyd@stupidchicken.com>
9899
9900 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
9901 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
9902 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
9903 New error handlers.
4b80f674
CY
9904 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
9905 Obey Vx_select_enable_clipboard_manager. Catch errors in
9906 x_clipboard_manager_save (Bug#8779).
9907 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 9908 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 9909
99a33b77 99102011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
9911
9912 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
9913
99a33b77 99142011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
9915
9916 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
9917 in the current matrix if keep_current_p is non-zero.
9918
8264569d
EZ
99192011-06-04 Eli Zaretskii <eliz@gnu.org>
9920
9921 * bidi.c (bidi_level_of_next_char): Fix last change.
9922
57f97249
EZ
99232011-06-03 Eli Zaretskii <eliz@gnu.org>
9924
fec2107c 9925 Support bidi reordering of text covered by display properties.
57f97249 9926
fec2107c
EZ
9927 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
9928 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
9929 (bidi_cache_search, bidi_cache_iterator_state)
9930 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
9931 (bidi_level_of_next_char, bidi_move_to_visually_next):
9932 Support character positions inside a run of characters covered by a
fec2107c
EZ
9933 display string.
9934 (bidi_paragraph_init, bidi_resolve_explicit_1)
9935 (bidi_level_of_next_char): Call bidi_fetch_char and
9936 bidi_fetch_char_advance instead of FETCH_CHAR and
9937 FETCH_CHAR_ADVANCE.
9938 (bidi_init_it): Initialize new members.
9939 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
9940 definitions.
9941 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
9942 instead of using explicit *_CHAR codes.
d6d100dd
SM
9943 (bidi_resolve_explicit, bidi_resolve_weak):
9944 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
9945 bidirectional text is supported only in multibyte buffers.
9946 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
9947 it to initialize the frame_window_p member of struct bidi_it.
9948 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
9949 (bidi_resolve_explicit, bidi_resolve_weak)
9950 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
9951 bidi_it->nchars is non-positive.
9952 (bidi_level_of_next_char): Don't try to lookup the cache for the
9953 next/previous character if nothing is cached there yet, or if we
9954 were just reseat()'ed to a new position.
c40e2fb2 9955
0e14fe90
EZ
9956 * xdisp.c (set_cursor_from_row): Set start and stop points
9957 according to the row's direction when priming the loop that looks
9958 for the glyph on which to display cursor.
9959 (single_display_spec_intangible_p): Function deleted.
9960 (display_prop_intangible_p): Reimplement to call
9961 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
9962 Accept 3 additional arguments needed by handle_display_spec.
9963 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
9964 values: lists, `(when COND...)' forms, etc.
9965 (single_display_spec_string_p): Support property values that are
9966 lists with the argument STRING its top-level element.
9967 (display_prop_string_p): Fix the condition for processing a
9968 property that is a list to be consistent with handle_display_spec.
fec2107c 9969 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
9970 last portion of handle_display_prop.
9971 (compute_display_string_pos): Accept additional argument
9972 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
9973 value of a `display' property is a "replacing spec".
9974 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
9975 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
9976 the display property, but just return a value indicating whether
9977 the display property will replace the characters it covers.
9978 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
9979 frame_window_p members of struct bidi_it.
d6d100dd
SM
9980 (compute_display_string_pos, compute_display_string_end):
9981 New functions.
fec2107c
EZ
9982 (push_it): Accept second argument POSITION, where pop_it should
9983 jump to continue iteration.
9984 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 9985
fec2107c
EZ
9986 * keyboard.c (adjust_point_for_property): Adjust the call to
9987 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
9988
9989 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
9990 (bidi_init_it): Update prototypes.
9991 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
9992 (compute_display_string_pos, compute_display_string_end):
9993 Declare prototypes.
fec2107c
EZ
9994 (struct bidi_it): New members nchars and disp_pos. ch_len is now
9995 EMACS_INT.
fc6f18ce 9996
40087514 99972011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 9998
57f53182
PE
9999 Malloc failure behavior now depends on size of allocation.
10000 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
10001 * lisp.h: Change signatures accordingly.
10002 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
10003 All callers changed. (Bug#8762)
10004
10005 * gnutls.c: Use Emacs's memory allocators.
10006 Without this change, the gnutls library would invoke malloc etc.
10007 directly, which causes problems on non-SYNC_INPUT hosts, and which
10008 runs afoul of improving memory_full behavior. (Bug#8761)
10009 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
10010 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
10011 xfree instead of the default malloc, realloc, free.
10012 (Fgnutls_boot): No need to check for memory allocation failure,
10013 since xmalloc does that for us.
10014
ac32cd99 10015 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
10016 * category.c (hash_get_category_set):
10017 * ccl.c (ccl_driver):
10018 * charset.c (Fdefine_charset_internal):
10019 * charset.h (struct charset.hash_index):
10020 * composite.c (get_composition_id, gstring_lookup_cache)
10021 (composition_gstring_put_cache):
10022 * composite.h (struct composition.hash_index):
10023 * dispextern.h (struct image.hash):
10024 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
10025 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
10026 (hashfn_equal, hashfn_user_defined, make_hash_table)
10027 (maybe_resize_hash_table, hash_lookup, hash_put)
10028 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
10029 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
10030 (Fsxhash, Fgethash, Fputhash, Fmaphash):
10031 * image.c (make_image, search_image_cache, lookup_image)
10032 (xpm_put_color_table_h):
10033 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 10034 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 10035 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 10036 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
10037 * alloc.c (allocate_vectorlike):
10038 Check for overflow in vector size calculations.
10039 * ccl.c (ccl_driver):
10040 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
10041 * fns.c, image.c: Remove unnecessary static decls that would otherwise
10042 need to be updated by these changes.
40087514
PE
10043 * fns.c (make_hash_table, maybe_resize_hash_table):
10044 Check for integer overflow with large hash tables.
0de4bb68
PE
10045 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
10046 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
10047 (SXHASH_REDUCE): New macro.
10048 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
10049 Use it instead of discarding useful hash info with large hash values.
10050 (sxhash_float): New function.
10051 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
10052 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
10053 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
10054 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
10055 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
10056 Adjust signatures to match updated version of code.
10057 (consing_since_gc): Now EMACS_INT, since a single hash table can
10058 use more than INT_MAX bytes.
10059
698d32e2
DN
100602011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
10061
10062 Make it possible to build with GCC-4.6+ -O2 -flto.
10063
10064 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
10065
fd6fa53f
SM
100662011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
10067
10068 * minibuf.c (get_minibuffer, read_minibuf_unwind):
10069 Call minibuffer-inactive-mode.
10070
864db017
JB
100712011-05-31 Juanma Barranquero <lekktu@gmail.com>
10072
10073 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
10074 Update dependencies.
10075
2ad0baf4
DN
100762011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10077
10078 * data.c (init_data): Remove code for UTS, this system is not
10079 supported anymore.
10080
4fcc2638
DN
100812011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10082
10083 Don't force ./temacs to start in terminal mode.
10084
10085 * frame.c (make_initial_frame): Initialize faces in all cases, not
10086 only when CANNOT_DUMP is defined.
10087 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
10088
c56e0fd5
DN
100892011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10090
10091 * dispnew.c (add_window_display_history): Use const for the string
10092 pointer. Remove declaration, not needed.
10093
333d54da 100942011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 10095
55d4c1b2 10096 Use 'inline', not 'INLINE'.
333d54da 10097 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
10098 * alloc.c, fontset.c (INLINE): Remove.
10099 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
10100 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
10101 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
10102 * gmalloc.c (register_heapinfo): Use inline unconditionally.
10103 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
10104
738db178
DN
101052011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
10106
10107 Make it possible to run ./temacs.
10108
10109 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
10110 syms_of_callproc does the same thing. Remove test for
10111 "initialized", do it in the caller.
10112 * emacs.c (main): Avoid calling set_initial_environment when dumping.
10113
620c53a6
SM
101142011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
10115
10116 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
10117 (read_minibuf): Use get_minibuffer.
10118 (syms_of_minibuf): Use DEFSYM.
10119 (Qmetadata): New var.
10120 * data.c (Qbuffer): Don't make it static.
10121 (syms_of_data): Use DEFSYM.
10122
e003a292
PE
101232011-05-31 Paul Eggert <eggert@cs.ucla.edu>
10124
10125 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
10126 (CCL_CODE_MIN): New macro.
10127
ed008a6d
PE
101282011-05-30 Paul Eggert <eggert@cs.ucla.edu>
10129
3687c2ef
PE
10130 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
10131
ed008a6d
PE
10132 * eval.c (Qdebug): Now static.
10133 * lisp.h (Qdebug): Remove decl. This reverts a part of the
10134 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
10135 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
10136
d66c4c7c
CY
101372011-05-29 Chong Yidong <cyd@stupidchicken.com>
10138
10139 * image.c: Various fixes to ImageMagick code comments.
10140 (Fimagemagick_types): Doc fix.
10141
5fbc2025
PE
101422011-05-29 Paul Eggert <eggert@cs.ucla.edu>
10143
0196f88a
PE
10144 Minor fixes prompted by GCC 4.6.0 warnings.
10145
10146 * xselect.c (converted_selections, conversion_fail_tag): Now static.
10147
5fbc2025
PE
10148 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
10149 (x_clipboard_manager_save_all): Move extern decl to ...
10150 * xterm.h: ... here, so that it can be checked for consistency.
10151
1dd3c2d9
CY
101522011-05-29 Chong Yidong <cyd@stupidchicken.com>
10153
10154 * xselect.c (x_clipboard_manager_save_frame)
10155 (x_clipboard_manager_save_all): New functions.
10156 (Fx_clipboard_manager_save): Lisp function deleted.
10157
10158 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
10159 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
10160
10161 * xterm.h: Update prototype.
10162
5ba6571d
WX
101632011-05-28 William Xu <william.xwl@gmail.com>
10164
10165 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
10166 exiting (Bug#8239).
10167
3eaff834
JM
101682011-05-28 Jim Meyering <meyering@redhat.com>
10169
e1900994 10170 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
10171 * fns.c (to_uchar): Define.
10172 (crypto_hash_function): Use it to convert some newly-signed
10173 variables to unsigned, to avoid sign-extension bugs. For example,
10174 without this change, (md5 "truc") would evaluate to
10175 45723a2aff78ff4fff7fff1114760e62 rather than the expected
10176 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 10177 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 10178
0f6990a7
PE
101792011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10180
10181 Integer overflow fixes.
c8a9ca5a 10182
08686060
PE
10183 * dbusbind.c: Serial number integer overflow fixes.
10184 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
10185 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
10186 to hold a serial number that is too large for a fixnum.
10187 (Fdbus_method_return_internal, Fdbus_method_error_internal):
10188 Check for serial numbers out of range. Decode any serial number
59568bf0 10189 that was so large that it became a float. (Bug#8722)
08686060 10190
2d1fc3c7
PE
10191 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
10192 (Fdbus_call_method, Fdbus_call_method_asynchronously):
10193 Use XFASTINT rather than XUINT when numbers are nonnegative.
10194 (xd_append_arg, Fdbus_method_return_internal):
10195 (Fdbus_method_error_internal): Likewise. Also, for unsigned
10196 arguments, check that Lisp number is nonnegative, rather than
59568bf0 10197 silently wrapping negative numbers around. (Bug#8722)
30217ff0 10198 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 10199 (Bug#8722)
2d1fc3c7 10200
c8a9ca5a
PE
10201 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
10202
519e1d69
PE
10203 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
10204
6df6ae42 10205 ccl: Add integer overflow checks.
30569699
PE
10206 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
10207 (IN_INT_RANGE): New macros.
10208 (ccl_driver): Use them to check for integer overflow when
10209 decoding a CCL program. Many of the new checks are whether XINT (x)
10210 fits in int; it doesn't always, on 64-bit hosts. The new version
10211 doesn't catch all possible integer overflows, but it's an
847044ea 10212 improvement. (Bug#8719)
30569699 10213
c11285dc
PE
10214 * alloc.c (make_event_array): Use XINT, not XUINT.
10215 There's no need for unsigned here.
10216
fdccd48e
PE
10217 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
10218 This follows up to the 2011-05-06 change that substituted uintptr_t
10219 for EMACS_INT. This case wasn't caught back then.
10220
37910ab2
PE
10221 Rework Fformat to avoid integer overflow issues.
10222 * editfns.c: Include <float.h> unconditionally, as it's everywhere
10223 now (part of C89). Include <verify.h>.
10224 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10225 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10226 (Fformat): Avoid the prepass trying to compute sizes; it was only
10227 approximate and thus did not catch overflow reliably. Instead, walk
10228 through the format just once, formatting and computing sizes as we go,
10229 checking for integer overflow at every step, and allocating a larger
10230 buffer as needed. Keep track separately whether the format is
10231 multibyte. Keep only the most-recently calculated precision, rather
10232 than them all. Record whether each argument has been converted to
10233 string. Use EMACS_INT, not int, for byte and char and arg counts.
10234 Support field widths and precisions larger than INT_MAX. Avoid
10235 sprintf's undefined behavior with conversion specifications such as %#d
10236 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
10237 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
10238 formatting out-of-range floating point numbers with int
9173deec 10239 formats. (Bug#8668)
37910ab2 10240
2e6578fb
PE
10241 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10242
0ae6bdee
PE
10243 * data.c: Avoid integer truncation in expressions involving floats.
10244 * data.c: Include <intprops.h>.
10245 (arith_driver): When there's an integer overflow in an expression
10246 involving floating point, convert the integers to floating point
10247 so that the resulting value does not suffer from catastrophic
10248 integer truncation. For example, on a 64-bit host (* 4
10249 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10250 Do not rely on undefined behavior after integer overflow.
10251
de883a70
PE
10252 merge count_size_as_multibyte, parse_str_to_multibyte
10253 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 10254 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
10255 Check for integer overflow.
10256 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10257 since it's now a duplicate of the other. This is more of
10258 a character than a buffer op, so better that it's in character.c.
10259 * fns.c, print.c: Adjust to above changes.
10260
2ff916cb
PE
102612011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
10262
10263 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10264
f1b54466
PE
102652011-05-27 Paul Eggert <eggert@cs.ucla.edu>
10266
fb1ac845
PE
10267 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10268 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10269 (x_clipboard_manager_save): Now static.
10270 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10271
f1b54466
PE
10272 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10273 (crypto_hash_function): Now static.
10274 Fix pointer signedness problems. Avoid unnecessary initializations.
10275
a9f737ee
CY
102762011-05-27 Chong Yidong <cyd@stupidchicken.com>
10277
10278 * termhooks.h (Vselection_alist): Make it terminal-local.
10279
10280 * terminal.c (create_terminal): Initialize it.
10281
10282 * xselect.c: Support for clipboard managers.
10283 (Vselection_alist): Move to termhooks.h as terminal-local var.
10284 (LOCAL_SELECTION): New macro.
10285 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10286 (symbol_to_x_atom): Remove gratuitous arg.
10287 (x_handle_selection_request, lisp_data_to_selection_data)
10288 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10289 (x_own_selection, x_get_local_selection, x_convert_selection):
10290 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10291 (some_frame_on_display): Delete unused function.
10292 (Fx_own_selection_internal, Fx_get_selection_internal)
10293 (Fx_disown_selection_internal, Fx_selection_owner_p)
10294 (Fx_selection_exists_p): New optional frame arg.
10295 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10296 (x_handle_selection_clear): Don't treat other terminals with the
10297 same keyboard specially. Use the terminal-local Vselection_alist.
10298 (x_clear_frame_selections): Use Frun_hook_with_args.
10299
10300 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10301
10302 * xterm.h: Add support for those atoms.
10303
e067f0c1
CY
103042011-05-26 Chong Yidong <cyd@stupidchicken.com>
10305
10306 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10307 (converted_selections, conversion_fail_tag): New global variables.
10308 (x_selection_request_lisp_error): Free the above.
10309 (x_get_local_selection): Remove unnecessary code.
10310 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10311 of converted selections stored in converted_selections.
10312 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10313 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10314 (x_convert_selection): New function.
10315 (x_handle_selection_event): Simplify.
10316 (x_get_foreign_selection): Don't ignore incoming requests while
10317 waiting for an answer; this will fail when we implement
10318 SAVE_TARGETS, and seems unnecessary anyway.
10319 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10320 (Vx_sent_selection_functions): Doc fix.
10321
0f4aebc0
LL
103222011-05-26 Leo Liu <sdl.web@gmail.com>
10323
10324 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10325
e61124cd
YM
103262011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10327
10328 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10329
10330 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10331 for fringe update if it has periodic bitmap.
ac389d0c 10332 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10333 and fringe_bitmap_periodic_p.
10334
10335 * fringe.c (get_fringe_bitmap_data): New function.
10336 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10337 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10338 row. Mark glyph row for fringe update if periodicity changed.
10339
10340 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10341 for fringe update unless it has periodic bitmap.
10342
f16d9837
KH
103432011-05-25 Kenichi Handa <handa@m17n.org>
10344
10345 * xdisp.c (get_next_display_element): Set correct it->face_id for
10346 a static composition.
10347
e1b90ef6
LL
103482011-05-24 Leo Liu <sdl.web@gmail.com>
10349
10350 * deps.mk (fns.o):
10351 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10352
10353 * fns.c (crypto_hash_function, Fsha1): New function.
10354 (Fmd5): Use crypto_hash_function.
10355 (syms_of_fns): Add Ssha1.
10356
7400048f
PE
103572011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10358
10359 * gnutls.c: Remove unused macros.
10360 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10361 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10362 Remove macros that are defined and never used.
10363 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10364
abb71cf4
CY
103652011-05-22 Chong Yidong <cyd@stupidchicken.com>
10366
10367 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10368 (Fx_get_selection_internal): Minor cleanup.
10369 (Fx_own_selection_internal): Rename arguments for consistency with
10370 select.el.
10371
6307db39
PE
103722011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10373
10374 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10375
f3d4e0a4
CY
103762011-05-22 Chong Yidong <cyd@stupidchicken.com>
10377
10378 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10379
4d8ade89
YM
103802011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10381
10382 * dispnew.c (scrolling_window): Don't exclude the case that the
10383 last enabled row in the desired matrix touches the bottom boundary.
10384
32078c8d
GM
103852011-05-21 Glenn Morris <rgm@gnu.org>
10386
10387 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10388 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10389 and add some more files.
32078c8d 10390
7285dc67
EZ
103912011-05-20 Eli Zaretskii <eliz@gnu.org>
10392
10393 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10394 report_file_error introduced by the change from 2011-05-07.
10395
89d1bd22
PE
103962011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10397
10398 * systime.h (Time): Define only if emacs is defined.
10399 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10400 where the include path doesn't have X11/X.h by default. See
10401 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10402
cd394be1 104032011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10404
10405 * composite.c (find_automatic_composition): Fix previous change.
10406
b9704ad9
GM
104072011-05-20 Glenn Morris <rgm@gnu.org>
10408
10409 * lisp.mk: New file, split from Makefile.in.
10410 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10411 (shortlisp): Remove.
10412 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10413
4a720484
GM
104142011-05-19 Glenn Morris <rgm@gnu.org>
10415
10416 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10417 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10418 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10419 (lisp): Set the order to that of loadup.el.
10420 (shortlisp): Make it a copy of $lisp.
10421 (SOME_MACHINE_LISP): Remove.
10422 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10423 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10424
a28d4396
KH
104252011-05-18 Kenichi Handa <handa@m17n.org>
10426
10427 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10428 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10429 (find_automatic_composition): Mostly rewrite for efficiency.
10430
a2b1fa8e
JB
104312011-05-18 Juanma Barranquero <lekktu@gmail.com>
10432
10433 * makefile.w32-in: Update dependencies.
10434
8e1f5610
CS
104352011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10436
10437 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10438 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10439
7025ee00 104402011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10441
cdfa6eab
PE
10442 Fix some integer overflow issues, such as string length overflow.
10443
06d6db33
PE
10444 * insdel.c (count_size_as_multibyte): Check for string overflow.
10445
2b4560a8
PE
10446 * character.c (lisp_string_width): Check for string overflow.
10447 Use EMACS_INT, not int, for string indexes and lengths; in
10448 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10449 the resulting string length overflows an EMACS_INT; instead,
10450 report a string overflow if no precision given. When checking for
10451 precision exhaustion, use a check that cannot possibly have
10452 integer overflow. (Bug#8675)
10453 * character.h (lisp_string_width): Adjust to new signature.
10454
cb93f9be
PE
10455 * alloc.c (string_overflow): New function.
10456 (Fmake_string): Use it. This doesn't change behavior, but saves
10457 a few bytes and will simplify future changes.
10458 * character.c (string_escape_byte8): Likewise.
10459 * lisp.h (string_overflow): New decl.
10460
1a1f3366
PE
10461 Fixups, following up to the user-interface timestamp change.
10462 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10463 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10464 * msdos.c (mouse_get_pos): Likewise.
10465 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10466 * w32gui.h (Time): Define by including "systime.h" rather than by
10467 declaring it ourselves. (Bug#8664)
10468
d4e3e4d3
PE
10469 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10470 * image.c (clear_image_cache): Likewise.
10471
f6a24d19
PE
10472 * term.c (term_mouse_position): Don't assume time_t wraparound.
10473
08dc5ae6
PE
10474 Be more systematic about user-interface timestamps.
10475 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10476 and sometimes 'EMACS_UINT', to represent these timestamps.
10477 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10478 This makes the code easier to follow, and makes it easier to catch
10479 integer overflow bugs such as Bug#8664.
10480 * frame.c (Fmouse_position, Fmouse_pixel_position):
10481 Use Time, not unsigned long, for user-interface timestamps.
10482 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10483 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10484 * keyboard.h (last_event_timestamp): Likewise.
10485 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10486 * menu.h (xmenu_show): Likewise.
10487 * term.c (term_mouse_position): Likewise.
10488 * termhooks.h (struct input_event.timestamp): Likewise.
10489 (struct terminal.mouse_position_hook): Likewise.
10490 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10491 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10492 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10493 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10494 what it was before.
10495 * menu.h, termhooks.h: Include "systime.h", for Time.
10496
8e55734a
PE
10497 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10498 Don't assume that the difference between two unsigned long values
10499 can fit into an integer. At this point, we know button_down_time
10500 <= event->timestamp, so the difference must be nonnegative, so
10501 there's no need to cast the result if double-click-time is
10502 nonnegative, as it should be; check that it's nonnegative, just in
10503 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10504 apart (about 25 days). (Bug#8664)
8e55734a 10505
841f1b75 10506 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10507 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10508
3e26f69c
PE
10509 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10510 that always fit in int. Use a sentinel instead of a counter, to
10511 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10512 * frame.h (struct frame): Use int for menu_bar_items_used
10513 instead of EMACS_INT, since it always fits in int.
3e26f69c 10514
5cc152c0
PE
10515 * menu.c (grow_menu_items): Check for int overflow.
10516
d89eb65e
PE
10517 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10518
5235bd3e
PE
10519 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10520 Before, the code was not consistent. These values cannot exceed
10521 2**31 - 1 so there's no need to make them unsigned.
10522 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10523 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10524 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10525 as modifiers.
10526 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10527
bc827e23
PE
10528 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10529 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10530 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10531 presumably because the widths might not match.
10532
78eb494e
PE
10533 * window.c (size_window): Avoid needless test at loop start.
10534
04f2d78b
CB
105352011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10536
10537 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10538
d2fc7e3d 105392011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10540
10541 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10542
d2fc7e3d 105432011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10544
10545 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10546 `width' to `bar_area_x' and `bar_area_width', respectively.
10547 (x_scroll_run): Take account of fringe background extension.
10548
04f2d78b
CB
10549 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10550 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10551 `bar_area_width', respectively.
10552 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10553 background extension.
10554
79b70037
GM
105552011-05-10 Jim Meyering <meyering@redhat.com>
10556
10557 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10558
2f142cc5
JB
105592011-05-10 Juanma Barranquero <lekktu@gmail.com>
10560
10561 * image.c (Finit_image_library): Return t for built-in image types,
10562 like pbm and xbm. (Bug#8640)
10563
57679c86
AS
105642011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10565
10566 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10567
888c9e86
EZ
105682011-05-07 Eli Zaretskii <eliz@gnu.org>
10569
b0512a1d
EZ
10570 * w32console.c (Fset_screen_color): Doc fix.
10571 (Fget_screen_color): New function.
10572 (syms_of_ntterm): Defsubr it.
10573
7285dc67
EZ
10574 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10575 unlink the temporary file if Fcall_process didn't create it in the
10576 first place.
10577 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10578 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
10579 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10580 cue to call_process_cleanup not to close that handle.
10581
4d3fcc8e
BK
105822011-05-07 Ben Key <bkey76@gmail.com>
10583
10584 * makefile.w32-in: The bootstrap-temacs rule now makes use of
10585 one of two shell specific rules, either bootstrap-temacs-CMD or
10586 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
10587 to the previous implementation of the bootstrap-temacs rule.
10588 The bootstrap-temacs-CMD rule is similar to the previous
10589 implementation of the bootstrap-temacs rule except that it
10590 makes use of the ESC_CFLAGS variable instead of the CFLAGS
10591 variable.
10592
10593 These changes, along with some changes to nt/configure.bat,
10594 nt/gmake.defs, and nt/nmake.defs, are required to extend my
10595 earlier fix to add support for --cflags and --ldflags options
10596 that include quotes so that it works whether make uses cmd or
10597 sh as the shell.
10598
b4289b64
MA
105992011-05-06 Michael Albinus <michael.albinus@gmx.de>
10600
10601 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10602 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10603 is a constant.
10604 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10605 a string. Handle both cases.
10606 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10607 (Fdbus_register_method): Use Qinvalid_function.
10608
af4c0e28
JB
106092011-05-06 Juanma Barranquero <lekktu@gmail.com>
10610
10611 * makefile.w32-in: Update dependencies.
10612 (LISP_H): Add inttypes.h and stdin.h.
10613 (PROCESS_H): Add unistd.h.
10614
c51453d9
EZ
106152011-05-06 Eli Zaretskii <eliz@gnu.org>
10616
10617 * lread.c: Include limits.h (fixes the MS-Windows build broken by
10618 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10619
8ff0ac3c 106202011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 10621
4c4b566b
PE
10622 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10623
aab2b9b5
PE
10624 * term.c (vfatal): Remove stray call to va_end.
10625 It's not needed and the C Standard doesn't allow it here anyway.
10626
c378da0b
PE
10627 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10628 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
10629
288b08c7
PE
10630 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10631 bytes.
10632
e3601888
PE
10633 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10634
db6c0e74
PE
10635 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10636
dd5963ea
PE
10637 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10638
88c9450f
PE
10639 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10640
2f9442b8
PE
10641 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10642
c032b5f8
PE
10643 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10644 * charset.c (Fdefine_charset_internal): Don't initialize
10645 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 10646 32-bit int (Bug#8600).
a108c10b
PE
10647
10648 * lread.c (read_integer): Be more consistent with string-to-number.
10649 Use string_to_number to do the actual conversion; this avoids
10650 rounding errors and fixes some other screwups. Without this fix,
10651 for example, #x1fffffffffffffff was misread as -2305843009213693952.
10652 (digit_to_number): Move earlier, for benefit of read_integer.
10653 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 10654 not a digit in any supported base. (Bug#8602)
a108c10b 10655
ad5f9eea
PE
10656 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10657
aec1708a
PE
10658 * dispnew.c (scrolling_window): Return 1 if we scrolled,
10659 to match comment at start of function. This also removes a
10660 GCC warning about overflow in a 32+64-bit port.
10661
47be4ab5
PE
10662 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10663
371cac43
PE
10664 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10665 Reported by Stefan Monnier in
10666 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
10667 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10668 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 10669
d01a7826
PE
10670 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
10671 (EMACS_UINTPTR): Likewise, with uintptr_t.
10672
7fd47d5c
PE
10673 * lisp.h: Prefer 64-bit EMACS_INT if available.
10674 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10675 on 32-bit hosts that have 64-bit int, so that they can access
10676 large files.
122b0c86
PE
10677 However, temporarily disable this change unless the temporary
10678 symbol WIDE_EMACS_INT is defined.
7fd47d5c 10679
8727937b
PE
10680 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10681
8ac068ac
PE
10682 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10683 This removes an assumption that EMACS_INT and long are the same
10684 width as pointers. The assumption is true for Emacs porting targets
10685 now, but we want to make other targets possible.
10686 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10687 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10688 In the rest of the code, change types of integers that hold casted
10689 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10690 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10691 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10692 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10693 No need to cast type when ORing.
10694 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10695 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10696 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10697 assume EMACS_INT is the same width as char *.
10698 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10699 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10700 Remove no-longer-needed casts.
10701 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10702 (xg_tool_bar_help_callback, xg_make_tool_item):
10703 Use EMACS_INTPTR to hold an integer
10704 that will be cast to void *; this can avoid a GCC warning
10705 if EMACS_INT is not the same width as void *.
10706 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10707 * xdisp.c (display_echo_area_1, resize_mini_window_1):
10708 (current_message_1, set_message_1):
10709 Use a local to convert to proper width without a cast.
10710 * xmenu.c (dialog_selection_callback): Likewise.
10711
ede49d71
PE
10712 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10713 Also, don't assume VALBITS / RAND_BITS is less than 5,
10714 and don't rely on undefined behavior when shifting a 1 left into
10715 the sign bit.
10716 * lisp.h (get_random): Change signature to match.
10717
2f30ecd0
PE
10718 * lread.c (hash_string): Use size_t, not int, for hash computation.
10719 Normally we prefer signed values; but hashing is special, because
10720 it's better to use unsigned division on hash table sizes so that
10721 the remainder is nonnegative. Also, size_t is the natural width
10722 for hashing into memory. The previous code used 'int', which doesn't
10723 retain enough info to hash well into very large tables.
10724 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10725
2a866e7b
PE
10726 * dbusbind.c: Don't possibly lose pointer info when converting.
10727 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10728 Use XPNTR rather than XHASH, so that the high-order bits of
10729 the pointer aren't lost when converting through void *.
10730
51639eac
PE
10731 * eval.c (Fautoload): Don't double-shift a pointer.
10732
92394119
PE
10733 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10734
dbdb9a7c
JB
107352011-05-06 Juanma Barranquero <lekktu@gmail.com>
10736
10737 * gnutls.c (DEF_GNUTLS_FN):
10738 * image.c (DEF_IMGLIB_FN): Make function pointers static.
10739
db7a0b4f
AS
107402011-05-05 Andreas Schwab <schwab@linux-m68k.org>
10741
10742 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10743 marker. (Bug#8610)
10744
cd394be1 107452011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
10746
10747 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
10748 New version that can reserve upto 2GB of heap space.
10749
f7ff1b0f 107502011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
10751
10752 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10753
639c109b
TZ
107542011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
10755
10756 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10757 `gnutls_certificate_set_x509_key_file'.
10758
d2127135
JB
107592011-05-05 Juanma Barranquero <lekktu@gmail.com>
10760
10761 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
10762 Update dependencies.
10763
e968f4f3
JB
107642011-05-04 Juanma Barranquero <lekktu@gmail.com>
10765
10766 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
10767 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10768 Remove unused parameter `fildes'.
10769 * process.c (read_process_output, send_process): Don't pass it.
10770
84d358f0
JB
107712011-05-04 Juanma Barranquero <lekktu@gmail.com>
10772
10773 Fix previous change: the library cache is defined in w32.c.
10774 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
10775 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
10776
0898ca10
JB
107772011-05-04 Juanma Barranquero <lekktu@gmail.com>
10778
10779 Implement dynamic loading of GnuTLS on Windows.
10780
10781 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
10782 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
10783 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10784 Declare.
10785
10786 * gnutls.c (Qgnutls_dll): Define.
10787 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
10788 (gnutls_*): Declare function pointers.
10789 (init_gnutls_functions): New function to initialize function pointers.
10790 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
10791 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
10792 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10793 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
10794 (emacs_gnutls_write, emacs_gnutls_read)
10795 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
10796 (Fgnutls_available_p): New function.
10797 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
10798 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
10799 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
10800
10801 * image.c: Include w32.h.
10802 (Vimage_type_cache): Delete.
10803 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
10804 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
10805 (w32_delayed_load): Move to w32.c.
10806
10807 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
10808
10809 * w32.c (QCloaded_from, Vlibrary_cache): Define.
10810 (w32_delayed_load): Move from image.c. When loading a library, record
10811 its filename in the :loaded-from property of the library id.
10812 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
10813 Initialize and staticpro them.
10814 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
10815
10816 * process.c: Include lisp.h before w32.h, not after.
10817 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
10818 instead of gnutls_record_check_pending.
10819
10820 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
10821
ff4de4aa
TZ
108222011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
10823
10824 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
10825 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
10826 as passed in.
10827
abe95abb
JD
108282011-05-03 Jan Djärv <jan.h.d@swipnet.se>
10829
10830 * xterm.c (x_set_frame_alpha): Do not set property on anything
10831 else than FRAME_X_OUTER_WINDOW (Bug#8608).
10832
e16e55d4
JB
108332011-05-02 Juanma Barranquero <lekktu@gmail.com>
10834
10835 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
10836
bafcf6a5
JB
108372011-05-02 Juanma Barranquero <lekktu@gmail.com>
10838
10839 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
10840 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
10841 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
10842 (gnutls_global_initialized, Qgnutls_bootprop_priority)
10843 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
10844 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
10845 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
10846 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
10847 (Qgnutls_bootprop_callbacks_verify): Make static.
10848
e7a6747f
AS
108492011-05-01 Andreas Schwab <schwab@linux-m68k.org>
10850
19ed11ba
AS
10851 * callproc.c: Indentation fixup.
10852
e7a6747f 10853 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
10854 (wait_for_termination, interruptible_wait_for_termination):
10855 Move after wait_for_termination_1.
e7a6747f 10856
1ef14cb4
LMI
108572011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
10858
10859 * sysdep.c (interruptible_wait_for_termination): New function
10860 which is like wait_for_termination, but allows keyboard
10861 interruptions.
10862
10863 * callproc.c (Fcall_process): Add (:file "file") as an option for
10864 the STDOUT buffer.
10865 (Fcall_process_region): Ditto.
10866
330d880c
EZ
108672011-04-30 Eli Zaretskii <eliz@gnu.org>
10868
8db90b73
EZ
10869 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
10870 rather than `XVECTOR (FOO)->size'.
10871
330d880c
EZ
10872 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
10873 inttypes.h, as a gnulib replacement is used if it not available in
10874 system headers.
10875
15cbd324
EZ
108762011-04-21 Eli Zaretskii <eliz@gnu.org>
10877
10878 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
10879 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
10880 of MOST_POSITIVE_FIXNUM. (Bug#8528)
10881
10882 * coding.c (coding_alloc_by_realloc): Error out if destination
10883 will grow beyond MOST_POSITIVE_FIXNUM.
10884 (decode_coding_emacs_mule): Abort if there isn't enough place in
10885 charbuf for the composition carryover bytes. Reserve an extra
10886 space for up to 2 characters produced in a loop.
10887 (decode_coding_iso_2022): Abort if there isn't enough place in
10888 charbuf for the composition carryover bytes.
10889
108902011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 10891
ae940cca
EZ
10892 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
10893 aborting when %lld or %lll format is passed.
10894 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
10895 %llo or %llx format is passed. (Bug#8545)
10896
03ab8921
EZ
10897 * window.c (window_scroll_line_based): Use a marker instead of
10898 simple variables to record original value of point. (Bug#7952)
10899
afda1437
EZ
10900 * doprnt.c (doprnt): Fix the case where a multibyte sequence
10901 produced by %s or %c overflows available buffer space. (Bug#8545)
10902
f76dee0c
PE
109032011-04-28 Paul Eggert <eggert@cs.ucla.edu>
10904
10905 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 10906 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 10907
fdc5744d
JB
109082011-04-28 Juanma Barranquero <lekktu@gmail.com>
10909
10910 * w32.c (init_environment): Warn about defaulting HOME to C:\.
10911
638f053a
JB
109122011-04-28 Juanma Barranquero <lekktu@gmail.com>
10913
10914 * keyboard.c (Qdelayed_warnings_hook): Define.
10915 (command_loop_1): Run `delayed-warnings-hook'
10916 if Vdelayed_warnings_list is non-nil.
10917 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
10918 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
10919
d178f871
EZ
109202011-04-28 Eli Zaretskii <eliz@gnu.org>
10921
10922 * doprnt.c (doprnt): Don't return value smaller than the buffer
10923 size if the message was truncated. (Bug#8545).
10924
b124fd93
JB
109252011-04-28 Juanma Barranquero <lekktu@gmail.com>
10926
10927 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
10928 (Fx_window_property): #if-0 the whole functions, not just the bodies.
10929
e810457d
PE
109302011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10931
10932 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
10933
ea51cceb
JB
109342011-04-27 Juanma Barranquero <lekktu@gmail.com>
10935
10936 * makefile.w32-in: Update dependencies.
10937
94dcfacf
EZ
109382011-04-27 Eli Zaretskii <eliz@gnu.org>
10939
10940 Improve `doprnt' and its usage. (Bug#8545)
10941 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
10942 `format_end'. Remove support for %l as a conversion specifier.
10943 Don't use xrealloc. Improve diagnostics when the %l size modifier
10944 is used. Update the commentary.
10945
10946 * eval.c (verror): Simplify calculation of size_t.
10947
10948 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
10949 messages.
10950
f61f41d7
PE
109512011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
10952
10953 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
10954 change.
10955
96fb4434
PE
109562011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10957
10958 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
10959 This makes this file independent of the recent pseudovector change.
10960
671875da 109612011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 10962
69e9b5a3
PE
10963 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
10964
b5f869a7 10965 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 10966 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 10967 Remove unused local.
c8926152 10968 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 10969
841a1577 10970 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
10971 GCC 4.6.0 optimizes based on type-based alias analysis.
10972 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
10973 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
10974 != &v->size, and therefore "v->size = 1; b->size = 2; return
10975 v->size;" must therefore return 1. This assumption is incorrect
10976 for Emacs, since it type-puns struct Lisp_Vector * with many other
10977 types. To fix this problem, this patch adds a new type struct
f904488f 10978 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
10979 and pseudovectors, and helps optimizing compilers not get fooled
10980 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
10981 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
10982 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
10983 the size member.
eab3844f
PE
10984 (XSETPVECTYPE): Rewrite in terms of new macro.
10985 (XSETPVECTYPESIZE): New macro, specifying both type and size.
10986 This is a bit clearer, and further avoids the possibility of
10987 undesirable aliasing.
10988 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 10989 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
10990 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
10991 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
10992 (ASIZE): Now uses header.size rather than size.
10993 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
10994 to avoid the hassle of writing XVECTOR (foo)->header.size.
10995 (struct vectorlike_header): New type.
eab3844f
PE
10996 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
10997 object, to help avoid aliasing.
10998 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
10999 (SUBRP): Likewise, since Lisp_Subr is a special case.
11000 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
11001 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
11002 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 11003 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
11004 changed to be "header.size" and "header.next".
11005 * buffer.h (struct buffer): Likewise.
11006 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
11007 * frame.h (struct frame): Likewise.
11008 * process.h (struct Lisp_Process): Likewise.
11009 * termhooks.h (struct terminal): Likewise.
11010 * window.c (struct save_window_data, struct saved_window): Likewise.
11011 * window.h (struct window): Likewise.
11012 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
11013 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
11014 * buffer.c (init_buffer_once): Likewise.
11015 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
11016 special case.
11017 * process.c (Fformat_network_address): Use local var for size,
11018 for brevity.
11019
0df1eac5
PE
11020 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
11021
847ab9d1 11022 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
11023 * data.c (atof): Remove decl; no longer used or needed.
11024 (digit_to_number): Move to lread.c.
11025 (Fstring_to_number): Use new string_to_number function, to be
11026 consistent with how the Lisp reader treats infinities and NaNs.
11027 Do not assume that floating-point numbers represent EMACS_INT
11028 without losing information; this is not true on most 64-bit hosts.
11029 Avoid double-rounding errors, by insisting on integers when
11030 parsing non-base-10 numbers, as the documentation specifies.
11031 * lisp.h (string_to_number): New decl, replacing ...
11032 (isfloat_string): Remove.
bc0a5c13 11033 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 11034 (read1): Do not accept +. and -. as integers; this
452f4150
PE
11035 appears to have been a coding error. Similarly, do not accept
11036 strings like +-1e0 as floating point numbers. Do not report
11037 overflow for integer overflows unless the base is not 10 which
11038 means we have no simple and reliable way to continue.
11039 Break out the floating-point parsing into a new
11040 function string_to_number, so that Fstring_to_number parses
11041 floating point numbers consistently with the Lisp reader.
04f2d78b 11042 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
11043 (E_CHAR, EXP_INT): Remove, replacing with ...
11044 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
11045 (string_to_number): New function, replacing isfloat_string.
11046 This function checks for valid syntax and produces the resulting
11047 Lisp float number too. Rework it so that string-to-number
bc0a5c13 11048 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
11049 so that overflow for non-base-10 numbers is reported only when
11050 there's no portable and simple way to convert to floating point.
452f4150 11051
67769ffc
PE
11052 * textprop.c (set_text_properties_1): Rewrite for clarity,
11053 and to avoid GCC warning about integer overflow.
11054
c20db43f
PE
11055 * intervals.h (struct interval): Use EMACS_INT for members
11056 where EMACS_UINT might cause problems. See
11057 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
11058 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
11059 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
11060 All uses changed.
37aa2f85
PE
11061 (offset_intervals): Tell GCC not to worry about length overflow
11062 when negating a negative length.
c20db43f 11063
2538aa2f
PE
11064 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
11065 (overrun_check_free): Likewise.
11066
f2d3008d
PE
11067 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
11068 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
11069 word size.
11070
ec8df744
PE
11071 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11072 (gnutls_make_error): Rename local to avoid shadowing.
11073 (gnutls_emacs_global_deinit): ifdef out; not used.
11074 (Fgnutls_boot): Use const for pointer to readonly storage.
11075 Comment out unused local. Fix pointer signedness problems.
11076
640ee02d
PE
11077 * lread.c (openp): Don't stuff size_t into an 'int'.
11078 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
11079 about possible signed overflow.
11080
6048fb2a
PE
11081 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
11082 (GDK_KEY_g): Don't define if already defined.
11083 (xg_prepare_tooltip): Avoid pointer signedness problem.
11084 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
11085
fa3c87e1
PE
11086 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
11087 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
11088
2172544b
PE
11089 * xfns.c (Fx_window_property): Simplify a bit,
11090 to make a bit faster and to avoid GCC 4.6.0 warning.
11091 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
11092
9b821a21
PE
11093 * fns.c (internal_equal): Don't assume size_t fits in int.
11094
3c616cfa
PE
11095 * alloc.c (compact_small_strings): Tighten assertion a little.
11096
c2982e87
PE
11097 Replace pEd with more-general pI, and fix some printf arg casts.
11098 * lisp.h (pI): New macro, generalizing old pEd macro to other
11099 conversion specifiers. For example, use "...%"pI"d..." rather
11100 than "...%"pEd"...".
11101 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 11102 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
11103 * alloc.c (check_pure_size): Don't overflow by converting size to int.
11104 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
11105 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
11106 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
11107 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
11108 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
11109 64-bit hosts.
11110 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
11111 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
11112 * print.c (safe_debug_print, print_object): Likewise.
11113 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
11114 to int.
6f04d126
PE
11115 Use pI instead of if-then-else-abort. Use %p to avoid casts,
11116 avoiding the 0 flag, which is not portable.
c2982e87
PE
11117 * process.c (Fmake_network_process): Use pI to avoid cast.
11118 * region-cache.c (pp_cache): Likewise.
11119 * xdisp.c (decode_mode_spec): Likewise.
11120 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
11121 behavior on 64-bit hosts with printf arg.
6f04d126 11122 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
11123 (x_stop_queuing_selection_requests): Likewise.
11124 (x_get_window_property): Don't truncate byte count to an 'int'
11125 when tracing.
0b432f21 11126
5e073ec7
PE
11127 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
11128 here, since it parses constructs like leading '-' and spaces,
11129 which are not wanted; and it overflows with large numbers.
11130 Instead, simply match F[0-9]+, which is what is wanted anyway.
11131
36372bf9
PE
11132 * alloc.c: Remove unportable assumptions about struct layout.
11133 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
11134 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
11135 (allocate_vectorlike, make_pure_vector): Use the new macros,
11136 plus offsetof, to remove unportable assumptions about struct layout.
11137 These assumptions hold on all porting targets that I know of, but
11138 they are not guaranteed, they're easy to remove, and removing them
11139 makes further changes easier.
11140
0b432f21
PE
11141 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
11142 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
11143 (string_overrun_cookie): Now const. Use initializers that
11144 don't formally overflow signed char, to avoid warnings.
000098c1
PE
11145 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
11146 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
11147 (allocate_buffer): Don't assume sizeof (struct buffer) is a
11148 multiple of sizeof (EMACS_INT); it need not be, if
11149 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 11150 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 11151
895009e1
JB
111522011-04-26 Juanma Barranquero <lekktu@gmail.com>
11153
11154 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
11155
6a7a1b0b
TZ
111562011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
11157
11158 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 11159 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
11160 Reported by Paul Eggert <eggert@cs.ucla.edu>.
11161
841a1577 111622011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
11163
11164 * lisp.h (Qdebug): List symbol.
895009e1 11165 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
11166 * keyboard.c (debug-on-event): New variable.
11167 (handle_user_signal): Break into debugger when debug-on-event
11168 matches the current signal symbol.
11169
f2d3ba6f
DN
111702011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
11171
11172 * alloc.c (check_sblock, check_string_bytes)
11173 (check_string_free_list): Convert to standard C.
11174
42ce4c63
TZ
111752011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
11176
11177 * w32.c (emacs_gnutls_push): Fix typo.
11178
825cd63c
EZ
111792011-04-25 Eli Zaretskii <eliz@gnu.org>
11180
fb11d64d
EZ
11181 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
11182 "cast to pointer from integer of different size".
11183
825cd63c
EZ
11184 Improve doprnt and its use in verror. (Bug#8545)
11185 * doprnt.c (doprnt): Document the set of format control sequences
11186 supported by the function. Use SAFE_ALLOCA instead of always
11187 using `alloca'.
11188
11189 * eval.c (verror): Don't limit the buffer size at size_max-1, that
11190 is one byte too soon. Don't use xrealloc; instead xfree and
11191 xmalloc anew.
11192
e061a11b
TZ
111932011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
11194
11195 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
11196 callbacks stage.
11197
11198 * gnutls.c: Renamed global_initialized to
11199 gnutls_global_initialized. Added internals for the
11200 :verify-hostname-error, :verify-error, and :verify-flags
11201 parameters of `gnutls-boot' and documented those parameters in the
11202 docstring. Start callback support.
9173deec
JB
11203 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
11204 unless a fatal error occurred. Call gnutls_alert_send_appropriate
11205 on error. Return error code.
e061a11b
TZ
11206 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
11207 (emacs_gnutls_read): Likewise.
11208 (Fgnutls_boot): Return handshake error code.
11209 (emacs_gnutls_handle_error): New function.
11210 (wsaerror_to_errno): Likewise.
11211
11212 * w32.h (emacs_gnutls_pull): Add prototype.
11213 (emacs_gnutls_push): Likewise.
11214
11215 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
11216 (emacs_gnutls_push): Likewise.
11217
112182011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
11219
11220 * process.c (wait_reading_process_output): Check if GnuTLS
11221 buffered some data internally if no FDs are set for TLS
11222 connections.
11223
11224 * makefile.w32-in (OBJ2): Add gnutls.$(O).
11225 (LIBS): Link to USER_LIBS.
11226 ($(BLD)/gnutls.$(0)): New target.
11227
fa6996bc
EZ
112282011-04-24 Eli Zaretskii <eliz@gnu.org>
11229
eb35682e
EZ
11230 * xdisp.c (handle_single_display_spec): Rename the
11231 display_replaced_before_p argument into display_replaced_p, to
11232 make it consistent with the commentary. Fix typos in the
11233 commentary.
11234
e2ad650c
EZ
11235 * textprop.c (syms_of_textprop): Remove dead code.
11236 (copy_text_properties): Delete obsolete commentary about an
11237 interface that was deleted long ago. Fix typos in the description
11238 of arguments.
11239
1b2de274
EZ
11240 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11241 to changes in oldXMenu/XMenu.h from 2011-04-16.
11242 <menu_help_message, prev_menu_help_message>: Constify.
11243 (IT_menu_make_room): menu->help_text is now `const char **';
11244 adjust.
11245
11246 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11247 to changes in oldXMenu/XMenu.h from 2011-04-16.
11248 (struct XMenu): Declare `help_text' `const char **'.
11249
11250 * xfaces.c <Qunspecified>: Make extern again.
11251
11252 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 11253 required by POSIX.
1b2de274 11254
762b15be
EZ
11255 * doc.c (get_doc_string): Improve the format passed to `error'.
11256
11257 * doprnt.c (doprnt): Improve commentary.
11258
11259 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11260
11261 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11262 them with etags.
11263
f1052e5d
EZ
11264 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11265 changes in globals.h immediately force recompilation.
762b15be
EZ
11266 (TAGS): Depend on $(CURDIR)/m/intel386.h and
11267 $(CURDIR)/s/ms-w32.h.
11268 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 11269
fa6996bc
EZ
11270 * character.c (Fchar_direction): Function deleted.
11271 (syms_of_character): Don't defsubr it.
11272 <char-direction-table>: Deleted.
11273
e6c3da20
EZ
112742011-04-23 Eli Zaretskii <eliz@gnu.org>
11275
11276 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
11277 * doprnt.c: Include limits.h.
11278 (SIZE_MAX): New macro.
04f2d78b
CB
11279 (doprnt): Return a size_t value. 2nd arg is now size_t.
11280 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
11281 Improve overflow protection. Support `l' modifier for integer
11282 conversions. Support %l conversion. Don't assume an EMACS_INT
11283 argument for integer conversions and for %c.
11284
11285 * lisp.h (doprnt): Restore prototype.
11286
11287 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11288 $(SRC)/character.h.
11289
11290 * Makefile.in (base_obj): Add back doprnt.o.
11291
11292 * deps.mk (doprnt.o): Add back prerequisites.
11293 (callint.o): Depend on character.h.
11294
11295 * eval.c (internal_lisp_condition_case): Include the handler
11296 representation in the error message.
11297 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11298 when breaking from the loop.
11299
11300 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11301
11302 * callint.c (Fcall_interactively): When displaying error message
11303 about invalid control letter, pass the character's codepoint, not
11304 a pointer to its multibyte form. Improve display of the character
11305 in octal and display also its hex code.
11306
11307 * character.c (char_string): Use %x to display the (unsigned)
11308 codepoint of an invalid character, to avoid displaying a bogus
11309 negative value.
11310
11311 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11312 `error', not SYMBOL_NAME itself.
11313
11314 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11315 character arguments to `error'.
11316
11317 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11318 to `error' in error message about FINAL_CHAR argument. Make sure
11319 FINAL_CHAR is a character, and use %c when it is passed as
11320 argument to `error'.
11321
4ffd0d6b 113222011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11323
11324 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11325
11326 * w32.c: Include <time.h>.
11327 (sys_localtime): New function.
11328
4ffd0d6b 113292011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11330
11331 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11332
4ffd0d6b 11333 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11334
4ffd0d6b 113352011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11336
4ffd0d6b
GM
11337 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11338 zombies (Bug#8467).
aac0c6e3 11339
04c56954
EZ
113402011-04-19 Eli Zaretskii <eliz@gnu.org>
11341
11342 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11343 gl_state.e_property when gl_state.object is Qt.
11344
11345 * insdel.c (make_gap_larger): Remove limitation of buffer size
11346 to <= INT_MAX.
11347
16a43933
CY
113482011-04-18 Chong Yidong <cyd@stupidchicken.com>
11349
11350 * xdisp.c (lookup_glyphless_char_display)
11351 (produce_glyphless_glyph): Handle cons cell entry in
11352 glyphless-char-display.
11353 (Vglyphless_char_display): Document it.
11354
11355 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11356 glyphless-char-display.
11357
4581706e
CY
113582011-04-17 Chong Yidong <cyd@stupidchicken.com>
11359
11360 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11361
11362 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11363
11364 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11365 definition for no-X builds.
11366
4887c6e2 113672011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11368
fd35b6f9
PE
11369 Static checks with GCC 4.6.0 and non-default toolkits.
11370
5c1ccb01
PE
11371 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11372
006c5daa
PE
11373 * process.c (keyboard_bit_set): Define only if SIGIO.
11374 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11375 (send_process): Repair possible setjmp clobbering.
11376
efc736d3
PE
11377 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11378
4e2fe2e6
PE
11379 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11380
f97334a2
PE
11381 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11382
4e75f29d
PE
11383 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11384 Define only if needed.
11385
90efadd1
PE
11386 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11387 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11388 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11389
3c647824
PE
11390 * dispextern.h (struct redisplay_interface): Rename param
11391 to avoid shadowing.
e264f262 11392 * termhooks.h (struct terminal): Likewise.
761383f4 11393 * xterm.c (xembed_send_message): Likewise.
3c647824 11394
b58c5c4a
PE
11395 * insdel.c (make_gap_smaller): Define only if
11396 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11397
cad59032
PE
11398 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11399 it.
11400
c339dc2e
PE
11401 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11402 so that we aren't warned about unused symbols.
11403
91a3e27b
PE
11404 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11405
399c71d3 11406 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11407
8ffc96f5
PE
11408 * xfns.c (x_real_positions): Mark locals as initialized.
11409
eef9bc79
PE
11410 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11411
098db9dd
PE
11412 * xterm.c: Fix problems found by static analysis with other toolkits.
11413 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11414 (x_dispatch_event): Declare static if USE_GTK, and
11415 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11416 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11417 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11418 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11419 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11420
eb18f6cc
PE
11421 * xmenu.c (menu_help_callback): Pointer type fixes.
11422 Use const pointers when pointing at readonly data. Avoid pointer
11423 signedness clashes.
11424 (FALSE): Remove unused macro.
11425 (update_frame_menubar): Remove unused decl.
11426
1fe72bf8
PE
11427 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11428
60d9e1db
PE
11429 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11430 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11431 (single_menu_item): Rename local to avoid shadowing.
11432
39261c26
PE
11433 * keyboard.c (make_lispy_event): Remove unused local var.
11434
018c5e19
PE
11435 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11436 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11437
63d2b86e
PE
11438 * bitmaps: Change bitmaps from unsigned char back to the X11
11439 compatible char. Avoid the old compiler warnings about
11440 out-of-range initializers by using, for example, '\xab' rather
11441 than 0xab.
11442
aefd87e1
PE
11443 * xgselect.c (xgselect_initialize): Check vs interface
11444 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11445
bf501fb9
PE
11446 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11447
e9829fdf
PE
11448 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11449 to read-only memory.
11450
1086c095
PE
11451 * fns.c (vector): Remove; this old hack is no longer needed.
11452
2baccd04 11453 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11454 Remove unused var.
dde42981 11455 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11456
72391843 11457 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11458
436c16df 11459 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11460 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11461 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11462
92bb796d 11463 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11464 (x_term_init): Remove local to avoid shadowing.
92bb796d 11465
764430a3 11466 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11467
11468 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11469 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11470
d1dfb56c
EZ
114712011-04-16 Eli Zaretskii <eliz@gnu.org>
11472
c4354cb4
EZ
11473 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11474
d1dfb56c
EZ
11475 Fix regex.c, syntax.c and friends for buffers > 2GB.
11476 * syntax.h (struct gl_state_s): Declare character position members
11477 EMACS_INT.
11478
11479 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11480
04f2d78b
CB
11481 * textprop.c (verify_interval_modification, interval_of):
11482 Declare arguments EMACS_INT.
d1dfb56c
EZ
11483
11484 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11485 EMACS_INT.
11486
11487 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11488
11489 * indent.c (Fvertical_motion): Local variable it_start is now
11490 EMACS_INT.
11491
11492 * regex.c (re_match, re_match_2, re_match_2_internal)
11493 (bcmp_translate, regcomp, regexec, print_double_string)
11494 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11495 (re_compile_pattern, re_exec): Declare arguments and local
11496 variables `size_t' and `ssize_t' and return values `regoff_t', as
11497 appropriate.
11498 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11499 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11500 <compile_stack_type>: `size' and `avail' are now `size_t'.
11501
11502 * regex.h <regoff_t>: Use ssize_t, not int.
11503 (re_search, re_search_2, re_match, re_match_2): Arguments that
11504 specify buffer/string position and length are now ssize_t and
11505 size_t. Return type is regoff_t.
11506
613052cd
BK
115072011-04-16 Ben Key <bkey76@gmail.com>
11508
11509 * nsfont.m: Fixed bugs in ns_get_family and
11510 ns_descriptor_to_entity that were caused by using free to
11511 deallocate memory blocks that were allocated by xmalloc (via
11512 xstrdup). This caused Emacs to crash when compiled with
11513 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11514 --enable-checking=xmallocoverrun). xfree is now used to
11515 deallocate these memory blocks.
11516
4170f62f 115172011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11518
71b41406
PE
11519 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11520
9587a89d
PE
11521 emacs_write: Accept and return EMACS_INT for sizes.
11522 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11523 et seq.
11524 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11525 Accept and return EMACS_INT.
11526 (emacs_gnutls_write): Return the number of bytes written on
11527 partial writes.
11528 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11529 (emacs_read, emacs_write): Remove check for negative size, as the
11530 Emacs source code has been audited now.
9587a89d
PE
11531 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11532 (emacs_read, emacs_write): Use it.
273a5f82
PE
11533 * process.c (send_process): Adjust to the new signatures of
11534 emacs_write and emacs_gnutls_write. Do not attempt to store
11535 a byte offset into an 'int'; it might overflow.
9587a89d 11536 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11537
3e047f51
PE
11538 * sound.c: Don't assume sizes fit in 'int'.
11539 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11540 Return EMACS_INT, not int.
3e047f51 11541 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11542 Accept EMACS_INT, not int.
11543 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11544 record read return values.
11545
cc39a9db
BK
115462011-04-15 Ben Key <bkey76@gmail.com>
11547
c9d0ec6d
JB
11548 * keyboard.c (Qundefined): Don't declare static since it is used
11549 in nsfns.m.
11550 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11551 static since they are used in nsfont.m.
cc39a9db 11552
6c60eb9f
SM
115532011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11554
11555 * process.c (Qprocessp): Don't declare static.
11556 * lisp.h (Qprocessp): Declare again.
11557
7990b61a
JB
115582011-04-15 Juanma Barranquero <lekktu@gmail.com>
11559
11560 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11561
5d4cb038
PE
115622011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11563
8bd7b830 11564 Improve C-level modularity by making more things 'static'.
cd64ea1d 11565
e3b27b31
PE
11566 Don't publish debugger-only interfaces to other modules.
11567 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11568 (verify_bytepos, count_markers): Move decls to the only modules
11569 that need them.
11570 * region-cache.h (pp_cache): Likewise.
11571 * window.h (check_all_windows): Likewise.
11572 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11573
5d4cb038
PE
11574 * sysdep.c (croak): Now static, if
11575 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11576 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
11577
11578 * alloc.c (refill_memory_reserve): Now static if
11579 !defined REL_ALLOC || defined SYSTEM_MALLOC.
11580 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 11581
e87b6180
PE
11582 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11583 Define only if USE_LUCID.
11584
ac64929e
PE
11585 * xrdb.c (x_customization_string, x_rm_string): Now static.
11586
6f37259d
PE
11587 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11588 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11589
1683e3ab
PE
11590 * xdisp.c (draw_row_with_mouse_face): Now static.
11591 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11592
de9c2632
PE
11593 * window.h (check_all_windows): Mark externally visible.
11594
2b96acb7
PE
11595 * window.c (window_deletion_count): Now static.
11596
11597 * undo.c: Make symbols static if they're not exported.
11598 (last_undo_buffer, last_boundary_position, pending_boundary):
11599 Now static.
11600
50436f33
PE
11601 * textprop.c (interval_insert_behind_hooks): Now static.
11602 (interval_insert_in_front_hooks): Likewise.
11603
64520e5c
PE
11604 * term.c: Make symbols static if they're not exported.
11605 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11606 (max_frame_lines, tty_set_terminal_modes):
11607 (tty_reset_terminal_modes, tty_turn_off_highlight):
11608 (get_tty_terminal): Now static.
11609 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11610 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 11611 HAVE_WINDOW_SYSTEM.
64520e5c
PE
11612 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11613 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11614
1fa53021
PE
11615 * sysdep.c: Make symbols static if they're not exported.
11616 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11617 Now static.
11618 (sigprocmask_set, full_mask): Remove; unused.
11619 (wait_debugging): Mark as visible.
11620 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11621 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11622
d4b43b22
PE
11623 * syntax.c (syntax_temp): Define only if !__GNUC__.
11624
b7c513d0
PE
11625 * sound.c (current_sound_device, current_sound): Now static.
11626
989b29ad
PE
11627 * search.c (searchbufs, searchbuf_head): Now static.
11628
13a55a78
PE
11629 * scroll.c (scroll_cost): Remove; unused.
11630 * dispextern.h (scroll_cost): Remove decl.
11631
de68a1fc
PE
11632 * region-cache.h (pp_cache): Mark as externally visible.
11633
40ccffa6
PE
11634 * process.c: Make symbols static if they're not exported.
11635 (process_tick, update_tick, create_process, chan_process):
11636 (Vprocess_alist, proc_buffered_char, datagram_access):
11637 (fd_callback_data, send_process_frame, process_sent_to): Now static.
11638 (deactivate_process): Mark defn as static, as well as decl.
11639 * lisp.h (create_process): Remove decl.
11640 * process.h (chan_process, Vprocess_alist): Remove decls.
11641
ad64fc97
PE
11642 * print.c: Make symbols static if they're not exported.
11643 (print_depth, new_backquote_output, being_printed, print_buffer):
11644 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11645 (print_interval, print_number_index, initial_stderr_stream):
11646 Now static.
11647 * lisp.h (Fprinc): Remove decl.
11648 (debug_output_compilation_hack): Mark as externally visible.
11649
adddb265
PE
11650 * sysdep.c (croak): Move decl from here to syssignal.h.
11651 * syssignal.h (croak): Put it here, so the API can be checked when
11652 'croak' is called from dissociate_if_controlling_tty.
11653
1717ede2
PE
11654 * minibuf.c: Make symbols static if they're not exported.
11655 (minibuf_save_list, choose_minibuf_frame): Now static.
11656 * lisp.h (choose_minibuf_frame): Remove decl.
11657
fa5fb2bc
PE
11658 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11659
1e3890d1
PE
11660 * lread.c: Make symbols static if they're not exported.
11661 (read_objects, initial_obarray, oblookup_last_bucket_number):
11662 Now static.
11663 (make_symbol): Remove; unused.
11664 * lisp.h (initial_obarray, make_symbol): Remove decls.
11665
8a1414fa
PE
11666 * keyboard.c: Make symbols static if they're not exported.
11667 (single_kboard, recent_keys_index, total_keys, recent_keys):
11668 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11669 (this_single_command_key_start, echoing, last_auto_save):
11670 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11671 (command_loop, echo_now, keyboard_init_hook, help_char_p):
11672 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11673 (Vlispy_mouse_stem, double_click_count):
11674 Now static.
11675 (force_auto_save_soon): Define only if SIGDANGER.
11676 (ignore_mouse_drag_p): Now static if
11677 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11678 (print_help): Remove; unused.
11679 (stop_character, last_timer_event): Mark as externally visible.
11680 * keyboard.h (ignore_mouse_drag_p): Declare only if
11681 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11682 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11683 * lisp.h (echoing): Remove decl.
11684 (force_auto_save_soon): Declare only if SIGDANGER.
11685 * xdisp.c (redisplay_window): Simplify code, to make it more
11686 obvious that ignore_mouse_drag_p is not accessed if !defined
11687 USE_GTK && !defined HAVE_NS.
11688
93ea6e8f
PE
11689 * intervals.c: Make symbols static if they're not exported.
11690 (merge_properties_sticky, merge_interval_right, delete_interval):
11691 Now static.
11692 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11693
77382fcc
PE
11694 * insdel.c: Make symbols static if they're not exported.
11695 However, leave prepare_to_modify_buffer alone. It's never
11696 called from outside this function, but that appears to be a bug.
11697 (combine_after_change_list, combine_after_change_buffer):
4889fc82 11698 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
11699 (adjust_after_replace_noundo): Remove; unused.
11700 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 11701 (signal_before_change): Remove decls.
77382fcc 11702
9306c32e
PE
11703 * indent.c (val_compute_motion, val_vmotion): Now static.
11704
cd44d2eb
PE
11705 * image.c: Make symbols static if they're not exported.
11706 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11707 if USE_GTK.
11708 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11709 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11710
ad9a7a06
PE
11711 * fringe.c (standard_bitmaps): Now static.
11712 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11713
81626931
PE
11714 * frame.c: Make symbols static if they're not exported.
11715 (x_report_frame_params, make_terminal_frame): Now static.
11716 (get_frame_param): Now static, unless HAVE_NS.
11717 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11718 (x_get_resource_string): Remove; not used.
11719 * frame.h (make_terminal_frame, x_report_frame_params):
11720 (x_get_resource_string); Remove decls.
11721 (x_fullscreen_adjust): Declare only if WINDOWSNT.
11722 * lisp.h (get_frame_param): Declare only if HAVE_NS.
11723
239f9db9
PE
11724 * font.c, fontset.c: Make symbols static if they're not exported.
11725 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11726 (FACE_SUITABLE_FOR_CHAR_P): Use it.
11727 * font.c (font_close_object): Now static.
11728 * font.h (font_close_object): Remove.
11729 * fontset.c (FONTSET_OBJLIST): Remove.
11730 (free_realized_fontset) #if-0 the body, which does nothing.
11731 (face_suitable_for_char_p): #if-0, as it's never called.
11732 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
11733 * xfaces.c (face_at_string_position):
11734 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
11735 since 0 is always ASCII.
11736
dfcf3579
PE
11737 * fns.c (weak_hash_tables): Now static.
11738
5045092b
PE
11739 * fileio.c: Make symbols static if they're not exported.
11740 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11741 (Vwrite_region_annotation_buffers): Now static.
11742
57a96f5c
PE
11743 * eval.c: Make symbols static if they're not exported.
11744 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
11745 * lisp.h (backtrace_list): Remove decl.
11746
35f08c38
PE
11747 * emacs.c: Make symbols static if they're not exported.
11748 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
11749 (fatal_error_code, fatal_error_signal_hook, standard_args):
11750 Now static.
11751 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11752 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11753 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11754 * lisp.h (fatal_error_signal_hook): Remove decl.
11755 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11756
f44bd759
PE
11757 * editfns.c: Move a (normally-unused) function to its only use.
11758 * editfns.c, lisp.h (get_operating_system_release): Remove.
11759 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11760 worth the hassle of breaking this out.
11761
b532497d
PE
11762 * xterm.c: Make symbols static if they're not exported.
11763 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
11764 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
11765 (x_destroy_window, x_delete_display):
11766 Now static.
11767 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
11768 (x_mouse_leave): Remove; unused.
11769 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
11770 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
11771 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
11772 Remove decls.
11773 (x_mouse_leave): Declare only if WINDOWSNT.
11774 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
11775 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
11776 USE_X_TOOLKIT.
11777
1675728f
PE
11778 * ftxfont.c: Make symbols static if they're not exported.
11779 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
11780 HAVE_FREETYPE.
11781 * font.h (ftxfont_driver): Likewise.
11782
e4cebfca
PE
11783 * xfns.c: Make symbols static if they're not exported.
11784 (x_last_font_name, x_display_info_for_name):
11785 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
11786 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
11787 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
11788 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
11789 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
11790 (last_show_tip_args): Now static.
11791 (xic_defaut_fontset, xic_create_fontsetname): Define only if
11792 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
11793 (x_screen_planes): Remove; unused.
11794 * dispextern.h (x_screen_planes): Remove decl.
11795
5bf46f05
PE
11796 * dispnew.c: Make symbols static if they're not exported.
11797 * dispextern.h (redraw_garbaged_frames, scrolling):
11798 (increment_row_positions): Remove.
11799 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
11800 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
11801 Now static.
11802 (redraw_garbaged_frames): Remove; unused.
11803
435f4c28
PE
11804 * xfaces.c: Make symbols static if they're not exported.
11805 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
11806 Remove decls.
11807 * xterm.h (defined_color): Remove decls.
11808 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
11809 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
11810 (menu_face_changed_default, defined_color, free_realized_face):
11811 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
11812 (ascii_face_of_lisp_face): Remove; unused.
11813
8524aef3
PE
11814 * xdisp.c: Make symbols static if they're not exported.
11815 * dispextern.h (scratch_glyph_row, window_box_edges):
11816 (glyph_to_pixel_coords, set_cursor_from_row):
11817 (get_next_display_element, set_iterator_to_next):
11818 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
11819 (show_mouse_face): Remove decls
11820 * frame.h (message_buf_print): Likewise.
11821 * lisp.h (pop_message, set_message, check_point_in_composition):
11822 Likewise.
11823 * xterm.h (set_vertical_scroll_bar): Likewise.
11824 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
11825 (message_buf_print, scratch_glyph_row, displayed_buffer):
11826 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
11827 (get_next_display_element, show_mouse_face, window_box_edges):
11828 (frame_to_window_pixel_xy, check_point_in_composition):
11829 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
11830 (glyph_to_pixel_coords): Remove; unused.
11831
16390cd2
PE
11832 * dired.c (file_name_completion): Now static.
11833
11834 * dbusbind.c (xd_in_read_queued_messages): Now static.
11835
a25f4dfa
PE
11836 * lisp.h (circular_list_error, FOREACH): Remove; unused.
11837 * data.c (circular_list_error): Remove.
11838
14a9c8df
PE
11839 * commands.h (last_point_position, last_point_position_buffer):
11840 (last_point_position_window): Remove decls.
11841 * keyboard.c: Make these variables static.
11842
04f2d78b
CB
11843 * coding.h (coding, code_convert_region, encode_coding_gap):
11844 Remove decls.
74ab6df5
PE
11845 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
11846 (iso_code_class, detect_coding, code_convert_region): Now static.
11847 (encode_coding_gap): Remove; unused.
11848
38dfbee1
PE
11849 * chartab.c (chartab_chars, chartab_bits): Now static.
11850
a2cb4e63
PE
11851 * charset.h (charset_iso_8859_1): Remove decl.
11852 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
11853 Now static.
11854
127198fd
PE
11855 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
11856 * ccl.c (Vccl_program_table): Now static.
11857 (check_ccl_update): Remove; unused.
11858
d85b608f
PE
11859 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
11860 * category.h: ... from here.
11861 * category.c (check_category_table, set_category_set): Now static.
11862
31cd66f3
PE
11863 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
11864 * lisp.h: Remove these decls.
11865
c358e587
PE
11866 * buffer.c (buffer_count): Remove unused var.
11867
e78aecca
PE
11868 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
11869 so that it's not optimized away.
11870 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
11871 * dispextern.h (bidi_dump_cached_states): Remove, since it's
11872 exported only to the debugger.
11873
e192d7d3 11874 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 11875 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 11876
92470028
PE
11877 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
11878 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
11879 was inaccessible from Lisp.
11880 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
11881 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
11882
244ed907
PE
11883 alloc.c: Import and export fewer symbols, and remove unused items.
11884 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
11885 is defined.
11886 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
11887 it's not optimized away by whole-program optimization.
11888 (message_enable_multibyte, free_misc): Remove.
11889 (catchlist, handlerlist, mark_backtrace):
11890 Declare only if BYTE_MARK_STACK.
11891 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
11892 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
11893 (message_enable_multibyte): Remove decl.
11894 (free_misc, interval_free_list, float_block, float_block_index):
11895 (n_float_blocks, float_free_list, cons_block, cons_block_index):
11896 (cons_free_list, last_marked_index):
11897 Now static.
11898 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
11899 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
11900 (mark_backtrace): Define only if BYTE_MARK_STACK.
11901 * xdisp.c (message_enable_multibyte): Now static.
11902
61c2b50e 11903 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
11904 This makes it easier for human readers (and static analyzers)
11905 to see whether these variables are used from other modules.
11906 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
11907 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
11908 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
11909 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
11910 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
11911 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
11912 * xmenu.c, xselect.c:
11913 Declare Q* vars static if they are not used in other modules.
11914 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
11915 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
11916 Remove decls of unexported vars.
11917 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
11918
95c82688
PE
11919 * lisp.h (DEFINE_FUNC): Make sname 'static'.
11920
16a97296
PE
11921 Make Emacs functions such as Fatom 'static' by default.
11922 This makes it easier for human readers (and static analyzers)
11923 to see whether these functions can be called from other modules.
11924 DEFUN now defines a static function. To make the function external
11925 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
11926 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
11927 (Finit_image_library):
16a97296
PE
11928 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
11929 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
11930 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
11931 Remove decls, since these functions are now static.
11932 (Funintern, Fget_internal_run_time): New decls, since these functions
11933 were already external.
95c82688 11934
16a97296
PE
11935 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
11936 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
11937 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
11938 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
11939 * keyboard.c, keymap.c, lread.c:
11940 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
11941 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
11942 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
11943 Mark functions with DEFUE instead of DEFUN,
11944 if they are used in other modules.
11945 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
11946 decls for now-static functions.
11947 * buffer.h (Fdelete_overlay): Remove decl.
11948 * callproc.c (Fgetenv_internal): Mark as internal.
11949 * composite.c (Fremove_list_of_text_properties): Remove decl.
11950 (Fcomposition_get_gstring): New forward static decl.
11951 * composite.h (Fcomposite_get_gstring): Remove decl.
11952 * dired.c (Ffile_attributes): New forward static decl.
11953 * doc.c (Fdocumntation_property): New forward static decl.
11954 * eval.c (Ffetch_bytecode): New forward static decl.
11955 (Funintern): Remove extern decl; now in .h file where it belongs.
11956 * fileio.c (Fmake_symbolic_link): New forward static decl.
11957 * image.c (Finit_image_library): New forward static decl.
11958 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
11959 * intervals.h (Fprevious_property_change):
11960 (Fremove_list_of_text_properties): Remove decls.
11961 * keyboard.c (Fthis_command_keys): Remove decl.
11962 (Fcommand_execute): New forward static decl.
11963 * keymap.c (Flookup_key): New forward static decl.
11964 (Fcopy_keymap): Now static.
11965 * keymap.h (Flookup_key): Remove decl.
11966 * process.c (Fget_process): New forward static decl.
11967 (Fprocess_datagram_address): Mark as internal.
11968 * syntax.c (Fsyntax_table_p): New forward static decl.
11969 (skip_chars): Remove duplicate decl.
11970 * textprop.c (Fprevious_property_change): New forward static decl.
11971 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
11972 Now internal.
11973 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
11974 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
11975
785bbd42
PE
11976 * editfns.c (Fformat): Remove unreachable code.
11977
8b913b57
AS
119782011-04-14 Andreas Schwab <schwab@linux-m68k.org>
11979
11980 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
11981 change. (Bug#8496)
11982
a6744a35
EZ
119832011-04-13 Eli Zaretskii <eliz@gnu.org>
11984
11985 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
11986 when at ZV. (Bug#8487)
11987
e7974947
AS
119882011-04-12 Andreas Schwab <schwab@linux-m68k.org>
11989
baad03f0
AS
11990 * charset.c (Fclear_charset_maps): Use xfree instead of free.
11991 (Bug#8437)
11992 * keyboard.c (parse_tool_bar_item): Likewise.
11993 * sound.c (sound_cleanup, alsa_close): Likewise.
11994 * termcap.c (tgetent): Likewise.
11995 * xfns.c (x_default_font_parameter): Likewise.
11996 * xsettings.c (read_and_apply_settings): Likewise.
11997
e7974947
AS
11998 * alloc.c (overrun_check_malloc, overrun_check_realloc)
11999 (overrun_check_free): Protoize.
12000
28272684
PE
120012011-04-12 Paul Eggert <eggert@cs.ucla.edu>
12002
12003 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
12004 since callers should never pass a negative size.
12005 Change the signature to match that of plain 'read' and 'write'; see
12006 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
12007 * lisp.h: Update prototypes of emacs_write and emacs_read.
12008
11997c76
EZ
120092011-04-11 Eli Zaretskii <eliz@gnu.org>
12010
12011 * xdisp.c (redisplay_window): Don't try to determine the character
12012 position of the scroll margin if the window start point w->startp
e896f03c 12013 is outside the buffer's accessible region. (Bug#8468)
11997c76 12014
8a2cbd72
EZ
120152011-04-10 Eli Zaretskii <eliz@gnu.org>
12016
12017 Fix write-region and its subroutines for buffers > 2GB.
12018 * fileio.c (a_write, e_write): Modify declaration of arguments and
12019 local variables to support buffers larger than 2GB.
12020 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
12021
12022 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
12023 argument, local variables, and return value.
12024
12025 * lisp.h: Update prototypes of emacs_write and emacs_read.
12026
12027 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
12028
4073e537 120292011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 12030
1ebfdcb6
PE
12031 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
12032
b2ded58d
PE
12033 Fix more problems found by GCC 4.6.0's static checks.
12034
7d66342c
PE
12035 * xdisp.c (vmessage): Use a better test for character truncation.
12036
bbf47d44
PE
12037 * charset.c (load_charset_map): <, not <=, for optimization,
12038 and to avoid potential problems with integer overflow.
9248994d 12039 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 12040 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 12041 * editfns.c (Fformat): Likewise.
1e69125e 12042 * syntax.c (skip_chars): Likewise.
3befa583 12043
e3019616
PE
12044 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
12045 This also lets GCC 4.6.0 generate slightly better loop code.
12046
becfa255
PE
12047 * callint.c (Fcall_interactively): <, not <=, for optimization.
12048 (Fcall_interactively): Count the number of arguments produced,
12049 not the number of arguments given. This is simpler and lets GCC
12050 4.6.0 generate slightly better code.
12051
dae0cd48
PE
12052 * ftfont.c: Distingish more carefully between FcChar8 and char.
12053 The previous code passed unsigned char * to a functions like
12054 strlen and xstrcasecmp that expect char *, which does not
12055 conform to the C standard.
12056 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
12057 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
12058 char * when the C standard requires it.
12059
76032d70
PE
12060 * keyboard.c (read_char): Remove unused var.
12061
eb3f1cc8
PE
12062 * eval.c: Port to Windows vsnprintf (Bug#8435).
12063 Include <limits.h>.
12064 (SIZE_MAX): Define if the headers do not.
12065 (verror): Do not give up if vsnprintf returns a negative count.
12066 Instead, grow the buffer. This ports to Windows vsnprintf, which
12067 does not conform to C99. Problem reported by Eli Zaretskii.
12068 Also, simplify the allocation scheme, by avoiding the need for
12069 calling realloc, and removing the ALLOCATED variable.
12070
70476b54
PE
12071 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
12072
12020a9e
PE
12073 Remove invocations of doprnt, as Emacs now uses vsnprintf.
12074 But keep the doprint source code for now, as we might revamp it
12075 and use it again (Bug#8435).
ea6c7ae6
PE
12076 * lisp.h (doprnt): Remove.
12077 * Makefile.in (base_obj): Remove doprnt.o.
12078 * deps.mk (doprnt.o): Remove.
12079
5fdb398c
PE
12080 error: Print 32- and 64-bit integers portably (Bug#8435).
12081 Without this change, on typical 64-bit hosts error ("...%d...", N)
12082 was used to print both 32- and 64-bit integers N, which relied on
12083 undefined behavior.
61bdb816 12084 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
12085 * lisp.h (error, verror): Mark as printf-like functions.
12086 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
12087 Report overflow in size calculations when allocating printf buffer.
12088 Do not truncate output string at its first null byte.
12089 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
12090 Truncate the output at a character boundary, since vsnprintf does not
12091 do that.
12092 * charset.c (check_iso_charset_parameter): Convert internal
12093 character to string before calling 'error', since %c now has the
12094 printf meaning.
12095 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
12096 overflow when computing char to be passed to 'error'. Do not
12097 pass Lisp_Object to 'error'; pass the integer instead.
12098 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
12099 formatted with plain %d.
12100
b189fa66
PE
12101 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
12102
bff87ef0
PE
12103 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
12104
7e2cac20
PE
12105 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
12106
ce4d90b5
PE
12107 * xterm.c (x_catch_errors): Remove duplicate declaration.
12108
266c9547
PE
12109 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
12110
79c49ad2
PE
12111 * xdisp.c, lisp.h (message_nolog): Remove; unused.
12112
368f4090
JM
121132011-04-10 Jim Meyering <meyering@redhat.com>
12114
12115 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
12116 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
12117 return ssize_t not "int", and use size_t as the buffer length.
12118 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
12119 * gnutls.h: Update declarations.
12120 * process.c (read_process_output): Use ssize_t, to match.
12121 (send_process): Likewise.
12122
a32d4040
CY
121232011-04-09 Chong Yidong <cyd@stupidchicken.com>
12124
12125 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
12126
8546720e 121272011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 12128
04f2d78b
CB
12129 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
12130 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 12131
8546720e
GM
12132 * xterm.c (handle_one_xevent):
12133 * xmenu.c (create_and_show_popup_menu):
12134 * xselect.c (x_decline_selection_request)
12135 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 12136
0a2f5c1a 121372011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
12138
12139 Fix some uses of `int' instead of EMACS_INT.
12140 * search.c (string_match_1, fast_string_match)
12141 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
12142 (scan_buffer, find_next_newline_no_quit)
12143 (find_before_next_newline, search_command, Freplace_match)
12144 (Fmatch_data): Make some `int' variables be EMACS_INT.
12145
12146 * xdisp.c (display_count_lines): 3rd argument and return value now
12147 EMACS_INT. All callers changed.
12148 (pint2hrstr): Last argument is now EMACS_INT.
12149
12150 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
12151 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12152 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
12153 (decode_coding_utf_16, decode_coding_emacs_mule)
12154 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
12155 (decode_coding_ccl, decode_coding_charset)
12156 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
12157 (decode_coding_iso_2022, decode_coding_emacs_mule)
12158 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
12159 <char_offset, last_offset>: Declare EMACS_INT.
12160 (encode_coding_utf_8, encode_coding_utf_16)
12161 (encode_coding_emacs_mule, encode_invocation_designation)
12162 (encode_designation_at_bol, encode_coding_iso_2022)
12163 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
12164 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
12165 Declare EMACS_INT.
12166 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
12167 (encode_invocation_designation): Last argument P_NCHARS is now
12168 EMACS_INT.
12169 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
12170 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
12171
12172 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
12173 All users changed.
12174
12175 * ccl.c (Fccl_execute_on_string): Declare some variables
12176 EMACS_INT.
12177
8546720e 121782011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
12179
12180 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
12181
4e19a977
CS
121822011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
12183
12184 * process.c (Fformat_network_address): Doc fix.
12185
87302331
R
121862011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
12187
ee7683eb 12188 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 12189
cbb59342
CY
121902011-04-08 Chong Yidong <cyd@stupidchicken.com>
12191
12192 * keyboard.c (read_char): Call Lisp function help-form-show,
12193 instead of using internal_with_output_to_temp_buffer.
12194 (Qhelp_form_show): New var.
e0d38eeb 12195 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
12196
12197 * print.c (internal_with_output_to_temp_buffer): Function deleted.
12198
12199 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
12200
e67a13ab
CY
122012011-04-06 Chong Yidong <cyd@stupidchicken.com>
12202
04f2d78b
CB
12203 * process.c (Flist_processes): Remove to Lisp.
12204 (list_processes_1): Delete.
e67a13ab 12205
973f782d
EZ
122062011-04-06 Eli Zaretskii <eliz@gnu.org>
12207
7c106b1e
EZ
12208 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
12209
973f782d
EZ
12210 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
12211
41cf7d1a 122122011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 12213
ca23cc88
PE
12214 Fix more problems found by GCC 4.6.0's static checks.
12215
f390e2d5
PE
12216 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
12217
42eea0d0
PE
12218 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
12219
b69769da 12220 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 12221
f9541e84
PE
12222 * xdisp.c (vmessage): Mark as a printf-like function.
12223
13841b55
PE
12224 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12225
c136c10f
PE
12226 * sound.c (sound_warning): Don't crash if arg contains a printf format.
12227
5e2d4a30
PE
12228 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12229 printf-like functions.
12230 (tiff_load): Add casts to remove these marks before passing them
12231 to system-supplied API.
12232
583f48b9
PE
12233 * eval.c (Fsignal): Remove excess argument to 'fatal'.
12234
b25d760e
PE
12235 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12236 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
12237 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12238 directly, rather than having caller test rule sign. This avoids
12239 some unnecessary tests.
12240 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12241 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
12242 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 12243
bc7b6697 12244 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 12245 (xfont_open): Avoid unnecessary tests.
bc7b6697 12246
27ccc379
PE
12247 * composite.c (composition_gstring_put_cache): Use unsigned integer.
12248
dcd5c89a
PE
12249 * composite.h, composite.c (composition_gstring_put_cache):
12250 Use EMACS_INT, not int, for length.
12251
b13a45c6
PE
12252 * composite.h (COMPOSITION_DECODE_REFS): New macro,
12253 breaking out part of COMPOSITION_DECODE_RULE.
12254 (COMPOSITION_DECODE_RULE): Use it.
12255 * composite.c (get_composition_id): Remove unused local vars,
12256 by using the new macro.
12257
1e792e4d
PE
12258 * textprop.c (set_text_properties_1): Change while to do-while,
12259 since the condition is always true at first.
12260
dc6c6455 12261 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
12262 (interval_deletion_adjustment): Return unsigned value.
12263 All uses changed.
dc6c6455 12264
aba7731a
PE
12265 * process.c (list_processes_1, create_pty, read_process_output):
12266 (exec_sentinel): Remove vars that were set but not used.
afd4052b 12267 (create_pty): Remove unnecessary "volatile"s.
bc57d757 12268 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 12269 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 12270 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 12271
fdfc4bf3
PE
12272 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12273
fca8fe46 12274 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 12275 (update_syntax_table): Use unsigned instead of int.
fca8fe46 12276
06a0259a 12277 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 12278 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 12279 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 12280
e7b9e80f
PE
12281 * print.c (print_error_message): Avoid int overflow.
12282
56201685
PE
12283 * font.c (font_list_entities): Redo for clarity,
12284 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12285
78834453 12286 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 12287 (font_score): Avoid potential overflow in diff calculation.
78834453 12288
0bc0b309 12289 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12290 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12291
e610eaca
PE
12292 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12293
b895abce
PE
12294 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12295 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12296 can always succeed if overflow has undefined behavior.
12297
1f1d9321 12298 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12299 (wordify): Omit three unnecessary tests.
1f1d9321 12300
c59478bc
PE
12301 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12302 All callers changed. This avoids the need for an unused var.
12303
79b73827
PE
12304 * casefiddle.c (casify_region): Remove var that is set but not used.
12305
a4db5dfe
PE
12306 * dired.c (file_name_completion): Remove var that is set but not used.
12307
43aae36e
PE
12308 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12309
2a47c44d 12310 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12311 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12312
a37c69bf
PE
12313 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12314 Check for integer overflow on size calculations.
12315
328ab8e7
PE
12316 * buffer.c (Fprevious_overlay_change): Remove var that is set
12317 but not used.
12318
e5a2a5cb
PE
12319 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12320 Remove vars that are set but not used.
8d84a6eb 12321 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12322 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12323
a60e5f68
PE
12324 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12325
f661cb61 12326 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12327 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12328
f0397f5a
PE
12329 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12330 that are set but not used.
12331
8664db06 12332 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12333 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12334
6abdaa4a
PE
12335 * xselect.c (x_get_local_selection, x_handle_property_notify):
12336 Remove vars that are set but not used.
12337
0ce7538d 12338 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12339 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12340
9ae848fc
PE
12341 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12342 Remove var that is set but not used.
0b918413
PE
12343 (scroll_bar_windows_size): Now size_t, not int.
12344 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12345 Check for overflow.
9ae848fc 12346
a5a62657
PE
12347 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12348 (map_tty_color) [!defined MSDOS]: Likewise.
12349
5c5cdd39
PE
12350 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12351
66ebf983
PE
12352 * coding.c: Remove vars that are set but not used.
12353 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12354 All callers changed.
12355 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12356 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12357 (decode_coding_charset): Remove vars that are set but not used.
12358
1be4d761
PE
12359 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12360 that is set but not used.
12361
47553fa8
PE
12362 * print.c (print_object): Remove var that is set but not used.
12363
1f7196bf 12364 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12365 The gnulib version avoids calling malloc in the usual case,
12366 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12367 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12368 * filelock.c (current_lock_owner): Likewise.
12369 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12370 * sysdep.c: Include allocator.h, careadlinkat.h.
12371 (emacs_no_realloc_allocator): New static constant.
12372 (emacs_readlink): New function.
fdb61804
PE
12373 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12374 ../lib/careadlinkat.h.
d1fdcab7 12375
f84c17c7
SM
123762011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12377
12378 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12379 first non-nil return value).
12380
ef3862ad
JD
123812011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12382
12383 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12384 if not defined (Bug#8403).
12385
376a7006
JB
123862011-04-02 Juanma Barranquero <lekktu@gmail.com>
12387
12388 * xdisp.c (display_count_lines): Remove parameter `start',
12389 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12390 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12391 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12392 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12393 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12394 and thereabouts. All callers changed.
12395 (get_per_char_metric): Remove parameter `f', unused since
12396 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12397
6ca3801d
JM
123982011-04-02 Jim Meyering <meyering@redhat.com>
12399
12400 do not dereference NULL upon failed strdup
12401 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12402 (ns_get_family): Likewise.
12403
d8e2b5ba
JB
124042011-04-02 Juanma Barranquero <lekktu@gmail.com>
12405
12406 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12407
8c74fcbd
JD
124082011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12409
12410 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12411 later (Bug#8403).
12412
7200d79c
SM
124132011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12414
03408648 12415 Add lexical binding.
7200d79c 12416
03408648
SM
12417 * window.c (Ftemp_output_buffer_show): New fun.
12418 (Fsave_window_excursion):
12419 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12420
12421 * lread.c (lisp_file_lexically_bound_p): New function.
12422 (Fload): Bind Qlexical_binding.
12423 (readevalloop): Remove `evalfun' arg.
12424 Bind Qinternal_interpreter_environment.
12425 (Feval_buffer): Bind Qlexical_binding.
12426 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12427 Mark as dynamic.
12428 (syms_of_lread): Declare `lexical-binding'.
12429
12430 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12431
12432 * keyboard.c (eval_dyn): New fun.
12433 (menu_item_eval_property): Use it.
ca105506
SM
12434
12435 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12436
03408648
SM
12437 * fns.c (concat, mapcar1): Accept byte-code-functions.
12438
12439 * eval.c (Fsetq): Handle lexical vars.
12440 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12441 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12442 (FletX, Flet): Obey lexical binding.
12443 (Fcommandp): Handle closures.
12444 (Feval): New `lexical' arg.
12445 (eval_sub): New function extracted from Feval. Use it almost
12446 everywhere where Feval was used. Look up vars in lexical env.
12447 Handle closures.
12448 (Ffunctionp): Move from subr.el.
12449 (Ffuncall): Handle closures.
12450 (apply_lambda): Remove `eval_flags'.
12451 (funcall_lambda): Handle closures and new byte-code-functions.
12452 (Fspecial_variable_p): New function.
12453 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12454 but without exporting it to Lisp.
23aba0ea 12455
23aba0ea 12456 * doc.c (Fdocumentation, store_function_docstring):
03408648 12457 * data.c (Finteractive_form): Handle closures.
23aba0ea 12458
03408648
SM
12459 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12460 interactive spec.
ba83908c 12461
04f2d78b
CB
12462 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12463 New byte-codes.
03408648
SM
12464 (exec_byte_code): New function extracted from Fbyte_code to handle new
12465 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12466
03408648 12467 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12468
03408648 12469 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12470
e2abce01
JB
124712011-03-31 Juanma Barranquero <lekktu@gmail.com>
12472
12473 * xdisp.c (redisplay_internal): Fix prototype.
12474
63696a73 124752011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12476
63696a73 12477 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12478 (try_scrolling): Use it when setting scroll_limit.
12479 Limit scrolling to 100 screen lines.
63696a73
EZ
12480 (redisplay_window): Even when falling back on "recentering",
12481 position point in the window according to scroll-conservatively,
12482 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12483
12484 (try_scrolling): When point is above the window, allow searching
12485 as far as scroll_max, or one screenful, to compute vertical
12486 distance from PT to the scroll margin position. This prevents
12487 try_scrolling from unnecessarily failing when
12488 scroll-conservatively is set to a value slightly larger than the
12489 window height. Clean up the case of PT below the margin at bottom
12490 of window: scroll_max can no longer be INT_MAX. When aggressive
12491 scrolling is in use, don't let point enter the opposite scroll
12492 margin as result of the scroll.
12493 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12494 threshold of 100 lines for never-recentering scrolling.
12495
e4cc2dfc
JB
124962011-03-31 Juanma Barranquero <lekktu@gmail.com>
12497
12498 * dispextern.h (move_it_by_lines):
12499 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12500 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12501 (message_log_check_duplicate): Remove parameters `prev_bol' and
12502 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12503 (redisplay_internal): Remove parameter `preserve_echo_area',
12504 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12505
12506 * indent.c (Fvertical_motion):
12507 * window.c (window_scroll_pixel_based, Frecenter):
12508 Don't pass `need_y_p' to `move_it_by_lines'.
12509
1c470562
SM
125102011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12511
44f230aa
SM
12512 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12513 steal a few bits to be more compact.
12514 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12515 Remove unneeded casts.
12516
1c470562
SM
12517 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12518
888adce9
ZK
125192011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12520
12521 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12522 binding" message (bug#7967).
12523
f838ed7b
PE
125242011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12525
77861b95
PE
12526 Fix more problems found by GCC 4.6.0's static checks.
12527
de6dbc14
PE
12528 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12529 Remove unused local var.
12530
f838ed7b
PE
12531 * editfns.c (Fmessage_box): Remove unused local var.
12532
792c7b2b
PE
12533 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12534 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12535 Omit unused local vars.
c499e557 12536 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12537 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12538 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12539 Omit unused local var.
12540
ba0165e1
PE
12541 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12542 Don't assume string length fits in int.
32ad8845 12543 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12544 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12545
3c59b4c9
PE
12546 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12547 instead of alloca (Bug#8344).
12548
a3eed478 12549 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12550 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12551
eb4d412d
PE
12552 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12553
1658b401
PE
12554 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12555 concerns.
12556
12557 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12558
12559 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12560
9a2c6e05
PE
12561 * keyboard.c (syms_of_keyboard): Use the same style as later
12562 in this function when indexing through an array. This also
12563 works around GCC bug 48267.
12564
03d0a109
PE
12565 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12566
44f730c8
PE
12567 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12568
fe75f926
PE
12569 * chartab.c (sub_char_table_ref_and_range): Redo for slight
12570 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12571
ffa8c828
PE
12572 * keyboard.c, keyboard.h (num_input_events): Now size_t.
12573 This avoids undefined behavior on integer overflow, and is a bit
12574 more convenient anyway since it is compared to a size_t variable.
12575
c5101a77
PE
12576 Variadic C functions now count arguments with size_t, not int.
12577 This avoids an unnecessary limitation on 64-bit machines, which
12578 caused (substring ...) to crash on large vectors (Bug#8344).
12579 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12580 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 12581 All variadic functions and their callers changed accordingly.
c5101a77
PE
12582 (struct gcpro.nvars): Now size_t, not int. All uses changed.
12583 * data.c (arith_driver, float_arith_driver): Likewise.
12584 * editfns.c (general_insert_function): Likewise.
12585 * eval.c (struct backtrace.nargs, interactive_p)
12586 (internal_condition_case_n, run_hook_with_args, apply_lambda)
12587 (funcall_lambda, mark_backtrace): Likewise.
12588 * fns.c (concat): Likewise.
12589 * frame.c (x_set_frame_parameters): Likewise.
12590 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12591 0 if not found, not -1. All callers changed.
12592
dd3f25f7
PE
12593 * alloc.c (garbage_collect): Don't assume stack size fits in int.
12594 (stack_copy_size): Now size_t, not int.
12595 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12596
461c2ab9
JB
125972011-03-28 Juanma Barranquero <lekktu@gmail.com>
12598
12599 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12600 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12601 All callers changed.
12602
12603 * lisp.h (multibyte_char_to_unibyte):
12604 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12605 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12606 * character.h (CHAR_TO_BYTE8):
12607 * cmds.c (internal_self_insert):
12608 * editfns.c (general_insert_function):
12609 * keymap.c (push_key_description):
12610 * search.c (Freplace_match):
12611 * xdisp.c (message_dolog, set_message_1): All callers changed.
12612
f6d62986
SM
126132011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12614
12615 * keyboard.c (safe_run_hook_funcall): New function.
12616 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12617 don't set the hook to nil, but remove the offending function instead.
12618 (Qcommand_hook_internal): Remove, unused.
12619 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12620 Vcommand_hook_internal.
12621
12622 * eval.c (enum run_hooks_condition): Remove.
12623 (funcall_nil, funcall_not): New functions.
12624 (run_hook_with_args): Call each function through a `funcall' argument.
12625 Remove `cond' argument, now redundant.
12626 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12627 (Frun_hook_with_args_until_failure): Adjust accordingly.
12628 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12629
1db5b1ad
JB
126302011-03-28 Juanma Barranquero <lekktu@gmail.com>
12631
12632 * dispextern.h (string_buffer_position): Remove declaration.
12633
12634 * print.c (strout): Remove parameter `multibyte', unused since
12635 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
12636
12637 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12638 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12639 All callers changed.
12640
12641 * w32.c (_wsa_errlist): Use braces for struct initializers.
12642
12643 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12644 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12645 All callers changed.
12646 (string_buffer_position): Likewise. Also, make static (it's never
12647 used outside xdisp.c).
12648 (cursor_row_p): Remove parameter `w', unused since
12649 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
12650 (decode_mode_spec): Remove parameter `precision', introduced during
12651 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12652 All callers changed.
12653
5ffb62aa
JD
126542011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12655
12656 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12657
461c2ab9 126582011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
12659
12660 * nsterm.m (ns_menu_bar_is_hidden): New variable.
12661 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12662 (ns_update_auto_hide_menu_bar): New functions.
12663 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12664 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12665 ns_constrain_all_frames.
12666 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12667 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12668
5c380ffb
JD
126692011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12670
12671 * nsmenu.m (runDialogAt): Remove argument to timer_check.
12672
9af30bdf
GM
126732011-03-27 Glenn Morris <rgm@gnu.org>
12674
12675 * syssignal.h: Replace RETSIGTYPE with void.
12676 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12677 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12678 Replace SIGTYPE with void everywhere.
12679 * s/usg5-4-common.h (SIGTYPE): Remove definition.
12680 * s/template.h (SIGTYPE): Remove commented out definition.
12681
e2abce01
JB
126822011-03-26 Eli Zaretskii <eliz@gnu.org>
12683
12684 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12685 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12686
f868cd8a
JB
126872011-03-26 Juanma Barranquero <lekktu@gmail.com>
12688
59eb0929
JB
12689 * w32.c (read_unc_volume): Use parameter `henum', instead of
12690 global variable `wget_enum_handle'.
12691
12692 * keymap.c (describe_vector): Remove parameters `indices' and
12693 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12694 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12695
f868cd8a
JB
12696 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12697
12698 * keyboard.c (timer_check): Remove parameter `do_it_now',
12699 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12700 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12701 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12702
12703 * keyboard.c (read_char):
12704 * w32menu.c (w32_menu_display_help):
12705 * xmenu.c (show_help_event, menu_help_callback):
12706 Adjust calls to `show_help_echo'.
12707
12708 * gtkutil.c (xg_maybe_add_timer):
12709 * keyboard.c (readable_events):
12710 * process.c (wait_reading_process_output):
12711 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12712
12713 * insdel.c (adjust_markers_gap_motion):
12714 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12715 (gap_left, gap_right): Don't call it.
12716
2ecf6fdb
CY
127172011-03-25 Chong Yidong <cyd@stupidchicken.com>
12718
12719 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12720 incurred during fontification.
12721
6b1f9ba4
JB
127222011-03-25 Juanma Barranquero <lekktu@gmail.com>
12723
12724 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12725 (DEFVAR_PER_BUFFER): Don't pass it.
12726
12727 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12728 (scrolling_window): Don't pass it.
12729
0f4a96b5
JB
127302011-03-25 Juanma Barranquero <lekktu@gmail.com>
12731
12732 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12733
12734 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12735 and `suffix'.
12736 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12737 of variables specific to SELinux and computation of `encoded_absname'.
12738
12739 * image.c (XPutPixel): Remove unused variable `height'.
12740
12741 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12742
12743 * unexw32.c (get_section_info): Remove unused variable `section'.
12744
12745 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
12746 (system_process_attributes): Remove unused variable `sess'.
12747 (sys_read): Remove unused variable `err'.
12748
12749 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
12750 (w32_wnd_proc): Remove unused variable `isdead'.
12751 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12752 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12753 (x_create_tip_frame): Remove unused variable `tem'.
12754
12755 * w32inevt.c (w32_console_read_socket):
12756 Remove unused variable `no_events'.
12757
12758 * w32term.c (x_draw_composite_glyph_string_foreground):
12759 Remove unused variable `width'.
12760
1149507c
JB
127612011-03-24 Juanma Barranquero <lekktu@gmail.com>
12762
12763 * w32term.c (x_set_glyph_string_clipping):
12764 Don't pass uninitialized region to CombineRgn.
12765
9c88f339
JB
127662011-03-23 Juanma Barranquero <lekktu@gmail.com>
12767
12768 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
12769 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
12770 (Fx_close_connection): Remove unused variable `i'.
12771
12772 * w32font.c (w32font_draw): Return number of glyphs.
12773 (w32font_open_internal): Remove unused variable `i'.
12774 (w32font_driver): Add missing initializer.
12775
12776 * w32menu.c (utf8to16): Remove unused variable `utf16'.
12777 (fill_in_menu): Remove unused variable `items_added'.
12778
12779 * w32term.c (last_mouse_press_frame): Remove static global variable.
12780 (w32_clip_to_row): Remove unused variable `f'.
12781 (x_delete_terminal): Remove unused variable `i'.
12782
12783 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
12784 (NOTHING): Remove unused static global variable.
12785 (uniscribe_check_otf): Remove unused variable `table'.
12786 (uniscribe_font_driver): Add missing initializers.
12787
dee091a3
JD
127882011-03-23 Julien Danjou <julien@danjou.info>
12789
12790 * term.c (Fsuspend_tty, Fresume_tty):
12791 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
12792 * window.c (temp_output_buffer_show):
12793 * insdel.c (signal_before_change):
12794 * frame.c (Fhandle_switch_frame):
12795 * fileio.c (Fdo_auto_save):
12796 * emacs.c (Fkill_emacs):
12797 * editfns.c (save_excursion_restore):
12798 * cmds.c (internal_self_insert):
12799 * callint.c (Fcall_interactively):
12800 * buffer.c (Fkill_all_local_variables):
12801 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
12802 Use Frun_hooks.
0f4a96b5 12803 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 12804 unconditionally since it does the check itself.
dee091a3 12805
2c520ab5 128062011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 12807
c9c49752
PE
12808 Fix more problems found by GCC 4.5.2's static checks.
12809
8abc3f12
PE
12810 * coding.c (encode_coding_raw_text): Avoid unnecessary test
12811 the first time through the loop, since we know p0 < p1 then.
12812 This also avoids a gcc -Wstrict-overflow warning.
12813
a2d26660
PE
12814 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
12815 leading to a memory leak, possible in functions like
12816 load_charset_map_from_file that can allocate an unbounded number
b12ef411 12817 of objects (Bug#8318).
a2d26660 12818
916c72e9
PE
12819 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
12820 that could (at least in theory) be that large.
12821
19ab8a18
PE
12822 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
12823 This is less likely to overflow, and avoids undefined behavior if
12824 overflow does occur. All callers changed. Use strtoul to scan
12825 for the unsigned long integer.
b7cbbd6f
PE
12826 (pint2hrstr): Simplify and tune code slightly.
12827 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 12828
f0641eff
PE
12829 * scroll.c (do_scrolling): Work around GCC bug 48228.
12830 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
12831
7f650bb9
PE
12832 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
12833 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
12834 (validate_x_resource_name): Simplify count usage.
12835 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 12836
37dd57d1
PE
12837 * fileio.c (Fcopy_file): Report error if fchown or fchmod
12838 fail (Bug#8306).
81e56e61 12839
699979fc 12840 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 12841
401bf9b4
PE
12842 * process.c (Fmake_network_process): Use socklen_t, not int,
12843 where POSIX says socklen_t is required in portable programs.
12844 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 12845 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
12846 (Fmake_network_process, server_accept_connection):
12847 (wait_reading_process_output, read_process_output):
12848 Likewise.
12849
b93aacde
PE
12850 * process.c: Rename or move locals to avoid shadowing.
12851 (list_processes_1, Fmake_network_process):
12852 (read_process_output_error_handler, exec_sentinel_error_handler):
12853 Rename or move locals.
4dc343ee 12854 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 12855 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 12856 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 12857 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 12858 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 12859
af8a867c 12860 Make tparam.h and terminfo.c consistent.
44f230aa
SM
12861 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
12862 Include tparam.h instead, since it declares them.
af8a867c
PE
12863 * cm.h (PC): Remove extern decl; tparam.h now does this.
12864 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
12865 * terminfo.c: Include tparam.h, to check interfaces.
12866 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
12867 (tparam): Adjust signature to match interface in tparam.h;
12868 this removes some undefined behavior. Check that outstring and len
12869 are zero, which they always are with Emacs.
12870 * tparam.h (PC, BC, UP): New extern decls.
12871
0248044d 12872 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 12873 (xftfont_open): Rename locals to avoid shadowing.
0248044d 12874
8ff096c1 12875 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
12876 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
12877 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 12878 (ftfont_list): Remove unused local.
49eaafba
PE
12879 (get_adstyle_property, ftfont_pattern_entity):
12880 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
12881 Rename locals to avoid shadowing.
8ff096c1 12882
e2be39f6
PE
12883 * xfont.c (xfont_list_family): Mark var as initialized.
12884
c9735e30
PE
12885 * xml.c (make_dom): Now static.
12886
8f5201ae
PE
12887 * composite.c (composition_compute_stop_pos): Rename local to
12888 avoid shadowing.
b246f932
PE
12889 (composition_reseat_it): Remove unused locals.
12890 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 12891 (composition_update_it): Mark var as initialized.
11b61122
PE
12892 (find_automatic_composition): Mark vars as initialized,
12893 with a FIXME (Bug#8290).
8f5201ae 12894
760fbc2c
PE
12895 character.h: Rename locals to avoid shadowing.
12896 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
12897 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
12898 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
12899 (BUF_DEC_POS): Be more systematic about renaming local temporaries
12900 to avoid shadowing.
12901
ff08eb85
PE
12902 * textprop.c (property_change_between_p): Remove; unused.
12903
fc7bf025
PE
12904 * intervals.c (interval_start_pos): Now static.
12905
235d7abc
PE
12906 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
12907
44f230aa
SM
12908 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
12909 Rename locals to avoid shadowing.
3e7d6594 12910
50060332
PE
12911 * sound.c (wav_play, au_play, Fplay_sound_internal):
12912 Fix pointer signedness.
d01f234b 12913 (alsa_choose_format): Remove unused local var.
c83b8872
PE
12914 (wav_play): Initialize a variable to 0, to prevent undefined
12915 behavior (Bug#8278).
50060332 12916
c4fc4e30
PE
12917 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
12918
918436ed
PE
12919 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
12920
c939f91b
PE
12921 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
12922 clobbering (Bug#8298).
b9c7f648
PE
12923 * sysdep.c (sys_subshell): Likewise.
12924 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 12925
6bd8c144
PE
12926 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
12927 This should get cleaned up, so that child_setup has the
12928 same signature on all platforms.
12929
7710357c 12930 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 12931 (relocate_fd): Rename locals to avoid shadowing.
7710357c 12932
c59da222
CY
129332011-03-22 Chong Yidong <cyd@stupidchicken.com>
12934
12935 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
12936 not to be necessary, and produces flickering.
12937
66b87493
GM
129382011-03-20 Glenn Morris <rgm@gnu.org>
12939
12940 * config.in: Remove file.
12941
45b6f6d5
JB
129422011-03-20 Juanma Barranquero <lekktu@gmail.com>
12943
12944 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
12945 are now in src/globals.h.
12946 (syms_of_minibuf): Remove spurious & from previous change.
12947
cd394be1 129482011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
12949
12950 * minibuf.c (completing-read-function): New variable.
12951 (completing-read-default): Rename from completing-read.
12952 (completing-read): Call completing-read-function.
12953
b14e3e21
CY
129542011-03-19 Juanma Barranquero <lekktu@gmail.com>
12955
12956 * xfaces.c (Fx_load_color_file):
12957 Read color file from absolute filename (bug#8250).
12958
f2b726e6
JB
129592011-03-19 Juanma Barranquero <lekktu@gmail.com>
12960
12961 * makefile.w32-in: Update dependencies.
12962
09f6ff02
EZ
129632011-03-17 Eli Zaretskii <eliz@gnu.org>
12964
12965 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
12966
29a6015a
PE
129672011-03-17 Paul Eggert <eggert@cs.ucla.edu>
12968
a3a6c54e
PE
12969 Fix more problems found by GCC 4.5.2's static checks.
12970
b766f867
PE
12971 * process.c (make_serial_process_unwind, send_process_trap):
12972 (sigchld_handler): Now static.
12973
be02381c
PE
12974 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
12975 That way, the code declares only the vars that it needs.
12976 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
12977 * s/cygwin.h (PTY_ITERATION): Likewise.
12978 * s/darwin.h (PTY_ITERATION): Likewise.
12979 * s/gnu-linux.h (PTY_ITERATION): Likewise.
12980
57048744
PE
12981 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
12982 * process.c (allocate_pty): Don't declare stb unless it's needed.
12983
7914961c 12984 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
12985 (CONSTANTLIM): Remove; unused.
12986 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
12987 Define only if needed.
7914961c 12988
b3967b18
PE
12989 * unexelf.c (unexec): Name an expression,
12990 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
12991 Use a different way to cause a compilation error if anyone uses
12992 n rather than nn, a way that does not involve shadowing.
73366a00 12993 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 12994
29a6015a
PE
12995 * deps.mk (unexalpha.o): Remove; unused.
12996
43cfc33e 12997 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 12998 * unexec.h: New file.
ce701a33
PE
12999 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
13000 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
13001 Depend on unexec.h.
13002 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
13003 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
13004 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 13005 Change as necessary to match prototype in unexec.h.
ce701a33 13006
01f44d5a
PE
13007 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
13008 shadowing.
4f63c6bb 13009 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 13010
a6670b0b
PE
13011 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
13012 Rename locals to avoid shadowing.
13013
cef2010d 13014 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 13015 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 13016
d4d7173a
PE
13017 * print.c (Fredirect_debugging_output): Fix pointer signedess.
13018
f08b802a
PE
13019 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
13020 warning when compiling print.c.
13021
3ddb0639
PE
13022 * font.c (font_unparse_fcname): Abort in an "impossible" situation
13023 instead of using an uninitialized var.
5ad03b97 13024 (font_sort_entities): Mark var as initialized.
3ddb0639 13025
170a2692
PE
13026 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
13027
e663c700
PE
13028 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
13029 pointers to constants.
89bc529a 13030 (font_parse_fcname): Remove unused vars.
7b81e2d0 13031 (font_delete_unmatched): Now static.
ea838e10 13032 (font_get_spec): Remove; unused.
13a547c6
PE
13033 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
13034 (font_update_drivers, Ffont_get_glyphs, font_add_log):
13035 Rename or move locals to avoid shadowing.
e663c700 13036
2a80c887 13037 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 13038 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 13039
1384fa33 13040 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 13041 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 13042
8b2c52e9
PE
13043 * alloc.c (mark_backtrace): Move decl from here ...
13044 * lisp.h: ... to here, so that it can be checked.
13045
475545b5 13046 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 13047 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
13048 (lisp_indirect_variable): Name an expression,
13049 to avoid gcc -Wbad-function-cast warning.
1faed8ae 13050 (Fdefvar): Rename locals to avoid shadowing.
475545b5 13051
b1349114 13052 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 13053 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 13054 Use const pointer when appropriate.
b1349114 13055
a2928364
PE
13056 * lisp.h (get_system_name, get_operating_system_release):
13057 Move decls here, to check interfaces.
13058 * process.c (get_operating_system_release): Move decl to lisp.h.
13059 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
13060 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
13061 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
13062 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
13063 (Fformat_time_string, Fencode_time, Finsert_char):
13064 (Ftranslate_region_internal, Fformat):
13065 Rename or remove local vars to avoid shadowing.
9710023e 13066 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 13067
a415e694
PE
13068 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
13069 avoid shadowing.
13070
8ef4622d
PE
13071 * lisp.h (eassert): Check that the argument compiles, even if
13072 ENABLE_CHECKING is not defined.
13073
946f9a5b
PE
13074 * data.c (Findirect_variable): Name an expression, to avoid
13075 gcc -Wbad-function-cast warning.
112396d6 13076 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 13077 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
13078 (Fmake_variable_buffer_local, Fmake_local_variable):
13079 Mark variables as initialized.
52746918 13080 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 13081
e5aab7e7 13082 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
13083 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
13084 Rename locals to avoid shadowing.
dff45157
PE
13085 (mark_stack): Move local variables into the #ifdef region where
13086 they're used.
7bc26fdb
PE
13087 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
13088 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
13089 needed otherwise.
13090 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
13091 (GC_STRING_CHARS): Remove; not used.
d40d4be1 13092 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 13093
e5aab7e7
PE
13094 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
13095 avoids undefined behavior in theory.
13096
4da60324
PE
13097 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
13098
88043301
PE
13099 Use functions, not macros, for up- and down-casing (Bug#8254).
13100 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13101 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
13102 to use the following functions instead of these macros.
13103 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
13104 EMACS_INT, since callers assume the returned value fits in int.
13105 (upcase1): Likewise, for UPCASE_TABLE.
13106 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 13107 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 13108 the race-condition problem in the old DOWNCASE.
88043301 13109
19ed5445
PE
13110 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
13111 Rename locals to avoid shadowing.
13112 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
13113 (regex_compile, re_search_2, re_match_2_internal):
13114 Remove unused local vars.
952db0d7
PE
13115 (FREE_VAR): Rewrite so as not to use empty "else",
13116 which gcc can warn about.
da053e48 13117 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
13118 (RETALLOC_IF): Define only if needed.
13119 (WORDCHAR_P): Likewise. This one is never needed, but is used
13120 only in a comment talking about a compiler bug, so put inside
13121 the #if 0 of that comment.
13122 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
13123 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
13124 Remove; unused.
19ed5445 13125
1f3561e4 13126 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
13127 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
13128 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 13129
ded6f8f7
PE
13130 * search.c (simple_search): Remove unused var.
13131
dbd37a95
PE
13132 * dired.c (compile_pattern): Move decl from here ...
13133 * lisp.h: ... to here, so that it can be checked.
13134 (struct re_registers): New forward decl.
13135
7e47afad
PE
13136 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
13137
85f24f61
PE
13138 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
13139 All uses changed.
13140 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
13141 Rename locals to avoid shadowing.
5671df8f 13142 (Fvertical_motion): Mark locals as initialized.
85f24f61 13143
181aa2be 13144 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 13145 (casify_region): Mark local as initialized.
181aa2be 13146
930d429c
PE
13147 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
13148
7082eac6
PE
13149 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
13150 New macros, so that the caller can use some names other than
13151 gcpro1, gcpro2, etc.
13152 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
13153 of the new macros.
13154 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
13155 argument, for consistency with GCPRO2_VAR, etc: it is now the
13156 prefix of the variable, not the variable itself. All uses
13157 changed.
38b2c076
PE
13158 * dired.c (directory_files_internal, file_name_completion):
13159 Rename locals to avoid shadowing.
13160
15206ed9
PE
13161 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
13162 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
13163 dired.c's scmp function, had undefined behavior.
13164 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
13165 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
13166 * buffer.h: ... to here, because these macros use current_buffer,
13167 and the new implementation with inline functions needs to have
13168 current_buffer in scope now, rather than later when the macros
13169 are used.
13170 (downcase, upcase1): New static inline functions.
13171 (DOWNCASE, UPCASE1): Reimplement using these functions.
13172 This avoids undefined behavior in expressions like
13173 DOWNCASE (x) == DOWNCASE (y), which previously suffered
13174 from race conditions in accessing the global variables
13175 case_temp1 and case_temp2.
13176 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
13177 * lisp.h (case_temp1, case_temp2): Remove their decls.
13178 * character.h (ASCII_CHAR_P): Move from here ...
13179 * lisp.h: ... to here, so that the inline functions mentioned
13180 above can use them.
13181
4a6bea26
PE
13182 * dired.c (directory_files_internal_unwind): Now static.
13183
f14b7e14
PE
13184 * fileio.c (file_name_as_directory, directory_file_name):
13185 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
13186 Now static.
2893f146
PE
13187 (file_name_as_directory): Use const pointers when appropriate.
13188 (Fexpand_file_name): Likewise. In particular, newdir might
13189 point at constant storage, so make it a const pointer.
fd4ead52 13190 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
13191 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
13192 signedness issues.
f839df0c
PE
13193 (Fset_file_times, Finsert_file_contents, auto_save_error):
13194 Rename locals to avoid shadowing.
f14b7e14 13195
5716756e 13196 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
13197 (Ftry_completion, Fall_completions): Rename or remove locals
13198 to avoid shadowing.
5716756e 13199
b4c3046a
PE
13200 * marker.c (bytepos_to_charpos): Remove; unused.
13201
b45db522
PE
13202 * lisp.h (verify_bytepos, count_markers): New decls,
13203 so that gcc does not warn that these functions aren't declared.
13204
85876d07
PE
13205 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
13206 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 13207 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 13208 (copy_text): Remove unused local var.
85876d07 13209
03d78a21 13210 * filelock.c (within_one_second): Now static.
b3dd38ab 13211 (lock_file_1): Rename local to avoid shadowing.
03d78a21 13212
5df8f01b
PE
13213 * buffer.c (fix_overlays_before): Mark locals as initialized.
13214 (fix_start_end_in_overlays): Likewise. This function should be
13215 simplified by using pointers-to-pointers, but that's a different
13216 matter.
b1d876f1 13217 (switch_to_buffer_1): Now static.
8f54f30a
PE
13218 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
13219 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 13220
a70072c9 13221 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 13222 Fix pointer signedness issue.
edced198
PE
13223 (sys_subshell): Mark local as volatile if checking for lint,
13224 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 13225 (MAXPATHLEN): Define only if needed.
a70072c9 13226
a0977c44
PE
13227 * process.c (serial_open, serial_configure): Move decls from here ...
13228 * systty.h: ... to here, so that they can be checked.
13229
a884fdcc
PE
13230 * fns.c (get_random, seed_random): Move extern decls from here ...
13231 * lisp.h: ... to here, so that they can be checked.
13232
604efe86 13233 * sysdep.c (reset_io): Now static.
b8950c94 13234 (wait_for_termination_signal): Remove; unused.
604efe86 13235
38fc62d9
PE
13236 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13237 (copy_keymap_item, append_key, push_text_char_description):
13238 Now static.
1004a21a 13239 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 13240 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
13241 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13242 (describe_map_tree):
13243 Rename locals to avoid shadowing.
38fc62d9 13244
2f2650da
PE
13245 * keyboard.c: Declare functions static if they are not used elsewhere.
13246 (echo_char, echo_dash, cmd_error, top_level_2):
13247 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
13248 (read_char, kbd_buffer_get_event, make_lispy_position):
13249 (make_lispy_event, make_lispy_movement, apply_modifiers):
13250 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13251 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13252 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 13253 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 13254 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 13255
a053e86c 13256 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
13257 (mark_kboards): Move decl here ...
13258 * alloc.c (mark_kboards): ... from here.
a053e86c 13259
4752793e
PE
13260 * lisp.h (force_auto_save_soon): New decl.
13261
74f10ca7 13262 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
13263 (DEFINE_DUMMY_FUNCTION): New macro.
13264 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13265 Use it.
c03cd23f
PE
13266 (main): Add casts to avoid warnings
13267 if GCC considers string literals to be constants.
74f10ca7 13268
022e70d4
PE
13269 * lisp.h (fatal_error_signal): Add decl, since it's exported.
13270
59d6fe83
PE
13271 * dbusbind.c: Pointer signedness fixes.
13272 (xd_signature, xd_append_arg, xd_initialize):
13273 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13274 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13275 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13276 (Fdbus_register_signal): Use SSDATA when the context wants char *.
13277
78320123
PE
13278 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13279 if GCC considers string literals to be constants.
49cebcca 13280 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 13281
35ac2a97
SM
132822011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
13283
fb103ca9
SM
13284 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13285 (print_preprocess, print_object): New macro to fix last change.
13286
35ac2a97
SM
13287 * print.c (print_preprocess): Don't forget font objects.
13288
62973b41
JB
132892011-03-16 Juanma Barranquero <lekktu@gmail.com>
13290
13291 * emacs.c (USAGE3): Doc fixes.
13292
0e48bb22
AS
132932011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13294
13295 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13296 structure.
13297
7684e57b
JB
132982011-03-14 Juanma Barranquero <lekktu@gmail.com>
13299
13300 * lisp.h (VWindow_system, Qfile_name_history):
13301 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13302 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13303 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13304
13305 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13306 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13307
13308 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13309 * w32console.c (detect_input_pending, read_input_pending)
13310 (encode_terminal_code):
13311 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13312 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13313 (w32_system_caret_y, Qfile_name_history):
13314 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13315 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13316 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13317 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13318 * w32proc.c (Qlocal, report_file_error):
13319 * w32term.c (Vwindow_system, updating_frame):
13320 * w32uniscribe.c (initialized, uniscribe_font_driver):
13321 Remove unneeded extern declarations.
13322
2aa46d6c
CY
133232011-03-14 Chong Yidong <cyd@stupidchicken.com>
13324
c96bbc66 13325 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13326
cffc6f3b
CY
133272011-03-13 Chong Yidong <cyd@stupidchicken.com>
13328
13329 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13330 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13331 These macros can no longer be used for assignment.
13332
44f230aa
SM
13333 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13334 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13335 (record_buffer_markers, fetch_buffer_markers): New functions for
13336 recording and fetching special buffer markers.
13337 (set_buffer_internal_1, set_buffer_temp): Use them.
13338
13339 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13340
13341 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13342
13343 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13344 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13345
13346 * xdisp.c (hscroll_window_tree):
13347 (reconsider_clip_changes): Use PT instead of BUF_PT.
13348
d251f04b
EZ
133492011-03-13 Eli Zaretskii <eliz@gnu.org>
13350
13351 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13352 $(EMACS_ROOT)/lib/intprops.h.
13353
f0c77cd1
PE
133542011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13355
3eca4629
PE
13356 Fix more problems found by GCC 4.5.2's static checks.
13357
7c86ee98
PE
13358 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13359 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13360 (xg_free_frame_widgets): Make it clear that a local variable is
13361 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13362 (gdk_window_get_screen): Make it clear that this macro is needed
13363 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13364 (int_gtk_range_get_value): New function, which avoids a diagnostic
13365 from gcc -Wbad-function-cast.
13366 (xg_set_toolkit_scroll_bar_thumb): Use it.
13367 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13368 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13369 (get_utf8_string, xg_get_file_with_chooser):
13370 Rename locals to avoid shadowing.
13371 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13372
41729b81
PE
13373 * xgselect.c (xg_select): Remove unused var.
13374
f0c77cd1
PE
13375 * image.c (four_corners_best): Mark locals as initialized.
13376 (gif_load): Initialize transparent_p to zero (Bug#8238).
13377 Mark another local as initialized.
ec6cf4c6 13378 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13379
ce0ad53d 13380 * image.c (clear_image_cache): Now static.
d5d5a617 13381 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13382 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13383 (x_edge_detection): Remove unnecessary cast that
13384 gcc -Wbad-function-cast diagnoses.
2037898d 13385 (gif_load): Fix pointer signedness.
6ae141d6
PE
13386 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13387 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13388
33383987 133892011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13390
d32df629
PE
13391 Improve quality of tests for time stamp overflow.
13392 For example, without this patch (encode-time 0 0 0 1 1
13393 1152921504606846976) returns the obviously-bogus value (-948597
13394 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13395 reports time overflow. See
13396 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13397 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13398 * editfns.c: Include limits.h and intprops.h.
13399 (TIME_T_MIN, TIME_T_MAX): New macros.
13400 (time_overflow): Move earlier, to before first use.
13401 (hi_time, lo_time): New functions, for an accurate test for
13402 out-of-range times.
13403 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13404 (Fget_internal_run_time): Don't assume time_t fits in int.
13405 (make_time): Use list2 instead of Fcons twice.
13406 (Fdecode_time): More accurate test for out-of-range times.
13407 (check_tm_member): New function.
13408 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13409 (lisp_time_argument): Don't rely on undefined left-shift and
13410 right-shift behavior when checking for time stamp overflow.
8be6f318 13411
fe31d94c
PE
13412 * editfns.c (time_overflow): New function, refactoring common code.
13413 (Fformat_time_string, Fdecode_time, Fencode_time):
13414 (Fcurrent_time_string): Use it.
13415
8be6f318
PE
13416 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13417 * dired.c (make_time): Move to ...
13418 * editfns.c (make_time): ... here.
13419 * systime.h: Note the move.
13420
09d9db2c 134212011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13422
126bc0dc
YM
13423 * fringe.c (update_window_fringes): Remove unused variables.
13424
c47cbdfd
YM
13425 * unexmacosx.c (copy_data_segment): Also copy __got section.
13426 (Bug#8223)
13427
7ac80be9
EZ
134282011-03-12 Eli Zaretskii <eliz@gnu.org>
13429
c96bbc66 13430 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13431 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13432 Constify `char *' arguments and their references according to
13433 prototypes in tparam.h.
13434
ecb0f94d 13435 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13436
7ac80be9
EZ
13437 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13438 Adapt all references accordingly.
13439
13440 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13441
ef1fd07e
TT
134422011-03-11 Tom Tromey <tromey@redhat.com>
13443
13444 * buffer.c (syms_of_buffer): Remove obsolete comment.
13445
7ef4b50c
EZ
134462011-03-11 Eli Zaretskii <eliz@gnu.org>
13447
13448 * termhooks.h (encode_terminal_code): Declare prototype.
13449
13450 * msdos.c (encode_terminal_code): Don't declare prototype.
13451
13452 * term.c (encode_terminal_code): Now external again, used by
13453 w32console.c and msdos.c.
13454
44f230aa
SM
13455 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13456 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13457
4b1ec863 134582011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13459
1714f52b 13460 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13461
4b1ec863
PE
13462 * fringe.c (update_window_fringes): Mark locals as initialized
13463 (Bug#8227).
13464 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13465
524c7aa6
PE
13466 * alloc.c (mark_fringe_data): Move decl from here ...
13467 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13468 to check its interface.
13469 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13470
a5c0af81 13471 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13472 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13473 (fontset_font): Mark local as initialized.
a9a06e0b 13474 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13475
b4716021
PE
13476 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13477
811e9bac 13478 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13479 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13480 (x_own_selection, Fx_disown_selection_internal): Rename locals
13481 to avoid shadowing.
13482 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13483
7e3ab302
PE
13484 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13485 so that the caller can use some name other than gcpro1.
13486 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13487 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13488 (Fx_backspace_delete_keys_p):
13489 Use them to avoid shadowing, and rename vars to avoid shadowing.
13490 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13491 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13492 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13493 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13494 Remove unused locals.
7e3ab302
PE
13495 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13496 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13497 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13498 macros.
f78faa98 13499
e2b13473
PE
13500 * xterm.h (x_mouse_leave): New decl.
13501
77f23912
PE
13502 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13503 Remove unused functions.
cdf4ba58
PE
13504 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13505 (x_calc_absolute_position): Now static.
7411c686 13506 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13507 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13508 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13509 unless they are used.
38d0b34a
PE
13510 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13511 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13512 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13513 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13514 (x_error_catcher, x_connection_closed, x_error_handler):
13515 (x_error_quitter, xembed_send_message, x_iconify_frame):
13516 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13517 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13518 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13519
44f230aa
SM
13520 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13521 Rename or move locals to avoid shadowing.
6b463e58 13522 (tty_defined_color, merge_face_heights): Now static.
5967d051 13523 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13524 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13525 does not deduce is never used uninitialized.
73719eba
PE
13526 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13527 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13528
426994c3 13529 * terminal.c (store_terminal_param): Now static.
5489860b 13530
032f1620 13531 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13532 (set_frame_menubar): Remove unused local.
d4323972 13533 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13534 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13535 since they might point to immutable storage.
281585b0
PE
13536 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13537 since it's unused otherwise.
032f1620 13538
367c19e5 13539 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13540 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13541 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13542 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13543 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13544 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13545 does not deduce are never used uninitialized.
70739cbe 13546
07b48fa9
PE
13547 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13548
8868a238 13549 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13550 * window.c (window_loop, size_window):
13551 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13552
7e5cf297 13553 * window.c (display_buffer): Now static.
d6550a9f
PE
13554 (size_window): Mark variables that gcc -Wuninitialized
13555 does not deduce are never used uninitialized.
a586633d
PE
13556 * window.h (check_all_windows): New decl, to forestall
13557 gcc -Wmissing-prototypes diagnostic.
5b555da1 13558 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13559
f6095868
PE
13560 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13561 shadowing.
13562 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13563 Include <limits.h>.
13564 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13565 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13566 (load_charset_map): Mark variables that gcc -Wuninitialized
13567 does not deduce are never used uninitialized.
53df7c11 13568 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13569
f38b440c
PE
13570 * coding.c (coding_set_source, coding_set_destination):
13571 Use "else { /* comment */ }" rather than "else /* comment */;"
13572 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
13573 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13574 a block, when the outer 'i' will do.
13575 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13576 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13577 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13578 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13579 (Fdecode_sjis_char, Fdefine_coding_system_internal):
13580 Rename locals to avoid shadowing.
13581 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
13582 * coding.c (emacs_mule_char, encode_invocation_designation):
13583 Now static, since they're not used elsewhere.
413bb2db 13584 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 13585 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
13586 (decode_coding_emacs_mule): Mark variables that gcc
13587 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
13588 (detect_coding_iso_2022): Initialize a local variable that might
13589 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 13590 this initialization is needed. (Bug#8211)
5f58e762
PE
13591 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13592 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13593 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13594 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13595 Remove unused macros.
f38b440c 13596
232b38b9 13597 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 13598 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 13599 * character.c (string_count_byte8): Likewise.
232b38b9 13600
fb90da1b
PE
13601 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13602 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13603
fb93dbc2
PE
13604 * chartab.c (copy_sub_char_table): Now static, since it's not used
13605 elsewhere.
5c156ace
PE
13606 (sub_char_table_ref_and_range, char_table_ref_and_range):
13607 Rename locals to avoid shadowing.
bbcd0949 13608 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 13609
7d3b3862 13610 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 13611 (BIDI_BOB): Remove unused macro.
7d3b3862 13612
6be7d3da
PE
13613 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13614 deduce are never used uninitialized.
c2ed9c8b 13615 * term.c (encode_terminal_code): Likewise.
6be7d3da 13616
75f8807f 13617 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 13618
50938595
PE
13619 * tparam.h: New file.
13620 * term.c, tparam.h: Include it.
13621 * deps.mk (term.o, tparam.o): Depend on tparam.h.
13622 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13623 Move these decls to tparam.h, and make them agree with what
13624 is actually in tparam.c. The previous trick of using incompatible
13625 decls in different modules does not conform to the C standard.
13626 All callers of tparam changed to use tparam's actual API.
13627 * tparam.c (tparam1, tparam, tgoto):
13628 Use const pointers where appropriate.
13629
fbceeba2
PE
13630 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13631 * cm.h (struct cm): Likewise.
13632 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13633 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13634 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13635 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13636 (turn_on_face, init_tty): Likewise.
13637 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 13638
7f3f1250
PE
13639 * term.c (term_mouse_position): Rename local to avoid shadowing.
13640
e6ca6543
PE
13641 * alloc.c (mark_ttys): Move decl from here ...
13642 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13643
c40f8d15
AS
136442011-03-11 Andreas Schwab <schwab@linux-m68k.org>
13645
13646 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13647
cfe0661d
JB
136482011-03-09 Juanma Barranquero <lekktu@gmail.com>
13649
13650 * search.c (compile_pattern_1): Remove argument regp, unused since
13651 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13652 (compile_pattern): Don't pass it.
13653
0afb4571
J
136542011-03-08 Jan Djärv <jan.h.d@swipnet.se>
13655
13656 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13657 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13658 for ! HAVE_GTK3.
13659 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13660
13661 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13662
13663 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
13664 gdk_window_get_screen, gdk_window_get_geometry,
13665 gdk_x11_window_lookup_for_display and GDK_KEY_g.
13666 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13667 (xg_get_pixbuf_from_pixmap): New function.
13668 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13669 to Pixmap, take frame as parameter, remove GdkColormap parameter.
13670 Call xg_get_pixbuf_from_pixmap instead of
13671 gdk_pixbuf_get_from_drawable.
13672 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13673 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13674 (xg_check_special_colors): Use GtkStyleContext and its functions
13675 for HAVE_GTK3.
13676 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13677 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13678 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
13679 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13680 Call gtk_widget_get_preferred_size.
0afb4571
J
13681 (xg_frame_resized): gdk_window_get_geometry only takes 5
13682 parameters.
44f230aa
SM
13683 (xg_win_to_widget, xg_event_is_for_menubar):
13684 Call gdk_x11_window_lookup_for_display.
0afb4571
J
13685 (xg_set_widget_bg): New function.
13686 (delete_cb): New function.
895009e1 13687 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 13688 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
13689 (xg_set_background_color): Call xg_set_widget_bg.
13690 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13691 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13692 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13693 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13694 if ! HAVE_GTK3.
13695 (update_frame_tool_bar): Call gtk_widget_hide.
13696 (xg_initialize): Use GDK_KEY_g.
13697
13698 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13699 if ! HAVE_GTK3
13700 (x_session_initialize): Call gdk_x11_set_sm_client_id.
13701
13702 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13703 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13704 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13705
1c2cc4ef
JB
137062011-03-08 Juanma Barranquero <lekktu@gmail.com>
13707
13708 * w32xfns.c (select_palette): Check success of RealizePalette against
13709 GDI_ERROR, not zero.
13710
33383987 13711See ChangeLog.11 for earlier changes.
aac0c6e3
MR
13712
13713;; Local Variables:
13714;; coding: utf-8
aac0c6e3
MR
13715;; End:
13716
2f097256 13717 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
13718
13719 This file is part of GNU Emacs.
13720
13721 GNU Emacs is free software: you can redistribute it and/or modify
13722 it under the terms of the GNU General Public License as published by
13723 the Free Software Foundation, either version 3 of the License, or
13724 (at your option) any later version.
13725
13726 GNU Emacs is distributed in the hope that it will be useful,
13727 but WITHOUT ANY WARRANTY; without even the implied warranty of
13728 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13729 GNU General Public License for more details.
13730
13731 You should have received a copy of the GNU General Public License
13732 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.