Avoid call to strlen in fast_c_string_match_ignore_case.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
d923b542
DA
12012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Avoid call to strlen in fast_c_string_match_ignore_case.
4 * search.c (fast_c_string_match_ignore_case): Change to use
5 length argument. Adjust users accordingly.
6 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
7
5ebbef1d
PE
82012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9
57054ddd
PE
10 Assume rename.
11 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
12
b747d3f7
PE
13 Assume perror.
14 * s/hpux10-20.h (HAVE_PERROR): Remove.
15 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
16 Remove dummy definition, as this problem was obsolete long ago.
17
5ebbef1d
PE
18 Assume strerror.
19 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
20
984e7f30
DA
212012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
22
23 Avoid calls to strlen in font processing functions.
24 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
d923b542 25 (font_open_by_name): Change to use length argument. Adjust
984e7f30 26 users accordingly.
d923b542
DA
27 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
28 Adjust prototypes.
29 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
30 Change to return ptrdiff_t.
984e7f30
DA
31 (xfont_list_pattern, xfont_match): Use length returned by
32 xfont_decode_coding_xlfd.
33 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
34
20e94fdd
GM
352012-07-11 Glenn Morris <rgm@gnu.org>
36
9d596af3
GM
37 * s/darwin.h, s/freebsd.h, s/netbsd.h:
38 Move DONT_REOPEN_PTY to configure.
39
20e94fdd
GM
40 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
41 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
42
e99a530f
PE
432012-07-10 Paul Eggert <eggert@cs.ucla.edu>
44
22ffb973
PE
45 Remove "#define unix" that is no longer needed (Bug#11905).
46 * s/aix4-2.h (unix): Remove; no longer needed.
47
e9a9ae03
PE
48 EMACS_TIME simplification (Bug#11875).
49 This replaces macros (which typically do not work in GDB)
50 with functions, typedefs and enums, making the code easier to debug.
51 The functional style also makes code easier to read and maintain.
52 * systime.h: Include <sys/time.h> on all hosts, not just if
53 WINDOWSNT, since 'struct timeval' is needed in general.
54 (EMACS_TIME): Now a typedef, not a macro.
55 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
56 not macros.
57 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
58 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
59 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
60 (EMACS_TIME_LE): Now functions, not macros.
61 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
62 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
63 which are not functions. All uses rewritten to use:
64 (make_emacs_time): New function.
65 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
66 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
67 not functions. All uses rewritten to use the following, respectively:
68 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
69 (add_emacs_time, sub_emacs_time): New functions.
70 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
71 * fileio.c (Fcopy_file):
72 * xterm.c (XTflash): Get the current time closer to when it's used.
73 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
74
ffacb126
PE
75 * bytecode.c (targets): Suppress -Woverride-init warnings.
76
e99a530f
PE
77 Simplify by avoiding confusing use of strncpy etc.
78 * doc.c (Fsnarf_documentation):
79 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
80 * frame.c (Fmake_terminal_frame):
81 * gtkutil.c (get_utf8_string):
82 * lread.c (openp):
83 * nsmenu.m (ns_update_menubar):
84 * regex.c (regerror):
85 Prefer memcpy to strncpy and strncat when either will do.
86 * fileio.c (Fsubstitute_in_file_name):
87 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
88 (menu_separator_name_p):
89 * nsmenu.m (ns_update_menubar):
90 Prefer memcmp to strncmp when either will do.
91 * nsterm.m: Include <ftoastr.h>.
92 (ns_get_color):
93 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
94 Prefer snprintf to strncpy.
95 * nsterm.m (ns_term_init):
96 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
97 * nsterm.m (ns_term_init):
98 Avoid the need for strncpy, by using build_string or
99 make_unibyte_string directly. Use dtoastr, not snprintf.
100 * process.c (Fmake_network_process): Diagnose service names that
101 are too long, rather than silently truncating them or creating
102 non-null-terminated names.
103 (Fnetwork_interface_info): Likewise, for interface names.
104 * sysdep.c (system_process_attributes) [GNU_LINUX]:
105 Prefer sprintf to strncat.
106 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
107 Prefer vsnprintf to vsprintf + strncpy.
108
c59592b3
GM
1092012-07-10 Glenn Morris <rgm@gnu.org>
110
111 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
112 Clarify fallback case.
113
7d7bbefd
DA
1142012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
115
116 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
117 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
118 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 119 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
120 where argument type is known to be a Lisp_Cons.
121
3a4c8000
TT
1222012-07-10 Tom Tromey <tromey@redhat.com>
123
124 * bytecode.c (BYTE_CODE_THREADED): New macro.
125 (BYTE_CODES): New macro. Replaces all old byte-code defines.
126 (enum byte_code_op): New type.
127 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
128 (exec_byte_code): Use them. Use token threading when applicable.
129
2a0213a6
DA
1302012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
131
132 Optimize pure C strings initialization.
133 * lisp.h (make_pure_string): Fix prototype.
134 (build_pure_c_string): New function, defined as static inline. This
135 provides a better opportunity to optimize away calls to strlen when
136 the function is called with compile-time constant argument.
137 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
138 argument, adjust users accordingly. Use build_pure_c_string where
139 appropriate.
140 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
141 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
142 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
143
cb1caeaf
DA
1442012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
145
146 Avoid calls to strlen in miscellaneous functions.
147 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
148 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
149 * lread.c (openp): Likewise.
150
c293e30c
DA
1512012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
152
153 Avoid calls to strlen in path processing functions.
154 * fileio.c (file_name_as_directory): Add comment. Change to add
155 srclen argument and return the length of result. Adjust users
156 accordingly.
157 (directory_file_name): Fix comment. Change to add srclen argument,
cb1caeaf 158 swap 1st and 2nd arguments to obey the common convention. Adjust
c293e30c
DA
159 users accordingly.
160 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
161
9e059e3f
GM
1622012-07-10 Glenn Morris <rgm@gnu.org>
163
d02eb359
GM
164 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
165 Move PENDING_OUTPUT_COUNT definition to configure.
166
882cf227
GM
167 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
168 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
169 * s/gnu.h (DATA_START): Move definitions to configure.
170
af6e839f
GM
171 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
172 We include usg5-4-common.h, which defines them both.
173
40289a12
GM
174 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
175 O_RDONLY already includes it).
176
9e059e3f
GM
177 Stop ns builds setting the EMACSLOADPATH environment variable.
178 * nsterm.m (ns_load_path): Rename from ns_init_paths.
179 Now it does not set EMACSLOADPATH, just returns the load-path string.
180 * nsterm.h: Update accordingly.
181 * lread.c [HAVE_NS]: Include nsterm.h.
182 (init_lread) [HAVE_NS]: Use ns_load_path.
183 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
184
7c4e8ec0
GM
1852012-07-09 Glenn Morris <rgm@gnu.org>
186
d4f600ff
GM
187 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
188 since the included bsd-common.h does so.
189
cbb31951
GM
190 Stop ns builds setting the EMACSPATH environment variable.
191 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
192 (ns_init_paths): Do not set EMACSPATH.
193 * nsterm.h (ns_exec_path): Add it.
194 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
195 Use ns_exec_path.
196
7c4e8ec0
GM
197 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
198
26bccfae
PE
1992012-07-09 Paul Eggert <eggert@cs.ucla.edu>
200
a0bee46f
PE
201 * process.c (wait_reading_process_output): 'waitchannels' was unset
202 when read_kbd || !NILP (wait_for_cell); fix this.
203
5994c183
PE
204 Add GCC-style 'const' attribute to functions that can use it.
205 * character.h (char_resolve_modifier_mask):
206 * keyboard.h (make_ctrl_char):
207 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
208 (init_character_once, next_almost_prime, init_fns, init_image)
209 (flush_pending_output, init_sound):
210 * mem-limits.h (start_of_data):
211 * menu.h (finish_menu_items):
212 Add ATTRIBUTE_CONST.
213 * emacs.c (DEFINE_DUMMY_FUNCTION):
214 Declare the dummy function with ATTRIBUTE_CONST.
215 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
216 Add decls with ATTRIBUTE_CONST.
217
26bccfae
PE
218 Minor improvements to make_formatted_string.
219 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
220 where int is good enough, as vsprintf returns an int.
221 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
222
a8290ec3
DA
2232012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
224
225 Use make_formatted_string to avoid double length calculation.
226 * lisp.h (make_formatted_string): New prototype.
227 * alloc.c (make_formatted_string): New function.
228 * buffer.c (Fgenerate_new_buffer_name): Use it.
229 * dbus.c (syms_of_dbusbind): Likewise.
230 * editfns.c (Fcurrent_time_zone): Likewise.
231 * filelock.c (get_boot_time): Likewise.
232 * frame.c (make_terminal_frame, set_term_frame_name)
233 (x_report_frame_params): Likewise.
234 * image.c (gs_load): Likewise.
235 * minibuf.c (get_minibuffer): Likewise.
236 * msdos.c (dos_set_window_size): Likewise.
237 * process.c (make_process): Likewise.
238 * xdisp.c (ensure_echo_area_buffers): Likewise.
239 * xsettings.c (apply_xft_settings): Likewise.
240
d01ba2f1
GM
2412012-07-09 Glenn Morris <rgm@gnu.org>
242
243 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
244 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
245 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
246 * nsterm.h (ns_etc_directory): Add it.
247 * callproc.c [HAVE_NS]: Include nsterm.h.
248 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
249
f1f924b6
DA
2502012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
251
252 Move marker debugging code under MARKER_DEBUG.
253 * marker.c (MARKER_DEBUG): Move marker debugging code under
254 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
255 for bootstrap with --enable-checking (~3x slowdown reported
256 by Juanma Barranquero <lekktu@gmail.com>).
257 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
258
ab531b66
PE
2592012-07-08 Paul Eggert <eggert@cs.ucla.edu>
260
261 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
262 See <http://bugs.gnu.org/11825#29>.
263
c4b3bc8a
EZ
2642012-07-08 Eli Zaretskii <eliz@gnu.org>
265
266 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
267 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
268 (display_line): Add commentary about displaying truncation glyphs
269 on GUI frames.
270 (produce_special_glyphs): Move here from term.c.
271
272 * term.c (produce_special_glyphs): Move to xdisp.c.
273
274 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
275 section.
c4b3bc8a 276
b676b881
AS
2772012-07-07 Andreas Schwab <schwab@linux-m68k.org>
278
f17c5273
AS
279 * xdisp.c (display_line): Avoid warning about implicit declaration
280 of FRAME_FONT.
281
298819b9
AS
282 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
283
b676b881
AS
284 * lisp.h: Remove empty conditional.
285
6045c4fd
PE
2862012-07-07 Paul Eggert <eggert@cs.ucla.edu>
287
b3350bf9
PE
288 * lread.c (load_path_check): Now static.
289
6045c4fd
PE
290 Fix some minor --with-ns problems found by static checking.
291 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
292 (x_set_font) [!HAVE_X_WINDOWS]:
293 * image.c (xpm_load_image) [HAVE_NS]:
294 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
295 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
296 Remove unused local.
297 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
298 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
299 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
300 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
301 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
302 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
303 Fix pointer signedness problem.
304 * xfaces.c (FRAME_X_FONT_TABLE):
305 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
306
929e7845
GM
3072012-07-07 Glenn Morris <rgm@gnu.org>
308
309 * lread.c (load_path_check): New function, split from init_lread.
310 (init_lread): Reorganize. Motivation:
311 If EMACSLOADPATH is set, check/warn about that rather than the
312 defaults, which we are not going to use. Hence we can remove
313 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
314 Don't warn if site-lisp directories are missing.
315 If not installed, start from a blank load-path, since
316 PATH_LOADSEARCH refers to the eventual installation directories.
317
58dd0aa4
EZ
3182012-07-07 Eli Zaretskii <eliz@gnu.org>
319
320 Support truncation and continuation glyphs on GUI frames, when
321 fringes are disabled. (Bug#11832)
322 * xdisp.c (init_iterator): Get dimensions of truncation and
323 continuation glyphs even if on GUI frames. Adjust
324 it->last_visible_x on GUI frames when the left or right fringes,
325 or both, are absent.
326 (start_display, move_it_in_display_line_to): Handle the case of a
327 GUI frame without a fringe to display continuation or truncation
328 glyphs.
329 (insert_left_trunc_glyphs): Support GUI frames: make sure
330 truncation glyphs overwrite enough glyphs from the current line to
331 have sufficient space in pixels.
332 (display_line): Support truncation and continuation glyphs on GUI
333 frames. If some spare pixels are left on the line after inserting
334 the truncation glyphs, fill that space with a stretch glyph of a
335 suitably computed width.
336
337 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
338 produce_glyphs, to support GUI sessions.
339
31571fd7
PE
3402012-07-07 Paul Eggert <eggert@cs.ucla.edu>
341
5a16b9bc
PE
342 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
343
f3047c75
PE
344 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
345
31571fd7
PE
346 Do not require float-time's arg to fit in time_t (Bug#11825).
347 This works better on hosts where time_t is unsigned, and where
348 float-time is applied to the (negative) difference between two times.
349 * editfns.c (decode_time_components): Last arg is now double *,
350 not int *, and means to store all the result as a double, without
351 worrying about whether the seconds part fits in time_t.
352 All callers changed.
353 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
354 All callers changed.
355 (Ffloat_time): Do not fail merely because the specified time falls
356 outside of time_t range.
357
4516fbef
GM
3582012-07-07 Glenn Morris <rgm@gnu.org>
359
360 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
361 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
362 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
363
07adc2c6
JB
3642012-07-07 Juanma Barranquero <lekktu@gmail.com>
365
366 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
367 Update dependencies.
368
369 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
370
fd573f31
PE
3712012-07-06 Paul Eggert <eggert@cs.ucla.edu>
372
fee5959d
PE
373 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
374 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
375 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
376 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
377 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
378 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
379
fd573f31
PE
380 * xfont.c (compare_font_names): Redo to omit the need for casts.
381
ddadbc0e
AS
3822012-07-06 Andreas Schwab <schwab@linux-m68k.org>
383
fca8d6b6
AS
384 * xfns.c (Fx_change_window_property): Doc fix.
385 * w32fns.c (Fx_change_window_property): Doc fix.
386
ddadbc0e
AS
387 * w32fns.c (Fx_window_property): Accept the same arguments as the
388 X Windows version. Doc fix.
389 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
390
f247498e
JB
3912012-07-06 Juanma Barranquero <lekktu@gmail.com>
392 Eli Zaretskii <eliz@gnu.org>
393
394 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
395 Windows-specific code from nt/config.nt moved here.
396 Obsolete settings removed.
397
216ee680
PE
3982012-07-06 Paul Eggert <eggert@cs.ucla.edu>
399
400 * process.c: Avoid unnecessary calls to gettime.
401 (wait_reading_process_output): Don't get the time of day
402 when gobbling data immediately and not waiting, as there's no need
403 for it in that case. This removes a FIXME.
404
bdd091e4
JD
4052012-07-06 Jan Djärv <jan.h.d@swipnet.se>
406
407 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
408 is defined (Bug#11768).
409
9d44f8ce
DA
4102012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
411
412 Fix marker debugging code.
413 * marker.c (byte_char_debug_check): Do not perform the check
414 if buffer is not multibyte.
090bd7cb
JB
415 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
416 Call byte_char_debug_check with correct arguments.
9d44f8ce 417
90fc4786
DA
4182012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
419
420 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
421 * marker.c (byte_char_debug_check, count_markers):
422 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
423 (byte_debug_flag): Remove.
424 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
425 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
426
7b7ae965
DA
4272012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
428
4e57b342
DA
429 Avoid code repetition in marker-related functions.
430 * marker.c (attach_marker): New function.
431 (Fset_marker, set_marker_restricted, set_marker_both)
432 (set_marker_restricted_both): Use it.
433 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
434 Consistently rename charno to charpos.
435 (marker_position): Add eassert.
436 (marker_byte_position): Convert to eassert.
437
4382012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
439
440 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 441 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 442 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 443
657924ff
DA
4442012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
445
446 Introduce fast path for the widely used marker operation.
447 * alloc.c (build_marker): New function.
448 * lisp.h (build_marker): New prototype.
449 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
450 * composite.c (autocmp_chars): Likewise.
451 * editfns.c (buildmark): Remove.
452 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
453 (save_restriction_save): Use build_marker.
454 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
455 * window.c (save_window_save): Likewise.
456
041a49a6
DA
4572012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
458
459 Do not use Fdelete_overlay in delete_all_overlays
460 to avoid redundant calls to unchain_overlay.
461 * buffer.c (drop_overlay): New function.
462 (delete_all_overlays, Fdelete_overlay): Use it.
463 * minibuf.c (get_minibuffer): Fix comment.
464
7dca65a4
PE
4652012-07-06 Paul Eggert <eggert@cs.ucla.edu>
466
467 Port to OpenBSD 5.1 amd64.
468 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
469 This is needed for OpenBSD, and should be harmless on all BSD systems.
470 Also, include <sys/sysctl.h>, as it should be available on all
471 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
472 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
473 use p_pid member, not kp_proc.pid.
474
8eb876e2
GM
4752012-07-06 Glenn Morris <rgm@gnu.org>
476
477 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
478
38182d90
PE
4792012-07-05 Paul Eggert <eggert@cs.ucla.edu>
480
481 More xmalloc and related cleanup.
482 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
483 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
484 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
485 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
486 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
487 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
488 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
489 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
490 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
491 * xterm.c:
492 Omit needless casts involving void * pointers and allocation.
493 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
494 as the former is more robust if P's type is changed.
495 Prefer xzalloc to xmalloc + memset 0.
496 Simplify malloc-or-realloc to realloc.
497 Don't worry about xmalloc returning a null pointer.
498 Prefer xstrdup to xmalloc + strcpy.
499 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
500 growing it.
501 * keyboard.c (apply_modifiers_uncached): Prefer local array to
502 alloca of a constant.
503
6dd5a677
EZ
5042012-07-05 Eli Zaretskii <eliz@gnu.org>
505
506 * xdisp.c (display_line): Fix horizontal pixel coordinates when
507 hscroll is larger than the line width. Fixes long and futile
508 looping inside extend_face_to_end_of_line (on a TTY) producing
509 glyphs that are not needed and thrown away.
510
6b312f0f
DA
5112012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
512
513 * marker.c (set_marker_restricted_both): Simplify by using
514 clip_to_bounds.
515
f520ef9b
PE
5162012-07-05 Paul Eggert <eggert@cs.ucla.edu>
517
518 * editfns.c (region_limit): Simplify by using clip_to_bounds.
519
383b7c95
JD
5202012-07-05 Jan Djärv <jan.h.d@swipnet.se>
521
522 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
523 not defined (Bug#11768).
524 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
525 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
526 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
527 followed by gtk_box_set_homogeneous (Bug#11768).
528 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
529 (update_theme_scrollbar_width, xg_create_scroll_bar):
530 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
531 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
532 (is_box_type): New function (Bug#11768).
533 (xg_tool_item_stale_p): Call is_box_type.
5293d758 534 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
535 with default display (Bug#11768).
536
d6e7bf45
EZ
5372012-07-05 Eli Zaretskii <eliz@gnu.org>
538
539 * xdisp.c (window_hscroll_limited): New function.
540 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
541 coordinates when window's hscroll is set to insanely large
542 values. (Bug#11857)
543
431391ec
JB
5442012-07-05 Juanma Barranquero <lekktu@gmail.com>
545
546 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
547 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
548
23f86fce
DA
5492012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
550
551 Cleanup xmalloc.
552 * lisp.h (xzalloc): New prototype. Omit needless casts.
553 * alloc.c (xzalloc): New function. Omit needless casts.
554 * charset.c: Omit needless casts. Convert all calls to
555 xmalloc with following memset to xzalloc.
556 * dispnew.c: Likewise.
557 * fringe.c: Likewise.
558 * image.c: Likewise.
559 * sound.c: Likewise.
560 * term.c: Likewise.
561 * w32fns.c: Likewise.
562 * w32font.c: Likewise.
563 * w32term.c: Likewise.
564 * xfaces.c: Likewise.
565 * xfns.c: Likewise.
566 * xterm.c: Likewise.
567 * atimer.c: Omit needless casts.
568 * buffer.c: Likewise.
569 * callproc.c: Likewise.
570 * ccl.c: Likewise.
571 * coding.c: Likewise.
572 * composite.c: Likewise.
573 * doc.c: Likewise.
574 * doprnt.c: Likewise.
575 * editfns.c: Likewise.
576 * emacs.c: Likewise.
577 * eval.c: Likewise.
578 * filelock.c: Likewise.
579 * fns.c: Likewise.
580 * gtkutil.c: Likewise.
581 * keyboard.c: Likewise.
582 * lisp.h: Likewise.
583 * lread.c: Likewise.
584 * minibuf.c: Likewise.
585 * msdos.c: Likewise.
586 * print.c: Likewise.
587 * process.c: Likewise.
588 * region-cache.c: Likewise.
589 * search.c: Likewise.
590 * sysdep.c: Likewise.
591 * termcap.c: Likewise.
592 * terminal.c: Likewise.
593 * tparam.c: Likewise.
594 * w16select.c: Likewise.
595 * w32.c: Likewise.
596 * w32reg.c: Likewise.
597 * w32select.c: Likewise.
598 * w32uniscribe.c: Likewise.
599 * widget.c: Likewise.
600 * xdisp.c: Likewise.
601 * xmenu.c: Likewise.
602 * xrdb.c: Likewise.
603 * xselect.c: Likewise.
604
0497dc44
PE
6052012-07-05 Paul Eggert <eggert@cs.ucla.edu>
606
607 * fileio.c (time_error_value): Check the right error number.
608 Problem reported by Troels Nielsen in
609 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
610
356e7178
PE
6112012-07-04 Paul Eggert <eggert@cs.ucla.edu>
612
4e71fd89
PE
613 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
614 This should be fixed in a better way; see Eli Zaretskii in
615 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
616 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
617
f0941253
PE
618 * fileio.c (time_error_value): Rename from special_mtime.
619 The old name's problems were noted by Eli Zaretskii in
620 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
621
065c9eb4
PE
622 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
623 This variable's comment says Emacs needs at least one GDB-visible
624 symbol of type enum pvec_type, to work around GDB problems.
625 The symbol's value doesn't matter.
626
356e7178
PE
627 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
628 that causes compilation to fail on pre-C99 compilers.
629
95f61aa2
JB
6302012-07-04 Juanma Barranquero <lekktu@gmail.com>
631
632 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
633 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
634
3884d954
DA
6352012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
636
d209e2fb 637 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
638 headers for buffer_defaults and buffer_local_symbols.
639 Reported by Juanma Barranquero <lekktu@gmail.com>.
640
ee28be33
SM
6412012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
642
643 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
644 * lisp.h (enum pvec_type): Use fewer bits.
645 (PSEUDOVECTOR_SIZE_BITS): New constant.
646 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
647 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
648 change in pvec_type.
649 (PSEUDOVECTOR_TYPEP): New macro.
650 (TYPED_PSEUDOVECTORP): Use it.
651 * fns.c (internal_equal): Adapt code to extract pvectype.
652 * emacs.c (gdb_pvec_type): Update type.
653 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
654 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
655 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
656 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
657 (sweep_vectors): Use it. Use local var `total_bytes' instead of
658 abusing vector->header.next.nbytes.
659 (live_vector_p): Use PVEC_TYPE.
660 (mark_object): Adapt code to extract pvectype. Use switch.
661
c7f2cd7f
PE
6622012-07-04 Paul Eggert <eggert@cs.ucla.edu>
663
664 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
665 Tighten new eassert a bit.
666
8ce70ed2
DA
6672012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
668
669 Fix compilation with --enable-gcc-warnings and -O1
670 optimization level.
671 * doprnt.c (doprnt): Change type of tem to int, initialize
672 to avoid compiler warning. Add eassert.
673 * search.c (simple_search): Initialize match_byte to avoid
674 compiler warning. Add eassert.
675
dea7f1e5
PE
6762012-07-04 Paul Eggert <eggert@cs.ucla.edu>
677
24a212eb
PE
678 Avoid weird behavior with large horizontal scrolls.
679 Without this change, for example, large hscroll values would
680 mess up Emacs's display on Fedora 15 x86, presumably due to
681 overflows in int calculations in the display code.
682 Also, if buffers had long lines, Emacs would freeze.
683 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
684 (set_window_hscroll): New function, containing the old guts of
685 Fset_window_hscroll. Return the clipped value.
686 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
687 This avoids the need to check against PTRDIFF_MAX.
688
dea7f1e5
PE
689 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
690
76046526
DA
6912012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
692
693 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
694
39adff0d
PE
6952012-07-04 Paul Eggert <eggert@cs.ucla.edu>
696
63807d47
PE
697 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
698 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
699 since GCC 4.4.6 issues a bogus warning for them.
700
39adff0d
PE
701 Fix bugs in file timestamp newness comparisons.
702 * fileio.c (Ffile_newer_than_file_p):
703 * lread.c (Fload): Use full timestamp resolution of files,
704 not just the 1-second resolution, so that files that are only
705 slightly newer still count as newer.
706 * fileio.c (Ffile_newer_than_file_p): Don't assume file
707 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
708
dbeed9a6
PE
7092012-07-03 Paul Eggert <eggert@cs.ucla.edu>
710
711 * fileio.c: Improve handling of file time marker. (Bug#11852)
712 (special_mtime): New function.
713 (Finsert_file_contents, Fverify_visited_file_modtime):
714 Use it to set special mtime values consistently.
715
636334d6
AS
7162012-07-03 Andreas Schwab <schwab@linux-m68k.org>
717
718 * fileio.c (Finsert_file_contents): Properly handle st_mtime
719 marker for non-existing file. (Bug#11852)
720
e2017fe2
GM
7212012-07-03 Glenn Morris <rgm@gnu.org>
722
723 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
724 and did not make it into globals.h).
725
404dbd37
TT
7262012-07-03 Tom Tromey <tromey@redhat.com>
727
728 * window.c (Fset_window_margins, Fset_window_fringes)
729 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
730 * textprop.c (Fprevious_property_change): No longer static.
731 * syntax.c (Fsyntax_table_p): No longer static.
732 * process.c (Fget_process, Fprocess_datagram_address): No longer
733 static.
734 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
735 * keyboard.c (Fcommand_execute): No longer static.
736 Remove EXFUN.
737 * insdel.c (Fcombine_after_change_execute): No longer static.
738 * image.c (Finit_image_library): No longer static.
739 * fileio.c (Fmake_symbolic_link): No longer static.
740 * eval.c (Ffetch_bytecode): No longer static.
741 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
742 * doc.c (Fdocumentation_property, Fsnarf_documentation):
743 No longer static.
404dbd37
TT
744 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
745 static.
746 * dired.c (Ffile_attributes): No longer static.
747 * composite.c (Fcomposition_get_gstring): No longer static.
748 * callproc.c (Fgetenv_internal): No longer static.
749
750 * ccl.h: Remove EXFUNs.
751 * buffer.h: Remove EXFUNs.
752 * dispextern.h: Remove EXFUNs.
753 * intervals.h: Remove EXFUNs.
754 * fontset.h: Remove EXFUN.
755 * font.h: Remove EXFUNs.
756 * dosfns.c (system_process_attributes): Remove EXFUN.
757 * keymap.h: Remove EXFUNs.
758 * lisp.h: Remove EXFUNs.
759 * w32term.h: Remove EXFUNs.
760 * window.h: Remove EXFUNs.
761 * xsettings.h: Remove EXFUN.
762 * xterm.h: Remove EXFUN.
763
8e4fd1e1
GM
7642012-07-03 Glenn Morris <rgm@gnu.org>
765
766 * lisp.h (Frandom): Make it visible to C.
767 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
768 buffer for invisible buffers. (Bug#1229)
769
ca95b3eb
DA
7702012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
771
772 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
773 values which aren't power of 2.
774 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro. Verify
775 it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
776 accordingly.
777
7555c33f
SM
7782012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
779
780 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
781
782 * alloc.c (mark_object): Revert part of last patch to use `switch'.
783
d12e8f5a
DA
7842012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
785
786 * alloc.c (allocate_vector_block): Remove redundant
787 calls to mallopt if DOUG_LEA_MALLOC is defined.
788 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
789 avoid calls to mallopt if zero_vector is returned.
790
296094c3
DA
7912012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
792
793 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
794 is enabled, avoid dereferencing NULL current_sblock if
795 running undumped.
796
36429c89
DA
7972012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
798
799 Cleanup basic buffer management.
800 * buffer.h (struct buffer): Change layout to use generic vector
801 marking code. Fix some comments. Change type of 'clip_changed'
802 to bitfield. Remove unused #ifndef old.
803 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
804 (GET_OVERLAYS_AT): Fix indentation.
805 (for_each_per_buffer_object_at): New macro.
806 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
807 (Fbuffer_local_variables): Use it.
808 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
809 * alloc.c (allocate_buffer): Adjust to match new layout of
810 struct buffer. Fix comment.
811 (mark_overlay): New function.
812 (mark_buffer): Use it. Use mark_vectorlike to mark normal
813 Lisp area of struct buffer.
814 (mark_object): Use it. Adjust marking of misc objects
815 and related comments.
816
3b3e4cac
PE
8172012-07-02 Paul Eggert <eggert@cs.ucla.edu>
818
819 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
820 wrapper that is not needed because the wrapped code is a no-op (zero
821 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
822 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
823
cf5c0175
DA
8242012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
825
826 * alloc.c (mark_buffer): Simplify. Remove prototype.
827 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 828 objects. Use CHECK_LIVE for all vector-like objects except buffers
cf5c0175
DA
829 and subroutines when GC_CHECK_MARKED_OBJECTS is defined. Avoid
830 redundant calls to mark_vectorlike for bool vectors.
831
ca26824c
GM
8322012-06-30 Glenn Morris <rgm@gnu.org>
833
2e4c5312
GM
834 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
835
ca26824c
GM
836 * epaths.in (PATH_SITELOADSEARCH): New.
837 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
838 This is rather than relying on --enable-locallisppath elements
839 having "site-lisp" in their names. (Bug#10208#25, 11658)
840
0d23c240
EZ
8412012-06-30 Eli Zaretskii <eliz@gnu.org>
842
c9240d7a
EZ
843 * w32proc.c (sys_select): Accept and ignore one more argument.
844
845 * w32.c (emacs_gnutls_pull): Call select with one more argument.
846
0d23c240 847 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 848 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
849
850 * sysdep.c: Don't include dos.h and dosfns.h.
851
852 * process.c (sys_select):
853 * msdos.c (sys_select): Accept one more argument and ignore it.
854
855 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
856 adapt data types and code to that.
857
858 * dosfns.c:
859 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
860 which clashes with the gnulib function of the same name.
861
af5a5a98
AS
8622012-06-30 Andreas Schwab <schwab@linux-m68k.org>
863
c5e4379c
AS
864 * font.c (font_style_to_value, font_style_symbolic)
865 (font_prop_validate_style): Add type checks for values in
866 font_style_table.
867
af5a5a98
AS
868 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
869 argument.
870 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
871 uses.
872
8d38f461
EZ
8732012-06-29 Eli Zaretskii <eliz@gnu.org>
874
2e5a6631
EZ
875 * xdisp.c (try_window_id): Undo last change.
876
8d38f461
EZ
877 * w32.c (getwd): Adjust commentary about startup_dir.
878 (init_environment): Always call sys_access, even in non-MSVC
879 builds. Don't chdir to the directory of the Emacs executable.
880 This undoes code from 1997 which was justified by the need to
881 "avoid conflicts when removing and renaming directories". But its
882 downside was that every relative file name was being interpreted
883 relative to the directory of the Emacs executable, which can never
884 be TRT. In particular, it broke sys_access when called with
885 relative file names.
886 (sys_access): Map GetLastError to errno.
887
2af3565e
DA
8882012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
889
890 * window.h (struct window): Change type of 'fringes_outside_margins'
891 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 892 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
893 Adjust comment.
894 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
895 to ptrdiff_t.
896
c8d3a25c 8972012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 898
c8d3a25c
GM
899 * gnutls.c (emacs_gnutls_handshake):
900 Add QUIT to make the loop interruptible.
57570cd3 901
c8d3a25c 9022012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 903
c8d3a25c
GM
904 * charset.c (init_charset): Make lack of etc/charsets fatal.
905
3e984ee8
DA
9062012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
907
908 * editfns.c (region_limit): Fix type mismatch.
909
ef884f23
DA
9102012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
911
912 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
913 undefined. Convert from xassert to eassert.
914 * nsmenu.m: Convert from xassert to eassert.
915 * nsterm.m: Likewise.
916
7d7e0027
SM
9172012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
918
919 * editfns.c (region_limit): Clip to narrowing (bug#11770).
920
aa754e6a
PE
9212012-06-28 Paul Eggert <eggert@cs.ucla.edu>
922
923 Avoid integer overflow on scroll-left and scroll-right.
924 * window.c (HSCROLL_MAX): New macro.
925 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
926 overflow when requested scroll falls outside ptrdiff_t range.
927
80b00b08
DA
9282012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
929
930 * window.h (struct window): Change type of 'hscroll',
931 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
932 'last_modified' and 'last_overlay_modified' to EMACS_INT.
933 Adjust users accordingly.
934 * xdisp.c (try_cursor_movement): Replace type check with eassert.
935 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
936 from EMACS_INT to ptrdiff_t.
937 (make_window): Omit redundant initialization.
938
62b2bcf6
JB
9392012-06-28 Juanma Barranquero <lekktu@gmail.com>
940
941 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
942
45942c7d
DA
9432012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
944
945 * window.h (struct window): Change type of 'use_time' and
946 'sequence_number' from Lisp_Object to int.
947 * frame.c (make_frame): Adjust users accordingly.
948 * print.c (print_object): Likewise.
949 * window.c (select_window, Fwindow_use_time, make_parent_window)
950 (make_window): Likewise.
951
e509cfa6
DA
9522012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
953
954 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
955 enabled with --enable-checking=[all,glyphs] configure option.
956 Fix GLYPH_DEBUG usage assuming that it may be undefined,
957 adjust comments accordingly.
958 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
959 undefined, adjust comments accordingly.
960 * image.c: Likewise.
961 * scroll.c: Likewise.
962 * w32fns.c: Likewise.
963 * w32term.c: Likewise.
964 * xdisp.c: Likewise.
965 * xfaces.c: Likewise.
966 * xfns.c: Likewise.
967 * xterm.c: Likewise.
968
a54e2c05
DA
9692012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
970
971 Generalize run-time debugging checks.
972 * dispextern.h (XASSERTS): Remove.
973 * fontset.c (xassert): Remove.
974 Convert from xassert to eassert.
975 * alloc.c: Convert from xassert to eassert.
976 * bidi.c: Likewise.
977 * dispnew.c: Likewise.
978 * fns.c: Likewise.
979 * fringe.c: Likewise.
980 * ftfont.c: Likewise.
981 * gtkutil.c: Likewise.
982 * image.c: Likewise.
983 * keyboard.c: Likewise.
984 * menu.c: Likewise.
985 * process.c: Likewise.
986 * scroll.c: Likewise.
987 * sound.c: Likewise.
988 * term.c: Likewise.
989 * w32console.c: Likewise.
990 * w32fns.c: Likewise.
991 * w32term.c: Likewise.
992 * window.c: Likewise.
993 * xdisp.c: Likewise.
994 * xfaces.c: Likewise.
995 * xfns.c: Likewise.
996 * xselect.c: Likewise.
997 * xterm.c: Likewise.
998
1ec4b7b2
SM
9992012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
1000
1001 * fns.c (maybe_resize_hash_table): Output message when growing the
1002 purify-hashtable.
1003
2014308a
DA
10042012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1005
1006 * alloc.c (allocate_string_data): Remove dead code.
1007 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1008 avoid GCC warning about unused macro.
1009
246155eb
DA
10102012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1011
1012 * alloc.c (allocate_string): Omit intervals initialization.
1013 * alloc.c (make_uninit_multibyte_string): Initialize intervals
1014 as in make_pure_string and make_pure_c_string.
1015
43184b7b
DA
10162012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1017
d209e2fb 1018 * alloc.c (allocate_string): Fix last change.
43184b7b 1019
3fe6dd74
DA
10202012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
1021
d209e2fb 1022 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
1023 to memset, add explicit initialization where appropriate.
1024
1ba6038a
GM
10252012-06-27 Glenn Morris <rgm@gnu.org>
1026
1027 * lisp.mk (lisp): Remove paths.elc.
1028
c89926a5
CY
10292012-06-27 Chong Yidong <cyd@gnu.org>
1030
1031 * doc.c (Fsubstitute_command_keys): Fix punctuation.
1032
ed6b3510
JW
10332012-06-26 John Wiegley <johnw@newartisans.com>
1034
1ec4b7b2 1035 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
1036 on Mac OS X Lion: __mod_init_func and __mod_term_func.
1037
ed6b3510
JW
1038 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1039 when building with Clang.
1040
8edd4a2b
SM
10412012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
1042
1043 * eval.c (Fapply): Allow calling it with a single argument.
1044
f6f62d1b
EZ
10452012-06-26 Eli Zaretskii <eliz@gnu.org>
1046
1047 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1048 _stricmp and _strnicmp.
1049 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1050
62efea5e
DA
10512012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1052
1053 * alloc.c (allocate_window): Zero out non-Lisp part of newly
1054 allocated window.
1055 (allocate_process): Likewise for new process.
8edd4a2b 1056 (allocate_terminal): Change to use offsetof.
62efea5e
DA
1057 (allocate_frame): Likewise.
1058 * frame.c (make_frame): Omit redundant initialization.
1059 * window.c (make_parent_window): Use memset.
1060 (make_window): Omit redundant initialization.
1061 * process.c (make_process): Omit redundant initialization.
1062 * terminal.c (create_terminal): Likewise.
1063
42997f4d
DA
10642012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1065
1066 * term.c (delete_tty): Remove redundant call to memset.
1067
1130ecfc
DA
10682012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
1069
1070 * alloc.c: Remove build_string.
1071 * lisp.h: Define build_string as static inline. This provides
1072 a better opportunity to optimize away calls to strlen when the
1073 function is called with compile-time constant argument.
1074 * image.c (imagemagick_error): Convert to build_string.
1075 * w32proc.c (sys_spawnve): Likewise.
1076 * xterm.c (x_term_init): Likewise.
1077
cf38a720
PE
10782012-06-26 Paul Eggert <eggert@cs.ucla.edu>
1079
99027bdd
PE
1080 Use sprintf return value instead of invoking strlen on result.
1081 In the old days this wasn't portable, since some sprintf
1082 implementations returned char *. But they died out years ago and
1083 Emacs already assumes sprintf returns int.
1084 Similarly for float_to_string.
1085 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1086 * ccl.c (ccl_driver):
1087 * character.c (string_escape_byte8):
1088 * data.c (Fnumber_to_string):
1089 * doprnt.c (doprnt):
1090 * print.c (print_object):
1091 * xdisp.c (message_dolog):
1092 * xfns.c (syms_of_xfns):
1093 Use sprintf or float_to_string result to avoid need to call strlen.
1094 * data.c (Fnumber_to_string):
1095 Use make_unibyte_string, since the string must be ASCII.
1096 * lisp.h, print.c (float_to_string): Now returns int length.
1097 * term.c (produce_glyphless_glyph):
1098 Use sprintf result rather than recomputing it.
1099
cf38a720
PE
1100 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1101 * Makefile.in (ALL_CFLAGS):
1102 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1103 * gmalloc.c, regex.c: Include <config.h> unconditionally.
1104
3511c784
DA
11052012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1106
0a08eb21 1107 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
1108 strcasecmp if available.
1109 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1110
fb7da12e
AS
11112012-06-25 Andreas Schwab <schwab@linux-m68k.org>
1112
1113 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1114 Avoid comma operator.
1115 * menu.c (push_submenu_start, push_submenu_end)
1116 (push_left_right_boundary, push_menu_pane): Likewise.
1117 * msdos.c (dos_rawgetc): Likewise.
1118
afa2ffd8
DA
11192012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1120
1121 * xfns.c (xic_create_fontsetname): Remove redundant calls
1122 to memset.
1123
b3b4476b
PE
11242012-06-25 Paul Eggert <eggert@cs.ucla.edu>
1125
4495ff38
PE
1126 * gtkutil.c (get_utf8_string): Remove redundant assignment.
1127 sprintf already null-terminates its output.
1128
b3b4476b
PE
1129 * xfns.c (x_window): Remove redundant cast.
1130
b00876c9
DA
11312012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
1132
1133 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1134 `const char *' to `char *' to avoid compiler warning.
1135
d188e26b
PE
11362012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1137
885d1d74
PE
1138 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1139 instead of truncating it to 63 (admittedly a generous limit).
1140
d188e26b
PE
1141 * process.c: Fix spelling and caps in comments.
1142
e2f560b1
DN
11432012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
1144
e86db54b 1145 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
1146 * sysdep.c (setpgrp): Remove definition, not used in this file.
1147
7583a3a1
JB
11482012-06-24 Juanma Barranquero <lekktu@gmail.com>
1149
1150 * makefile.w32-in: Update dependencies.
1151
696056c2
EZ
11522012-06-24 Eli Zaretskii <eliz@gnu.org>
1153
1154 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1155 (SYSTIME_H): Add nt/inc/sys/time.h.
1156
1157 * systime.h [WINDOWSNT]: Include sys/time.h.
1158
1159 * s/ms-w32.h (struct timespec): Definition moved from
1160 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1161
845ca893
PE
11622012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1163
1164 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1165 * buffer.h (buffer_slot_type_mismatch):
1166 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1167 * eval.c (unwind_to_catch):
1168 * image.c (my_png_error, my_error_exit):
1169 * keyboard.c (quit_throw_to_read_char, user_error)
1170 (Fexit_recursive_edit, Fabort_recursive_edit):
1171 * lisp.h (die, args_out_of_range, args_out_of_range_3)
1172 (wrong_type_argument, buffer_overflow, __executable_start)
1173 (memory_full, buffer_memory_full, string_overflow, Fthrow)
1174 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1175 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1176 (fatal):
1177 (child_setup) [!DOS_NT]:
1178 * lread.c (end_of_file_error, invalid_syntax):
1179 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1180 * puresize.h (pure_write_error):
1181 * search.c (matcher_overflow):
1182 * sound.c (sound_perror, alsa_sound_perror):
1183 * sysdep.c, syssignal.h (croak):
1184 * term.c (maybe_fatal, vfatal):
1185 * textprop.c (text_read_only):
1186 * undo.c (user_error):
1187 * unexmacosx.c (unexec_error):
1188 * xterm.c (x_ins_del_lines, x_delete_glyphs):
1189 Use _Noreturn rather than NO_RETURN.
1190 No need for separate decl merely because of _Noreturn.
1191 * sound.c (sound_warning, parse_sound):
1192 Remove unnecessary forward decls.
1193
f1dd8073
PE
11942012-06-24 Paul Eggert <eggert@cs.ucla.edu>
1195
1196 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1197 * lisp.h (WAIT_READING_MAX): New macro.
1198 * dispnew.c (Fsleep_for, sit_for):
1199 * keyboard.c (kbd_buffer_get_event):
1200 * process.c (Faccept_process_output):
1201 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1202 This improves on the previous patch, which introduced a bug
1203 when time_t is unsigned and as wide as intmax_t.
1204 See <http://bugs.gnu.org/9000#51>.
1205
b82c1755
EZ
12062012-06-23 Eli Zaretskii <eliz@gnu.org>
1207
1208 * dispnew.c (sit_for, Fsleep_for):
1209 * keyboard.c (kbd_buffer_get_event):
1210 * process.c (Faccept_process_output): Avoid compiler warnings when
1211 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1212
ca300656
JB
12132012-06-23 Juanma Barranquero <lekktu@gmail.com>
1214
049ec95b
JB
1215 * makefile.w32-in: Update dependencies.
1216
ca300656
JB
1217 * w32.c (ltime): Add return type and declare static.
1218 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1219
db7b8d06
PE
12202012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1221
1222 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1223 Privately reported by Herbert J. Skuhra.
1224 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1225 All uses changed.
1226 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1227 not make_lisp_timeval, when the argument is of type EMACS_TIME.
1228
0bd8297f
EZ
12292012-06-23 Eli Zaretskii <eliz@gnu.org>
1230
96512555
EZ
1231 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1232 last argument of make_unibyte_string.
1233
0bd8297f
EZ
1234 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1235 language ID in the event parameters.
1236
1237 * w32term.c (w32_read_socket): Put the new keyboard codepage into
1238 event.code, not the obscure "character set ID".
1239
63def6b6
CY
12402012-06-23 Chong Yidong <cyd@gnu.org>
1241
1242 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1243
e8a02204
EZ
12442012-06-23 Eli Zaretskii <eliz@gnu.org>
1245
388cdec0
EZ
1246 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1247 * w32.c (fdutimens): New function.
1248
1249 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1250
1251 * s/ms-w32.h (pselect): Redirect to sys_select.
1252
1253 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1254
e8a02204
EZ
1255 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1256 in the logic of incrementing and decrementing the value of
1257 use_relocatable_buffers.
1258
d054f3fb
PE
12592012-06-23 Paul Eggert <eggert@cs.ucla.edu>
1260
1261 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1262 Privately reported by Herbert J. Skuhra.
1263 [__FreeBSD__]: Remove "*/" typo after "#include".
1264 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1265 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1266 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1267 Don't assume EMACS_TIME and struct timeval are the same type.
1268
d35af63c
PE
12692012-06-22 Paul Eggert <eggert@cs.ucla.edu>
1270
1271 Support higher-resolution time stamps (Bug#9000).
1272 The time stamps are only nanosecond-resolution at the C level,
1273 since that's the best that any real-world system supports now.
1274 But they are picosecond-resolution at the Lisp level, as that's
1275 easy, and leaves room for future OS improvements.
1276
1277 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1278 (LIBES): Use it.
1279
1280 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1281 Don't get current time unless it's needed.
1282
1283 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1284 now provides it if it's absent.
1285 (start_atimer): Port to higher-res time stamps.
1286 Check for time stamp overflow. Don't get current time more
1287 often than is needed.
1288
1289 * buffer.h (struct buffer): Buffer modtime now has high resolution.
1290 Include systime.h, not time.h.
1291 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1292
1293 * dired.c: Include stat-time.h.
1294 (Ffile-attributes): File times now have higher resolution.
1295
1296 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1297 (struct image): Timestamp now has higher resolution.
1298
1299 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1300 has at least microseconds now. All uses removed.
1301 (update_frame, update_single_window, update_window, update_frame_1)
1302 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1303
1304 * editfns.c (time_overflow): Now extern.
1305 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1306 (float-time, Fformat_time_string, Fcurrent_time_string)
1307 (Fcurrent_time_zone): Accept and generate higher-resolution
1308 time stamps.
1309 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1310 (decode_time_components, lisp_seconds_argument): New functions.
1311 (make_time): Now static.
1312 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
1313 Report an error if the time is invalid, rather than having the caller
1314 do that.
1315
1316 * fileio.c: Include <stat-time.h>
1317 (Fcopy_file): Copy higher-resolution time stamps.
1318 Prefer to set the time stamp via a file descriptor if that works.
1319 (Fset_file_times, Finsert_file_contents, Fwrite_region)
1320 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1321 (Fvisited_file_modtime, Fset_visited_file_modtime):
1322 Support higher-resolution time stamps.
1323
1324 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1325
1326 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1327
1328 * image.c (prepare_image_for_display, clear_image_cache)
1329 (lookup_image): Port to higer-resolution time stamps.
1330
1331 * keyboard.c (start_polling, bind_polling_period):
1332 Check for time stamp overflow.
1333 (read_char, kbd_buffer_get_event, timer_start_idle)
1334 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1335 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1336 Port to higher-resolution time stamps. Do not assume time_t is signed.
1337 (decode_timer): New function. Timers are now vectors of length 9,
1338 not 8, to accommodate the picosecond component.
1339 (timer_check_2): Use it.
1340
1341 * nsterm.m (select_timeout, timeval_subtract): Remove.
1342 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1343 as they're a bit more accurate and handle overflow better.
1344 (ns_select): Change prototype to be compatible with pselect.
1345 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1346 * nsterm.h (ns_select): Adjust prototype.
1347
1348 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1349 us-resolution time stamps.
1350 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1351
1352 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1353
1354 * lisp.h (time_overflow): New decl.
1355 (wait_reading_process_output): First arg is now intmax_t, not int,
1356 to accommodate larger waits.
1357
1358 * process.h (struct Lisp_Process.read_output_delay):
1359 Now counts nanoseconds, not microseconds.
1360 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1361 EMACS_HAS_USECS.
1362 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1363 (wait_reading_process_output):
1364 Port to ns-resolution time stamps.
1365 (Faccept_process_output, wait_reading_process_output):
1366 Check for time stamp overflow. Do not assume time_t is signed.
1367 (select_wrapper): Remove; we now use pselect.
1368 (Fprocess_attributes): Now generates ns-resolution time stamps.
1369
1370 * sysdep.c: Include utimens.h. Don't include utime.h
1371 or worry about struct utimbuf; gnulib does that for us now.
1372 (gettimeofday): Remove; gnulib provides a substitute.
1373 (make_timeval): New function.
1374 (set_file_times): Now sets ns-resolution time stamps.
1375 New arg FD; all uses changed.
1376 (time_from_jiffies, ltime_from_jiffies, get_up_time)
1377 (system_process_attributes):
1378 Now returns ns-resolution time stamp. All uses changed.
1379 Check for time stamp overflow.
1380
1381 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1382 provides a substitute now.
1383
1384 * systime.h: Include timespec.h rather than sys/time.h and time.h,
1385 since it guarantees struct timespec.
1386 (EMACS_TIME): Now struct timespec, so that we can support
1387 ns-resolution time stamps.
1388 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1389 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1390 (EMACS_USECS): Remove.
1391 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1392 so multiply the arg by 1000 before storing it.
1393 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1394 New macros.
1395 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1396 Port to ns-resolution time stamps.
1397 (EMACS_TIME_NEG_P): Remove; replaced by....
1398 (EMACS_TIME_SIGN): New macro.
1399 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1400 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1401 (set_file_times, make_time, lisp_time_argument): Adjust signature.
1402 (make_timeval, make_lisp_time, decode_time_components): New decls.
1403 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
1404 that it mishandled time_t overflow. You can't compare by subtracting!
1405 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1406 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1407
1408 * term.c: Include <sys/time.h>.
1409 (timeval_to_Time): New function, for proper overflow wraparound.
1410 (term_mouse_position, term_mouse_click): Use it.
1411
1412 * undo.c (record_first_change): Support higher-resolution time stamps
1413 in the undo buffer.
1414 (Fprimitive_undo): Use them when restoring time stamps.
1415
1416 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1417 (w32_get_internal_run_time):
1418 Port to higher-resolution Emacs time stamps.
1419 (ltime): Now accepts single 64-bit integer, as that's more convenient
1420 for callers.
1421
1422 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1423
1424 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1425 for compatibility with pselect. Support ns-resolution time stamps.
1426
1427 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1428
1429 * xselect.c (wait_for_property_change, x_get_foreign_selection):
1430 Check for time stamp overflow, and support ns-resolution time stamps.
1431
1432 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1433 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1434 (timeval_subtract): Remove; no longer needed.
1435 (XTflash, XTring_bell, x_wait_for_event):
1436 Port to ns-resolution time stamps. Don't assume time_t is signed.
1437
b6a92dfe
CY
14382012-06-22 Chong Yidong <cyd@gnu.org>
1439
1440 * xdisp.c (x_consider_frame_title): Revert last change.
1441
d251c37c
EZ
14422012-06-22 Eli Zaretskii <eliz@gnu.org>
1443
1444 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
1445 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1446 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
1447 staticidx goes up to 1597 out of 1600 = 0x640.)
1448
f10deafb
PE
14492012-06-20 Paul Eggert <eggert@cs.ucla.edu>
1450
1451 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1452 Otherwise, the umask might be mistakenly 0 while handling input signals.
1453
ec6de1e2
SM
14542012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
1455
1456 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
1457
28be1ada
DA
14582012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
1459
1460 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
1461 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
1462 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
1463 access to `contents' member of Lisp_Vector objects with AREF and ASET
1464 where appropriate.
1465
c6bf3022
CY
14662012-06-19 Chong Yidong <cyd@gnu.org>
1467
1468 * frame.c (delete_frame): When selecting a frame on a different
1469 text terminal, do not alter the terminal's top-frame.
1470
1471 * xdisp.c (format_mode_line_unwind_data): Record the target
1472 frame's selected window and its terminal's top-frame.
1473 (unwind_format_mode_line): Restore them.
1474 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
1475 Callers changed.
1476 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
1477 since tty frames can be explicitly named.
1478 (prepare_menu_bars): Likewise.
1479
1480 * term.c (Ftty_top_frame): New function.
1481
defd4196
PE
14822012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1483
1484 Port byte-code-meter to modern targets.
1485 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
1486 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 1487 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
1488 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
1489 (METER_1, METER_2): Simplify.
1490
1053a871
SM
14912012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
1492
1493 * data.c (Fdefalias): Return `symbol' (bug#11686).
1494
b7e8d081
MR
14952012-06-18 Martin Rudalics <rudalics@gmx.at>
1496
1497 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
1498 gets killed during executing of this function (Bug#11665).
1499 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
1500 (Vkill_buffer_query_functions): In doc-string say that functions
1501 run by this hook should not change the current buffer.
1502
7ea2b339
PE
15032012-06-18 Paul Eggert <eggert@cs.ucla.edu>
1504
1505 Fix recently-introduced process.c problems found by static checking.
1506 * process.c (write_queue_push, write_queue_pop, send_process):
1507 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
1508 (write_queue_pop): Fix pointer signedness problem.
1509 (send_process): Remove unused local.
1510
96a313a1
CY
15112012-06-17 Chong Yidong <cyd@gnu.org>
1512
1513 * xdisp.c (redisplay_internal): No need to redisplay terminal
1514 frames that are not on top.
1515
20ca2e94
TN
15162012-06-17 Troels Nielsen <bn.troels@gmail.com>
1517
1518 * process.c (make_process): Initialize write_queue.
1519 (write_queue_push, write_queue_pop): New functions.
1520 (send_process): Use them to maintain correct ordering of process
1521 writes (Bug#10815).
1522
9a900ca9
PE
15232012-06-17 Paul Eggert <eggert@cs.ucla.edu>
1524
310fbfa8
PE
1525 * lisp.h (eassert): Assume C89 or later.
1526 This removes the need for CHECK.
1527 (CHECK): Remove. Its comments about always evaluating its
1528 argument were confusing, as 'eassert' typically does not evaluate
1529 its argument.
1530
27bb1ca4
PE
1531 * coding.c (produce_chars): Use ptrdiff_t, not int.
1532
9a900ca9
PE
1533 * xterm.c (x_draw_underwave): Check for integer overflow.
1534 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
1535
41b7f8bc 15362012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
1537
1538 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
1539 referenced (Bug#11583).
1540
9b0e3eba
AA
15412012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
1542
1543 Implement wave-style variant of underlining.
1544 * dispextern.h (face_underline_type): New enum.
1545 (face): Add field for underline type.
1546 * nsterm.m (ns_draw_underwave): New function.
1547 (ns_draw_text_decoration): Use it.
1548 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
1549 New functions.
1550 (x_draw_glyph_string): Use them.
1551 * xfaces.c (Qline, Qwave): New Lisp objects.
1552 (check_lface_attrs, merge_face_ref)
1053a871
SM
1553 (Finternal_set_lisp_face_attribute, realize_x_face):
1554 Handle wave-style underline face attributes.
9b0e3eba
AA
1555 * xterm.c (x_draw_underwave): New function.
1556 (x_draw_glyph_string): Use it.
1557
0fb52f11
JB
15582012-06-16 Juanma Barranquero <lekktu@gmail.com>
1559
1560 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
1561 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
1562 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
1563 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
1564 ($(BLD)/w32select.$(O)): Update dependencies.
1565
e5560ff7
AS
15662012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1567
1568 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
1569 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
1570 * character.c (_fetch_multibyte_char_p): Remove.
1571 * alloc.c: Include "character.h" before "buffer.h".
1572 * bidi.c: Likewise.
1573 * buffer.c: Likewise.
1574 * bytecode.c: Likewise.
1575 * callint.c: Likewise.
1576 * callproc.c: Likewise.
1577 * casefiddle.c: Likewise.
1578 * casetab.c: Likewise.
1579 * category.c: Likewise.
1580 * cmds.c: Likewise.
1581 * coding.c: Likewise.
1582 * composite.c: Likewise.
1583 * dired.c: Likewise.
1584 * dispnew.c: Likewise.
1585 * doc.c: Likewise.
1586 * dosfns.c: Likewise.
1587 * editfns.c: Likewise.
1588 * emacs.c: Likewise.
1589 * fileio.c: Likewise.
1590 * filelock.c: Likewise.
1591 * font.c: Likewise.
1592 * fontset.c: Likewise.
1593 * fringe.c: Likewise.
1594 * indent.c: Likewise.
1595 * insdel.c: Likewise.
1596 * intervals.c: Likewise.
1597 * keyboard.c: Likewise.
1598 * keymap.c: Likewise.
1599 * lread.c: Likewise.
1600 * macros.c: Likewise.
1601 * marker.c: Likewise.
1602 * minibuf.c: Likewise.
1603 * nsfns.m: Likewise.
1604 * nsmenu.m: Likewise.
1605 * print.c: Likewise.
1606 * process.c: Likewise.
1607 * regex.c: Likewise.
1608 * region-cache.c: Likewise.
1609 * search.c: Likewise.
1610 * syntax.c: Likewise.
1611 * term.c: Likewise.
1612 * textprop.c: Likewise.
1613 * undo.c: Likewise.
1614 * unexsol.c: Likewise.
1615 * w16select.c: Likewise.
1616 * w32fns.c: Likewise.
1617 * w32menu.c: Likewise.
1618 * window.c: Likewise.
1619 * xdisp.c: Likewise.
1620 * xfns.c: Likewise.
1621 * xmenu.c: Likewise.
1622 * xml.c: Likewise.
1623 * xselect.c: Likewise.
1624
2f07e6af
EZ
16252012-06-16 Eli Zaretskii <eliz@gnu.org>
1626
1053a871
SM
1627 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
1628 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 1629 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
1630 row.
1631 (handle_face_prop): Use chunk-relative overlay string index when
1632 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
1633 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
1634 the rightmost. (Bug#11720)
2f07e6af 1635
29b83cec
AS
16362012-06-16 Andreas Schwab <schwab@linux-m68k.org>
1637
1638 * category.h (CHAR_HAS_CATEGORY): Define as inline.
1639 (CATEGORY_MEMBER): Enforce 1/0 value.
1640 * category.c (_temp_category_set): Remove.
1641
4c5501e9
EZ
16422012-06-16 Eli Zaretskii <eliz@gnu.org>
1643
1644 * window.c (Fdelete_other_windows_internal)
1645 (Fdelete_window_internal): Don't access frame's mouse highlight
1646 info of the initial frame. (Bug#11677)
1647
2b570124
PE
16482012-06-14 Paul Eggert <eggert@cs.ucla.edu>
1649
e93864f9
PE
1650 * .gdbinit (xgetint): Fix recently-introduced paren typo.
1651 Assume USE_2_TAGS_FOR_INTS.
1652 (xreload): Adjust $tagmask width to match recent lisp.h change.
1653
2b570124
PE
1654 Simplify lisp.h in minor ways that should not affect code.
1655 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
1656 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
1657 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
1658 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
1659 (INTTYPEBITS): New macro, for clarity.
1660 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
1661 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
1662 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
1663 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
1664 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
1665
81755f69
JB
16662012-06-13 Juanma Barranquero <lekktu@gmail.com>
1667
1668 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
1669
16192a57
GM
16702012-06-13 Glenn Morris <rgm@gnu.org>
1671
1672 * s/bsd-common.h (BSD4_3):
1673 * s/usg5-4-common.h (USG5_4): No longer define; unused.
1674
646b5f55
AS
16752012-06-13 Andreas Schwab <schwab@linux-m68k.org>
1676
1677 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
1678 instead of union.
1679 (XLI, XIL): Define.
1053a871
SM
1680 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
1681 Use them.
1682 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 1683 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 1684 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
1685 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
1686 * frame.c (delete_frame): Remove outdated comment.
1687 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
1688 USE_LISP_UNION_TYPE.
1689 (Fw32_unregister_hot_key): Likewise.
1690 (Fw32_toggle_lock_key): Likewise.
1691 * w32menu.c (add_menu_item): Likewise.
1692 (w32_menu_display_help): Use XIL instead of checking
1693 USE_LISP_UNION_TYPE.
1694 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
1695 (init_heap): Likewise.
1696 * w32term.c (w32_read_socket): Update comment.
1697
1d3823c9
GM
16982012-06-13 Glenn Morris <rgm@gnu.org>
1699
c62ff706
GM
1700 * s/usg5-4-common.h, src/s/unixware.h:
1701 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
1702
1d3823c9
GM
1703 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
1704
bfe3e0a2
PE
17052012-06-13 Paul Eggert <eggert@cs.ucla.edu>
1706
1707 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
1708 * alloc.c (make_number) [!defined make_number]:
1709 Remove, as lisp.h always defines this now.
1710 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
1711 (roundup_size): Verify that it is a power of 2.
1712 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
1713 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
1714 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
1715 -DUSE_LSB_TAG=0, to override the automatically-selected default.
1716 USE_LSB_TAG now is always defined to be either 0 or 1.
1717 All uses changed.
1718 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
1719 code works fine either way, and efficiency is not a concern here,
1720 as the union type is for debugging, not for production.
1721 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
1722 Use an inline function on all platforms when using the union type,
1723 since this is simpler and 'static inline' can be used portably
1724 within Emacs now.
1725 (LISP_INITIALLY_ZERO): New macro.
1726 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
1727 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
1728
45fa9c0f
GM
17292012-06-12 Glenn Morris <rgm@gnu.org>
1730
b4492cba
GM
1731 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
1732
1733 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 1734
45fa9c0f
GM
1735 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
1736 Move BROKEN_SIGIO to configure.
1737
1738 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
1739 Move NO_TERMIO to configure.
1740
0e25d334
CY
17412012-06-12 Chong Yidong <cyd@gnu.org>
1742
1743 * image.c (imagemagick_load_image): Use MagickFlattenImage if
1744 MagickMergeImageLayers is undefined. Use pixel pusher loop if
1745 MagickExportImagePixels is undefined.
1746
43682bb6
PE
17472012-06-12 Paul Eggert <eggert@cs.ucla.edu>
1748
1749 * image.c (imagemagick_load_image): Remove unused label.
1750
a9be7d2b
GM
17512012-06-11 Glenn Morris <rgm@gnu.org>
1752
1753 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1754 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
1755 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
1756 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
1757
3017f87f
SM
17582012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
1759
1760 * alloc.c (make_byte_code): New function.
1761 (Fmake_byte_code): Use it. Don't purify here.
1762 * lread.c (read1): Use it as well to avoid extra allocation.
1763
1b9b4cf4
CY
17642012-06-11 Chong Yidong <cyd@gnu.org>
1765
1766 * image.c (imagemagick_load_image): Implement transparency.
1767
95988fcf
AS
17682012-06-10 Andreas Schwab <schwab@linux-m68k.org>
1769
1770 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
1771 account for preceding backslashes. (Bug#11663)
1772
cd4eb164
CY
17732012-06-09 Chong Yidong <cyd@gnu.org>
1774
1775 * term.c: Support italics in capable terminals (Bug#9652).
1776 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
1777 (turn_on_face): Output using TS_enter_italic_mode if available.
1778 Don't handle unused blinking and alt-charset cases.
1779 (turn_off_face): Handle italic case; discard unused tty_blinking_p
1780 and tty_alt_charset_p cases.
1781 (tty_capable_p, init_tty): Support italics.
1782
1783 * termchar.h (struct tty_display_info): Add field for italics.
1784 Remove unused blink field.
1785
1786 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
1787 Handle slant.
1788
1789 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
1790 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
1791 tty_alt_charset_p. Add tty_italic_p.
1792
ff88beb8
MA
17932012-06-09 Michael Albinus <michael.albinus@gmx.de>
1794
1795 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
1796 dbus_type_is_basic if available.
1797 (xd_extract_signed, xd_extract_unsigned): Rename from
1798 extract_signed and extract_unsigned, respectively. Adapt callers.
1799
44286096
CY
18002012-06-09 Chong Yidong <cyd@gnu.org>
1801
1682701f
CY
1802 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
1803
44286096
CY
1804 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
1805 case (Bug#9752).
1806
d86feb17
PE
18072012-06-08 Paul Eggert <eggert@cs.ucla.edu>
1808
1809 * xdisp.c (vmessage): Treat frame message as multibyte.
1810 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
1811 would generate the diagnostic "Making \302\247 buffer-local while
1812 let-bound!".
1813
d5c20fe8
EZ
18142012-06-08 Eli Zaretskii <eliz@gnu.org>
1815
1816 * dispnew.c (showing_window_margins_p): Undo last change, which
1817 was done due to an inadvertent commit.
1818 (adjust_frame_glyphs_for_frame_redisplay): Do call
1819 showing_window_margins_p.
1820
513749ee
SM
18212012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
1822
1823 * eval.c (Fmake_var_non_special): New primitive.
1824 (syms_of_eval): Defsubr it.
1825 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
1826
d4a8f5c1
JB
18272012-06-08 Juanma Barranquero <lekktu@gmail.com>
1828
1829 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
1830 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
1831
8bbbc977
EZ
18322012-06-08 Eli Zaretskii <eliz@gnu.org>
1833
1834 * alloc.c (allocate_vectorlike): Fix last change.
1835
f3372c87
DA
18362012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
1837
1838 Block-based vector allocation of small vectors.
1839 * lisp.h (struct vectorlike_header): New field `nbytes',
1840 adjust comment accordingly.
1841 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
1842 to denote vector blocks. Adjust users (live_vector_p,
1843 mark_maybe_pointer, valid_lisp_object_p) accordingly.
1844 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
1845 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
1846 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
1847 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
1848 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
1849 (roundup_size): New constant.
1850 (struct vector_block): New data type.
1851 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 1852 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
1853 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
1854 (sweep_vectors): New functions.
1855 (allocate_vectorlike): Return `zero_vector' as the only vector of
1856 0 items. Allocate new vector from block if vector size is less than
1857 or equal to VBLOCK_BYTES_MAX.
1858 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
1859 (init_alloc_once): Add call to init_vectors.
1860
4f18a4ed
SM
18612012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
1862
1863 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
1864
86f158bc
PE
18652012-06-07 Paul Eggert <eggert@cs.ucla.edu>
1866
1867 * doprnt.c (doprnt): Truncate multibyte char correctly.
1868 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
1869 would mishandle a string argument "Xc" if X was a multibyte
1870 character of length 2: it would truncate after X's first byte
1871 rather than including all of X.
1872
c5cfcbe0
CY
18732012-06-06 Chong Yidong <cyd@gnu.org>
1874
1875 * buffer.c (word_wrap): Doc fix.
1876
c05cf390
PE
18772012-06-04 Paul Eggert <eggert@cs.ucla.edu>
1878
1879 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
1880
0c3461de
GM
18812012-06-03 Glenn Morris <rgm@gnu.org>
1882
1883 * xdisp.c (tool-bar-style): Doc fix.
1884
c71232db
UM
18852012-06-03 Ulrich Müller <ulm@gentoo.org>
1886
1887 * Makefile.in (PAXCTL): Define.
1888 (temacs$(EXEEXT)): Disable memory randomization for the temacs
1889 binary via PaX flags if the paxctl utility is available.
1890 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1891 Restore PaX flags to their default. (Bug#11398)
1892
383f7350
CY
18932012-06-03 Chong Yidong <cyd@gnu.org>
1894
1895 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
1896 buffer (Bug#11226).
1897
5f2c76c6
CY
18982012-06-03 Chong Yidong <cyd@gnu.org>
1899
1900 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
1901 (note_mode_line_or_margin_highlight): If there is no help echo,
1902 use mode-line-default-help-echo. Handle the case where the mouse
1903 position is past the end of the mode line string.
1904
1905 * buffer.c (buffer_local_value_1): New function, split from
1906 Fbuffer_local_value; can return Qunbound.
1907 (Fbuffer_local_value): Use it.
1908 (Vmode_line_format): Docstring tweaks.
1909
773d47f6
PE
19102012-06-02 Paul Eggert <eggert@cs.ucla.edu>
1911
1912 * sysdep.c (system_process_attributes): Improve comment.
1913
f2d6a3df
SM
19142012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
1915
1916 * keyboard.c: Export real-this-command to Elisp.
1917 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
1918 and DEFVAR it. Update all users.
1919
63810350
PE
19202012-06-02 Paul Eggert <eggert@cs.ucla.edu>
1921
7bd5c1f4
PE
1922 * minibuf.c (Fassoc_string): Remove duplicate declaration.
1923
63810350
PE
1924 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
1925 Convert pctcpu and pctmem to Lisp float properly.
1926 Let the compiler fold better, as 100.0/0x8000 is exact.
1927
a2821611
AS
19282012-06-02 Andreas Schwab <schwab@linux-m68k.org>
1929
1930 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
1931 cons_block.
1932
5fceba1d
PE
19332012-06-01 Paul Eggert <eggert@cs.ucla.edu>
1934
1935 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
1936
c98ff5dd
DA
19372012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
1938
1939 For a 'struct window', replace some Lisp_Object fields to
1940 bitfields where appropriate, remove unused fields.
1941 * window.h (struct window): Remove unused 'last_mark_x' and
1942 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1943 change it's type from Lisp_Object to bitfield.
1944 Change type of 'force_start', 'optional_new_start',
1945 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
1946 fields from Lisp_Object to bitfield. Adjust users accordingly.
1947
ca34e0be
PE
19482012-05-31 Paul Eggert <eggert@cs.ucla.edu>
1949
1950 Pacify gcc -Wdouble-precision when using Xaw.
1951 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
1952 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
1953 Use 'float' consistently, rather than 'float' in most places
1954 and 'double' in a couple of places.
1955
efc00ab1 19562012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
1957
1958 * xdisp.c (handle_stop): Detect whether we have overlay strings
1959 loaded by testing it->current.overlay_string_index to be
1960 non-negative, instead of checking whether n_overlay_strings is
1961 positive. (Bug#11587)
1962
efc00ab1 19632012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
1964
1965 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
1966
1967 * doc.c (Fsubstitute_command_keys): Doc fix.
1968
efc00ab1 19692012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
1970
1971 * search.c (search_buffer): Remove calls to
1972 r_alloc_inhibit_buffer_relocation, as it is now called by
1973 maybe_unify_char, which was the cause of relocation of buffer text
1974 in bug#11519.
1975
efc00ab1 19762012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
1977
1978 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
1979 for the duration of call to load_charset, to avoid problems with
1980 callers of maybe_unify_char that access buffer text through C
1981 pointers.
1982
1983 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
1984 decrement the inhibition flag, instead of just setting or
1985 resetting it.
1986
ba93a187
PE
19872012-05-31 Paul Eggert <eggert@cs.ucla.edu>
1988
1989 Remove obsolete '#define static' cruft.
1990 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
1991 This #undef was "temporary" in 2000; it is no longer needed
1992 now that '#define static' has gone away.
1993 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
1994 (gray_bitmap_bits): Remove; no longer needed.
1995 All uses replaced with definiens.
1996 * xterm.c: Include "bitmaps/gray.xbm".
1997
9e4bf381
PE
19982012-05-30 Paul Eggert <eggert@cs.ucla.edu>
1999
2000 Clean up __executable_start, monstartup when --enable-profiling.
2001 The following changes affect the code only when profiling.
2002 * dispnew.c (__executable_start): Rename from safe_bcopy.
2003 Define only on platforms that need it.
2004 * emacs.c: Include <sys/gmon.h> when profiling.
2005 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2006 (__executable_start): Remove decl, since lisp.h does it now.
2007 (safe_bcopy): Remove decl; no longer has that name.
2008 (main): Coalesce #if into single bit of code, for simplicity.
2009 Cast pointers to uintptr_t, since standard libraries want integers
2010 and not pointers.
2011 * lisp.h (__executable_start): New decl.
2012
32d72c2f
GM
20132012-05-31 Glenn Morris <rgm@gnu.org>
2014
2015 * image.c (Fimagemagick_types): Doc fix.
2016
baac5bc7
JM
20172012-05-30 Jim Meyering <meyering@redhat.com>
2018
2019 * callproc.c (Fcall_process_region): Include directory component
2020 in mkstemp error message (Bug#11586).
2021
72cb32cf
PE
20222012-05-30 Paul Eggert <eggert@cs.ucla.edu>
2023
2024 * alloc.c, lisp.h (make_pure_vector): Now static.
2025
61b108cc
SM
20262012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
2027
2028 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2029 Move to byte-run.el.
2030 (Fautoload): Do the hash-doc more carefully.
2031 * data.c (Fdefalias): Purify definition, except for keymaps.
2032 (Qdefun): Move from eval.c.
2033 * lisp.h (Qdefun): Remove.
2034 * lread.c (read1): Tiny simplification.
2035
471fe23d
TN
20362012-05-29 Troels Nielsen <bn.troels@gmail.com>
2037
934f3f58 2038 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
2039 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2040 Bug#9642, but explicitly check that the buffer the overlay would
2041 be moved to is live and rearrange lines to make sure that errors
2042 will not put the overlay in an inconsistent state.
2043 (Fdelete_overlay): Cosmetics.
2044
85d0efd1
EZ
20452012-05-28 Eli Zaretskii <eliz@gnu.org>
2046
2047 * w32term.c (my_bring_window_to_top): New function.
2048 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
2049 could be different from the original one.
2050 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
2051 (Bug#11513)
2052
2053 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2054 by calling BringWindowToTop.
2055
2056 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2057 (WM_EMACS_END): Increase by one.
2058
da92a98c
PE
20592012-05-28 Paul Eggert <eggert@cs.ucla.edu>
2060
2061 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2062 This avoids undefined behavior that might cause the eassert
2063 to not catch an out-of-range value.
2064
74d1f848
JB
20652012-05-28 Juanma Barranquero <lekktu@gmail.com>
2066
2067 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2068 Update dependencies.
2069
9e1a06fc
EZ
20702012-05-27 Eli Zaretskii <eliz@gnu.org>
2071
2072 * bidi.c (bidi_mirror_char): Fix last change.
2073
f3dd7312
AS
20742012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2075
2076 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2077 when referring to sectname field in printf format.
2078
81899c91
PE
20792012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2080
57b81a9f
PE
2081 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2082 Only r_alloc_inhibit_buffer_relocation needed to be added;
2083 the others were already declared.
2084
81899c91
PE
2085 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2086 before checking whether it's out of range. Put the check inside
2087 eassert. See
2088 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2089
33017faf 20902012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
2091
2092 * callproc.c (Fcall_process): Restore a line that was accidentally
2093 commented out in the 2011-02-13 change (bug#11547).
2094
33017faf 20952012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
2096
2097 * lisp.h [REL_ALLOC]: Add prototypes for external functions
2098 defined on ralloc.c.
2099
2100 * buffer.c [REL_ALLOC]: Remove prototypes of
2101 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2102 they are now on lisp.h.
2103
2104 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2105
2106 * search.c (search_buffer): Use it to inhibit relocation of buffer
2107 text while re_search_2 is doing its job, because re_search_2 is
2108 passed C pointers to buffer text. (Bug#11519)
2109
23415acf
EZ
2110 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2111 Update value to 24.
2112
44e27368
EZ
2113 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2114 state after an additional call to move_it_in_display_line_to, keep
2115 the values of it->max_ascent and it->max_descent found for the
2116 entire line.
2117 (pos_visible_p): Revert the comparison against bottom_y to what it
2118 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2119 (Bug#11464)
2120
c1892f11
PE
21212012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2122
2123 Fix coding-related core dumps with gcc -ftrapv.
2124 The code was computing A - B, where A and B are pointers, and B is
2125 random garbage. This can lead to core dumps on platforms that
2126 have special pointer registers, and it also leads to core dumps on
2127 x86-64 when compiled with gcc -ftrapv. The fix is to compute
2128 A - B only when B is initialized properly.
2129 * coding.c (coding_set_source, coding_set_destination): Return void.
2130 (coding_change_source, coding_change_destinations): New functions,
2131 with the old behaviors of coding_set_source and coding_set_destination.
2132 All callers that need an offset changed to use these new functions.
2133
eb7afdad
GM
21342012-05-26 Glenn Morris <rgm@gnu.org>
2135
2136 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
2137
f12fdf02
EZ
21382012-05-26 Eli Zaretskii <eliz@gnu.org>
2139
53a63be6 2140 Extend mouse support on W32 text-mode console.
61b108cc
SM
2141 * xdisp.c (draw_row_with_mouse_face):
2142 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 2143
eb3f6f01 2144 * w32console.c: Include window.h.
61b108cc
SM
2145 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2146 New functions.
eb3f6f01
EZ
2147 (initialize_w32_display): Initialize mouse-highlight data.
2148
53a63be6
EZ
2149 * w32inevt.c: Include termchar.h and window.h.
2150 (do_mouse_event): Support mouse-autoselect-window. When the mouse
2151 moves, call note_mouse_highlight. If help_echo changed, call
2152 gen_help_event to produce help-echo message in the echo area.
2153 Call clear_mouse_face if mouse_face_hidden is set in the mouse
2154 highlight info.
2155
4cfd81f6
PE
21562012-05-26 Paul Eggert <eggert@cs.ucla.edu>
2157
2158 * lread.c (read1): Simplify slightly to avoid an overflow warning
2159 with GCC 4.7.0 on x86-64.
2160
4446092a
EZ
21612012-05-26 Eli Zaretskii <eliz@gnu.org>
2162
2163 * bidi.c (bidi_mirror_char): Revert last change: an int is
2164 definitely wide enough here.
2165
42b2a986 21662012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 2167
42b2a986 2168 Fix integer width and related bugs (Bug#9874).
eb106a49 2169 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
2170 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2171 (string_bytes, check_sblock, allocate_string_data):
2172 (compact_small_strings, Fmake_bool_vector, make_string)
2173 (make_unibyte_string, make_multibyte_string)
2174 (make_string_from_bytes, make_specified_string)
2175 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2176 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2177 (mark_vectorlike):
2178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2179 (allocate_pseudovector):
2180 Use int, not EMACS_INT, where int is wide enough.
2181 (inhibit_garbage_collection, Fgarbage_collect):
2182 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2183 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2184 int might not be wide enough.
2185 (bidi_cache_search, bidi_cache_find, bidi_init_it)
2186 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2187 (bidi_at_paragraph_end, bidi_find_paragraph_start)
2188 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2189 (bidi_level_of_next_char, bidi_move_to_visually_next):
2190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2191 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2192 (Fkill_buffer, Fset_buffer_major_mode)
2193 (advance_to_char_boundary, Fbuffer_swap_text)
2194 (Fset_buffer_multibyte, overlays_at, overlays_in)
2195 (overlay_touches_p, struct sortvec, record_overlay_string)
2196 (overlay_strings, recenter_overlay_lists)
2197 (adjust_overlays_for_insert, adjust_overlays_for_delete)
2198 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2199 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2200 (Foverlay_recenter, last_overlay_modification_hooks_used)
2201 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2202 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
2203 (validate_region): Omit unnecessary test for b <= e,
2204 since that's guaranteed by the previous test.
d311d28c
PE
2205 (adjust_overlays_for_delete): Avoid pos + length overflow.
2206 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2207 (report_overlay_modification):
2208 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2209 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2210 Omit pointer cast, which isn't needed anyway, and doesn't work
2211 after the EMACS_INT -> ptrdiff_t change.
02481186 2212 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
2213 * buffer.h: Adjust decls to match defn changes elsewhere.
2214 (struct buffer_text, struct buffer):
2215 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2216 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
2217 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2218 not int, to avoid needless 32-bit limit on 64-bit hosts.
2219 (exec_byte_code): Use tighter memory-full test, one that checks
2220 for alloca overflow. Don't compute the address of the object just
2221 before an array, as that's not portable. Use EMACS_INT, not
2222 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
2223 * callint.c (Fcall_interactively):
2224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2225 * callproc.c (call_process_kill, Fcall_process):
2226 Don't assume pid_t fits into an Emacs fixnum.
2227 (call_process_cleanup, Fcall_process, child_setup):
2228 Don't assume pid_t fits into int.
2229 (call_process_cleanup, Fcall_process, delete_temp_file)
2230 (Fcall_process_region):
2231 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2232 (Fcall_process): Simplify handling of volatile integers.
2233 Use int, not EMACS_INT, where int will do.
2234 * casefiddle.c (casify_object, casify_region, operate_on_word)
2235 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2236 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2237 (casify_object): Avoid integer overflow when overallocating buffer.
2238 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 2239 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
2240 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2241 * category.h (CATEGORYP): Don't assume arg is nonnegative.
2242 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2243 integers are now checked earlier. All uses replaced with XINT.
2244 (ccl_driver):
2245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2246 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
2247 (ccl_driver, Fregister_code_conversion_map):
2248 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
2249 (resolve_symbol_ccl_program): Check that vector header is in range.
2250 Always copy the vector, so that we can check its contents reliably
2251 now rather than having to recheck each instruction as it's being
2252 executed. Check that vector words fit in 'int'.
2253 (ccl_get_compiled_code, Fregister_ccl_program)
2254 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2255 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2256 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2257 contents are in range.
2258 (Fccl_execute_on_string): Check that status is in range.
2259 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2260 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2261 Accept and return EMACS_INT, not int, because callers can pass values
2262 out of 'int' range.
2263 (c_string_width, strwidth, lisp_string_width, chars_in_text)
2264 (multibyte_chars_in_text, parse_str_as_multibyte)
2265 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2266 (str_as_unibyte, str_to_unibyte, string_count_byte8)
2267 (string_escape_byte8, Fget_byte):
2268 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 2269 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
2270 avoid mishandling large integers.
2271 * character.h: Adjust decls to match defn changes elsewhere.
2272 * charset.c (load_charset_map_from_file, find_charsets_in_text)
2273 (Ffind_charset_region):
2274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2275 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2276 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 2277 Don't assume fixnum fits in int.
d311d28c
PE
2278 (load_charset_map_from_vector, Fmap_charset_chars):
2279 Remove now-unnecessary CHECK_NATNUMs.
2280 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
2281 Don't rely on undefined behavior with signed left shift overflow.
2282 Don't assume unsigned int fits into fixnum, or that fixnum fits
2283 into unsigned int. Don't require max_code to be a valid fixnum;
2284 that's not true for gb10830 4-byte on a 32-bit host. Allow
2285 invalid_code to be a cons, for the same reason. Require code_offset
2286 to be a character. Avoid int overflow if max_char is close
2287 to INT_MAX.
2288 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2289 this is intended anyway and avoids some undefined behavior.
2290 (load_charset_map): Pass unsigned, not int, as 2nd arg of
2291 INDEX_TO_CODE_POINT, as that's what it expects.
2292 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
2293 * charset.h (DECODE_CHAR): Return int, not unsigned;
2294 this is what was intended anyway, and it avoids undefined behavior.
2295 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2296 integer-overflow issues.
2297 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2298 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2299 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
2300 * chartab.c (Fmake_char_table, Fset_char_table_range)
2301 (uniprop_get_decoder, uniprop_get_encoder):
2302 Don't assume fixnum fits in int.
2303 * cmds.c (move_point): New function, that does the gist of
2304 Fforward_char and Fbackward_char, but does so while checking
2305 for integer overflow more accurately.
c96e5d6a 2306 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
2307 (Fforward_line, Fend_of_line, internal_self_insert)
2308 (internal_self_insert):
2309 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2310 Fix a FIXME, by checking for integer overflow when calculating
2311 target_clm and actual_clm.
2312 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 2313 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
2314 (ASSURE_DESTINATION, coding_alloc_by_realloc)
2315 (coding_alloc_by_making_gap, alloc_destination)
2316 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2317 (encode_coding_utf_16, detect_coding_emacs_mule)
2318 (decode_coding_emacs_mule, encode_coding_emacs_mule)
2319 (detect_coding_iso_2022, decode_coding_iso_2022)
2320 (encode_invocation_designation, encode_designation_at_bol)
2321 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2322 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2323 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2324 (encode_coding_ccl, encode_coding_raw_text)
2325 (detect_coding_charset, decode_coding_charset)
2326 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2327 (produce_composition, produce_charset, produce_annotation)
2328 (decode_coding, handle_composition_annotation)
2329 (handle_charset_annotation, consume_chars, decode_coding_gap)
2330 (decode_coding_object, encode_coding_object, detect_coding_system)
2331 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2332 (code_convert_region, code_convert_string)
8f50130c
PE
2333 (Fdefine_coding_system_internal)
2334 (coding_set_source, coding_set_destination):
d311d28c
PE
2335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2336 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2337 (Fdefine_coding_system_internal):
2338 Don't assume fixnums fit in int.
2339 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 2340 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
2341 (Funencodable_char_position, Fcheck_coding_systems_region)
2342 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 2343 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 2344 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 2345 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 2346 Don't access memory outside of the args array.
d311d28c 2347 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
2348 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2349 result of ENCODE_CHAR.
d311d28c
PE
2350 * coding.h: Adjust decls to match defn changes elsewhere.
2351 (struct coding_system):
2352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2353 * composite.c (get_composition_id, find_composition)
2354 (run_composition_function, update_compositions)
2355 (compose_text, composition_gstring_put_cache)
2356 (composition_gstring_p, composition_gstring_width)
2357 (fill_gstring_header, fill_gstring_body, autocmp_chars)
2358 (composition_compute_stop_pos, composition_reseat_it)
2359 (composition_update_it, struct position_record)
2360 (find_automatic_composition, composition_adjust_point)
2361 (Fcomposition_get_gstring, Ffind_composition_internal):
2362 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2363 (update_compositions):
2364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2365 * composite.h: Adjust decls to match defn changes elsewhere.
2366 (struct composition):
2367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2368 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2369 Do not attempt to compute the address of the object just before a
2370 buffer; this is not portable.
2371 (Faref, Faset):
2372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2373 (Faset): Use int, not EMACS_INT, where int is wide enough.
2374 (Fstring_to_number): Don't assume fixnums fit in int.
2375 (Frem): Don't assume arg is nonnegative.
2376 * dbusbind.c (xd_append_arg): Check for integers out of range.
2377 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 2378 (extract_signed, extract_unsigned): New functions.
243e0530
PE
2379 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2380 (xd_get_connection_references): Return ptrdiff_t, not int.
2381 All uses changed.
2382 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2383 (xd_read_message_1):
2384 Use int, not unsigned, where the dbus API uses int.
2385 (Fdbus_message_internal): Don't overflow mtype.
2386 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
2387 * dired.c (directory_files_internal, file_name_completion, scmp)
2388 (file_name_completion_stat):
2389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2390 (file_name_completion): Don't overflow matchcount.
2391 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2392 * dispextern.h: Adjust decls to match defn changes elsewhere.
2393 (struct text_pos, struct glyph, struct bidi_saved_info)
2394 (struct bidi_string_data, struct bidi_it, struct composition_it)
2395 (struct it):
2396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2397 (struct display_pos, struct composition_it, struct it):
2398 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2399 * dispnew.c (increment_matrix_positions)
2400 (increment_row_positions, mode_line_string)
2401 (marginal_area_string):
2402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 2403 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
2404 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2405 (duration_to_sec_usec): New function, to check for overflow better.
2406 (Fsleep_for, sit_for): Use it.
2407 * doc.c (get_doc_string, store_function_docstring):
2408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2409 (get_doc_string, Fsnarf_documentation):
2410 Use int, not EMACS_INT, where int is wide enough.
2411 (get_doc_string):
2412 Use SAFE_ALLOCA, not alloca.
2413 Check for overflow when converting EMACS_INT to off_t.
2414 * doprnt.c (doprnt):
2415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2416 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2417 Don't assume uid_t fits into fixnum.
2418 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2419 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2420 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2421 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2422 (general_insert_function)
2423 (Finsert_char, make_buffer_string, make_buffer_string_both)
2424 (update_buffer_properties, Fbuffer_substring)
2425 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2426 (Fsubst_char_in_region, check_translation)
2427 (Ftranslate_region_internal, save_restriction_restore, Fformat)
2428 (transpose_markers, Ftranspose_regions):
2429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2430 (clip_to_bounds): Move to lisp.h as an inline function).
2431 (Fconstrain_to_field): Don't assume integers are nonnegative.
2432 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2433 (Fsubst_char_in_region, Fsave_restriction):
2434 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2435 (Femacs_pid): Don't assume pid_t fits into fixnum.
2436 (lo_time): Use int, not EMACS_INT, when int suffices.
2437 (lisp_time_argument): Check for usec out of range.
2438 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
2439 (Fuser_login_name, Fuser_full_name): Signal an error
2440 if a uid argument is out of range, rather than relying on
2441 undefined behavior.
c8d5c857
PE
2442 (Fformat_time_string): Remove now-unnecessary check.
2443 lisp_time_argument checks for out-of-range usec now.
243e0530 2444 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
2445 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2446 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2447 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2448 (init_cmdargs, Fdump_emacs):
2449 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2450 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2451 the bottom (typically) 32 bits of the fixnum.
2452 * eval.c (specpdl_size, call_debugger):
2453 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2454 (when_entered_debugger, Fbacktrace_debug):
2455 Don't assume fixnum can fit in int.
2456 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
2457 the object just before a buffer; this is not portable.
2458 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
2459 (grow_specpdl, unbind_to):
2460 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2461 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
2462 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 2463 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
2464 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2465 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2467 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2468 (a_write, e_write):
2469 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2470 (Fcopy_file, non_regular_nbytes, read_non_regular)
2471 (Finsert_file_contents):
2472 Use int, not EMACS_INT, where int is wide enough.
2473 (READ_BUF_SIZE): Verify that it fits in int.
2474 (Finsert_file_contents): Check that counts are in proper range,
2475 rather than assuming fixnums fit into ptrdiff_t etc.
2476 Don't assume fixnums fit into int.
125b3835 2477 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
2478 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
2479 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
2480 (string_char_to_byte, string_byte_to_char)
2481 (string_make_multibyte, string_to_multibyte)
2482 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
2483 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
2484 (substring_both, Fdelete, internal_equal, Ffillarray)
2485 (Fclear_string, mapcar1)
2486 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
2487 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
2488 (larger_vector, make_hash_table, maybe_resize_hash_table)
2489 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
2490 (Fmaphash, secure_hash):
2491 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2492 (concat): Check for string index and length overflow.
2493 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
2494 (Frequire):
2495 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2496 (larger_vector): New API (vec, incr_min, size_max) replaces old
2497 one (vec, new_size, init). This catches size overflow.
2498 INIT was removed because it was always Qnil.
2499 All callers changed.
2500 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
2501 the upper bound on a hash table index size.
2502 (make_hash_table, maybe_resize_hash_table): Use it.
2503 (secure_hash): Computer start_byte and end_byte only after
2504 they're known to be in ptrdiff_t range.
2505 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
2506 (Ffont_get_glyphs, Ffont_at):
2507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2508 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
2509 (Flist_fonts, Fopen_font):
2510 Don't assume fixnum can fit in int.
2511 (check_gstring): Don't assume index can fit in int.
2512 (font_match_p): Check that fixnum is a character, not a nonnegative
2513 fixnum, since the later code needs to stuff it into an int.
2514 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
2515 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
2516 conversion overflow issues.
2517 (Fopen_font): Check for integer out of range.
2518 (Ffont_get_glyphs): Don't assume index can fit in int.
2519 * font.h: Adjust decls to match defn changes elsewhere.
2520 * fontset.c (reorder_font_vector): Redo score calculation to avoid
2521 integer overflow.
2522 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
2523 printmax_t, where ptrdiff_t is wide enough.
2524 (Finternal_char_font):
2525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2526 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
2527 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
2528 (Fset_frame_position, x_set_frame_parameters)
2529 (x_set_line_spacing, x_set_border_width)
2530 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
2531 Check that fixnums are in proper range for system types.
2532 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
2533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2534 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
2535 Use SAFE_ALLOCA_LISP, not alloca.
2536 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
2537 intptr_t is wide enough.
2538 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
2539 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
2540 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
2541 Check for fixnum out of range.
2542 * ftfont.c (ftfont_list): Don't assume index fits in int.
2543 Check that fixnums are in proper range for system types.
2544 (ftfont_shape_by_flt):
2545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
2546 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2548 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
2549 Check that fixnums are in proper range for system types.
2550 * gnutls.h: Adjust decls to match defn changes elsewhere.
2551 * gtkutil.c (xg_dialog_run):
2552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2553 (update_frame_tool_bar):
2554 Check that fixnums are in proper range for system types.
2555 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 2556 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
2557 * indent.c (last_known_column, last_known_column_point):
2558 (current_column_bol_cache):
2559 (skip_invisible, current_column, check_display_width):
2560 (check_display_width, scan_for_column, current_column_1)
2561 (Findent_to, Fcurrent_indentation, position_indentation)
2562 (indented_beyond_p, Fmove_to_column, compute_motion):
2563 (Fcompute_motion, Fvertical_motion):
2564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2565 (last_known_column_modified): Use EMACS_INT, not int.
2566 (check_display_width):
2567 (Fcompute_motion):
2568 Check that fixnums and floats are in proper range for system types.
2569 (compute_motion): Don't assume index or fixnum fits in int.
2570 (compute_motion, Fcompute_motion):
2571 Use int, not EMACS_INT, when it is wide enough.
2572 (vmotion): Omit local var start_hpos that is always 0; that way
2573 we don't need to worry about overflow in expressions involving it.
2574 * indent.h: Adjust decls to match defn changes elsewhere.
2575 (struct position):
2576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2577 Use int, not EMACS_INT, where int is wide enough.
2578 Remove unused members ovstring_chars_done and tab_offset;
2579 all uses removed.
2580 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
2581 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
2582 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
2583 (make_gap, copy_text, insert, insert_and_inherit)
2584 (insert_before_markers, insert_before_markers_and_inherit)
2585 (insert_1, count_combining_before, count_combining_after)
2586 (insert_1_both, insert_from_string)
2587 (insert_from_string_before_markers, insert_from_string_1)
2588 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
2589 (adjust_after_replace, adjust_after_insert, replace_range)
2590 (replace_range_2, del_range, del_range_1, del_range_byte)
2591 (del_range_both, del_range_2, modify_region)
2592 (prepare_to_modify_buffer, signal_before_change)
2593 (signal_after_change, Fcombine_after_change_execute):
2594 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2595 * intervals.c (traverse_intervals, rotate_right, rotate_left)
2596 (balance_an_interval, split_interval_right, split_interval_left)
2597 (find_interval, next_interval, update_interval)
2598 (adjust_intervals_for_insertion, delete_node, delete_interval)
2599 (interval_deletion_adjustment, adjust_intervals_for_deletion)
2600 (static_offset_intervals, offset_intervals)
2601 (merge_interval_right, merge_interval_left, make_new_interval)
2602 (graft_intervals_into_buffer, temp_set_point_both)
2603 (temp_set_point, set_point, adjust_for_invis_intang)
2604 (set_point_both, move_if_not_intangible, get_property_and_range)
2605 (get_local_map, copy_intervals, copy_intervals_to_string)
2606 (compare_string_intervals, set_intervals_multibyte_1):
2607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2608 * intervals.h: Adjust decls to match defn changes elsewhere.
2609 (struct interval):
2610 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2611 * keyboard.c (this_command_key_count, this_single_command_key_start)
2612 (before_command_key_count, before_command_echo_length, echo_now)
2613 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
2614 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
2615 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
2616 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
2617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2618 (last_non_minibuf_size, last_point_position, echo_truncate)
2619 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
2620 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
2621 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
2622 (stuff_buffered_input):
2623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2624 (last_auto_save, command_loop_1, read_char):
2625 Use EMACS_INT, not int, to avoid integer overflow.
2626 (record_char): Avoid overflow in total_keys computation.
2627 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
2628 * keyboard.h: Adjust decls to match defn changes elsewhere.
2629 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
2630 (Fkey_description, Fdescribe_vector, Flookup_key):
2631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2632 (click_position): New function, to check that positions are in range.
2633 (Fcurrent_active_maps):
2634 (describe_command):
2635 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2636 (Faccessible_keymaps, Fkey_description):
2637 (preferred_sequence_p):
2638 Don't assume fixnum can fit into int.
2639 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
2640 Check for integer overflow in size calculations.
2641 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
2642 avoid mishandling large integers.
2643 * lisp.h: Adjust decls to match defn changes elsewhere.
2644 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
2645 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
2646 (struct Lisp_Marker):
2647 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2648 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
2649 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
2650 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
2651 All callers changed.
2652 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
2653 Assume the arg has valid form, since it always does.
2654 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
2655 unsigned integer system type.
2656 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
2657 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
2658 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2659 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
2660 (duration_to_sec_usec): New decl.
2661 * lread.c (read_from_string_index, read_from_string_index_byte)
2662 (read_from_string_limit, readchar, unreadchar, openp)
2663 (read_internal_start, read1, oblookup):
2664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2665 (Fload, readevalloop, Feval_buffer, Feval_region):
2666 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2667 (openp): Check for out-of-range argument to 'access'.
2668 (read1): Use int, not EMACS_INT, where int is wide enough.
2669 Don't assume fixnum fits into int.
6efdadfd 2670 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
2671 (read_filtered_event): Use duration_to_sec_usec
2672 to do proper overflow checking on durations.
d311d28c
PE
2673 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
2674 in size calculation.
2675 (Fexecute_kbd_macro):
2676 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2677 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
2678 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
2679 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
2680 (set_marker_both, set_marker_restricted_both, marker_position)
2681 (marker_byte_position, Fbuffer_has_markers_at):
2682 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2683 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 2684 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
2685 It now merely ensures that the menu is large enough, without
2686 necessarily growing it, as this avoids some integer overflow issues.
2687 All callers changed.
2688 (keymap_panes, parse_single_submenu, Fx_popup_menu):
2689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2690 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
2691 Use SAFE_ALLOCA_LISP, not alloca.
2692 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
2693 to EMACS_INT. Check that fixnums are in proper range for system types.
2694 * minibuf.c (minibuf_prompt_width, string_to_object)
2695 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
2696 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
2697 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2698 (get_minibuffer, read_minibuf_unwind):
2699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2700 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
2701 this simplifies overflow checking. All callers changed.
2702 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
2703 (Ftest_completion):
2704 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2705 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
2706 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
2707 Check that fixnums are in proper range for system types.
2708 (Fx_create_frame, Fx_show_tip):
2709 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2710 * nsfont.m (ns_findfonts, nsfont_list_family):
2711 Don't assume fixnum fits in long.
2712 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
2713 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2714 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
2715 wide enough.
17fdb222 2716 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
2717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2718 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
2719 (PRINTDECLARE, PRINTPREPARE):
2720 (strout, print_string):
2721 (print, print_preprocess, print_check_string_charset_prop)
2722 (print_object):
2723 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2724 (PRINTDECLARE):
2725 (temp_output_buffer_setup, Fprin1_to_string, print_object):
2726 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2727 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 2728 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 2729 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
2730 (print_error_message): Use SAFE_ALLOCA, not alloca.
2731 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
2732 (print_depth, new_backquote_output, print_number_index):
2733 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
2734 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
2735 (Fset_process_window_size, Fformat_network_address)
2736 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 2737 (sigchld_handler):
d311d28c 2738 Check that fixnums are in proper range for system types.
d44287d4 2739 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
2740 Check for process-ids out of pid_t range rather than relying on
2741 undefined behavior.
e4d81efc 2742 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
2743 (Fformat_network_address, read_process_output, send_process)
2744 (Fprocess_send_region, status_notify):
2745 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2746 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
2747 (wait_reading_process_output, read_process_output, exec_sentinel):
2748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2749 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
2750 (Faccept_process_output): Use duration_to_sec_usec to do proper
2751 overflow checking on durations.
dde14581
PE
2752 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
2753 Don't assume pid_t fits in int.
02481186
PE
2754 * process.h (struct Lisp_Process): Members tick and update_tick
2755 are now of type EMACS_INT, not int.
b62b53e8
PE
2756 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
2757 configured --with-wide-int.
d311d28c
PE
2758 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
2759 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
2760 * search.c (looking_at_1, string_match_1):
2761 (fast_string_match, fast_c_string_match_ignore_case)
2762 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
2763 (scan_newline, find_before_next_newline, search_command)
2764 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
2765 (set_search_regs, wordify):
2766 (Freplace_match):
2767 (Fmatch_data):
2768 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2769 (string_match_1, search_buffer, set_search_regs):
2770 (Fmatch_data):
2771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2772 (wordify): Check for overflow in size calculation.
2773 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
2774 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
2775 Check that fixnums are in proper range for system types.
2776 * sound.c (struct sound_device)
2777 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
2778 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2779 (Fplay_sound_internal):
2780 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 2781 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
2782 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
2783 (Fparse_partial_sexp):
2784 Don't assume fixnums can fit in int.
2785 (struct lisp_parse_state, find_start_pos, find_start_value)
2786 (find_start_value_byte, find_start_begv)
2787 (update_syntax_table, char_quoted, dec_bytepos)
2788 (find_defun_start, prev_char_comend_first, back_comment):
2789 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
2790 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
2791 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2792 (Finternal_describe_syntax_value): Check that match_lisp is a
2793 character, not an integer, since the code stuffs it into int.
2794 (scan_words, scan_sexps_forward):
2795 Check that fixnums are in proper range for system types.
2796 (Fforward_word):
2797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2798 (scan_sexps_forward):
2799 Use CHARACTERP, not INTEGERP, since the value must fit into int.
2800 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
2801 * syntax.h: Adjust decls to match defn changes elsewhere.
2802 (struct gl_state_s):
2803 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
2804 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
2805 MOST_POSITIVE_FIXNUM.
d311d28c
PE
2806 * sysdep.c (wait_for_termination_1, wait_for_termination)
2807 (interruptible_wait_for_termination, mkdir):
2808 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
2809 (emacs_read, emacs_write):
2810 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
2811 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
2812 and double all fit in int.
d311d28c
PE
2813 * term.c (set_tty_color_mode):
2814 Check that fixnums are in proper range for system types.
2815 * termhooks.h (struct input_event):
2816 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2817 * textprop.c (validate_interval_range, interval_of)
2818 (Fadd_text_properties, set_text_properties_1)
2819 (Fremove_text_properties, Fremove_list_of_text_properties)
2820 (Ftext_property_any, Ftext_property_not_all)
2821 (copy_text_properties, text_property_list, extend_property_ranges)
2822 (verify_interval_modification):
2823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2824 (Fnext_single_char_property_change)
2825 (Fprevious_single_char_property_change):
2826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
2827 (copy_text_properties):
2828 Check for integer overflow in index calculation.
d311d28c
PE
2829 * undo.c (last_boundary_position, record_point, record_insert)
2830 (record_delete, record_marker_adjustment, record_change)
2831 (record_property_change):
2832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2833 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
2834 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2835 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
2836 (Fx_hide_tip, Fx_file_dialog):
2837 * w32menu.c (set_frame_menubar):
2838 Use ptrdiff_t, not int, for consistency with rest of code.
2839 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
2840 (select_window, Fdelete_other_windows_internal)
2841 (window_scroll_pixel_based, window_scroll_line_based)
2842 (Frecenter, Fset_window_configuration):
2843 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2844 (Fset_window_hscroll, run_window_configuration_change_hook)
2845 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 2846 (Fscroll_other_window, Frecenter):
d311d28c
PE
2847 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2848 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
2849 Don't assume fixnum fits in int.
2850 (Fset_window_scroll_bars):
2851 Check that fixnums are in proper range for system types.
2852 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
2853 (string_pos, c_string_pos, number_of_chars, init_iterator)
2854 (in_ellipses_for_invisible_text_p, init_from_display_pos)
2855 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
2856 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
2857 (face_before_or_after_it_pos, handle_invisible_prop)
2858 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
2859 (display_prop_intangible_p, string_buffer_position_lim)
2860 (string_buffer_position, handle_composition_prop, load_overlay_strings)
2861 (get_overlay_strings_1, get_overlay_strings)
2862 (iterate_out_of_display_property, forward_to_next_line_start)
2863 (back_to_previous_visible_line_start, reseat, reseat_to_string)
2864 (get_next_display_element, set_iterator_to_next)
2865 (get_visually_first_element, compute_stop_pos_backwards)
2866 (handle_stop_backwards, next_element_from_buffer)
2867 (move_it_in_display_line_to, move_it_in_display_line)
2868 (move_it_to, move_it_vertically_backward, move_it_by_lines)
2869 (add_to_log, message_dolog, message_log_check_duplicate)
2870 (message2, message2_nolog, message3, message3_nolog
2871 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
2872 (current_message_1, truncate_echo_area, truncate_message_1)
2873 (set_message, set_message_1, store_mode_line_noprop)
2874 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
2875 (text_outside_line_unchanged_p, check_point_in_composition)
2876 (reconsider_clip_changes)
2877 (redisplay_internal, set_cursor_from_row, try_scrolling)
2878 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
2879 (redisplay_window, find_last_unchanged_at_beg_row)
2880 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
2881 (trailing_whitespace_p, find_row_edges, display_line)
2882 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
2883 (display_mode_element, store_mode_line_string)
2884 (pint2str, pint2hrstr, decode_mode_spec)
2885 (display_count_lines, display_string, draw_glyphs)
2886 (x_produce_glyphs, x_insert_glyphs)
2887 (rows_from_pos_range, mouse_face_from_buffer_pos)
2888 (fast_find_string_pos, mouse_face_from_string_pos)
2889 (note_mode_line_or_margin_highlight, note_mouse_highlight):
2890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2891 (safe_call, init_from_display_pos, handle_fontified_prop)
2892 (handle_single_display_spec, load_overlay_strings)
2893 (with_echo_area_buffer, setup_echo_area_for_printing)
2894 (display_echo_area, echo_area_display)
2895 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
2896 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
2897 (redisplay_window, dump_glyph_row, display_mode_line)
2898 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 2899 (handle_display_spec, display_prop_string_p):
d311d28c
PE
2900 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2901 (handle_single_display_spec, build_desired_tool_bar_string)
2902 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
2903 (get_specified_cursor_type):
2904 Check that fixnums are in proper range for system types.
2905 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
2906 (Flookup_image_map):
2907 Don't assume fixnums fit in int.
2908 (compare_overlay_entries):
2909 Avoid mishandling comparisons due to subtraction overflow.
2910 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
2911 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
2912 (handle_tool_bar_click):
2913 Use int, not unsigned, since we prefer signed and the signedness
2914 doesn't matter here.
2915 (get_next_display_element, next_element_from_display_vector):
2916 Use int, not EMACS_INT, when int is wide enough.
2917 (start_hourglass): Use duration_to_sec_usec to do proper
2918 overflow checking on durations.
2919 * xfaces.c (Fbitmap_spec_p):
2920 Check that fixnums are in proper range for system types.
2921 (compare_fonts_by_sort_order):
2922 Avoid mishandling comparisons due to subtraction overflow.
2923 (Fx_family_fonts, realize_basic_faces):
2924 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2925 (Fx_family_fonts):
2926 Don't assume fixnum fits in int.
2927 Use SAFE_ALLOCA_LISP, not alloca.
2928 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
2929 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
2930 (face_at_buffer_position, face_for_overlay_string)
2931 (face_at_string_position):
2932 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2933 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
2934 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
2935 (Fx_show_tip):
2936 Check that fixnums are in proper range for system types.
2937 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
2938 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
2939 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2940 (Fx_change_window_property): Don't assume fixnums fit in int.
2941 * xfont.c (xfont_chars_supported):
2942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2943 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
2944 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
2945 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2946 * xml.c (parse_region):
2947 * xrdb.c (magic_file_p):
2948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2949 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
2950 (x_get_local_selection, x_reply_selection_request)
2951 (x_handle_selection_request, wait_for_property_change):
2952 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2953 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
2954 short is wide enough.
2955 (x_send_client_event): Don't assume fixnum fits in int.
2956 * xterm.c (x_x_to_emacs_modifiers):
2957 Don't assume EMACS_INT overflows nicely into int.
2958 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
2959 may come from Lisp.
2960 (handle_one_xevent): NATNUMP can eval its arg twice.
2961 (x_connection_closed):
2962 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2963 * xterm.h: Adjust decls to match defn changes elsewhere.
2964 (struct scroll_bar): Use struct vectorlike_header
2965 rather than rolling our own approximation.
2966 (SCROLL_BAR_VEC_SIZE): Remove; not used.
2967
c6574eb5
GM
29682012-05-25 Glenn Morris <rgm@gnu.org>
2969
2970 * lisp.mk (lisp): Update for more files being compiled now.
2971
e8d32c7e
SM
29722012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
2973
48def666
SM
2974 * lread.c: Remove `read_pure' which makes no difference.
2975 (read_pure): Remove var.
2976 (unreadpure): Remove function.
2977 (readevalloop): Don't call read_list with -1 flag.
2978 (read1, read_vector): Don't test read_pure any more.
2979 (read_list): Simplify.
2980
e8d32c7e
SM
2981 * fileio.c, character.h: Minor style tweaks.
2982
4b2addb7
DA
29832012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
2984
2985 * window.h (clip_changed): Remove useless declaration.
2986
584461b2
JB
29872012-05-22 Juanma Barranquero <lekktu@gmail.com>
2988
2989 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
2990 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
2991
34374650
PE
29922012-05-22 Paul Eggert <eggert@cs.ucla.edu>
2993
2994 Remove src/m/*.
2995 This directory predates autoconf and is no longer needed nowadays.
2996 Move its few remaining bits of functionality to where they're needed.
2997 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
2998 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
2999 * m/template.h: Remove.
3000 * Makefile.in (M_FILE): Remove. All uses removed.
3001 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3002 * lisp.h (USE_LSB_TAG):
3003 * mem-limits.h (EXCEEDS_LISP_PTR):
3004 Use VAL_MAX, not VALBITS, in #if.
3005 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3006 (EMACS_UINT): Define unconditionally now.
3007 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3008 (BITS_PER_EMACS_INT): New constants, replacing
3009 what used to be in config.h, but not useful in #if.
3010 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3011 define them any more.
3012 (VAL_MAX): New macro.
3013 (VALMASK): Use it.
3014 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3015 BITS_PER_EMACS_INT, in #if.
3016 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3017 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3018 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3019 * s/ms-w32.h (DATA_START):
3020 Move here from removed file m/intel386.h.
3021 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3022 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3023
261cb4bb
PE
30242012-05-21 Paul Eggert <eggert@cs.ucla.edu>
3025
3026 Assume C89 or later.
3027 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3028 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3029 (xrealloc):
3030 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3031 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3032 * textprop.c, tparam.c (NULL): Remove.
3033 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3034 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3035 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
3036 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3037 * xterm.c (input_signal_count): Assume volatile works.
3038
ff23cd9f
KB
30392012-05-21 Ken Brown <kbrown@cornell.edu>
3040
3041 * xgselect.c (xg_select): Fix first argument in call to 'select'
3042 (bug#11508).
3043
1b170bc6
KB
30442012-05-20 Ken Brown <kbrown@cornell.edu>
3045
3046 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 3047 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 3048
b2f4d39f
KB
30492012-05-19 Ken Brown <kbrown@cornell.edu>
3050
3051 * xfns.c (x_in_use): Remove `static' qualifier.
3052 * xterm.h (x_in_use): Declare.
3053 * xgselect.c: Include xterm.h.
3054 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3055 and `display_arg' (bug#9754).
3056
003fdae2
PE
30572012-05-19 Paul Eggert <eggert@cs.ucla.edu>
3058
9232a6d9
PE
3059 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3060
003fdae2
PE
3061 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3062 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3063
784b56e2
EZ
30642012-05-18 Eli Zaretskii <eliz@gnu.org>
3065
3066 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3067
3068 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 3069 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
3070
3071 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3072 reference to image_cache->refcount.
3073 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3074
a0a79cde
JL
30752012-05-17 Juri Linkov <juri@jurta.org>
3076
3077 * search.c (Fword_search_regexp, Fword_search_backward)
3078 (Fword_search_forward, Fword_search_backward_lax)
3079 (Fword_search_forward_lax): Move functions to isearch.el
3080 (bug#10145, bug#11381).
3081
b0572523
PE
30822012-05-16 Paul Eggert <eggert@cs.ucla.edu>
3083
3084 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3085
9660f5fc
SM
30862012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3087
3088 * lread.c (init_obarray): Declare Qt and Qnil as special.
3089
4374de83
GM
30902012-05-14 Glenn Morris <rgm@gnu.org>
3091
3092 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 3093 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 3094
dc44c39a
PE
30952012-05-14 Paul Eggert <eggert@cs.ucla.edu>
3096
078c97cb
PE
3097 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3098
dc44c39a
PE
3099 * unexaix.c: Port to more-recent AIX compilers.
3100 (report_error, report_error_1, make_hdr, copy_sym)
3101 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3102 Make arguments const char *, not char *, to avoid violations of C
3103 standard and to fix some AIX warnings reported by Gilles Pion.
3104
e18afed7 31052012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
3106
3107 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3108 already have overlays loaded.
3109 (handle_single_display_spec): Before returning without displaying
3110 fringe bitmap, synchronize the bidi iterator with the main display
3111 iterator, by calling iterate_out_of_display_property.
3112 (iterate_out_of_display_property): Detect buffer iteration by
3113 testing that it->string is a Lisp string.
3114 (get_next_display_element): When the current object is exhausted,
3115 and there's something on it->stack, call set_iterator_to_next to
3116 proceed with what's on the stack, instead of returning zero.
3117 (set_iterator_to_next): If called at the end of a Lisp string,
3118 proceed to consider_string_end without incrementing string
3119 position. Don't increment display vector index past the end of
3120 the display vector. (Bug#11417)
c8fb9dc6
EZ
3121 (pos_visible_p): Don't report a position visible when move_it_to
3122 stopped at the last line of window, which happens to be scanned
3123 backwards by the bidi iteration. (Bug#11464)
ac268e67 3124
e18afed7 31252012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
3126
3127 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3128 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
3129 are on a TTY, and thus unable to display on the fringes.
3130 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
3131 so we need to signal to the caller that this is a "replacing"
3132 display spec. This fixes display when the spec is invalid or we
3133 are on a TTY.
3134
e18afed7 31352012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
3136
3137 * unexaix.c (make_hdr): Fix typo in prototype.
3138 This bug broke the build on AIX. Problem reported by Gilles Pion.
3139
9d0a235a
MA
31402012-05-14 Michael Albinus <michael.albinus@gmx.de>
3141
3142 * keyboard.c (kbd_buffer_get_event): Read special events also in
3143 batch mode. (Bug#11415)
3144
9e6b06ed
GM
31452012-05-12 Glenn Morris <rgm@gnu.org>
3146
3147 * ns.mk: Update for ns_appbindir no longer having trailing "/".
3148
c1a1d7a3
EZ
31492012-05-12 Eli Zaretskii <eliz@gnu.org>
3150
3151 * lisp.mk (lisp): Add newcomment.elc.
3152
3fe7cdc8
GM
31532012-05-12 Glenn Morris <rgm@gnu.org>
3154
3155 * Makefile.in (MKDIR_P): New, set by configure.
3156 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3157
53f7d2c0
PE
31582012-05-11 Paul Eggert <eggert@cs.ucla.edu>
3159
3160 Remove unused function hourglass_started.
3161 * dispextern.h (hourglass_started):
3162 * w32fns.c (hourglass_started):
3163 * xdisp.c (hourglass_started): Remove.
3164
75aafb17
JB
31652012-05-10 Juanma Barranquero <lekktu@gmail.com>
3166
3167 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3168 Update dependencies.
3169
12959e8e
PE
31702012-05-10 Paul Eggert <eggert@cs.ucla.edu>
3171
97107e2e
PE
3172 * xgselect.c (xg_select): Put maxfds+1 into a var.
3173 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3174
12959e8e
PE
3175 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3176
836d29b3
DA
31772012-05-10 Dave Abrahams <dave@boostpro.com>
3178
3179 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3180 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
3181
5cb67954
MA
31822012-05-09 Michael Albinus <michael.albinus@gmx.de>
3183
3184 * dbusbind.c (xd_registered_buses): New internal Lisp object.
3185 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3186 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3187 Initialize xd_registered_buses.
3188
3478ec45
PE
31892012-05-09 Paul Eggert <eggert@cs.ucla.edu>
3190
b263a6b0
PE
3191 Untag more efficiently if USE_LSB_TAG.
3192 This is based on a proposal by YAMAMOTO Mitsuharu in
3193 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3194 For an admittedly artificial (nth 8000 longlist) benchmark on
3195 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
3196 Emacs's overall text size by 1%.
3197 * lisp.h (XUNTAG): New macro.
3198 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3199 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3200 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3201 * eval.c (Fautoload):
3202 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3203 * frame.h (XFRAME): Use XUNTAG.
3204
3478ec45
PE
3205 Port recent dbusbind.c changes to 32-bit --with-wide-int.
3206 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3207 Remove unportable assumptions about print widths of types like
3208 dbus_uint32_t.
3209 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3210 intptr_t when converting between pointer and integer, to avoid GCC
3211 warnings about wrong width.
3212
666b903b 32132012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
3214
3215 * w32proc.c (new_child): Force Windows to reserve only 64KB of
3216 stack for each reader_thread, instead of defaulting to 8MB
3217 determined by the linker. This avoids failures in creating
3218 subprocesses on Windows 7, see the discussion in this thread:
3219 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3220
b120cc17
JC
32212012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
3222
3223 Fix up display of the *Minibuf-0* buffer in the mini window.
3224 * keyboard.c (read_char): Don't clear the echo area if there's no
3225 message to clear.
3226 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 3227 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 3228
9a4b36f8
MA
32292012-05-07 Michael Albinus <michael.albinus@gmx.de>
3230
3231 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3232 batch mode.
3233
e5f9458f
CY
32342012-05-06 Chong Yidong <cyd@gnu.org>
3235
3236 * lisp.mk (lisp): Update.
3237
eceeb5fc 32382012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
3239
3240 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3241
71873e2b
SM
32422012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3243
3244 * data.c (PUT_ERROR): New macro.
3245 (syms_of_data): Use it. Add new error type `user-error'.
3246 * undo.c (user_error): New function.
3247 (Fprimitive_undo): Use it.
3248 * print.c (print_error_message): Adjust print style for `user-error'.
3249 * keyboard.c (user_error): New function.
3250 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3251
ab0fa4e4
PE
32522012-05-03 Paul Eggert <eggert@cs.ucla.edu>
3253
3254 Do not limit current-time-string to years 1000..9999.
3255 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3256 (Fcurrent_time_string): Support any year that is supported by the
3257 underlying localtime representation. Don't use asctime, as it
3258 has undefined behavior for years outside the range -999..9999.
3259
7ed806a7
PE
32602012-05-02 Paul Eggert <eggert@cs.ucla.edu>
3261
3262 Fix race conditions involving setenv, gmtime, localtime, asctime.
3263 Without this fix, interrupts could mess up code that uses these
3264 nonreentrant functions, since setting TZ invalidates existing
3265 tm_zone or tzname values, and since most of these functions return
3266 pointers to static storage.
3267 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3268 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3269 Grow the critical sections to include not just invoking
3270 localtime/gmtime, but also accessing these functions' results
3271 including their tm_zone values if any, and any related TZ setting.
3272 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
3273 so that the struct tm is saved in the critical section.
3274 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
3275 motivated by the fact that memory allocation needs to be outside
3276 the critical section.
3277
0c16dfed
DA
32782012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
3279
3280 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3281 with RESET_INTERVAL.
3282
3283 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3284 Remove duplicated buffer name initialization.
3285
3f83ace8
JM
32862012-05-02 Jim Meyering <jim@meyering.net>
3287
3288 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3289
c7b8541e
JM
3290 * xfns.c (x_window): Use xstrdup (Bug#11375).
3291
90207a15 32922012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
3293
3294 * xdisp.c (pos_visible_p): If already at a newline from the
3295 display string before the 'while' loop, don't walk back the glyphs
3296 from it3.glyph_row. Solves assertion violation when the display
3297 string begins with a newline (egg.el). (Bug#11367)
3298
b593d6a9
AH
32992012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
3300
3301 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3302 Move to simple.el.
3303
4737362e
GM
33042012-05-01 Glenn Morris <rgm@gnu.org>
3305
99cf43f9
GM
3306 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3307 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3308 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3309 All were removed before 23.1.
3310
9311dcff
GM
3311 * dispnew.c: Remove HAVE_LIBNCURSES test;
3312 it is always true on relevant platforms.
3313
4d5c6349
GM
3314 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3315 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3316
4737362e
GM
3317 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3318
74dd3a6b
AS
33192012-04-30 Andreas Schwab <schwab@linux-m68k.org>
3320
3321 * .gdbinit (xpr): Remove checks for no longer existing misc types.
3322 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3323 Remove.
3324
13c379ee
PE
33252012-04-28 Paul Eggert <eggert@cs.ucla.edu>
3326
3327 Do not avoid creating empty evaporating overlays (Bug#9642).
3328 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3329 That is, do not delete an evaporating overlay if it becomes
3330 empty after its bounds are adjusted to fit within its buffer.
3331 This fix caused other problems, and I'm reverting it until we get
3332 to the bottom of them.
3333
a8e7d6d7 33342012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
3335
3336 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3337
a8e7d6d7 33382012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
3339
3340 * xdisp.c (pos_visible_p): If the window start position is beyond
3341 ZV, start the display from buffer beginning. Prevents assertion
3342 violation in init_iterator when the minibuffer window is scrolled
3343 via the scroll bar.
3344
3345 * window.c (window_scroll_pixel_based): Likewise.
3346
a8e7d6d7 33472012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
3348
3349 * keymap.c (where_is_internal): Doc fix (Bug#10872).
3350
a8e7d6d7 33512012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
3352
3353 * fileio.c (Fcopy_file, Fset_file_selinux_context):
3354 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
3355
a8e7d6d7 33562012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 3357
b593d6a9
AH
3358 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3359 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 3360
1c6900d9
EZ
33612012-04-26 Eli Zaretskii <eliz@gnu.org>
3362
4c3fa1d9
EZ
3363 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3364 display element, check also the underlying string or buffer
3365 character. (Bug#11341)
3366
1c6900d9
EZ
3367 * w32menu.c: Include w32heap.h.
3368 (add_menu_item): If the call to AppendMenuW (via
3369 unicode_append_menu) fails, disable Unicode menus only if we are
3370 running on Windows 9X/Me.
3371
42bf8205
AS
33722012-04-24 Andreas Schwab <schwab@linux-m68k.org>
3373
3374 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3375 (xgetint): Add missing shift for LSB tags.
3376
b1bac16e
MR
33772012-04-24 Martin Rudalics <rudalics@gmx.at>
3378
3379 * keyboard.c (read_char): Don't wipe echo area for select window
3380 events: These might get delayed via `mouse-autoselect-window'
3381 (Bug#11304).
3382
d69621cc
JB
33832012-04-24 Juanma Barranquero <lekktu@gmail.com>
3384
3385 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3386 manipulation of :loaded-from data.
3387
02fd101b
JB
33882012-04-23 Juanma Barranquero <lekktu@gmail.com>
3389
3390 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3391 now a cons (bug#11311).
3392
888bec30
PE
33932012-04-23 Paul Eggert <eggert@cs.ucla.edu>
3394
89a438bd
PE
3395 Do not create empty overlays with the evaporate property (Bug#9642).
3396 * buffer.c (Fmove_overlay): Delete an evaporating overlay
3397 if it becomes empty after its bounds are adjusted to fit within
3398 its buffer. Without this fix, in a nonempty buffer (let ((o
3399 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3400 yields an empty overlay that has the evaporate property, which is
3401 not supposed to happen.
3402
1068fe4d
PE
3403 Fix minor GTK3 problems found by static checking.
3404 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3405 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3406 (struct _EmacsFixedClass, emacs_fixed_get_type):
3407 Move decls here from emacsgtkfixed.h, since they needn't be public.
3408 (emacs_fixed_get_type): Now static.
3409 (emacs_fixed_class_init): Omit unused local.
3410 (emacs_fixed_child_type): Remove; unused.
3411 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3412 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3413 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3414 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3415 (EMACS_FIXED_GET_CLASS): Remove; unused.
3416 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3417
888bec30
PE
3418 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3419 Problem reported by Juanma Barranquero for Windows -Wunused-function.
3420
de85e130
PE
34212012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3422
d0baac98 3423 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 3424 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
3425 (__malloc_size_t, __malloc_ptrdiff_t):
3426 Remove. All uses removed, replaced by the definiens if needed,
3427 since we can assume C89 or better now.
3428 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3429 (protect_malloc_state, align, get_contiguous_space)
3430 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3431 (malloc_atfork_handler_child, malloc_enable_thread)
3432 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3433 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3434 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3435 (special_realloc, _realloc_internal_nolock, _realloc_internal)
3436 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3437 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3438 Define using prototypes, not old style.
3439 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3440 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3441 (align): Don't assume that signed integer overflow wraps around.
3442 Omit unused local var.
3443 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3444 (_free_internal_nolock, memalign, mallochook, reallochook):
3445 Omit no-longer-needed casts.
3446 (valloc): Use getpagesize, not __getpagesize.
3447 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3448 (struct hdr): The 'magic' member is now size_t, not unsigned long.
3449
de85e130
PE
3450 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3451
dcbf5805
MA
34522012-04-22 Michael Albinus <michael.albinus@gmx.de>
3453
3454 Move functions from C to Lisp. Make non-blocking method calls
3455 the default. Implement further D-Bus standard interfaces.
3456
3457 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
3458 (QCdbus_request_name_allow_replacement)
3459 (QCdbus_request_name_replace_existing)
3460 (QCdbus_request_name_do_not_queue)
3461 (QCdbus_request_name_reply_primary_owner)
3462 (QCdbus_request_name_reply_in_queue)
3463 (QCdbus_request_name_reply_exists)
3464 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3465 (QCdbus_registered_serial, QCdbus_registered_method)
3466 (QCdbus_registered_signal): New Lisp objects.
3467 (XD_DEBUG_MESSAGE): Use sizeof.
3468 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3469 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3470 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3471 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3472 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3473 (xd_signature, xd_append_arg): Allow float for integer types.
3474 (xd_get_connection_references): New function.
b593d6a9
AH
3475 (xd_get_connection_address): Rename from xd_initialize.
3476 Return cached address.
dcbf5805
MA
3477 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
3478 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
3479 level.
3480 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 3481 Return number of refcounts.
dcbf5805
MA
3482 (Fdbus_get_unique_name): Make stronger parameter check.
3483 (Fdbus_message_internal): New defun.
3484 (Fdbus_call_method, Fdbus_call_method_asynchronously)
3485 (Fdbus_method_return_internal, Fdbus_method_error_internal)
3486 (Fdbus_send_signal, Fdbus_register_service)
3487 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
3488 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
3489 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
3490 (Vdbus_compiled_version, Vdbus_runtime_version)
3491 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
3492 (Vdbus_message_type_method_return, Vdbus_message_type_error)
3493 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
3494 (Vdbus_registered_buses, Vdbus_registered_objects_table):
3495 Adapt docstring.
dcbf5805 3496
52828e02
PE
34972012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3498
da05bc4c
PE
3499 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
3500 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
3501 Do not assume ptrdiff_t is the same width as 'int'.
3502
52828e02
PE
3503 * alloc.c: Handle unusual debugging option combinations.
3504 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
3505 since the two debugging options are incompatible.
3506 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
3507 is defined.
3508 (mem_init, mem_insert, mem_insert_fixup):
3509 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
3510 (NEED_MEM_INSERT): Remove; no longer needed.
3511
f01769f9
LL
35122012-04-22 Leo Liu <sdl.web@gmail.com>
3513
3514 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
3515
5790543d
PE
35162012-04-22 Paul Eggert <eggert@cs.ucla.edu>
3517
3518 * sysdep.c [__FreeBSD__]: Minor cleanups.
3519 (list_system_processes, system_process_attributes) [__FreeBSD__]:
3520 Use Emacs indenting style more consistently. Avoid some casts.
3521 Use 'double' consistently rather than mixing 'float' and 'double'.
3522
b91b7e4d
EW
35232012-04-21 Eduard Wiebe <usenet@pusto.de>
3524
b593d6a9
AH
3525 * sysdep.c (list_system_processes, system_process_attributes):
3526 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 3527
6114eb15
AS
35282012-04-21 Andreas Schwab <schwab@linux-m68k.org>
3529
3530 * lisp.mk (lisp): Update.
3531
2f38dff7
PE
35322012-04-20 Paul Eggert <eggert@cs.ucla.edu>
3533
3534 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
3535 It is never used otherwise.
3536
4ae29f89
SM
35372012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
3538
3539 * print.c (print_preprocess): Only check print_depth if print-circle
3540 is nil.
3541 (print_object): Check for cycles even when print-circle is nil and
3542 print-gensym is t, but only check print_depth if print-circle is nil.
3543
f30d612a
CY
35442012-04-20 Chong Yidong <cyd@gnu.org>
3545
3546 * process.c (wait_reading_process_output): If EIO occurs on a pty,
3547 set the status to "failed" and ensure that sentinel is run.
3548
c07a4c0b 35492012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
3550
3551 * process.c (Fset_process_inherit_coding_system_flag)
3552 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 3553 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 3554
c07a4c0b 35552012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
3556
3557 * xdisp.c (string_buffer_position_lim): Limit starting position to
3558 BEGV.
3559 (set_cursor_from_row): If called for a mode-line or header-line
3560 row, return zero immediately.
3561 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
3562 farther than the first row after the header line, if any.
3563 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
3564 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
3565
c07a4c0b 35662012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3567
4ae29f89
SM
3568 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
3569 (bug#11238).
ad3a2b41 3570
c07a4c0b 35712012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 35722012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
3573
3574 configure: new option --enable-gcc-warnings (Bug#11207)
3575 * Makefile.in (C_WARNINGS_SWITCH): Remove.
3576 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
3577 (ALL_CFLAGS): Use new macros rather than old.
3578 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
3579 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
3580 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
3581 -Wunused-result, -Wunused-variable. This should go away once
3582 the Emacs and Gnulib regex code is merged.
3583 (xmalloc, xrealloc): Now static.
3584
aba027e8
PE
35852012-04-17 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 * dired.c (Fsystem_groups): Remove unused local.
3588
e5a36063
GM
35892012-04-17 Glenn Morris <rgm@gnu.org>
3590
3591 * dired.c (Fsystem_users): Doc fix.
3592
316411f0
DA
35932012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
3594
3595 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
3596 (syms_of_dired): Add them.
3597
9426aba4
PE
35982012-04-16 Paul Eggert <eggert@cs.ucla.edu>
3599
b62a57be
PE
3600 Fix minor alloc.c problems found by static checking.
3601 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
3602 New extern decls, to avoid calling undeclared functions.
3603 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
3604 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
3605 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
3606 (NEED_MEM_INSERT): New macro.
3607 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 3608 Remove one incorrect comment and fix another.
b62a57be 3609
3539f31f
PE
3610 Fix minor ralloc.c problems found by static checking.
3611 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3612 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
3613 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
3614 (r_alloc_sbrk): Now static.
3615
a041960a
PE
3616 Improve ralloc.c interface checking.
3617 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3618 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
3619 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
3620 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
3621 [REL_ALLOC]: ... to here, to check interface.
3622 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
3623 Remove decls. This fixes an "It stinks!".
3624
9426aba4
PE
3625 * alloc.c (which_symbols): Fix alignment issue / type clash.
3626
d55c12ed
AS
36272012-04-15 Andreas Schwab <schwab@linux-m68k.org>
3628
3629 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
3630 (struct Lisp_Misc_Any): Likewise.
3631 (struct Lisp_Free): Likewise.
3632 * alloc.c (union aligned_Lisp_Symbol): Define.
3633 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
3634 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
3635 (union aligned_Lisp_Misc): Define.
3636 (MARKER_BLOCK_SIZE, struct marker_block): Use union
3637 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 3638 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 3639
b948ce8b
PE
36402012-04-14 Paul Eggert <eggert@cs.ucla.edu>
3641
3642 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
3643 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
3644 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
3645 * s/netbsd.h, s/sol2-6.h:
3646 Remove definition of GC_MARK_STACK, since the default now works.
3647 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
3648 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
3649 no longer the default.
3650 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
3651
35dc09a1 36522012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 3653
35dc09a1
GM
3654 * lread.c (lisp_file_lexically_bound_p):
3655 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 3656
35dc09a1
GM
36572012-04-14 Eli Zaretskii <eliz@gnu.org>
3658
3659 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
3660 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
3661
36622012-04-14 Jan Djärv <jan.h.d@swipnet.se>
3663
3664 * nsterm.m (constrainFrameRect): Always constrain when there is only
3665 one screen (Bug#10962).
3666
bcd86815
KB
36672012-04-13 Ken Brown <kbrown@cornell.edu>
3668
3669 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
3670
c25df26e
RT
36712012-04-13 Reuben Thomas <rrt@sc3d.org>
3672
3673 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
3674
0fc59f1e
DC
36752012-04-11 Daniel Colascione <dancol@dancol.org>
3676
3677 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
3678 against is gone. It's better to use vfork now so that when Cygwin
3679 gains a new, working vfork, we use it automatically (bug#10398).
3680
de8c03dc
SM
36812012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3682
3683 * window.c (save_window_save): Obey window-point-insertion-type.
3684
2f097256
GM
36852012-04-11 Glenn Morris <rgm@gnu.org>
3686
3687 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
3688
453b951e
SM
36892012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
3690
3691 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
3692
75f1671a 36932012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
3694
3695 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
3696 (force_quit_count): New var.
3697 (handle_interrupt): Use it.
3698
2a8ce227
JB
36992012-04-10 Juanma Barranquero <lekktu@gmail.com>
3700
3701 * w32.c (w32_delayed_load): Record the full path of the library
3702 being loaded (bug#10424).
3703
935396c0
GM
37042012-04-09 Glenn Morris <rgm@gnu.org>
3705
05920a43
GM
3706 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
3707 not just in the obarray, before snarfing them. (Bug#11036)
3708
935396c0
GM
3709 * Makefile.in ($(leimdir)/leim-list.el):
3710 Pass EMACS rather than BUILT_EMACS.
3711
a18ecafa
TZ
37122012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
3713
3714 * process.c (make_process):
3715 * process.h: Add integer `gnutls_handshakes_tried' member to
3716 process struct.
3717
6bbef4e5
JC
3718 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
3719 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
3720
3721 * gnutls.c (gnutls_log_function2i): Convenience log function.
3722 (emacs_gnutls_read): Use new log functions,
3723 `gnutls_handshakes_tried' process member, and
3724 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
3725 attempts per process (connection).
3726
b4d3bc10
CY
37272012-04-09 Chong Yidong <cyd@gnu.org>
3728
3729 * eval.c (Fuser_variable_p, user_variable_p_eh)
3730 (lisp_indirect_variable): Functions deleted.
3731 (Fdefvar): Caller changed.
3732
3733 * callint.c (Finteractive, Fcall_interactively):
3734 * minibuf.c (Fread_variable): Callers changed.
3735
70f4d973
EZ
37362012-04-09 Eli Zaretskii <eliz@gnu.org>
3737
3738 * xdisp.c (set_cursor_from_row): If the display string appears in
3739 the buffer at position that is closer to point than the position
3740 after the display string, display the cursor on the first glyph of
3741 the display string. Fixes cursor display when a 'display' text
3742 property immediately follows invisible text. (Bug#11094)
3743
cb3c2e3e
PE
37442012-04-09 Paul Eggert <eggert@cs.ucla.edu>
3745
3746 composite.c: use 'double' consistently
3747 * composite.c (get_composition_id): Use 'double' consistently
3748 instead of converting 'float' to 'double' and vice versa; this is
3749 easier to understand and avoids a GCC warning.
3750
fd06db5d
GM
37512012-04-09 Glenn Morris <rgm@gnu.org>
3752
50fe702a
GM
3753 * Makefile.in: Generate leim-list with bootstrap-emacs, in
3754 preparation for dumping it with emacs. (Bug#4789)
3755 (leimdir): New variable.
3756 ($(leimdir)/leim-list.el): New rule.
3757 (emacs$(EXEEXT)): Depend on leim-list.el.
3758
fd06db5d
GM
3759 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
3760 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
3761 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
3762
55c131ee
AS
37632012-04-08 Andreas Schwab <schwab@linux-m68k.org>
3764
3765 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
3766 proper alignment.
3767
9209588f
JB
37682012-04-07 Juanma Barranquero <lekktu@gmail.com>
3769
3770 * xml.c (init_libxml2_functions) [WINDOWSNT]:
3771 Remove unused local variable.
3772
e3fb2efb
PE
37732012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3774
3775 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
3776 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
3777 (mark_memory): Mark Lisp_Objects only if pointers might hide in
3778 objects, as mark_maybe_pointer will catch them otherwise.
3779 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
3780 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
3781
b5385551
PE
37822012-04-07 Paul Eggert <eggert@cs.ucla.edu>
3783
3784 Fix typo that broke non-Windows builds.
3785 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
3786
9078ead6
EZ
37872012-04-07 Eli Zaretskii <eliz@gnu.org>
3788
3789 Support building on MS-Windows with libxml2.
3790
3791 * makefile.w32-in (OBJ2): Add xml.$(O).
3792 (GLOBAL_SOURCES): Add xml.c.
3793 ($(BLD)/xml.$(O)): New dependency list.
3794
3795 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
3796 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
3797 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
3798 [!WINDOWSNT]: New macros.
3799 (init_libxml2_functions, libxml2_loaded_p): New functions.
3800 (parse_region): Call fn_xmlCheckVersion instead of using the macro
3801 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
3802 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
3803 Calls xmlCleanupParser only if libxml2 was loaded (or statically
3804 linked in).
6bbef4e5
JC
3805 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
3806 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
3807 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
3808
3809 * emacs.c: Don't include libxml/parser.h.
3810 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
3811 xmlCleanupParser directly.
3812
3813 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
3814
3811fdf3
EZ
38152012-04-07 Eli Zaretskii <eliz@gnu.org>
3816
3817 * indent.c (Fvertical_motion): If there is a display string at
3818 point, use it.vpos to compute how many lines to backtrack after
3819 move_it_to point. (Bug#11133)
3820
2f8e16b2
EZ
38212012-04-06 Eli Zaretskii <eliz@gnu.org>
3822
3823 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
3824 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
3825 about subtle differences between FETCH_CHAR* and STRING_CHAR*
3826 macros related to unification of CJK characters. For the details,
3827 see the discussion following the message here:
3828 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
3829
3d439cd1
CY
38302012-04-04 Chong Yidong <cyd@gnu.org>
3831
3832 * keyboard.c (Vdelayed_warnings_list): Doc fix.
3833
8bc53d00
EZ
38342012-04-01 Eli Zaretskii <eliz@gnu.org>
3835
3836 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
3837 instead of alloca. (Bug#11138)
3838
3b0512a3
AS
38392012-04-01 Andreas Schwab <schwab@linux-m68k.org>
3840
3841 * w32menu.c (is_simple_dialog): Properly check lisp types.
3842 (Bug#11141)
3843
8427ddd2
EZ
38442012-03-31 Eli Zaretskii <eliz@gnu.org>
3845
979022ef
EZ
3846 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
3847 position we get to after a call to move_it_to fails the
3848 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
3849 only if we wind up in a string from display property. (Bug#11063)
3850
a6b1c7cc
EZ
3851 * window.c (Fdelete_other_windows_internal): Invalidate the row
3852 and column information about mouse highlight, so that redisplay
3853 restores it after reallocating the glyph matrices. (Bug#7464)
3854
8427ddd2
EZ
3855 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
3856 string comes from a `display' text property, use the buffer
3857 position of that property as if we actually saw that position in
3858 the row's glyphs.
697ba24b
EZ
3859 (move_it_by_lines): Remove the assertion that
3860 "it->current_x == 0 && it->hpos == 0" which can be legitimately
3861 violated when there's a before-string at the beginning of a line.
3862 (Bug#11063)
8427ddd2 3863
65a0a738
EZ
38642012-03-30 Eli Zaretskii <eliz@gnu.org>
3865
3866 * xdisp.c (append_space_for_newline): If the default face was
3867 remapped, use the remapped face for the appended newline.
3868 (extend_face_to_end_of_line): Use the remapped default face for
3869 extending the face to the end of the line.
3870 (display_line): Call extend_face_to_end_of_line when the default
3871 face was remapped. (Bug#11068)
3872
581355cc
EZ
38732012-03-29 Eli Zaretskii <eliz@gnu.org>
3874
3875 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
3876
e8fc049f
SM
38772012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
3878
3879 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
3880
4fb9a543
GM
38812012-03-27 Glenn Morris <rgm@gnu.org>
3882
3883 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
3884 Doc fixes.
3885
679910f1
KH
38862012-03-26 Kenichi Handa <handa@m17n.org>
3887
3888 * dispextern.h (struct glyph): Fix previous change. Change the
3889 bit length of glyphless.ch to 25 (Bug#11082).
3890
90d49b7f
CY
38912012-03-26 Chong Yidong <cyd@gnu.org>
3892
3893 * keyboard.c (Vselection_inhibit_update_commands): New variable.
3894 (command_loop_1): Use it; inhibit selection update for
3895 handle-select-window too (Bug#8996).
3896
f514f6f0
FP
38972012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
3898
e8fc049f 3899 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 3900
bf43fa51
KH
39012012-03-25 Kenichi Handa <handa@m17n.org>
3902
3903 * dispextern.h (struct glyph): Change the bit length of
3904 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
3905
8a0c01dd
EZ
39062012-03-24 Eli Zaretskii <eliz@gnu.org>
3907
3908 * s/ms-w32.h (tzname): Include time.h before redirecting to
3909 _tzname. Fixes the MSVC build. (Bug#9960)
3910
7d1c3a76
AS
39112012-03-24 Andreas Schwab <schwab@linux-m68k.org>
3912
8ed79523
AS
3913 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
3914 characters.
3915
7d1c3a76
AS
3916 * xterm.c (XTread_socket): Only modify handling_signal if
3917 !SYNC_INPUT. (Bug#11080)
3918
e99a9b8b
EZ
39192012-03-23 Eli Zaretskii <eliz@gnu.org>
3920
3921 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
3922 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
3923 when fetching a multibyte character consumes more bytes than
3924 CHAR_BYTES returns, due to unification of CJK characters in
3925 string_char. (Bug#11073)
3926
5063c0e1
TN
39272012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
3928
3929 * process.c (wait_reading_process_output): Handle pty disconnect
3930 by refraining from sending oneself a SIGCHLD (bug#10933).
3931
9f851fbd
CY
39322012-03-22 Chong Yidong <cyd@gnu.org>
3933
3934 * dispextern.h (struct it): New member string_from_prefix_prop_p.
3935
5063c0e1 3936 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
3937 Mark string as coming from a prefix property.
3938 (handle_face_prop): Use default face for prefix strings (Bug#4281).
3939 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
3940
fb5b8aca
CY
39412012-03-21 Chong Yidong <cyd@gnu.org>
3942
3943 * xfaces.c (Vface_remapping_alist): Doc fix.
3944
62356a1b
EZ
39452012-03-20 Eli Zaretskii <eliz@gnu.org>
3946
3947 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
3948 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
3949 Doc fixes.
62356a1b 3950
025de85b
CY
39512012-03-20 Chong Yidong <cyd@gnu.org>
3952
3953 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
3954 to reflect default non-nil value of redisplay-dont-pause.
3955
4827f94e
KH
39562012-03-19 Kenichi Handa <handa@m17n.org>
3957
3958 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
3959 it fit in a valid range (Bug#11003).
3960
e50a24a2
EZ
39612012-03-18 Eli Zaretskii <eliz@gnu.org>
3962
3963 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
3964 that is not from display property, accept the row as a "cursor
3965 row" if one of the string's character has a non-nil `cursor'
3966 property. Fixes cursor positioning when there are newlines in
3967 overlay strings, e.g. in icomplete.el. (Bug#11035)
3968
9af5ed87
PE
39692012-03-12 Paul Eggert <eggert@cs.ucla.edu>
3970
3971 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
3972
d1f55f16
CY
39732012-03-12 Chong Yidong <cyd@gnu.org>
3974
3975 * eval.c (inhibit_lisp_code): Rename from
3976 inhibit_window_configuration_change_hook; move from window.c.
3977
3978 * xfns.c (unwind_create_frame_1, Fx_create_frame):
3979 * window.c (run_window_configuration_change_hook)
3980 (syms_of_window): Callers changed.
3981
66c5eebd
CY
39822012-03-11 Chong Yidong <cyd@gnu.org>
3983
413df973
CY
3984 * keymap.c (Fkey_description): Doc fix (Bug#9700).
3985
66c5eebd
CY
3986 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
3987
1de11f56
CY
39882012-03-10 Chong Yidong <cyd@gnu.org>
3989
3990 * frame.c (other_visible_frames): Don't assume the selected frame
3991 is visible (Bug#10955).
3992
cae07000
SM
39932012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
3994
3995 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
3996
89c94350
JD
39972012-03-08 Jan Djärv <jan.h.d@swipnet.se>
3998
3999 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4000 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4001 zero (Bug#10954).
4002
999dd333
GM
40032012-03-03 Glenn Morris <rgm@gnu.org>
4004
01a6dcc8 4005 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 4006
de0100f2
EZ
40072012-03-02 Eli Zaretskii <eliz@gnu.org>
4008
4009 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4010 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
4011 (redisplay_window, next_element_from_string): Fix typos in
4012 comments.
3e441275
EZ
4013 (redisplay_window): Pass to move_it_vertically the margin in
4014 pixels, not in screen lines.
de0100f2 4015
96a72ee9
GM
40162012-03-02 Glenn Morris <rgm@gnu.org>
4017
4018 * buffer.c (buffer-list-update-hook): Doc fix.
4019
312508d7
EZ
40202012-02-29 Eli Zaretskii <eliz@gnu.org>
4021
4022 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4023 push_it before setting up the iterator for the first overlay
4024 string, even if we have an empty string loaded.
4025 (next_overlay_string): If there's an empty string on the iterator
4026 stack, pop the stack. (Bug#10903)
4027
27f3c637
PE
40282012-02-25 Paul Eggert <eggert@cs.ucla.edu>
4029
4030 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4031 Suggested by Stefan Monnier in
4032 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4033 * alloc.c (widen_to_Lisp_Object): New static function.
4034 (mark_memory): Also mark Lisp_Objects by fetching pointer words
4035 and widening them to Lisp_Objects. This would work even if
4036 USE_LSB_TAG is defined and wide integers are used, which might
4037 happen in a future version of Emacs.
4038
3c9dfce6
CY
40392012-02-25 Chong Yidong <cyd@gnu.org>
4040
fa74b241
CY
4041 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4042 Doc fix.
4043
3c9dfce6
CY
4044 * xselect.c (Fx_selection_exists_p): Doc fix.
4045 (x_clipboard_manager_save_all): Print an informative message
4046 before saving to clipboard manager.
4047
9486df08
CY
40482012-02-24 Chong Yidong <cyd@gnu.org>
4049
4050 * keyboard.c (process_special_events): Handle all X selection
4051 requests in kbd_buffer, not just the next one (Bug#8869).
4052
f01d3321
CY
40532012-02-23 Chong Yidong <cyd@gnu.org>
4054
4055 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4056 call when setting menu-bar-lines and tool-bar-lines parameters.
4057 (unwind_create_frame_1): New helper function.
4058
4059 * window.c (inhibit_window_configuration_change_hook): New var.
4060 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 4061 (syms_of_window): Initialize it.
f01d3321 4062
86b847b6
CY
40632012-02-22 Chong Yidong <cyd@gnu.org>
4064
4065 * xterm.c (x_draw_image_relief): Add missing type check for
4066 Vtool_bar_button_margin (Bug#10743).
4067
a59225b1
CY
40682012-02-21 Chong Yidong <cyd@gnu.org>
4069
4070 * fileio.c (Vfile_name_handler_alist): Doc fix.
4071
4072 * buffer.c (Fget_file_buffer): Protect against invalid file
4073 handler return value.
4074
310f5bd4
PE
40752012-02-20 Paul Eggert <eggert@cs.ucla.edu>
4076
cb3a28cc
PE
4077 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4078 when computing $valmask.
4079
310f5bd4
PE
4080 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4081 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4082 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4083 It's useless in that case, and it can cause problems on hosts
4084 that allocate halves of EMACS_INT values separately.
4085 Reported by Dan Horák. Diagnosed by Andreas Schwab in
4086 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4087 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4088 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
4089 it avoids undefined behavior on hosts where shifting right by more
4090 than the word width has undefined behavior.
4091
2375c96a
CY
40922012-02-19 Chong Yidong <cyd@gnu.org>
4093
4094 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4095 (Funhandled_file_name_directory, Ffile_name_as_directory)
4096 (Fdirectory_file_name, Fexpand_file_name)
4097 (Fsubstitute_in_file_name): Protect against invalid file handler
4098 return values (Bug#10845).
4099
3eb49e71
EZ
41002012-02-18 Eli Zaretskii <eliz@gnu.org>
4101
4102 * .gdbinit (pitx): Fix incorrect references to fields of the
4103 iterator stack.
4104
7b926f3f
CY
41052012-02-17 Chong Yidong <cyd@gnu.org>
4106
4107 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4108
11273115
PE
41092012-02-15 Paul Eggert <eggert@cs.ucla.edu>
4110
4111 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4112 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4113
c3a70e2b
CY
41142012-02-15 Chong Yidong <cyd@gnu.org>
4115
4116 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4117 marked as special. Also, starting docstrings with * is obsolete.
4118
0ca43699
AS
41192012-02-13 Andreas Schwab <schwab@linux-m68k.org>
4120
4121 * gnutls.c (emacs_gnutls_write): Fix last change.
4122
2e8f3c56
LI
41232012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
4124
4125 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4126 send_process.
4127
af70074f
SM
41282012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
4129
4130 * keymap.c (Fsingle_key_description): Handle char ranges.
4131
95986d52
CY
41322012-02-12 Chong Yidong <cyd@gnu.org>
4133
afd83bd1
CY
4134 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4135 as that creates a dangerous corner case.
4136
95986d52
CY
4137 * window.c (Fdelete_window_internal): Invalidate the mouse
4138 highlight (Bug#9904).
4139
bd7da63e
GM
41402012-02-12 Glenn Morris <rgm@gnu.org>
4141
4142 * xselect.c (Fx_own_selection_internal)
4143 (Fx_get_selection_internal, Fx_disown_selection_internal)
4144 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4145 * nsselect.m (Fx_own_selection_internal)
4146 (Fx_disown_selection_internal, Fx_selection_exists_p)
4147 (Fx_selection_owner_p, Fx_get_selection_internal):
4148 Sync docs and argument specs with the xselect.c versions.
4149
77abcbc2
LI
41502012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
4151
4152 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4153
90b671e2
EZ
41542012-02-11 Eli Zaretskii <eliz@gnu.org>
4155
1c0ca0b7
EZ
4156 * w32select.c (Fx_selection_exists_p): Sync doc string and
4157 argument list with xselect.c. (Bug#10783)
4158
4159 * w16select.c (Fx_selection_exists_p): Sync doc string and
4160 argument list with xselect.c. (Bug#10783)
90b671e2 4161
49241268
GM
41622012-02-10 Glenn Morris <rgm@gnu.org>
4163
4164 * fns.c (Fsecure_hash): Doc fix.
4165
f998bbe7 41662012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
4167
4168 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4169
0992bd9c
CY
41702012-02-07 Chong Yidong <cyd@gnu.org>
4171
4172 * buffer.c (Fbuffer_local_variables)
4173 (buffer_lisp_local_variables): Handle unbound vars correctly;
4174 don't let Qunbound leak into Lisp.
4175
af008560
GM
41762012-02-07 Glenn Morris <rgm@gnu.org>
4177
dd605cc4
GM
4178 * image.c (Fimagemagick_types): Doc fix.
4179
af008560
GM
4180 * image.c (imagemagick-render-type): Change it from a lisp object
4181 to an integer. Move the doc here from the lisp manual.
4182 Treat all values not equal to 0 the same.
4183
1449fa1d
CY
41842012-02-06 Chong Yidong <cyd@gnu.org>
4185
4186 * doc.c (store_function_docstring): Avoid applying docstring of
4187 alias to base function (Bug#2603).
4188
3723ec07
AS
41892012-02-04 Andreas Schwab <schwab@linux-m68k.org>
4190
4191 * .gdbinit (pp1, pv1): Remove redundant defines.
4192 (pr): Use pp.
4193
79c1cc1e
CY
41942012-02-04 Chong Yidong <cyd@gnu.org>
4195
4196 * nsterm.m: Declare a global (Bug#10694).
4197
d7f29f8e
EZ
41982012-02-04 Eli Zaretskii <eliz@gnu.org>
4199
cae07000
SM
4200 * w32.c (get_emacs_configuration_options):
4201 Include --enable-checking, if specified, in the return value.
d7f29f8e 4202
3b95a6f9
MR
42032012-02-04 Martin Rudalics <rudalics@gmx.at>
4204
4205 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4206 after rounding frame sizes. (Bug#9723)
4207
d6fa96a6
EZ
42082012-02-04 Eli Zaretskii <eliz@gnu.org>
4209
4210 * keyboard.c (adjust_point_for_property): Don't position point
4211 before BEGV. (Bug#10696)
4212
df0b2940
PE
42132012-02-03 Paul Eggert <eggert@cs.ucla.edu>
4214
4215 Handle overflow when computing char display width (Bug#9496).
4216 * character.c (char_width): Return EMACS_INT, not int.
4217 (char_width, c_string_width): Check for overflow when
4218 computing the width; this is possible now that individual
4219 characters can have unbounded width. Problem introduced
4220 by merge from Emacs 23 on 2012-01-19.
4221
6bee44d6
MA
42222012-02-02 Michael Albinus <michael.albinus@gmx.de>
4223
4224 * dbusbind.c (Fdbus_register_method): Mention the return value
4225 :ignore in the docstring.
4226
44f92739
GM
42272012-02-02 Glenn Morris <rgm@gnu.org>
4228
1b9f60cc
GM
4229 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4230
44f92739
GM
4231 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4232 Unconditionally set to t. (Bug#10673)
4233 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4234 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4235 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4236
c5d3843c
KH
42372012-02-02 Kenichi Handa <handa@m17n.org>
4238
4239 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
4240 0, do not call append_composite_glyph.
4241
159462d4 42422012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
4243
4244 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4245 NULL (Bug#6988).
4246 (x_produce_glyphs): If the component of a composition is a null
4247 string, set it->pixel_width to 1 to avoid zero-width glyph.
4248
78cef877
EZ
42492012-02-01 Eli Zaretskii <eliz@gnu.org>
4250
4251 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4252 first 2 arguments are identical. This makes inserting large
4253 output from a subprocess an order of magnitude faster on
4254 MS-Windows, where all sbrk'ed memory is always contiguous.
4255
97897668
GM
42562012-01-31 Glenn Morris <rgm@gnu.org>
4257
4258 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 4259 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
4260 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4261
31fd3586
GM
42622012-01-29 Glenn Morris <rgm@gnu.org>
4263
4264 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4265
0e24a8b2
CY
42662012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
4267
4268 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4269
cc0adcb0
CY
42702012-01-28 Chong Yidong <cyd@gnu.org>
4271
4272 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4273
acc28cb9
CY
42742012-01-26 Chong Yidong <cyd@gnu.org>
4275
9c69cfb7
CY
4276 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4277
acc28cb9
CY
4278 * search.c (Fsearch_forward, Fsearch_backward): Document negative
4279 repeat counts (Bug#10507).
4280
48da7392
GM
42812012-01-26 Glenn Morris <rgm@gnu.org>
4282
4283 * lread.c (syms_of_lread): Doc fix.
4284
14af5f7f
CY
42852012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
4286
4287 * coding.c (encode_designation_at_bol): Change return value to
4288 EMACS_INT.
4289
0b21c100
CY
42902012-01-25 Chong Yidong <cyd@gnu.org>
4291
4292 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4293
3c2907f7
CY
42942012-01-21 Chong Yidong <cyd@gnu.org>
4295
4296 * floatfns.c (Fcopysign): Make the second argument non-optional,
4297 since nil is not allowed anyway.
4298
959ad23f
AS
42992012-01-21 Andreas Schwab <schwab@linux-m68k.org>
4300
4301 * process.c (read_process_output): Use p instead of XPROCESS (proc).
4302 (send_process): Likewise.
4303
34a02f46
MR
43042012-01-19 Martin Rudalics <rudalics@gmx.at>
4305
4306 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
4307 (Vwindow_persistent_parameters): Do not use Qstate.
4308 Rewrite doc-strings.
34a02f46 4309
1259009a 43102012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
4311
4312 * character.c (char_width): New function.
70d4fdf6
GM
4313 (Fchar_width, c_string_width, lisp_string_width):
4314 Use char_width (Bug#9496).
25ed9e61 4315
6a6ee00d
MR
43162012-01-16 Martin Rudalics <rudalics@gmx.at>
4317
4318 * window.c (Vwindow_persistent_parameters): New variable.
4319 (Fset_window_configuration, save_window_save): Handle persistent
4320 window parameters.
4321
c85efaf7
EZ
43222012-01-14 Eli Zaretskii <eliz@gnu.org>
4323
4324 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4325 thrashing the stack of the thread. (Bug#9087)
4326
5944709e
PE
43272012-01-12 Paul Eggert <eggert@cs.ucla.edu>
4328
4329 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4330
e71f5d99
EZ
43312012-01-11 Eli Zaretskii <eliz@gnu.org>
4332
4333 * xdisp.c (rows_from_pos_range): Handle the case where the
4334 highlight ends on a newline. (Bug#10464)
4335 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4336 he end column for display of highlight that ends on a newline
4337 before a R2L line.
4338
ce316182
GM
43392012-01-11 Glenn Morris <rgm@gnu.org>
4340
4341 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4342 from load-path also when installation-directory is nil. (Bug#10208)
4343
5b43da69
GM
43442012-01-10 Glenn Morris <rgm@gnu.org>
4345
74cc8ff9
GM
4346 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4347
7d8d6e4e
GM
4348 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4349 Update template values to be closer to their typical values these days.
5b43da69 4350
a0db8d43
EZ
43512012-01-09 Eli Zaretskii <eliz@gnu.org>
4352
4353 * xdisp.c (rows_from_pos_range): Accept additional argument
4354 DISP_STRING, and accept any glyph in a row whose object is that
4355 string as eligible for mouse highlight. Fixes mouse highlight of
4356 display strings from overlays. (Bug#10464)
4357
9a0115ab 43582012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 4359
b9110d6a 4360 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
4361 * fileio.c (auto_saving_dir_umask): New static var.
4362 (Fmake_directory_internal): Use it.
4363 (do_auto_save_make_dir): Set it, instead of invoking chmod after
4364 creating the directory. The old code temporarily assigns
4365 too-generous permissions to the directory.
4366 (do_auto_save_eh): Clear it.
b9110d6a 4367 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
4368 that the var is always cleared.
4369
6c1bd3f3
EZ
43702012-01-07 Eli Zaretskii <eliz@gnu.org>
4371
4372 * search.c (scan_buffer): Pass character positions to
4373 know_region_cache, not byte positions. (Bug#6540)
4374
069d2b50
L
43752012-01-07 LynX <_LynX@bk.ru> (tiny change)
4376
4377 * w32.c (sys_rename): Report EXDEV when rename of a directory
4378 fails because the target is on another logical disk. (Bug#10284)
4379
75bf0d33
DB
43802012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
4381
4382 * xterm.c (x_embed_request_focus): New function.
4383
4384 * xterm.h: Add prototype.
4385
4386 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4387
1c6e5a32
GM
43882012-01-05 Glenn Morris <rgm@gnu.org>
4389
4390 * emacs.c (emacs_copyright): Update short copyright year to 2012.
4391
651e947e
EZ
43922012-01-01 Eli Zaretskii <eliz@gnu.org>
4393
4394 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4395 Load gnutls_transport_set_lowat only if GnuTLS version is below
4396 2.11.1.
4397 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4398 GnuTLS versions below 2.11.1.
4399
3778cdd8
AL
44002011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
4401
4402 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4403 to the doc string advising against its use for altering the way
4404 windows are scrolled.
4405
0e5317f7
KH
44062011-12-28 Kenichi Handa <handa@m17n.org>
4407
4408 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4409 coding-system ASCII compatible only when it does not produce BOM
4410 on encoding (Bug#10383).
4411
93d5ca1f
JD
44122011-12-26 Jan Djärv <jan.h.d@swipnet.se>
4413
4414 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4415 can scroll.
4416 (create_and_show_popup_menu): Always use menu_position_func for
4417 Gtk3 (Bug#10361).
4418
ca22b785
AS
44192011-12-24 Andreas Schwab <schwab@linux-m68k.org>
4420
4421 * callint.c (Fcall_interactively): Don't truncate prompt string.
4422
d048e1e6
EZ
44232011-12-23 Eli Zaretskii <eliz@gnu.org>
4424
4425 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4426 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 4427 resumed from there (after widening). (Bug#10360)
d048e1e6 4428
5ccaba1f
JD
44292011-12-22 Jan Djärv <jan.h.d@swipnet.se>
4430
4431 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4432
204ee57f
JD
44332011-12-21 Jan Djärv <jan.h.d@swipnet.se>
4434
b81d40f0
JB
4435 * nsterm.m (x_free_frame_resources):
4436 Release f->output_data.ns->miniimage.
204ee57f
JD
4437 (ns_index_color): Fix indentation. Do not retain
4438 color_table->colors[i].
4439
4440 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4441 before returning.
4442
4443 * nsfns.m (x_set_background_color): Assign return value from
4444 ns_index_color to face-background instead of NSColor*.
4445 (ns_implicitly_set_icon_type): Fix indentation.
4446 Change assignment in for loop to comparison.
4447
4448 * emacs.c (ns_pool): New variable.
4449 (main): Assign ns_pool.
4450 (Fkill_emacs): Call ns_release_autorelease_pool.
4451
4452 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4453 autorelease fdesc, release fdAttrs and tdict.
4454 (ns_get_covering_families): Release charset.
4455 (ns_findfonts): Release NSFontDescriptor created with new.
4456 (ns_uni_to_glyphs): Fix indentation.
4457 (setString): Release attrStr before assigning new value.
4458
c803b2b7
JD
44592011-12-18 Jan Djärv <jan.h.d@swipnet.se>
4460
678f4426
JD
4461 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
4462 and NS_IMPL_COCOA.
4463 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4464 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4465
cd394be1 44662011-12-18 David Reitter <reitter@cmu.edu>
678f4426 4467
5fecd5fc
JD
4468 * nsterm.m (ns_term_init): Subscribe for notifications
4469 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4470 to method trackingNotification in EmacsMenu.
4471
4472 * nsmenu.m (trackingMenu): New variable.
3771cb17 4473 (trackingNotification): New method (from Aquamacs).
5fecd5fc 4474 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 4475 from Aquamacs (Bug#7030).
678f4426
JD
4476
44772011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 4478
c803b2b7
JD
4479 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
4480 (symbol_to_nsstring): Fix indentation.
4481 (ns_symbol_to_pb): New function.
cae07000
SM
4482 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
4483 (Fns_rotate_cut_buffers_internal): Remove.
4484 (Fns_store_selection_internal): Rename from
c803b2b7
JD
4485 Fns_store_cut_buffer_internal.
4486 (ns_get_foreign_selection, Fx_own_selection_internal)
4487 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
4488 (Fns_get_selection_internal, Fns_store_selection_internal):
4489 Use ns_symbol_to_pb and check if return value is nil.
4490 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
4491 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
4492 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
4493 renamed to Sns_store_selection_internal.
4494 (ns_handle_selection_request): Move code to Fx_own_selection_internal
4495 and remove this function.
4496 (ns_handle_selection_clear): Remove, never used.
4497 (Fx_own_selection_internal): Move code from ns_handle_selection_request
4498 here.
4499
e1b01a3a
KB
45002011-12-17 Ken Brown <kbrown@cornell.edu>
4501
4502 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
4503 GID is unknown (Bug#10257).
4504
2adb6e85
PE
45052011-12-17 Paul Eggert <eggert@cs.ucla.edu>
4506
4507 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
4508 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
4509 which caused a build failure on GNU/Linux IA-64. This problem was
4510 introduced by my 2011-10-07 patch.
4511
d1d7b339
JL
45122011-12-15 Juri Linkov <juri@jurta.org>
4513
4514 * image.c (imagemagick_error): New function. (Bug#10112)
4515 (imagemagick_load_image): Comment out `MagickSetResolution' call.
4516 Use `imagemagick_error' where ImageMagick functions return
4517 `MagickFalse'.
4518 (Fimagemagick_types): Add `Fnreverse' to return the list in the
4519 proper order.
4520
100d5755
KH
45212011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4522
4523 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
4524 fill background (Bug#8992).
4525
454592a6
MR
45262011-12-13 Martin Rudalics <rudalics@gmx.at>
4527
4528 * window.c (Vwindow_combination_resize)
4529 (Vwindow_combination_limit): Use t instead of non-nil in
4530 doc-strings.
61d4b438
MR
4531 (Vrecenter_redisplay): Add first sentence of doc-string on
4532 separate line.
53524d93 4533 (Frecenter): Fix doc-string typo.
454592a6 4534
3633e3aa
KH
45352011-12-11 Kenichi Handa <handa@m17n.org>
4536
4537 * coding.c (Funencodable_char_position): Pay attention to the
4538 buffer text relocation (Bug#9389).
4539
7b9d523a 45402011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 4541
7b9d523a
JD
4542 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
4543 gtk_init (Bug#10100).
4544
b73189c6
EZ
45452011-12-10 Eli Zaretskii <eliz@gnu.org>
4546
4547 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
4548 IT->string is nil. (Bug#10263)
4549
f7dfe5d6
JD
45502011-12-10 Jan Djärv <jan.h.d@swipnet.se>
4551
83faebb4
JD
4552 * nsterm.h (x_free_frame_resources): Declare.
4553
f7dfe5d6
JD
4554 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
4555 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
4556
4557 * nsterm.h (ns_get_defaults_value): Declare.
4558
4559 * nsterm.m (ns_default): Call ns_get_defaults_value.
4560
7cd4e72c
EZ
45612011-12-09 Eli Zaretskii <eliz@gnu.org>
4562
4563 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
4564 (Bug#10170)
4565
b34d7317
YM
45662011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4567
4568 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
4569 that where the value of an _OBJC_* symbol points to is in the .bss
4570 section (Bug#10240).
4571
76470ad1
KH
45722011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4573
4574 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 4575 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 4576
745fff94
KH
45772011-12-08 Kenichi Handa <handa@m17n.org>
4578
4579 * ftfont.c (get_adstyle_property): Fix previous change
4580 (Bug#10233).
4581
6e44397c
JB
45822011-12-07 Juanma Barranquero <lekktu@gmail.com>
4583
4584 * w32.c (init_environment): If no_site_lisp, remove site-lisp
4585 dirs from the default value of EMACSLOADPATH (bug#10208).
4586
7efa6272
GM
45872011-12-07 Glenn Morris <rgm@gnu.org>
4588
4589 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
4590 installation and source directories as well. (Bug#10208)
4591
f6fc4d87
CY
45922011-12-06 Chong Yidong <cyd@gnu.org>
4593
4594 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
4595
2bf26180
GM
45962011-12-06 Glenn Morris <rgm@gnu.org>
4597
4598 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
4599 as an error, not just -1. (Bug#10217)
4600
3a6ad4f0
CY
46012011-12-05 Chong Yidong <cyd@gnu.org>
4602
4603 * keyboard.c (process_special_events): New function.
4604 (swallow_events, Finput_pending_p): Use it (Bug#10195).
4605
75a3b399
PE
46062011-12-05 Paul Eggert <eggert@cs.ucla.edu>
4607
4608 * coding.c (encode_designation_at_bol): Don't use uninitialized
4609 local variable (Bug#9318).
4610
c3c9e25e
KH
46112011-12-05 Kenichi Handa <handa@m17n.org>
4612
4613 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
4614 return Qnil (Bug#8046, Bug#10193).
4615
5eb05ea3
KH
46162011-12-05 Kenichi Handa <handa@m17n.org>
4617
4618 * coding.c (encode_designation_at_bol): New args charbuf_end and
4619 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
4620 (coding_set_source): Return how many bytes coding->source was
4621 relocated.
4622 (coding_set_destination): Return how many bytes
4623 coding->destination was relocated.
4624 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 4625 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
4626
46272011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4628
4629 * coding.c (CODING_CHAR_CHARSET_P): New macro.
4630 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
4631 macro (Bug#9318).
4632
46332011-12-05 Andreas Schwab <schwab@linux-m68k.org>
4634
4635 The following changes are to fix Bug#9318.
4636
a79703f5 4637 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
4638 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
4639 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 4640 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 4641
7dbda6df
JB
46422011-12-05 Juanma Barranquero <lekktu@gmail.com>
4643
4644 * lisp.h (process_quit_flag): Fix external declaration.
4645
6d5eb5b0
SM
46462011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
4647
4648 Don't macro-inline non-performance-critical code.
4649 * eval.c (process_quit_flag): New function.
4650 * lisp.h (QUIT): Use it.
4651
a0c3fad0
JD
46522011-12-04 Jan Djärv <jan.h.d@swipnet.se>
4653
4654 * nsfns.m (get_geometry_from_preferences): New function.
4655 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
4656
6c07aac2
AS
46572011-12-04 Andreas Schwab <schwab@linux-m68k.org>
4658
4659 * emacs.c (Qkill_emacs): Define.
4660 (syms_of_emacs): Initialize it.
4661 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
4662 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
4663 (quit_throw_to_read_char): Add parameter `from_signal'.
4664 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
4665 * lisp.h (QUIT): Call Fkill_emacs if requested.
4666
c052ead4
JD
46672011-12-03 Jan Djärv <jan.h.d@swipnet.se>
4668
4669 * widget.c (update_wm_hints): Return if wmshell is null.
4670 (widget_update_wm_size_hints): New function.
4671
4672 * widget.h (widget_update_wm_size_hints): Declare.
4673
4674 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
4675 widget_update_wm_size_hints (Bug#10104).
4676
9e49252b
EZ
46772011-12-03 Eli Zaretskii <eliz@gnu.org>
4678
4679 * xdisp.c (handle_invisible_prop): If the invisible text ends just
4680 before a newline, prepare the bidi iterator for consuming the
4681 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 4682 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 4683
02b16839
JL
46842011-12-02 Juri Linkov <juri@jurta.org>
4685
4686 * search.c (Fword_search_regexp): New Lisp function created from
4687 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
4688 (Fword_search_backward, Fword_search_forward)
4689 (Fword_search_backward_lax, Fword_search_forward_lax):
4690 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
4691 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
4692
0068070e
SM
46932011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
4694
4695 * fileio.c (Finsert_file_contents): Move after-change-function call
4696 to before the "handled:" label, since all "goto handled" appear in
4697 cases where the *-change-functions have already been properly called
4698 (bug#10117).
4699
3360a3fc
AS
47002011-12-01 Andreas Schwab <schwab@linux-m68k.org>
4701
4702 * keyboard.c (interrupt_signal): Don't call kill-emacs when
4703 waiting for input. (Bug#10169)
4704
73d6c093
EZ
47052011-11-30 Eli Zaretskii <eliz@gnu.org>
4706
4707 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
4708 verifies glyph row's hash code--we have just reallocated the
4709 glyphs, so their contents can be complete garbage. (Bug#10164)
4710
febe6bea
JB
47112011-11-30 Juanma Barranquero <lekktu@gmail.com>
4712
4713 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
4714
801a4313
EZ
47152011-11-30 Eli Zaretskii <eliz@gnu.org>
4716
4717 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
4718 attributes are tested _before_ calling verify_row_hash, to protect
4719 against GCC re-ordering of the tests. (Bug#10164)
4720
2b56b87e
JD
47212011-11-29 Jan Djärv <jan.h.d@swipnet.se>
4722
4723 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
4724
4725 * xterm.c (handle_one_xevent): Only set async_visible and friends
4726 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 4727 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
4728 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
4729
dbf31225
PE
47302011-11-28 Paul Eggert <eggert@cs.ucla.edu>
4731
4732 Remove GCPRO-related macros that exist only to avoid shadowing locals.
4733 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
4734 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
4735 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4736 All uses changed to use GCPRO1 etc.
4737 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
4738 Revert to old implementation (i.e., before 2011-03-11).
4739
1305621b
YM
47402011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4741
4742 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
4743 of scroll runs so as to avoid assigning disabled bogus rows and
4744 unnecessary graphics copy operations.
4745
8c9afb46
EZ
47462011-11-27 Eli Zaretskii <eliz@gnu.org>
4747
4748 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
4749 (snprintf) [_MSC_VER]: Redirect to _snprintf.
4750 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
4751 (malloc, free, realloc, calloc): Redirect to e_* only when
4752 compiling Emacs.
4753
4754 * lisp.h (GCTYPEBITS): Move before first use.
4755 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
4756 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
4757 this macro definition.
4758
4759 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
4760 _MSC_VER.
4761
54e9e3bf
JD
47622011-11-27 Jan Djärv <jan.h.d@swipnet.se>
4763
6d5eb5b0
SM
4764 * gtkutil.c (xg_create_frame_widgets):
4765 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
4766 present with Gtk+ 2.0.
4767
83aca1cb
PE
47682011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4769
4770 * fileio.c (Finsert_file_contents): Undo previous change; see
4771 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4772
5b76caa4
PE
47732011-11-26 Paul Eggert <eggert@cs.ucla.edu>
4774
4775 Rename locals to avoid shadowing.
4776 * fileio.c (Finsert_file_contents):
4777 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
4778 * process.c (wait_reading_process_output):
4779 Rename inner 'proc' to 'p' to avoid shadowing.
4780 Indent for consistency with usual Emacs style.
4781
8c535114
EZ
47822011-11-25 Eli Zaretskii <eliz@gnu.org>
4783
4784 * xdisp.c (redisplay_window): If cursor row is not fully visible
4785 after recentering, and scroll-conservatively is set to a large
4786 number, scroll window by a few more lines to make the cursor fully
4787 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
4788 (start_display): Don't move to the next line if the display should
4789 start at a newline that is part of a display vector or an overlay
4790 string. (Bug#10119)
8c535114 4791
fa4fdb5c
JL
47922011-11-24 Juri Linkov <juri@jurta.org>
4793
4794 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
4795 after the `MagickPingImage' call. (Bug#10112)
4796
90ec88df
CY
47972011-11-23 Chong Yidong <cyd@gnu.org>
4798
4799 * window.c (Fcoordinates_in_window_p): Accept only live windows.
4800
56e2e794
MR
48012011-11-23 Martin Rudalics <rudalics@gmx.at>
4802
4803 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
4804 making another buffer current. (Bug#10114)
4805
b6e64c41
GM
48062011-11-23 Glenn Morris <rgm@gnu.org>
4807
4808 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
4809
6b21de18
CY
48102011-11-23 Chong Yidong <cyd@gnu.org>
4811
4812 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
4813 using it (Bug#5984).
4814
b12cd789
EZ
48152011-11-22 Eli Zaretskii <eliz@gnu.org>
4816
4817 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
4818 and header-lines, as they don't have one computed for them.
4819 (Bug#10098)
4820
4821 * .gdbinit (prow): Make displayed values more self-explaining.
4822 Add row's hash code.
4823
261b6fd4
LMI
48242011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
4825
4826 * process.c (wait_reading_process_output): Fix asynchrounous
4827 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 4828 (wait_reading_process_output): Add comment and URL.
261b6fd4 4829
e7cfd277
JD
48302011-11-21 Jan Djärv <jan.h.d@swipnet.se>
4831
4832 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
4833
a9b9b7f5
CY
48342011-11-21 Chong Yidong <cyd@gnu.org>
4835
4836 * window.c (Fnext_window, Fprevious_window): Doc fix.
4837
b0d15b4f
SM
48382011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4839
4840 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
4841
fe7a3057
JB
48422011-11-20 Juanma Barranquero <lekktu@gmail.com>
4843
4844 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
4845
d2999b1a
MR
48462011-11-20 Martin Rudalics <rudalics@gmx.at>
4847
4848 * window.c (Fset_window_combination_limit): Rename argument
4849 STATUS to LIMIT.
4850 (Vwindow_combination_limit): Remove "status" from doc-string.
4851
d5ff9cd0
AS
48522011-11-20 Andreas Schwab <schwab@linux-m68k.org>
4853
4854 * m/ibms390.h: Remove.
4855 * m/ibms390x.h: Don't include "ibms390.h".
4856
a5bb9bd3
SM
48572011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4858
4859 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
4860 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
4861
cd1181db
JB
48622011-11-20 Juanma Barranquero <lekktu@gmail.com>
4863
4864 * casetab.c (Fset_case_table):
4865 * charset.c (Fcharset_after): Fix typos.
4866
615a3b8d 48672011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 4868
17e845af
PE
4869 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
4870 Otherwise, valgrind does not work on some platforms.
4871 Problem reported by Andreas Schwab in
6a0bf43d
PE
4872 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
4873 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
4874 is set, removing the need for VIRT_ADDRESS_VARIES.
4875 (PURE_P): Use a more-efficient implementation that needs just one
4876 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
4877 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
4878 to 4 (xorl, subq, cmpq, setbe).
4879 * alloc.c (pure): Always extern now, since that's the
4880 VIRT_ADDR_VARIES behavior.
4881 (PURE_POINTER_P): Use a single comparison, not two, for
4882 consistency with the new puresize.h.
4883 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
4884 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
4885 Remove VIRT_ADDR_VARIES no longer needed.
4886
f8fe6f96
EZ
48872011-11-19 Eli Zaretskii <eliz@gnu.org>
4888
4889 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
4890 (erase_phys_cursor, update_window_cursor, show_mouse_face)
4891 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
4892 behave as if the cursor position were at the window margin.
4893
4894 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
4895 and the cursor position is out of bounds, behave as if the cursor
4896 position were at the window margin. (Bug#10075)
4897
df05a53c
CY
48982011-11-18 Chong Yidong <cyd@gnu.org>
4899
4900 * window.c (Fwindow_combination_limit): Make first argument
4901 non-optional, since it is meaningless for live windows like the
4902 selected window.
61ccba97 4903
2071918e
DA
49042011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
4905
4906 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
4907
b50a28de
SM
49082011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
4909
4910 * intervals.c: Fix grafting over the whole buffer (bug#10071).
4911 (graft_intervals_into_buffer): Simplify.
4912
015137db
EZ
49132011-11-18 Eli Zaretskii <eliz@gnu.org>
4914
4915 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
4916 hash values of the two rows.
4917 (copy_row_except_pointers): Preserve the used[] arrays and the
4918 hash values of the two rows. (Bug#10035)
68c95424 4919 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
4920
4921 * xdisp.c (row_hash): New function, body extracted from
4922 compute_line_metrics.
4923 (compute_line_metrics): Call row_hash, instead of computing the
4924 hash code inline.
4925
4926 * dispnew.c (verify_row_hash): Call row_hash for computing the
4927 hash code of a row, instead of duplicating code from xdisp.c.
4928
4929 * dispextern.h (row_hash): Add prototype.
4930
a2addb04
TH
49312011-11-18 Tassilo Horn <tassilo@member.fsf.org>
4932
4933 * frame.c (delete_frame): Don't delete the terminal when the last
4934 X frame is closed if emacs is built with GTK toolkit.
4935
df85d315
JB
49362011-11-17 Juanma Barranquero <lekktu@gmail.com>
4937
4938 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
4939
a0c2d0ae
MR
49402011-11-17 Martin Rudalics <rudalics@gmx.at>
4941
4942 * window.c (Vwindow_splits): Rename to
4943 Vwindow_combination_resize. Suggested by Juri Linkov.
4944 (Fsplit_window_internal): Use Vwindow_combination_resize instead
4945 of Vwindow_splits.
4946
58179cce
JB
49472011-11-16 Juanma Barranquero <lekktu@gmail.com>
4948
7877f373
JB
4949 * nsfns.m (Fns_font_name):
4950 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 4951
b6f67890
MR
49522011-11-16 Martin Rudalics <rudalics@gmx.at>
4953
4954 * window.h (window): Rename slot "nest" to "combination_limit".
4955 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
4956 (Fset_window_nest): Rename to Fset_window_combination_limit.
4957 (Vwindow_nest): Rename to Vwindow_combination_limit.
4958 (recombine_windows, make_parent_window, make_window)
4959 (Fsplit_window_internal, saved_window)
4960 (Fset_window_configuration, save_window_save): Rename all
4961 occurrences of window_nest to window_combination_limit.
4962
c7015153
JB
49632011-11-15 Juanma Barranquero <lekktu@gmail.com>
4964
4965 * image.c (imagemagick_load_image): Fix typo.
4966
322ad6ec
EZ
49672011-11-14 Eli Zaretskii <eliz@gnu.org>
4968
4969 * xdisp.c (display_line): Move the call to
4970 highlight_trailing_whitespace before the call to
4971 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
4972 faces of all the glyphs to compute ROW's hash value.
4973 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 4974
f067b8ec
JB
49752011-11-14 Juanma Barranquero <lekktu@gmail.com>
4976
4977 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
4978 just return (bug#10044).
4979
1e5b2111
EZ
49802011-11-12 Eli Zaretskii <eliz@gnu.org>
4981
7ef3cbd5
EZ
4982 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
4983 with user-defined heap size. Bump the default size of the temacs
4984 heap to 27MB, to avoid memory warning when running temacs.
4985 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
4986
1e5b2111
EZ
4987 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
4988 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
4989 (verify_row_hash) [XASSERTS]: New function.
4990 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
4991 that the hash value of glyph rows is correct.
1e5b2111 4992
89d61221
MR
49932011-11-12 Martin Rudalics <rudalics@gmx.at>
4994
4995 * window.h (window): Remove splits slot.
4996 * window.c (Fwindow_splits, Fset_window_splits): Remove.
4997 (Fdelete_other_windows_internal, make_parent_window)
4998 (make_window, Fsplit_window_internal, Fdelete_window_internal)
4999 (Fset_window_configuration, save_window_save): Don't deal with
5000 split status of windows.
5001 (saved_window): Remove splits slot.
5002 (Vwindow_splits): Rewrite doc-string.
5003
97f18cc8
JD
50042011-11-11 Jan Djärv <jan.h.d@swipnet.se>
5005
5006 * xfns.c (unwind_create_frame):
5007 * nsfns.m (unwind_create_frame):
5008 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5009 Vframe_list (Bug#9999).
5010
22a648b4
DA
50112011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
5012
0b381c7e 5013 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 5014
659afede
KH
50152011-11-11 Kenichi Handa <handa@m17n.org>
5016
5017 * callproc.c (Fcall_process): Set the member dst_multibyte of
5018 process_coding.
5019
9ac0394b
KH
50202011-11-11 Johan Bockgård <bojohan@gnu.org>
5021
5022 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5023 avoid a crash (bug#9496).
5024
2fbdc249
CY
50252011-11-09 Chong Yidong <cyd@gnu.org>
5026
5027 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5028 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5029
ac6b1f81
PE
50302011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5031
5032 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5033
09db192c
PE
50342011-11-08 Paul Eggert <eggert@cs.ucla.edu>
5035
5036 Avoid some portability problems by eschewing 'extern inline' functions.
5037 The trivial performance wins aren't worth the portability hassles; see
5038 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5039 et seq.
5040 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5041 (window_box_width, window_box_left, window_box_left_offset)
5042 (window_box_right, window_box_right_offset): Undo previous change,
5043 by removing the "extern"s.
5044 * intervals.c (adjust_intervals_for_insertion)
5045 (adjust_intervals_for_deletion): Undo previous change,
5046 making these static again.
5047 (offset_intervals, temp_set_point_both, temp_set_point)
5048 (copy_intervals_to_string): No longer inline.
5049 * xdisp.c (window_text_bottom_y, window_box_width)
5050 (window_box_height, window_box_left_offset)
5051 (window_box_right_offset, window_box_left, window_box_right)
5052 (window_box): No longer inline.
5053
105216ed
CY
50542011-11-08 Chong Yidong <cyd@gnu.org>
5055
5056 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
5057 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5058 Signal an error if not a live window.
105216ed
CY
5059 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5060 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5061
ae9e237f
JB
50622011-11-07 Juanma Barranquero <lekktu@gmail.com>
5063
5064 * lisp.h (syms_of_abbrev): Remove declaration.
5065 Reported by CHENG Gao <chenggao@royau.me>.
5066
c7aa8333
EZ
50672011-11-07 Eli Zaretskii <eliz@gnu.org>
5068
5069 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5070 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
5071 of temacs in GUI mode.
5072
be7f5545
MR
50732011-11-07 Martin Rudalics <rudalics@gmx.at>
5074
5075 * window.h: Declare delete_all_child_windows instead of
5076 delete_all_subwindows.
5077 * window.c (Fwindow_nest, Fset_window_nest)
5078 (Fset_window_new_total, Fset_window_new_normal)
5079 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5080 (delete_all_subwindows): Rename to delete_all_child_windows.
5081 (Fdelete_other_windows_internal, Fset_window_configuration):
5082 Call delete_all_child_windows instead of delete_all_subwindows.
5083 * frame.c (delete_frame): Call delete_all_child_windows instead
5084 of delete_all_subwindows.
5085
ca78dc43
PE
50862011-11-07 Paul Eggert <eggert@cs.ucla.edu>
5087
5088 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5089 This is also needed for porting to any host where GC_MARK_STACK is
5090 not GC_MAKE_GCPROS_NOOPS.
5091 (which_symbols): Use it.
5092
a0241d01
KH
50932011-11-07 Kenichi Handa <handa@m17n.org>
5094
5095 * coding.c (coding_set_destination): Check coding->src_pos only
5096 when coding->src_object is a buffer (bug#9910).
5097
5098 * process.c (send_process): Set the member src_multibyte of coding
5099 to 0 (bug#9911) when sending a unibyte text.
5100
5101 * callproc.c (Fcall_process): Set the member src_multibyte of
5102 process_coding to 0 (bug#9912).
5103
a64bfdfa 51042011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
5105
5106 * xmenu.c (cleanup_widget_value_tree): New function.
5107 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5108 calling free_menubar_widget_value_tree directly (Bug#9830).
5109
cb41b32a
PE
51102011-11-06 Paul Eggert <eggert@cs.ucla.edu>
5111
5112 Fix some portability problems with 'inline'.
5113 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5114 (window_box_width, window_box_left, window_box_left_offset)
5115 (window_box_right, window_box_right_offset): Declare extern.
5116 Otherwise, these inline functions do not conform to C99 and
5117 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
5118 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5119 * intervals.c (adjust_intervals_for_insertion)
5120 (adjust_intervals_for_deletion): Now extern, because otherwise the
5121 extern inline functions 'offset_intervals' couldn't refer to it.
5122 (static_offset_intervals): Remove.
5123 (offset_intervals): Rewrite using the old contents of
5124 static_offset_intervals. The old version didn't conform to C99
5125 because an extern inline function contained a reference to an
5126 identifier with static linkage.
5127
b7041366
AS
51282011-11-06 Andreas Schwab <schwab@linux-m68k.org>
5129
5130 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5131 GC.
5132
88a37c4d
EZ
51332011-11-06 Eli Zaretskii <eliz@gnu.org>
5134
5135 * xdisp.c (init_iterator, reseat_to_string): Don't set the
5136 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
5137 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5138 return Qleft_to_right.
5139
49745b39
CY
51402011-11-06 Chong Yidong <cyd@gnu.org>
5141
5142 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5143 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5144 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5145 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5146 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5147 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5148 (Fwindow_vscroll): Doc fix.
5149 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5150 argument, since it makes no sense to pass a live window and for
5151 consistency with window-child.
5152
1f05cd82
CS
51532011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
5154
5155 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5156 support MSVC.
5157
22610910
JR
51582011-11-05 Jason Rumney <jasonr@gnu.org>
5159
5160 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5161 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5162 fonts (Bug#6029).
5163 (add_font_entity_to_list): Fix logic errors in mixed boolean and
5164 bitwise arithmetic preventing use of unicode-sip and non-truetype
5165 opentype fonts.
5166
a06776b2
EZ
51672011-11-05 Eli Zaretskii <eliz@gnu.org>
5168
3ad924ba
EZ
5169 * s/ms-w32.h (fstat, stat, utime): Move redirections to
5170 "emacs"-only part.
5171
a06776b2
EZ
5172 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5173 initialization code to keep similarity to xfns.c after changes
5174 from 2011-11-05.
5175
c9e7db78
JD
51762011-11-05 Jan Djärv <jan.h.d@swipnet.se>
5177
a97f8f3f
JD
5178 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5179 (unwind_create_frame): New function (Bug#9943).
5180 (Fx_create_frame): Restructure code to be more similar to the one in
5181 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
5182 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5183 Move terminal->reference_count++ just before making the frame official
5184 (Bug#9943).
5185
5186 * nsterm.m (x_free_frame_resources): New function.
5187 (x_destroy_window): Move code to x_free_frame_resources.
5188
c9e7db78 5189 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
5190 (Fx_create_frame, x_create_tip_frame):
5191 Move terminal->reference_count++ just before making the frame
75f1671a 5192 official. Move initialization of image_cache_refcount and
c9e7db78
JD
5193 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5194
a6fc3b5c
EZ
51952011-11-05 Eli Zaretskii <eliz@gnu.org>
5196
5197 Support MSVC build with newer versions of Visual Studio.
5198 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5199 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
5200 nt/gmake.defs.
5201
5202 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5203 which are not supported by MSVC.
5204 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5205 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5206 bitfields.
5207 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5208 types in bitfields.
5209 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5210
5211 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5212
58179cce 52132011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
5214
5215 Support MSVC build with newer versions of Visual Studio.
5216 * w32.c: Don't include w32api.h for MSVC.
5217 (init_environment) [_MSC_VER]: Call sys_access, not _access.
5218
5219 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5220 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5221 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5222 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5223 e_* cousins.
5224 (alloca) [_MSC_VER]: Define to _alloca.
5225
5226 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5227
5228 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5229
a58c13ed
EZ
52302011-11-04 Eli Zaretskii <eliz@gnu.org>
5231
5232 * xdisp.c (note_mouse_highlight): If either of
5233 previous/next-single-property-change returns nil, treat that as
5234 the beginning or the end of the buffer. (Bug#9955)
5235
fe0b6370
JD
52362011-11-04 Jan Djärv <jan.h.d@swipnet.se>
5237
a58c13ed 5238 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
5239 label is not null (Bug#9951).
5240 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5241 may be NULL.
5242
89bd5ee1
EZ
52432011-11-04 Eli Zaretskii <eliz@gnu.org>
5244
5245 * window.c (Fwindow_body_size): Mention in the doc string that the
5246 return value is in frame's canonical units. (Bug#9949)
5247
84c3edb9
EZ
52482011-11-03 Eli Zaretskii <eliz@gnu.org>
5249
4e2fb5c7
EZ
5250 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
5251
84c3edb9 5252 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 5253 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 5254 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 5255
bc17a887
EZ
52562011-11-01 Eli Zaretskii <eliz@gnu.org>
5257
5258 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5259 Don't stop backward scan on the continuation glyph, even though
5260 its CHARPOS is positive.
6d5eb5b0
SM
5261 (mouse_face_from_buffer_pos, note_mouse_highlight):
5262 Rename cover_string to disp_string.
bc17a887 5263
4ee88440
MR
52642011-11-01 Martin Rudalics <rudalics@gmx.at>
5265
5266 * window.c (temp_output_buffer_show): Don't use
5267 Vtemp_buffer_show_specifiers.
5268 (Vtemp_buffer_show_specifiers): Remove unused variable.
5269
c2ff3c02
EZ
52702011-10-30 Eli Zaretskii <eliz@gnu.org>
5271
5272 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5273 past the beginning of the current glyph matrix.
5274
58179cce 52752011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
5276
5277 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5278 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5279 HAVE_GTK3 (Bug#9869).
b77a6a7f 5280
3b574623
JD
5281 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5282 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5283
b77a6a7f
JD
5284 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5285
5286 * xterm.c: Declare x_handle_net_wm_state to return int.
5287 (handle_one_xevent): Check if we are iconified but don't have
5288 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
5289 (get_current_wm_state): Return non-zero if not hidden,
5290 check for _NET_WM_STATE_HIDDEN (Bug#9893).
5291 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5292 (x_handle_net_wm_state): Return what get_current_wm_state returns.
5293 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5294
196e41e4
PE
52952011-10-29 Paul Eggert <eggert@cs.ucla.edu>
5296
5297 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5298 so that this new function doesn't get optimized away by a
5299 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
5300
021f2e1a
AS
53012011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5302
5303 * frame.h (MOUSE_HL_INFO): Remove excess parens.
5304
8b058d44
EZ
53052011-10-29 Eli Zaretskii <eliz@gnu.org>
5306
5307 Fix the `xbytecode' command.
5308 * .gdbinit (xprintbytestr): New command.
b50a28de 5309 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
5310 (xbytecode): Print the byte-code string as well.
5311
4452fb80
EZ
53122011-10-29 Kim Storm <storm@cua.dk>
5313
8b058d44
EZ
5314 * alloc.c (which_symbols): New function.
5315
21b72067
AS
53162011-10-29 Andreas Schwab <schwab@linux-m68k.org>
5317
5318 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5319 line. (Bug#9903)
5320
83ed7b5c
GM
53212011-10-29 Glenn Morris <rgm@gnu.org>
5322
5323 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5324 Not clear what it was for, and it causes various bugs. (Bug#9839)
5325
5a7a728b
EZ
53262011-10-28 Eli Zaretskii <eliz@gnu.org>
5327
5328 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5329 possible random value that matches one of those tested as
5330 condition to clear the mouse face.
5331
d3d0842f
CY
53322011-10-28 Chong Yidong <cyd@gnu.org>
5333
5334 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5335
31b39d13
DN
53362011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
5337
5338 * window.c (make_window): Initialize phys_cursor_on_p.
5339
9aba6043
SM
53402011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5341
5342 * lisp.h (struct Lisp_Symbol): Update comments.
5343
c20992f4
JB
53442011-10-28 Juanma Barranquero <lekktu@gmail.com>
5345
5346 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5347
db4f02f2
EZ
53482011-10-28 Eli Zaretskii <eliz@gnu.org>
5349
5350 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
5351 <oslsachem@gmail.com> for helping to debug this.
5352
5353 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5354 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5355 (g_b_init_get_glyph_outline_w): New static variables.
5356 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5357 (GetGlyphOutlineW_Proc): New typedefs.
5358 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
5359 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5360 New functions.
5361 (w32font_open_internal, compute_metrics):
5362 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
5363 instead of calling the "wide" APIs directly.
5364
5365 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5366
5367 * w32.h (syms_of_w32font): Add prototype.
5368
87e68db4
JB
53692011-10-27 Juanma Barranquero <lekktu@gmail.com>
5370
5371 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5372 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5373 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5374 (Fmove_to_window_line): Doc fix.
5375
435c1d67
CY
53762011-10-27 Chong Yidong <cyd@gnu.org>
5377
5378 * process.c (make_process): Set gnutls_state to NULL.
5379
5380 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5381 non-NULL, regardless of GNUTLS_INITSTAGE.
5382 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
5383 an error. Set process slots as soon as we allocate them.
5384
5385 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5386
9c6c6f49
CY
53872011-10-27 Chong Yidong <cyd@gnu.org>
5388
9aba6043
SM
5389 * gnutls.c (emacs_gnutls_deinit): New function.
5390 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
5391 (Fgnutls_deinit, Fgnutls_boot): Use it.
5392
5393 * process.c (make_process): Initialize GnuTLS credentials to NULL.
5394 (deactivate_process): Call emacs_gnutls_deinit.
5395
657d08d3
JB
53962011-10-27 Juanma Barranquero <lekktu@gmail.com>
5397
5398 * image.c (x_create_x_image_and_pixmap):
5399 * w32.c (sys_rename, w32_delayed_load):
5400 * w32font.c (fill_in_logfont):
5401 * w32reg.c (x_get_string_resource): Silence compiler warnings.
5402
5430d399
JB
54032011-10-26 Juanma Barranquero <lekktu@gmail.com>
5404
5405 * w32fns.c (w32_default_color_map): New function,
5406 extracted from Fw32_default_color_map.
a7ef684b 5407 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 5408
fe0055fa
PE
54092011-10-25 Paul Eggert <eggert@cs.ucla.edu>
5410
5411 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5412
e6346438
SM
54132011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
5414
5415 * keyboard.c (test_undefined): New function (bug#9751).
5416 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5417
e112cc37
ET
54182011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
5419
5420 * sysdep.c (init_sys_modes): Fix the check for the controlling
5421 terminal (Bug#6649).
5422
7b5d6677
EZ
54232011-10-20 Eli Zaretskii <eliz@gnu.org>
5424
5425 * dispextern.h (struct bidi_it): New member next_en_type.
5426
5427 * bidi.c (bidi_line_init): Initialize the next_en_type member.
5428 (bidi_resolve_explicit_1): When next_en_pos is valid for the
5429 current character, check also for next_en_type being WEAK_EN.
5430 (bidi_resolve_weak): Don't enter the expensive loop if the current
5431 position is before next_en_pos. Record the bidi type of the first
5432 non-ET, non-BN character we find, in addition to its position.
5433 (bidi_level_of_next_char): Invalidate next_en_type when
5434 next_en_pos is over-stepped.
5435
7da0b018
PE
54362011-10-20 Paul Eggert <eggert@cs.ucla.edu>
5437
5438 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5439 * editfns.c: Rewrite current-time-zone so that it invokes
5440 the equivalent of (format-time-string "%Z") to get the time zone name.
5441 This fixes a bug when the time zone name contains characters that
5442 need converting from the system time locale to Emacs internal format.
5443 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5444 that patch fixed format-time-string to do the conversion, but
5445 I forgot to fix current-time-zone.
5446 (format_time_string): New function, containing most of
5447 what Fformat_time_string used to contain.
5448 (Fformat_time_string): Rewrite in terms of format_time_string.
5449 This doesn't change this function's behavior.
5450 (current-time-zone): Rewrite to use format_time_string.
5451 This fixes the bug reported by Michael Schierl in
5452 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5453 Jason Rumney's 2007-06-07 change worked around this bug, but
5454 didn't fix it.
5455 * systime.h (tzname, timezone): Remove no-longer-used declarations.
5456
8547b010
EZ
54572011-10-19 Eli Zaretskii <eliz@gnu.org>
5458
5459 * xdisp.c (start_display): If the character at POS is displayed
5460 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
5461 (try_window_reusing_current_matrix): If a line ends in a display
5462 vector or the next line starts in a display vector, continue
5463 redrawing the window even though the character position of
5464 start_row was reached.
8547b010
EZ
5465 (Bug#9771, part 2)
5466
4e948d15
CY
54672011-10-18 Chong Yidong <cyd@gnu.org>
5468
5469 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5470 with nobreak-char-display too.
5471
4787455f
EZ
54722011-10-18 Eli Zaretskii <eliz@gnu.org>
5473
5474 Fix part 3 of bug#9771.
5475 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
5476 (bidi_resolve_neutral): Don't enter the expensive loop looking for
5477 non-neutral characters if the current character is a paragraph
5478 separator (a.k.a. Newline). This avoids running the same
5479 expensive loop twice, once when we consume the preceding newline
5480 and the other time when the line actually needs to be displayed.
5481 Avoid the loop when we see neutrals on the base embedding level
5482 following a character whose directionality is the same as the
5483 paragraph's. This avoids running the expensive loop when a line
5484 ends in a long sequence of neutrals, like control characters.
5485 Add assertion against STRONG_AL type. Slightly rearrange code
5486 that determines the type of a neutral given the first non-neutral
5487 that follows it.
5488 (bidi_level_of_next_char): Set next_en_pos to zero when
5489 invalidating its info.
5490
2c91f553
EZ
54912011-10-17 Eli Zaretskii <eliz@gnu.org>
5492
5493 * xdisp.c (push_display_prop): Determine whether to record string
5494 or buffer position by IT->string, not by IT->method. Allow
5495 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
5496 (move_it_vertically_backward): Don't look for character position
5497 immediately after the newline when in a continuation line.
5498 (Bug#9771, part 1)
2c91f553 5499
c7b08b0d
MR
55002011-10-15 Martin Rudalics <rudalics@gmx.at>
5501
5502 * window.c (coordinates_in_window): Rewrite and delabelize
5503 vertical border check. (Bug#5357) (Bug#9618)
5504
6b02f655
SM
55052011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
5506
5507 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
5508 errors in XSetWindowBorder (bug#9310).
5509
81d40c92
DA
55102011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
5511
5512 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
5513 avoid crash when xmalloc overrun checking is enabled.
5514
d4172c3b
EZ
55152011-10-13 Eli Zaretskii <eliz@gnu.org>
5516
5517 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
5518 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
5519 cursor motion with <left> and <right> arrow keys.
5520
5521 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
5522 some callers set that themselves.
5523
b00eea75
EZ
55242011-10-12 Eli Zaretskii <eliz@gnu.org>
5525
5526 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
5527 display string and the previous row comes from the same string and
5528 is empty. (Bug#9739) (Bug#9738)
5529
8fe012c4
SM
55302011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5531
5532 * doc.c (get_doc_string): Encode file name (bug#9735).
5533
0074aef2
EZ
55342011-10-12 Eli Zaretskii <eliz@gnu.org>
5535
79beb178
EZ
5536 * bidi.c (bidi_level_of_next_char):
5537 * xdisp.c (get_visually_first_element): Remove old incorrect
5538 comments regarding the Unicode Line Separator character.
5539
0074aef2
EZ
5540 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
5541
6e4b3fbe
DA
55422011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
5543
5544 * alloc.c (Fgc_status): Do not access beyond zombies array
5545 boundary if nzombies > MAX_ZOMBIES.
5546 * alloc.c (dump_zombies): Add missing format specifier.
5547
0324f3af
PE
55482011-10-12 Paul Eggert <eggert@cs.ucla.edu>
5549
b5525cac
PE
5550 * xdisp.c (set_cursor_from_row): Simplify conditionals,
5551 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
5552
0324f3af
PE
5553 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
5554 Some packages use them to denote characters with modifiers.
5555
e9b5f888
AS
55562011-10-11 Andreas Schwab <schwab@linux-m68k.org>
5557
5558 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
5559 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
5560 matching a pp-number. Rename parameter var to var1.
5561
127827c0
SM
55622011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5563
5564 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
5565
c8fd3bd0
GM
55662011-10-08 Glenn Morris <rgm@gnu.org>
5567
5568 * callint.c (Fcall_interactively): Give a more explicit error for the
5569 'c' case with a non-character input. (Bug#8479)
5570
352ec8ff
EZ
55712011-10-08 Eli Zaretskii <eliz@gnu.org>
5572
03669ccb
EZ
5573 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
5574 lines.
7061c986
EZ
5575 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
5576 lines that are hscrolled on the left.
03669ccb 5577
352ec8ff
EZ
5578 * dispnew.c (buffer_posn_from_coords): Account for a possible
5579 presence of header-line. (Bug#4426)
5580
a66cfb1c
SM
55812011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
5582
6b02f655
SM
5583 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
5584 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 5585
7c5ee88e
PE
55862011-10-07 Paul Eggert <eggert@cs.ucla.edu>
5587
5588 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
5589 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
5590 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
5591 this makes Emacs dump core during garbage collection on rare
5592 occasions. sizeof is obviously inferior to offsetof here, so
5593 stick with offsetof.
5594 (GC_POINTER_ALIGNMENT): New macro.
5595 (mark_memory): Omit 3rd (offset) arg; caller changed.
5596 Don't assume EMACS_INT alignment is the same as pointer alignment.
5597
df1bbe5b
SM
55982011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
5599
5600 * keyboard.c (read_key_sequence_remapped): New var.
5601 (read_key_sequence): Compute remapping in the right buffer.
5602 (command_loop_1): Use read_key_sequence's remapping directly.
5603
51553db6
SM
56042011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5605
32c1fffd
SM
5606 * dired.c (file_name_completion): Don't expand file name.
5607 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
5608 before checking file name handler.
5609
51553db6
SM
5610 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
5611 they've been requested explicitly (bug#9591).
5612
b6bd1599 56132011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
5614
5615 * keymap.c (Fsingle_key_description): Use make_specified_string
5616 instead of build_string to build string from push_key_description.
5617 (Bug#5193)
5618
f701dc2a
PE
56192011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5620
4222c55d
PE
5621 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
5622 This fixes a Y2038 bug on 64-bit hosts.
5623 * buffer.c (reset_buffer):
5624 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
5625 (Fclear_buffer_auto_save_failure):
5626 Use 0, not -1, to represent an unset failure time, since time_t
5627 might not be signed.
5628
f701dc2a
PE
5629 Remove dependency on glibc malloc internals.
5630 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5631 Move back here from lisp.h, but with their new implementations.
5632 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5633 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
5634 * charset.c (charset_table_init): New static var.
5635 (syms_of_charset): Use it instead of xmalloc. This removes a
5636 dependency on glibc malloc internals. See Eli Zaretskii's comment in
5637 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
5638 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5639 Move back to alloc.c.
5640 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5641 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
5642
9ceebf39
JD
56432011-09-30 Jan Djärv <jan.h.d@swipnet.se>
5644
5645 * nsterm.m (windowDidResize): Call x_set_window_size only when
5646 ns_in_resize is true. Otherwise set pixelwidth/height and
5647 call change_frame_size (Bug#9628).
5648
cb993c58
PE
56492011-09-30 Paul Eggert <eggert@cs.ucla.edu>
5650
3930c88b
PE
5651 Port --enable-checking=all to Fedora 14 x86-64.
5652 * charset.c (syms_of_charset): Also account for glibc malloc's
5653 internal overhead when calculating the initial malloc maximum.
5654
cb993c58
PE
5655 Port --enable-checking=all to Fedora 14 x86.
5656 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5657 Move to lisp.h.
5658 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
5659 (overrun_check_realloc, overrun_check_free):
5660 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
5661 That way, xmalloc returns a properly-aligned pointer even if
5662 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
5663 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
5664 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
5665 into account when calculating the initial malloc maximum.
5666 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5667 Move here from alloc.c, so that charset.c can use it too.
5668 Properly align; the old code wasn't right for common 32-bit hosts
5669 when configured with --enable-checking=all.
5670 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5671 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
5672
31bed486
EZ
56732011-09-29 Eli Zaretskii <eliz@gnu.org>
5674
04c70788 5675 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
5676 use EDOM.
5677
fbcaa2f3
EZ
56782011-09-28 Eli Zaretskii <eliz@gnu.org>
5679
5680 * xdisp.c (compute_display_string_end): If there's no display
5681 string at CHARPOS, return -1.
5682
5683 * bidi.c (bidi_fetch_char): When compute_display_string_end
5684 returns a negative value, treat the character as a normal
5685 character not covered by a display string. (Bug#9624)
5686
a239d4e9
JB
56872011-09-28 Juanma Barranquero <lekktu@gmail.com>
5688
5689 * lread.c (Fread_from_string): Fix typo in docstring.
5690
88652fd5
EZ
56912011-09-27 Eli Zaretskii <eliz@gnu.org>
5692
5693 * xdisp.c (handle_invisible_prop): If invisible text ends on a
5694 newline, reseat the iterator instead of bidi-iterating there one
5695 character at a time. (Bug#9610)
32c1fffd
SM
5696 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
5697 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 5698
ed497dd4
AS
56992011-09-27 Andreas Schwab <schwab@linux-m68k.org>
5700
5701 * lread.c (readevalloop): Use correct code for NBSP.
5702 (read1): Likewise. (Bug#9608)
5703
b2bf61aa
MA
57042011-09-25 Michael Albinus <michael.albinus@gmx.de>
5705
5706 * dbusbind.c (Fdbus_register_signal): When service is not
5707 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
5708
32bbb17c
GM
57092011-09-25 Glenn Morris <rgm@gnu.org>
5710
5711 * buffer.c (truncate-lines): Doc fix.
5712
94e0933e
CY
57132011-09-24 Chong Yidong <cyd@stupidchicken.com>
5714
5715 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
5716 (Fset_window_next_buffers): Doc fix.
5717
cddde921
GM
57182011-09-24 Glenn Morris <rgm@gnu.org>
5719
5720 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
5721
1260aef1
PE
57222011-09-24 Paul Eggert <eggert@cs.ucla.edu>
5723
25b4bfa0
PE
5724 Fix minor problems found by static checking.
5725 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
5726 * indent.c (Fvertical_motion): Fix == vs = typo.
5727
e3cbd34b
EZ
57282011-09-24 Eli Zaretskii <eliz@gnu.org>
5729
a66cfb1c
SM
5730 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
5731 Default value is now t. Doc fix.
6bf7006f 5732
e3cbd34b 5733 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 5734 logic when moving up, not only when moving down. Fix the
e3cbd34b 5735 confusing name and values of the it_overshoot_expected variable;
32c1fffd 5736 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
5737
5738 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
5739 CHARPOS is covered by a display string which includes newlines.
5740 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
5741 is covered by a display string with embedded newlines.
5742
a3de0cbd
MA
57432011-09-24 Michael Albinus <michael.albinus@gmx.de>
5744
5745 * dbusbind.c (Fdbus_register_signal): Add match rule to
5746 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
5747 (Fdbus_register_method, Vdbus_registered_objects_table):
5748 Fix docstring.
a3de0cbd 5749
b260039d
JM
57502011-09-24 Jim Meyering <meyering@redhat.com>
5751
32c1fffd 5752 do not ignore write error for any output size
b260039d
JM
5753 The previous change was incomplete.
5754 While it makes emacs --batch detect the vast majority of stdout
5755 write failures, errors were still ignored whenever the output size is
5756 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
5757 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
5758 && echo FAIL: ignored write error
5759 FAIL: ignored write error
5760 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
5761 && echo FAIL: ignored write error
5762 FAIL: ignored write error
5763 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
5764
8eca8a7c
AS
57652011-09-23 Andreas Schwab <schwab@linux-m68k.org>
5766
5767 * emacs.c (Fkill_emacs): In noninteractive mode exit
5768 non-successfully if a write error occurred on stdout. (Bug#9574)
5769
3341db62
EZ
57702011-09-21 Eli Zaretskii <eliz@gnu.org>
5771
5772 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
5773 the xassert test.
5774
5775 * dispextern.h (struct it): Update the comment documenting what
5776 can it->OBJECT be.
5777
8c203dbf
EZ
57782011-09-20 Eli Zaretskii <eliz@gnu.org>
5779
5780 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
5781 a display string, extend search for cursor position to end of row.
5782 (find_row_edges): If the row ends in a newline from a display
5783 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
5784 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
5785 (Fcurrent_bidi_paragraph_direction): Fix search for previous
5786 non-empty line. Fixes confusing cursor motion with arrow keys at
5787 the beginning of a line that starts with whitespace.
8c203dbf 5788
a4824228
LMI
57892011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
5790
5791 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
5792 (bug#9493).
5793
33ed493b
CY
57942011-09-18 Chong Yidong <cyd@stupidchicken.com>
5795
5796 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
5797 boolean (Bug#9154).
5798
56cd55c8
EZ
57992011-09-18 Eli Zaretskii <eliz@gnu.org>
5800
5801 * xdisp.c (display_line): Record maximum and minimum buffer
5802 positions even if no glyphs were produced (e.g., by a zero-width
5803 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
5804 buffer positions that will be removed from the glyph row because
5805 they don't fit.
c02dcedf
EZ
5806 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
5807 column is beyond frame width: don't subtract 1 "pixel" when
5808 computing width of the stretch.
3e62b7e0
EZ
5809 (reseat_at_next_visible_line_start): Undo the change made on
5810 2011-09-17 that saved paragraph information and restored it after
5811 the call to `reseat'. (Bug#9545)
56cd55c8 5812
5ed99d36 58132011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
5814
5815 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
5816 and turn window cursor on if cleared (Bug#9415).
5817
5ed99d36 58182011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
5819
5820 * search.c (boyer_moore): Take unibyte characters from pattern
5821 literally. (Bug#9458)
5822
9bade7b2
EZ
58232011-09-18 Eli Zaretskii <eliz@gnu.org>
5824
5825 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
5826
e5e9d610
PE
58272011-09-18 Paul Eggert <eggert@cs.ucla.edu>
5828
87e4427a
PE
5829 Fix minor problem found by static checking.
5830 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
5831 initialized, to pacify gcc -Wuninitialized.
5832
e5e9d610
PE
5833 * fileio.c: Report proper errno when syscall falls.
5834 (Finsert_file_contents): Save and restore errno,
5835 so that report_file_error outputs the correct diagnostic.
5836 (Fwrite_region) [CLASH_DETECTION]: Likewise.
5837
a1674f0b
EZ
58382011-09-18 Eli Zaretskii <eliz@gnu.org>
5839
5840 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
5841
fbfb6dd4
EZ
58422011-09-17 Eli Zaretskii <eliz@gnu.org>
5843
5844 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
5845 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
5846
bb187662
EZ
58472011-09-17 Eli Zaretskii <eliz@gnu.org>
5848
1137e8b8 5849 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 5850 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
5851
5852 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
5853 (bidi_find_paragraph_start): Search back for paragraph beginning
5854 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
5855 (bidi_move_to_visually_next): Only trigger paragraph-related
5856 computations when the last character is a newline or at EOB, not
5857 just any NEUTRAL_B. (Bug#9470)
5858
bb187662
EZ
5859 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
5860 truncated lines if point is covered by a display string. (Bug#9524)
5861
2e621251
PE
58622011-09-16 Paul Eggert <eggert@cs.ucla.edu>
5863
5864 * xselect.c: Relax test for outgoing X longs (Bug#9498).
5865 (cons_to_x_long): New function.
5866 (lisp_data_to_selection_data): Use it. Correct the test for
5867 short-versus-long data; it was negated. Break out of vector
5868 loop, for efficiency, when a long datum is discovered.
5869
91a15bc6
SM
58702011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
5871
5872 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
5873
b41c3a35
EZ
58742011-09-16 Eli Zaretskii <eliz@gnu.org>
5875
5876 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
5877 GCC PR/17406) by declaring this function with external scope.
5878
7812ba2d
PE
58792011-09-15 Paul Eggert <eggert@cs.ucla.edu>
5880
5881 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
5882 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
5883
cf7edc2a
AS
58842011-09-15 Andreas Schwab <schwab@linux-m68k.org>
5885
5886 * editfns.c (Fformat): Correctly handle text properties on "%%".
5887
bd01620e
EZ
58882011-09-15 Eli Zaretskii <eliz@gnu.org>
5889
5890 * xterm.c (x_draw_composite_glyph_string_foreground):
5891 * w32term.c (x_draw_composite_glyph_string_foreground):
5892 * term.c (encode_terminal_code):
5893 * composite.c (composition_update_it, get_composition_id):
5894 * xdisp.c (get_next_display_element)
5895 (fill_composite_glyph_string): Add comments about special meaning
5896 of TAB characters in a composition.
5897
a02719a3
PE
58982011-09-15 Paul Eggert <eggert@cs.ucla.edu>
5899
5900 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
5901 This occurs when processing a multibyte format.
5902 Problem reported by Wolfgang Jenker.
a02719a3 5903
72589a3c
JB
59042011-09-15 Johan Bockgård <bojohan@gnu.org>
5905
5906 * xdisp.c (try_cursor_movement): Only check for exact match if
5907 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
5908
1c14176c
PE
59092011-09-14 Paul Eggert <eggert@cs.ucla.edu>
5910
5911 Remove unused external symbols.
5912 * dispextern.h (calc_pixel_width_or_height): Remove decl.
5913 * xdisp.c (calc_pixel_width_or_height): Now static.
5914 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
5915 * indent.c (check_display_width):
5916 * w32term.c: Fix comment to match code.
5917 * xterm.c, xterm.h (x_catching_errors): Remove.
5918
d2eea5b5
PE
59192011-09-14 Paul Eggert <eggert@cs.ucla.edu>
5920
5921 * xselect.c: Use signed conversions more consistently (Bug#9498).
5922 (selection_data_to_lisp_data): Assume incoming selection data are
5923 signed integers, not unsigned. This is to be consistent with
5924 outgoing selection data, which was modified to use signed integers
5925 in as part of the fix to Bug#9196 in response to Jan D.'s comment
5926 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
5927 expects long, not unsigned long.
5928
46888499
EZ
59292011-09-14 Eli Zaretskii <eliz@gnu.org>
5930
5931 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
5932 computation of loop end. Reported by Johan Bockgård
5933 <bojohan@gnu.org>.
5934
ef8ef9fb
CY
59352011-09-13 Chong Yidong <cyd@stupidchicken.com>
5936
5937 * frame.c (Fother_visible_frames_p): Function deleted.
5938
fa819fed
EZ
59392011-09-12 Eli Zaretskii <eliz@gnu.org>
5940
5941 * indent.c (compute_motion): Process display vector front to back
5942 rather than the other way around. (Bug#2496)
5943
2ba8e008
SM
59442011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5945
5946 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
5947
20f53c69
CY
59482011-09-11 Chong Yidong <cyd@stupidchicken.com>
5949
5950 * minibuf.c (Fread_from_minibuffer): Doc fix.
5951
d562d7a4
EZ
59522011-09-11 Eli Zaretskii <eliz@gnu.org>
5953
5954 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
5955 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
5956
1c4d7f3d
LMI
59572011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5958
5959 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
5960 value for non-existent files.
5961
b885bf36
EZ
59622011-09-11 Eli Zaretskii <eliz@gnu.org>
5963
5964 * fileio.c (Finsert_file_contents): If the file cannot be opened,
5965 set its "size" to -1. This will set the modtime_size field of
5966 the corresponding buffer to -1, which is what
5967 verify-visited-file-modtime expects for files that do not exist.
5968 (Bug#9139)
5969
6612f0bf
PE
59702011-09-11 Paul Eggert <eggert@cs.ucla.edu>
5971
5972 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
5973 here ...
5974 * lisp.h: ... from here. push_key_description is no longer
5975 defined in keyboard.c, so its declaration should not be in
5976 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
5977 logically belongs with push_key_description.
5978
dfb3f755
PE
59792011-09-10 Paul Eggert <eggert@cs.ucla.edu>
5980
5981 * buffer.h: Include <sys/types.h> instead of <time.h>.
5982 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
5983 Problem reported by Herbert J. Skuhra.
5984
3134906c
LMI
59852011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
5986
5987 * xml.c (parse_region): Make the parsing work for
5988 non-comment-starting XML files again (bug#9144).
5989
8d903f4e
AS
59902011-09-10 Andreas Schwab <schwab@linux-m68k.org>
5991
5992 * image.c (gif_load): Fix calculation of bottom and right corner.
5993 (Bug#9468)
5994
80ad64f4
EZ
59952011-09-10 Eli Zaretskii <eliz@gnu.org>
5996
5997 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
5998 redisplay in small windows.
5999
208a048d
EZ
60002011-09-09 Eli Zaretskii <eliz@gnu.org>
6001
6002 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6003
9b1c252e
MR
60042011-09-08 Martin Rudalics <rudalics@gmx.at>
6005
6006 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6007 Operate on live windows only.
6008
2949f33b
JB
60092011-09-08 Juanma Barranquero <lekktu@gmail.com>
6010
6011 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6012
e08dcafd
EZ
60132011-09-07 Eli Zaretskii <eliz@gnu.org>
6014
6015 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6016 only under bidi iteration.
6017
115b96bd
JD
60182011-09-07 Jan Djärv <jan.h.d@swipnet.se>
6019
6020 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6021
c8199d0f
PE
60222011-09-06 Paul Eggert <eggert@cs.ucla.edu>
6023
6024 isnan: Fix porting problem to Solaris 10 with bundled gcc.
6025 Without this fix, the command to link temacs failed due to an
6026 undefined symbol __builtin_isnan. This is because
6027 /usr/include/iso/math_c99.h #defines isnan(x) to
6028 __builtin_isnan(x), but the bundled gcc, which identifies itself
6029 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6030 a __builtin_isnan.
6031 * floatfns.c (isnan): #undef, and then #define to a clone of
6032 what's in data.c.
6033 (Fisnan): Always define, since it's always available now.
6034 (syms_of_floatfns): Always define isnan at the Lisp level.
6035
e39b275c 60362011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
6037
6038 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6039
b2db44d9 60402011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 6041
f4af5137 6042 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
6043 The previous code assumed that file offsets (off_t values) fit in
6044 EMACS_INT variables, which is not true on typical 32-bit hosts.
6045 The code messed up by falsely reporting buffer overflow in cases
6046 such as (insert-file-contents "big" nil 1 2) into an empty buffer
6047 when "big" contains more than 2**29 bytes, even though this
6048 inserts just one byte and does not overflow the buffer.
6049 (Finsert_file_contents): Store file offsets as off_t
6050 values, not as EMACS_INT values. Check for overflow when
6051 converting between EMACS_INT and off_t. When checking for
6052 buffer overflow or for overlap, take the offsets into account.
6053 Don't use EMACS_INT for small values where int suffices.
6054 When checking for overlap, fix a typo: ZV was used where
6055 ZV_BYTE was intended.
6056 (Fwrite_region): Don't assume off_t fits into 'long'.
6057 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6058
ecfc0a49
MA
60592011-09-05 Michael Albinus <michael.albinus@gmx.de>
6060
6061 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6062
6511acf2 60632011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 6064
0999621a 6065 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
6066
6067 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 6068 (esprintf, exprintf, evxprintf): New functions.
62f19c19 6069 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 6070 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
6071 (modify_event_symbol): Do not assume that the length of
6072 name_alist_or_stem is safe to alloca and fits in int.
6073 (Fexecute_extended_command): Likewise for function name and binding.
6074 (Frecursion_depth): Wrap around reliably on integer overflow.
6075 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6076 since some callers pass EMACS_INT values.
6077 (Fsingle_key_description): Don't crash if symbol name contains more
6078 than MAX_ALLOCA bytes.
6079 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6080 (get_minibuffer): Arg is now EMACS_INT, not int.
6081 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 6082 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
6083 * window.h (command_loop_level, minibuf_level): Reflect API changes.
6084
2be7d702
PE
6085 * dbusbind.c (signature_cat): New function.
6086 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
6087 Do not overrun buffer; instead, report string overflow.
6088
9d1df220
PE
6089 * dispnew.c (add_window_display_history): Don't overrun buffer.
6090 Truncate instead; this is OK since it's just a log.
6091
33ef5c64
PE
6092 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6093 even if the time zone offset is outlandishly large.
6094 Don't mishandle offset == INT_MIN.
6095
66c6fdd5
PE
6096 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6097 when creating daemon; the previous buffer-overflow check was incorrect.
6098
d749b01b
PE
6099 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6100 which has the guts of the old verror function.
6101
b5cd1905
PE
6102 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6103 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
6104
6e1a67fb
PE
6105 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6106 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 6107 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 6108 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
6109 length of string rather than counting it via multiple sprintfs;
6110 that's simpler and more reliable.
c21721cc
PE
6111 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6112 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6113 sprintf, in case result does not fit in int.
6114
c57b67fc
PE
6115 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6116 (fontset_from_font): Print it.
6117
8a401434
PE
6118 * frame.c (tty_frame_count): Now printmax_t, not int.
6119 (make_terminal_frame, set_term_frame_name): Print it.
6120 (x_report_frame_params): In X, window IDs are unsigned long,
6121 not signed long, so print them as unsigned.
6122 (validate_x_resource_name): Check for implausibly long names,
6123 and don't assume name length fits in 'int'.
6124 (x_get_resource_string): Don't blindly alloca invocation name;
6125 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
6126 not fit in int.
6127
6e1a67fb
PE
6128 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6129 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
6130 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6131
0df02bf3
PE
6132 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6133 Use esprintf, not sprintf, in case result does not fit in int.
6134
48e30793
PE
6135 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6136 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6137 it as a large positive number.
6138 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6139 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6140
a66ff6d8
PE
6141 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6142 in case result does not fit in int.
6143
aca216ff
PE
6144 * print.c (float_to_string): Detect width overflow more reliably.
6145 (print_object): Make sprintf buffer a bit bigger, to avoid potential
6146 buffer overrun. Don't assume list length fits in 'int'. Treat
6147 print length of 0 as 0, not as infinity; to be consistent with other
6148 uses of print length in this function. Don't overflow print length
6149 index. Don't assume hash table size fits in 'long', or that
6150 vectorlike size fits in 'unsigned long'.
6151
31c286f7
PE
6152 * process.c (make_process): Use printmax_t, not int, to format
6153 process-name gensyms.
6154
55e5faa1
PE
6155 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6156
80f2e268
PE
6157 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6158 to avoid potential buffer overrun.
6159
670741ab
PE
6160 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6161 if X resource line is longer than 512 bytes.
6162
b7163a50
PE
6163 * xfns.c (x_window): Make sprintf buffer a bit bigger
6164 to avoid potential buffer overrun.
6165
ae58ff1f
PE
6166 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6167
c43c8a6a
PE
6168 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6169
3f8236f4
PE
61702011-09-04 Paul Eggert <eggert@cs.ucla.edu>
6171
53e9fe90 6172 Integer overflow fixes for scrolling, etc.
6511acf2
PE
6173 Without these, Emacs silently mishandles large integers sometimes.
6174 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
6175 it were "C-u 1 M-x recenter" on a typical 64-bit host.
6176
6511acf2
PE
6177 * xdisp.c (try_window_id): Check Emacs fixnum range before
6178 converting to 'int'.
806add1d 6179
6511acf2 6180 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
6181 Check that an Emacs fixnum is in range before assigning it to 'int'.
6182 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6183 values converted from Emacs fixnums.
6184 (Frecenter): Don't wrap around a line count if it is out of 'int'
6185 range; instead, treat it as an extreme value.
6186 (Fset_window_configuration, compare_window_configurations):
6187 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6188
6511acf2
PE
6189 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6190 that can exceed INT_MAX. Check that EMACS_INT value is in range
6191 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
6192 (match_limit): Don't assume that a fixnum can fit in 'int'.
6193
6511acf2 6194 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
6195 exceed INT_MAX.
6196
6511acf2 6197 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
6198 (Fvertical_motion): Don't wrap around LINES values that don't fit
6199 in 'int'. Instead, treat them as extreme values. This is good
6200 enough for windows, which can't have more than INT_MAX lines anyway.
6201
fcb901a7
LMI
62022011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6203
0f2f6b6d
LMI
6204 * Require libxml/parser.h to avoid compilation warning.
6205
fcb901a7
LMI
6206 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6207
6208 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6209 since this reportedly can destroy thread storage.
6210
6e20a0d4
CY
62112011-08-30 Chong Yidong <cyd@stupidchicken.com>
6212
6213 * syntax.c (find_defun_start): Update all cache variables if
6214 exiting early (Bug#9401).
6215
148ae00e
EZ
62162011-08-30 Eli Zaretskii <eliz@gnu.org>
6217
f6cfbd8f
EZ
6218 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6219
148ae00e
EZ
6220 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6221 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
6222 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
6223
6224 * term.c (tty_append_glyph): New function.
6225 (produce_stretch_glyph): Static function and its prototype deleted.
6226
a66cfb1c
SM
6227 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6228 Add prototypes.
148ae00e 6229
c4a07a4c
PE
62302011-08-29 Paul Eggert <eggert@cs.ucla.edu>
6231
6232 * image.c (parse_image_spec): Check for nonnegative, not for positive,
6233 when checking :margin (Bug#9390).
6234 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 6235 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
6236 so that the name doesn't mislead. All uses changed.
6237
6bc8cd65
JB
62382011-08-28 Johan Bockgård <bojohan@gnu.org>
6239
6240 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6241 set_tty_hooks.
6242
dca4927e
EZ
62432011-08-27 Eli Zaretskii <eliz@gnu.org>
6244
6245 * xdisp.c (move_it_to): Don't bail out early when reaching
6246 position beyond to_charpos, if we are scanning backwards.
6247 (move_it_vertically_backward): When DY == 0, make sure we get to
6248 the first character in the line after the newline.
6249
f2cad773
PE
62502011-08-27 Paul Eggert <eggert@cs.ucla.edu>
6251
6252 * ccl.c: Improve and simplify overflow checking (Bug#9196).
6253 (ccl_driver): Do not generate an out-of-range pointer.
6254 (Fccl_execute_on_string): Remove unnecessary check for
6255 integer overflow, noted by Stefan Monnier in
6256 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6257 Remove a FIXME that didn't need fixing.
6258 Simplify the newly-introduced buffer reallocation code.
6259
0cae2cdb
JB
62602011-08-27 Juanma Barranquero <lekktu@gmail.com>
6261
6262 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6263
5fc295a4 62642011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 6265
70c60eb2 6266 Integer and memory overflow issues (Bug#9196).
726e0ab1 6267
d31850da
PE
6268 * doc.c (get_doc_string): Rework so that
6269 get_doc_string_buffer_size is the actual buffer size, rather than
6270 being 1 less than the actual buffer size; this makes xpalloc more
6271 convenient.
6272
a69fbedb
PE
6273 * image.c (x_allocate_bitmap_record, cache_image):
6274 * xselect.c (Fx_register_dnd_atom):
6275 Simplify previous changes by using xpalloc.
6276
fe5c5d37
PE
6277 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6278 since either will do and ptrdiff_t is convenient with xpalloc.
6279
0065d054
PE
6280 * charset.c (charset_table_size)
6281 (struct charset_sort_data.priority): Now ptrdiff_t.
6282 (charset_compare): Don't overflow if priorities differ greatly.
6283 (Fsort_charsets): Don't assume list length fits in int.
6284 Check for size-calculation overflow when allocating sort data.
6285 (syms_of_charset): Allocate an initial charset table that is
6286 just under 64 KiB, to avoid problems with glibc malloc and mmap.
6287
6288 * cmds.c (internal_self_insert): Check for size-calculation overflow.
6289
6290 * composite.h (struct composition.glyph_len): Now int, not unsigned.
6291 The actual value is always <= INT_MAX, and leaving it unsigned made
6292 overflow checking harder.
6293
6294 * dispextern.h (struct glyph_matrix.rows_allocated)
6295 (struct face_cache.size): Now ptrdiff_t, for convenience in use
6296 with xpalloc. The values are still always <= INT_MAX.
6297
6298 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6299
6300 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6301 (SAFE_NALLOCA): New macro.
6302
6303 * region-cache.c (struct boundary.pos, find_cache_boundary)
6304 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6305 (set_cache_region, invalidate_region_cache)
6306 (revalidate_region_cache, know_region_cache, region_cache_forward)
6307 (region_cache_backward, pp_cache):
6308 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
6309 so that ptrdiff_t * can be passed to xpalloc.
6310 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6311 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6312 (pp_cache): Don't assume cache_len fits in int.
6313 * region-cache.h: Adjust extern decls to match.
6314
6315 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6316 EMACS_INT, since either will do, for xpalloc.
6317
6318 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6319 (xnmalloc, xnrealloc, xpalloc): New functions.
6320
726e0ab1
PE
6321 * bidi.c (bidi_shelve_header_size): New constant.
6322 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6323 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6324
51f30bc5 6325 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
6326 * buffer.c (overlays_at, overlays_in, record_overlay_string)
6327 (overlay_strings):
6328 Don't update size of array until after memory allocation succeeds,
6329 because xmalloc/xrealloc may not return.
0065d054
PE
6330 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6331 now that we have proper integer overflow checking.
6332 (record_overlay_string, overlay_strings): Catch overflows when
6333 calculating size of overlay_str_buf.
726e0ab1 6334
0065d054
PE
6335 * callproc.c (Fcall_process): Check for size overflow when
6336 calculating size of args2.
6337 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6338 Normally we prefer signed values, but sticking with ptrdiff_t would
6339 require adding more-complicated checks.
726e0ab1
PE
6340
6341 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6342 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6343 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 6344 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
6345
6346 * character.c (Fstring): Check for size-calculation overflow.
6347
6348 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6349 unnecessary integer overflow. Check for size overflow.
6350 (encode_coding_object): Don't update size until xmalloc succeeds.
6351
6352 * composite.c (get_composition_id): Check for overflow in glyph
6353 length calculations.
6354
6355 Integer and memory overflow fixes for display code.
6356 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6357 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6358 (scrolling_window): Check for overflow in size calculations.
6359 (line_draw_cost, realloc_glyph_pool, add_row_entry):
6360 Don't assume glyph table len fits in int.
6361 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6362 (row_table_size): Now ptrdiff_t, not int.
6363 (scrolling_window): Avoid overflow in size calculations.
6364 Don't update size until allocation succeeds.
6365 * fns.c (concat): Check for overflow in size calculations.
6366 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6367 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6368 (NEXT_ALMOST_PRIME_LIMIT): New constant.
6369
6370 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6371 (get_doc_string): Check for size calculation overflow.
6372 Don't update size until allocation succeeds.
6373 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6374 EMACS_INT, where ptrdiff_t will do.
6375 (Fsubstitute_command_keys): Check for string overflow.
6376
6377 * editfns.c (set_time_zone_rule): Don't assume environment length
6378 fits in int.
6379 (message_length): Now ptrdiff_t, not int.
6380 (Fmessage_box): Don't update size until allocation succeeds.
6381 Don't assume message length fits in int.
6382 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6383
0065d054
PE
6384 * emacs.c (main): Do not reallocate argv, since there is a null at
6385 the end that can be overwritten, and this way there's no need to
6386 worry about size-calculation overflow.
6387 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
6388
6389 * eval.c (init_eval_once, grow_specpdl): Don't update size until
6390 alloc succeeds.
6391 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6392
6393 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6394 (x_set_scroll_bar_width, x_figure_window_size):
6395 Check for integer overflow.
6396 (x_set_alpha): Do not assume XINT fits in int.
6397
6398 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6399 This is for the members text_lines, text_cols, total_lines, total_cols,
6400 where the system imposes an 'int' limit.
6401
6402 * fringe.c (Fdefine_fringe_bitmap):
6403 Don't update size until alloc works.
6404
6405 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6406 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6407
6408 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6409 Check for size-calculation overflow.
6410 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6411 do, as we prefer signed integers.
6412 (id_to_widget.max_size, id_to_widget.used)
6413 (xg_store_widget_in_map, xg_remove_widget_from_map)
6414 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6415 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6416 Use and return ptrdiff_t, not int.
6417 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6418 * gtkutil.h: Change prototypes to match the above.
6419
6420 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6421 are duplicate now that they've been promoted to lisp.h.
6422 (x_allocate_bitmap_record, x_alloc_image_color)
6423 (make_image_cache, cache_image, xpm_load):
6424 Don't update size until alloc is done.
6425 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6426 (x_detect_edges):
3256efce 6427 Check for size calculation overflow.
726e0ab1
PE
6428 (ct_colors_allocated_max): New constant.
6429 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6430 overflow.
3256efce 6431
726e0ab1
PE
6432 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6433 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6434 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6435 Use ptrdiff_t, not int, to count maps.
6436 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
6437 calculations. Don't update size until allocation succeeds.
6438 Redo calculations to avoid overflow.
726e0ab1
PE
6439 * keyboard.h: Change prototypes to match the above.
6440
6441 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6442 to count maps.
6443 (current_minor_maps): Check for size calculation overflow.
6444 * keymap.h: Change prototypes to match the above.
6445
6446 * lread.c (read1, init_obarray): Don't update size until alloc done.
6447
6448 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6449 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6450
726e0ab1
PE
6451 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6452 Now ptrdiff_t, not int.
6453 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6454 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6455
6456 * process.c (Fnetwork_interface_list): Check for overflow
6457 in size calculation.
6458
6459 * region-cache.c (move_cache_gap): Check for size calculation overflow.
6460
6461 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
6462 overflow. Don't bother calling xmalloc when xrealloc will do.
6463
6464 * search.c (Freplace_match): Check for size calculation overflow.
6465 (Fset_match_data): Don't assume list lengths fit in 'int'.
6466
6467 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6468 for command line length. Do not attempt to address one before the
6469 beginning of an array, as that's not portable.
6470
6471 * term.c (max_frame_lines): Remove; unused.
6472 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6473 not int.
6474 (encode_terminal_code, calculate_costs): Check for size
6475 calculation overflow.
6476 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
6477 table lengths and related sizes. Don't update size until alloc
6478 done. Redo calculations to avoid overflow.
6479 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
6480
6481 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
6482 subtracting pointers.
6483 (gobble_line): Check for overflow more carefully. Don't update size
6484 until alloc done.
6485
6486 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
6487 Don't update size until alloc done.
6488 Redo size calculations to avoid overflow.
6489 Check for size calculation overflow.
0065d054 6490 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
6491
6492 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
6493 Use ptrdiff_t, not int, for sizes.
6494 (store_mode_line_noprop_char): Don't update size until alloc done.
6495
0065d054
PE
6496 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
6497 Use ptrdiff_t, not int, for sizes.
6498 (Finternal_make_lisp_face, cache_face):
6499 Check for size calculation overflow.
6500 (cache_face): Treat size calculation overflows as if they were
6501 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
6502
6503 * xfns.c (x_encode_text, x_set_name_internal)
6504 (Fx_change_window_property): Use ptrdiff_t, not int, to count
6505 sizes, since they can exceed INT_MAX in size. Check for size
6506 calculation overflow.
6507
0065d054
PE
6508 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
6509 (xg_select): Check for size calculation overflow.
726e0ab1
PE
6510 Don't update size until alloc done.
6511
0065d054 6512 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 6513 as sprintf is limited to int lengths.
1d526e2f 6514
252c5ee1
PE
6515 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
6516 (X_LONG_MIN): New macros.
864d7ce7
PE
6517 Use them to make the following changes clearer.
6518 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
6519 This change doesn't affect the value now, but it may help remind
6520 future maintainers not to raise the value too much later.
6521 (SELECTION_QUANTUM): Remove, replacing with ...
6522 (selection_quantum): ... new function, which avoids overflow.
6523 All uses changed.
6524 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
6525 assumption that selection length fits in 'int'.
6526 (x_reply_selection_request, x_handle_selection_request)
6527 (x_get_window_property, receive_incremental_selection)
6528 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
6529 (lisp_data_to_selection_data, clean_local_selection_data):
6530 Use ptrdiff_t, not int, to record length of selection.
6531 (x_reply_selection_request, x_get_window_property)
6532 (receive_incremental_selection, x_property_data_to_lisp):
6533 Redo calculations to avoid overflow.
6534 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 6535 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
6536 something.
6537 (x_get_window_property, receive_incremental_selection)
6538 (lisp_data_to_selection_data, x_property_data_to_lisp):
6539 Check for size-calculation overflow.
6540 (x_get_window_property, receive_incremental_selection)
6541 (lisp_data_to_selection_data, Fx_register_dnd_atom):
6542 Don't store size until memory allocation succeeds.
6543 (x_get_window_property): Plug memory leak on memory exhaustion.
6544 Don't double-block input; malloc is safe here. Don't assume 2**34
6545 - 4 fits in unsigned long. Add an xassert to check
6546 XGetWindowProperty overflow. Be more careful about overflow
6547 calculations, and distinguish size from memory overflow better.
6548 (receive_incremental_selection): When tracing, don't assume
6549 unsigned int is less than INT_MAX.
6550 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
6551 harmful) conversions of unsigned short to int.
6552 (lisp_data_to_selection_data): Don't assume that integers
6553 in the range -65535 through -1 fit in an X unsigned short.
6554 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
6555 result parameters unless successful. Rely on cons_to_unsigned
6556 to report problems with elements; the old code wasn't right anyway.
6557 (x_check_property_data): Check for int overflow; we cannot use
6558 a wider type due to X limits.
6559 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
6560
726e0ab1 6561 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 6562
0065d054
PE
6563 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
6564 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
6565 (x_color_cells): Don't store size until memory allocation succeeds.
6566 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 6567 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
6568 (x_term_init): Don't assume length fits in int (sprintf is limited
6569 to int size).
bc18e09d 6570
ebfa62c0
PE
6571 Use ptrdiff_t for composition IDs.
6572 * character.c (lisp_string_width):
6573 * composite.c (composition_table_size, n_compositions)
6574 (get_composition_id, composition_gstring_from_id):
6575 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
6576 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
6577 * window.c (Frecenter):
6578 Use ptrdiff_t, not int, for composition IDs.
6579 * composite.c (get_composition_id): Check for integer overflow.
6580 * composite.h: Adjust prototypes to match the above changes.
6581
d3411f89
PE
6582 Use ptrdiff_t for hash table indexes.
6583 * category.c (hash_get_category_set):
6584 * ccl.c (ccl_driver):
6585 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
6586 * coding.c (coding_system_charset_list, detect_coding_system):
6587 * coding.h (struct coding_system.id):
6588 * composite.c (get_composition_id, gstring_lookup_cache):
6589 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
6590 * image.c (xpm_get_color_table_h):
6591 * lisp.h (hash_lookup, hash_put):
6592 * minibuf.c (Ftest_completion):
6593 Use ptrdiff_t for hash table indexes, not int (which is too
6594 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
6595 32-bit --with-wide-int hosts).
6596
e097a6fa
PE
6597 * charset.c (Fdefine_charset_internal): Check for integer overflow.
6598 Add a FIXME comment about memory leaks.
6599 (syms_of_charset): Don't assume xmalloc returns.
6600
5637687f
PE
6601 Don't assume that stated character widths fit in int.
6602 * character.c (Fchar_width, c_string_width, lisp_string_width):
6603 * character.h (CHAR_WIDTH):
6604 * indent.c (MULTIBYTE_BYTES_WIDTH):
6605 Use sanitize_char_width to avoid undefined and/or bad behavior
6606 with outlandish widths.
a66cfb1c 6607 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
6608 now that we have two such functions. All uses changed.
6609 (sanitize_char_width): New inline function.
6610
a2271ba2
PE
6611 Don't assume that tab-width fits in int.
6612 * character.h (sanitize_width): New inline function.
6613 (SANE_TAB_WIDTH): New macro.
6614 (ASCII_CHAR_WIDTH): Use it.
6615 * indent.c (sane_tab_width): Remove. All uses replaced by
6616 SANE_TAB_WIDTH (current_buffer).
6617 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
6618
18c52557
PE
6619 * fileio.c: Integer overflow issues with file modes.
6620 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
6621
caeeedc1
PE
6622 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
6623 Remove unreachable code.
6624 (read_hex, load_charset_map_from_file): Check for integer overflow.
6625
6df6ae42 6626 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
6627 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
6628 (x_send_scroll_bar_event): Likewise. Check that the size does not
6629 exceed limits imposed by XClientMessageEvent, as well as the usual
6630 ptrdiff_t and size_t limits.
6631
b13995db
PE
6632 * keyboard.c: Overflow, signedness and related fixes.
6633 (make_lispy_movement): Use same integer type in forward decl
6634 that is used in the definition.
6635 (read_key_sequence, keyremap_step):
6636 Change bufsize argument back to int, undoing my 2011-03-30 change.
6637 We prefer signed types, and int is wide enough here.
6638 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
6639 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
6640 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
6641 length, not size_t. Use ptrdiff_t for index, not int.
6642 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
6643 possibility of integer overflow.
6644
13464394
PE
6645 Overflow, signedness and related fixes for images.
6646
6647 * dispextern.h (struct it.stack[0].u.image.image_id)
6648 (struct_it.image_id, struct image.id, struct image_cache.size)
6649 (struct image_cache.used, struct image_cache.ref_count):
6650 * gtkutil.c (update_frame_tool_bar):
6651 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
6652 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
6653 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
6654 * nsmenu.m (update_frame_tool_bar):
6655 * xdisp.c (calc_pixel_width_or_height):
6656 * xfns.c (image_cache_refcount):
6657 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
6658 on typical 64-bit hosts.
6659
6660 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6661 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
6662 Omit unnecessary casts to int.
6663 (parse_image_spec): Check that integers fall into 'int' range
6664 when the callers expect that.
6665 (image_ascent): Redo ascent calculation to avoid int overflow.
6666 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
6667 (lookup_image): Remove unnecessary tests.
6668 (xbm_image_p): Locals are now of int, not EMACS_INT,
6669 since parse_image_check makes sure they fit into int.
6670 (png_load, gif_load, svg_load_image):
6671 Prefer int to unsigned where either will do.
6672 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
6673 old tiff_error_handler and tiff_warning_handler.
6674 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
6675 stack buffer overflows. It uses only the features of vsnprintf
6676 that are common to both POSIX and native Microsoft.
6677 (tiff_error_handler, tiff_warning_handler): Use it.
6678 (tiff_load, gif_load, imagemagick_load_image):
6679 Don't assume :index value fits in 'int'.
6680 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
6681 (imagemagick_load_image): Check that crop parameters fit into
6682 the integer types that MagickCropImage accepts. Don't assume
6683 Vimagemagick_render_type has a nonnegative value. Don't assume
6684 size_t fits in 'long'.
6685 (gs_load): Use printmax_t to print the widest integers possible.
6686 Check for integer overflow when computing image height and width.
6687
c11821d4
EZ
66882011-08-26 Eli Zaretskii <eliz@gnu.org>
6689
6690 * xdisp.c (redisplay_window): Don't force window start if point
6691 will be invisible in the resulting window. (Bug#9324)
6692
0c95fcf7
EZ
66932011-08-25 Eli Zaretskii <eliz@gnu.org>
6694
6695 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
6696 the display spec is of the form `(space ...)'.
6697 (handle_display_spec): Return the value returned by
6698 handle_single_display_spec, not just 1 or zero.
6699 (handle_single_display_spec): If the display spec is of the form
6700 `(space ...)', and specifies display in the text area, return 2
6701 rather than 1.
fee65a97 6702 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
6703 accurately, and prefer exact match for point under bidi.
6704 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
6705
6706 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
6707 into disp_prop; all users changed.
6708
6709 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
6710 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
6711 for the text covered by the display property.
6712
e4ed06f1
CY
67132011-08-25 Chong Yidong <cyd@stupidchicken.com>
6714
6715 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
6716 Change return value to nil.
6717 (Frecord_buffer): Delete unused function.
6718
f67cdd7f
EZ
67192011-08-24 Eli Zaretskii <eliz@gnu.org>
6720
5980d4c6
EZ
6721 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
6722 buffers, return left-to-right.
8610fe8b
EZ
6723 (set_cursor_from_row): Consider candidate row a win if its glyph
6724 represents a newline and point is on that newline. Fixes cursor
6725 positioning on the newline at EOL of R2L text within L2R
6726 paragraph, and vice versa.
6727 (try_cursor_movement): Check continued rows, in addition to
6728 continuation rows. Fixes unwarranted scroll when point enters a
6729 continued line of R2L text within an L2R paragraph, or vice versa.
6730 (cursor_row_p): Consider the case of point being equal to
6731 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
6732 from the end of a short line to the beginning of a continued line
6733 of R2L text within L2R paragraph.
6734 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
6735 composed characters.
5980d4c6 6736
f67cdd7f
EZ
6737 * bidi.c (bidi_check_type): Use xassert.
6738 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
6739 members.
6740
bca633fb
EZ
67412011-08-23 Eli Zaretskii <eliz@gnu.org>
6742
6743 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
6744 a character.
6745
4a5885a7
CY
67462011-08-23 Chong Yidong <cyd@stupidchicken.com>
6747
6748 * nsfont.m (ns_otf_to_script): Fix typo.
6749
0902a04e
KH
67502011-08-22 Kenichi Handa <handa@m17n.org>
6751
6752 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
6753 extra slot even if the purpose is char-code-property-table.
6754
1a2e6670
EZ
67552011-08-23 Eli Zaretskii <eliz@gnu.org>
6756
8ddde651
EZ
6757 * xdisp.c (redisplay_window): When computing centering_position,
6758 account for the height of the header line. (Bug#8874)
6759
425cc014
EZ
6760 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
6761 instead of CHAR_TO_BYTE. Fixes a crash when a completion
6762 candidate is selected by the mouse, and that candidate has a
6763 composed character under the mouse.
6764
1a2e6670
EZ
6765 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
6766 coordinates reported by pos-visible-in-window-p for a composed
6767 character in column zero.
6768
8b76d6f8
SM
67692011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
6770
6771 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
6772
dac347dd
EZ
67732011-08-22 Eli Zaretskii <eliz@gnu.org>
6774
6775 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
6776 consider it a hit if to_charpos is anywhere in the range of the
6777 composed buffer positions.
6778
e013fb34
CY
67792011-08-22 Chong Yidong <cyd@stupidchicken.com>
6780
6781 * image.c (gif_load): Don't assume that each subimage has the same
6782 dimensions as the base image. Handle disposal method that is
6783 "undefined" by the gif spec (Bug#9335).
6784
bd1ba3e8
CY
67852011-08-20 Chong Yidong <cyd@stupidchicken.com>
6786
6787 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 6788 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 6789
54a1215b
EZ
67902011-08-19 Eli Zaretskii <eliz@gnu.org>
6791
823564e5
EZ
6792 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
6793 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
6794 from an Org mode buffer to a Speedbar frame.
6795
54a1215b
EZ
6796 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
6797 a composition, take its buffer position from IT->cmp_it.charpos.
6798 Fixes cursor positioning at the beginning of a line that begins
6799 with a composed character.
6800
9778ebcc
EZ
68012011-08-18 Eli Zaretskii <eliz@gnu.org>
6802
0be6ee06
EZ
6803 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
6804 character bidirectional type, use STRONG_L instead. Fixes crashes
6805 in a buffer produced by `describe-categories'.
6806
9778ebcc
EZ
6807 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
6808 members before the level stack, so they would be saved and
6809 restored when copying iterator state. Fixes incorrect reordering
6810 around TABs covered by display properties.
6811
156bffbe
AS
68122011-08-18 Andreas Schwab <schwab@linux-m68k.org>
6813
6b02f655 6814 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 6815
72ad093b
CY
68162011-08-17 Chong Yidong <cyd@stupidchicken.com>
6817
6818 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
6819 (internal_condition_case_2, internal_condition_case_n):
6820 Remove unnecessary aborts (Bug#9081).
72ad093b 6821
35774242
EZ
68222011-08-17 Eli Zaretskii <eliz@gnu.org>
6823
6824 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
6825 has no `load' handler, try opening the file locally. (Bug#9311)
6826
db76dd85
KB
68272011-08-16 Ken Brown <kbrown@cornell.edu>
6828
6829 * gmalloc.c: Expand comment.
6830
b215eee5
EZ
68312011-08-16 Eli Zaretskii <eliz@gnu.org>
6832
6833 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
6834 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
6835
a4579d33
KB
68362011-08-16 Ken Brown <kbrown@cornell.edu>
6837
6838 Fix memory allocation problems in Cygwin build (Bug#9273).
6839
6840 * unexcw.c ( __malloc_initialized): Declare external variable.
6841 (fixup_executable): Force the dumped emacs to reinitialize malloc.
6842
8b76d6f8
SM
6843 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
6844 New variables.
a4579d33
KB
6845 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
6846 dumped emacs.
6847 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
6848 in the static heap.
6849 [CYGWIN] (special_realloc): New function.
6850 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
6851 requests to realloc storage in the static heap.
6852
3ebec551
PE
68532011-08-15 Paul Eggert <eggert@cs.ucla.edu>
6854
6855 * bidi.c (bidi_initialize): Remove unused local.
6856
9fd8be00
EZ
68572011-08-15 Eli Zaretskii <eliz@gnu.org>
6858
6b02f655
SM
6859 * bidimirror.h:
6860 * biditype.h: Remove file.
6861 * makefile.w32-in ($(BLD)/bidi.$(O)):
6862 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
6863
6864 * dispextern.h: Fix a typo in the comment to bidi_type_t.
6865
6866 * chartab.c: Improve commentary for the uniprop_table API.
6867
32413314
EZ
6868 * bidi.c (bidi_paragraph_init): Support zero value of
6869 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
6870 (bidi_initialize): Use uniprop_table instead of including
6871 biditype.h and bidimirror.h.
32413314 6872
9fd8be00
EZ
6873 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
6874 coordinates of the iterator when restoring from ppos_it.
6875 (Bug#9296)
6876
5cf2b69b
KH
68772011-08-14 Kenichi Handa <handa@m17n.org>
6878
6879 * process.c (create_process): Call setup_process_coding_systems
72ad093b 6880 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 6881
daf17d00
EZ
68822011-08-14 Eli Zaretskii <eliz@gnu.org>
6883
6884 * xdisp.c (move_it_in_display_line_to): Don't invoke
6885 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
6886 ppos_it. Fixes vertical cursor motion when line beginning is
6887 covered by an image. (Bug#9296)
6888
08e3161a
JD
68892011-08-14 Jan Djärv <jan.h.d@swipnet.se>
6890
6891 * nsterm.h (ns_run_ascript): Declare.
6892 (NSAPP_DATA2_RUNASSCRIPT): Define.
6893
6894 * nsfns.m (as_script, as_result, as_status): New static variables.
6895 (ns_run_ascript): New function.
5e617bc2 6896 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
6897 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
6898 the event loop. Get status from as_status (Bug#7276).
6899
6900 * nsterm.m (sendEvent): If event is NSApplicationDefined and
6901 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
6902 the event loop (Bug#7276).
6903
a3720aa2
AS
69042011-08-14 Andreas Schwab <schwab@linux-m68k.org>
6905
6906 * gnutls.c (QCgnutls_bootprop_priority)
6907 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
6908 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
6909 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
6910 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
6911 (QCgnutls_bootprop_verify_hostname_error)
6912 (QCgnutls_bootprop_callbacks_verify): Rename from
6913 Qgnutls_bootprop_..., all uses changed.
6914
6915 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
6916 uses changed.
6917
0a0d27fb
PE
69182011-08-14 Paul Eggert <eggert@cs.ucla.edu>
6919
19d5c50c
PE
6920 * xfaces.c (Qframe_set_background_mode): Now static.
6921 * dispextern.h (Qframe_set_background_mode): Remove decl.
6922
0a0d27fb
PE
6923 * process.c (Fnetwork_interface_info): Declare local only if needed.
6924
377538cb
JD
69252011-08-13 Jan Djärv <jan.h.d@swipnet.se>
6926
6927 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
6928 (Fnetwork_interface_list): Allocate in increments of bytes instead
6929 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
6930 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
6931 sockaddr.
6932 (struct ifflag_def): notrailers is smart on OSX.
6933 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
6934 Get hardware address with getifaddrs if available.
6935
08fff70c
EZ
69362011-08-12 Eli Zaretskii <eliz@gnu.org>
6937
6938 * xdisp.c (iterate_out_of_display_property): xassert that
6939 IT->position is set to within IT->object's boundaries. Break from
6940 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
6941 when IT->position is set up wrongly due to some bug.
6942 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
6943 (push_display_prop): Allow GET_FROM_STRING as IT->method on
6944 entry. Force push_it to save on the stack the current
6945 buffer/string position, to be restored by pop_it. Fix flags in
6946 the iterator structure wrt the object coming from a display
6947 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
6948 properties. (Bug#9284)
6949
7be1c708 69502011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 6951
7be1c708
CY
6952 * fontset.c (fontset_get_font_group): Add proper type checks.
6953 (Bug#9172)
aac0c6e3 6954
7be1c708 69552011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 6956
7be1c708
CY
6957 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
6958 and LC_VERSION_MIN_MACOSX.
6959 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
6960 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 6961
97bb72a6
EZ
69622011-08-08 Eli Zaretskii <eliz@gnu.org>
6963
6964 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
6965 no-display-properties-and-no-overlays under bidi display.
6966 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 6967 properties and overlays.
97bb72a6 6968
d5617611
CY
69692011-08-08 Chong Yidong <cyd@stupidchicken.com>
6970
37e11a63
CY
6971 * editfns.c (Fset_time_zone_rule): Document relationship with the
6972 setenv function.
6973
d5617611
CY
6974 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
6975 the font entity extracted from the cache (Bug#8109).
6976
58872834
CY
69772011-08-07 Chong Yidong <cyd@stupidchicken.com>
6978
6979 * composite.c (autocmp_chars): Don't reset point. That is done by
6980 restore_point_unwind (Bug#5984).
6981
75bfc667
JL
69822011-08-07 Juri Linkov <juri@jurta.org>
6983
6984 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
6985 to show the arg `TIME' instead of `TIMEVAL'.
6986
d1410150
EZ
69872011-08-06 Eli Zaretskii <eliz@gnu.org>
6988
6989 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
6990 display property strides EOL and includes a newline, as in
6991 longlines-mode. (Bug#9254)
75b771e4
EZ
6992 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
6993 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
6994
6995 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
6996 is non-zero, even if the data buffer is NULL. Fixes a crash in
6997 vertical-motion with longlines-mode. (Bug#9254)
6998
35928349
EZ
69992011-08-05 Eli Zaretskii <eliz@gnu.org>
7000
ec7cc85b
EZ
7001 * bidi.c <bidi_cache_total_alloc>: Now static.
7002 (bidi_initialize): Initialize bidi_cache_total_alloc.
7003
8b76d6f8 7004 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
7005 cache. (Bug#9221)
7006
7007 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7008 amount allocated this far in `bidi_cache_total_alloc'.
7009 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7010 non-zero, only free the data buffer without restoring the cache
7011 contents. All callers changed.
7012
7013 * dispextern.h (bidi_unshelve_cache): Update prototype.
7014
7015 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7016 (move_it_in_display_line, move_it_to)
7017 (move_it_vertically_backward, move_it_by_lines): Replace the call
7018 to xfree to an equivalent call to bidi_unshelve_cache.
7019 (move_it_in_display_line_to): Fix logic of returning
412b6358 7020 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 7021
e2e2423b
EZ
70222011-08-05 Eli Zaretskii <eliz@gnu.org>
7023
7024 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7025 came from a string character with a `cursor' property. (Bug#9229)
7026
ae9e757a
JD
70272011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7028
7029 * Makefile.in (LIB_PTHREAD): New variable.
7030 (LIBES): Add LIB_PTHREAD (Bug#9216).
7031
7032 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7033 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7034
213bd7f2
AS
70352011-08-04 Andreas Schwab <schwab@linux-m68k.org>
7036
6b02f655 7037 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 7038
99aaf75f
JD
70392011-08-04 Jan Djärv <jan.h.d@swipnet.se>
7040
7041 * xterm.c (x_find_topmost_parent): New function.
7042 (x_set_frame_alpha): Find topmost parent window with
7043 x_find_topmost_parent and set the property there also (bug#9181).
7044 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7045
c74e9d86
PE
70462011-08-04 Paul Eggert <eggert@cs.ucla.edu>
7047
7048 * callproc.c (Fcall_process): Avoid vfork clobbering
7049 the local vars buffer, coding_systems, current_dir.
7050
640c8776
SM
70512011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
7052
7053 * keymap.c (Fmake_composed_keymap): Move to subr.el.
7054
f26d0e4c
PE
70552011-08-03 Paul Eggert <eggert@cs.ucla.edu>
7056
8a10d76c
PE
7057 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7058 so that it is not optimized away.
7059
f26d0e4c
PE
7060 * xdisp.c (compute_display_string_pos): Remove unused local.
7061
55439c61
EZ
70622011-08-02 Eli Zaretskii <eliz@gnu.org>
7063
7064 Fix slow cursor motion and scrolling in large buffers with
7065 selective display, like Org Mode buffers. (Bug#9218)
7066
7067 * dispextern.h (struct bidi_it): New member disp_prop_p.
7068
7069 * xdisp.c: Remove one-slot cache of display string positions.
7070 (compute_display_string_pos): Accept an additional argument
5e617bc2 7071 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
7072 for a display string or property. If found, set DISP_PROP_P
7073 non-zero.
7074
7075 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
7076 DISP_PROP_P, and pass it to compute_display_string_pos.
7077 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
7078 non-zero. All callers of bidi_fetch_char changed.
7079
fb33fa43
SM
70802011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
7081
7082 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7083
b099e063
DM
70842010-12-03 Don March <don@ohspite.net>
7085
7086 * keymap.c (Fdefine_key): Fix non-prefix key error message when
7087 last character M-[char] is translated to ESC [char] (bug#7541).
7088
5cc7f7af
KH
70892011-08-02 Kenichi Handa <handa@m17n.org>
7090
d0fffa3f 7091 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
7092
7093 * chartab.c (uniprop_table): Make it non-static.
7094
525d5e6e
EZ
70952011-08-01 Eli Zaretskii <eliz@gnu.org>
7096
7097 * xdisp.c (forward_to_next_line_start): Accept additional argument
7098 BIDI_IT_PREV, and store into it the state of the bidi iterator had
7099 on the newline.
7100 (reseat_at_next_visible_line_start): Use the bidi iterator state
7101 returned by forward_to_next_line_start to restore the state of
7102 it->bidi_it after backing up to previous newline. (Bug#9212)
7103
31011111
AS
71042011-07-30 Andreas Schwab <schwab@linux-m68k.org>
7105
7106 * regex.c (re_comp): Protoize.
7107 (re_exec): Fix return type.
7108 (regexec): Fix type of `ret'. (Bug#9203)
7109
476371c4
PE
71102011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7111
e5d76069
PE
7112 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7113 This is needed if max-image-size is a floating-point number.
7114
9a79b20c
AS
71152011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7116
7117 * print.c (print_object): Print empty symbol as ##.
7118
7119 * lread.c (read1): Read ## as empty symbol.
7120
d8c2fa78
AA
71212011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
7122
7123 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7124 setting frame foreground color (Bug#9175).
7125 (x_set_background_color): Likewise.
7126
ffe57a7a
AA
7127 * nsmenu.m (-setText): Size tooltip dimensions precisely to
7128 contents (Bug#9176).
7129 (EmacsTooltip -init): Remove bezels and add shadows to
7130 tooltip windows.
7131
bf3492a5
AA
7132 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7133 or scroll bar (Bug#8470).
7134
d55e9c53
AA
7135 * nsfont.m (nsfont_open): Remove assignment to voffset and
7136 unnecessary vars hshink, expand, hd, full_height, min_height.
7137 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7138
7139 * nsterm.h (nsfont_info): Remove voffset field.
7140
d8c2fa78 71412011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
7142
7143 Implement strike-through and overline on NextStep (Bug#8863).
7144
7145 * nsfont.m (nsfont_open): Use underline position provided by font,
7146 instead of hard-coded value of 2.
7147 (nsfont_draw): Call ns_draw_text_decoration instead.
7148
7149 * nsterm.h: Add declaration for ns_draw_text_decoration.
7150
7151 * nsterm.m (ns_draw_text_decoration): New function for drawing
7152 underline, overline, and strike-through.
7153 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7154 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 7155 accommodate underlining, etc.
4843aac3 7156
4cc60b9b
EZ
71572011-07-28 Eli Zaretskii <eliz@gnu.org>
7158
bc7ece87
EZ
7159 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7160 default.
4cc60b9b 7161
476371c4
PE
71622011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7163
66606eea
PE
7164 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7165 Without this fix, if a signal arrives just after memory fills up,
7166 'malloc' might be invoked reentrantly.
7167
476371c4
PE
7168 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7169 In other words, assume that every image size is allowed, on non-X
7170 hosts. This assumption is probably wrong, but it lets Emacs compile.
7171
f3fcc40d
AS
71722011-07-28 Andreas Schwab <schwab@linux-m68k.org>
7173
7174 * regex.c (re_iswctype): Convert return values to boolean.
7175
350c992f
EZ
71762011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
7177
7178 * xdisp.c (compute_display_string_pos): Don't use cached display
7179 string position if the buffer had its restriction changed.
7180 (Bug#9184)
7181
5266b4bb
PE
71822011-07-28 Paul Eggert <eggert@cs.ucla.edu>
7183
7184 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7185
2573a837 71862011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 7187
41f55ccd 7188 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 7189
39e378da
PE
7190 * bidi.c: Integer size and overflow fixes.
7191 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7192 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7193 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7194 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7195 (bidi_find_other_level_edge):
7196 Use ptrdiff_t instead of EMACS_INT where either will do.
7197 This works better on 32-bit hosts configured --with-wide-int.
7198 (bidi_cache_ensure_space): Check for size-calculation overflow.
7199 Use % rather than repeated addition, for better worst-case speed.
7200 Don't set bidi_cache_size until after xrealloc returns, because it
7201 might not return.
7202 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
7203 (bidi_cache_ensure_space): Also check that the bidi cache size
7204 does not exceed that of the largest Lisp string or buffer. See Eli
7205 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 7206
5e927815
PE
7207 * alloc.c (__malloc_size_t): Remove.
7208 All uses replaced by size_t. See Andreas Schwab's note
7209 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7210
ca4aa935
PE
7211 * image.c: Improve checking for integer overflow.
7212 (check_image_size): Assume that f is nonnull, since
7213 it is always nonnull in practice. This is one less thing to
7214 worry about when checking for integer overflow later.
7215 (x_check_image_size): New function, which checks for integer
7216 overflow issues inside X.
7217 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7218 This removes the need for a memory_full check.
7219 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7220 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7221 (xbm_read_bitmap_data): Change locals back to 'int', since
7222 their values must fit in 'int'.
7223 (xpm_load_image, png_load, tiff_load):
7224 Invoke x_create_x_image_and_pixmap earlier,
7225 to avoid much needless work if the image is too large.
7226 (tiff_load): Treat overly large images as if
7227 x_create_x_image_and_pixmap failed, not as malloc failures.
7228 (gs_load): Use x_check_image_size.
7229
5f8f9cc2
PE
7230 * gtkutil.c: Omit integer casts.
7231 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7232 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7233
5adf60bc
PE
7234 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7235
c8907a93
PE
7236 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7237 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7238 would wrongly return t on a 64-bit host.
7239
e3c25c68
PE
7240 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7241 The plain *_OVERFLOW macros run afoul of GCC bug 49705
7242 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7243 and therefore cause GCC to emit a bogus diagnostic in some cases.
7244
3f791afe
PE
7245 * image.c: Integer signedness and overflow and related fixes.
7246 This is not an exhaustive set of fixes, but it's time to
7247 record what I've got.
7248 (lookup_pixel_color, check_image_size): Remove redundant decls.
7249 (check_image_size): Don't assume that arbitrary EMACS_INT values
7250 fit in 'int', or that arbitrary 'double' values fit in 'int'.
7251 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7252 (tiff_load, imagemagick_load_image):
7253 Check for overflow in size calculations.
7254 (x_create_x_image_and_pixmap): Remove unnecessary test for
7255 xmalloc returning NULL; that can't happen.
7256 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7257 (xpm_color_bucket): Use better integer hashing function.
7258 (xpm_cache_color): Don't possibly over-allocate memory.
7259 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7260 (gif_memory_source):
7261 Use ptrdiff_t, not int or size_t, to record sizes.
7262 (png_load): Don't assume values greater than 2**31 fit in 'int'.
7263 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7264 either works, as we prefer signed integers.
7265 (tiff_read_from_memory, tiff_write_from_memory):
7266 Return tsize_t, not size_t, since that's what the TIFF API wants.
7267 (tiff_read_from_memory): Don't fail simply because the read would
7268 go past EOF; instead, return a short read.
7269 (tiff_load): Omit no-longer-needed casts.
7270 (Fimagemagick_types): Don't assume size fits into 'int'.
7271
3cc5a532
PE
7272 Improve hashing quality when configured --with-wide-int.
7273 * fns.c (hash_string): New function, taken from sxhash_string.
7274 Do not discard information about ASCII character case; this
7275 discarding is no longer needed.
7276 (sxhash-string): Use it. Change sig to match it. Caller changed.
7277 * lisp.h: Declare it.
7278 * lread.c (hash_string): Remove, since we now use fns.c's version.
7279 The fns.c version returns a wider integer if --with-wide-int is
7280 specified, so this should help the quality of the hashing a bit.
7281
b312a492
PE
7282 * emacs.c: Integer overflow minor fix.
7283 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
7284 Define only if GNU_LINUX.
7285 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7286
dfd153ae
PE
7287 * dispnew.c: Integer signedness and overflow fixes.
7288 Remove unnecessary forward decls, that were a maintenance hassle.
7289 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7290 All uses changed.
7291 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7292 (scrolling_window): Use ptrdiff_t, not int, for byte count.
7293 (prepare_desired_row, line_draw_cost):
7294 Use int, not unsigned, where either works.
7295 (save_current_matrix, restore_current_matrix):
7296 Use ptrdiff_t, not size_t, where either works.
7297 (init_display): Check for overflow more accurately, and without
7298 relying on undefined behavior.
7299
a81d11a3
PE
7300 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7301 Remove, replacing with the new symbols in lisp.h. All uses changed.
7302 * fileio.c (make_temp_name):
7303 * filelock.c (lock_file_1, lock_file):
7304 * xdisp.c (message_dolog):
7305 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7306 Use pMd etc. instead.
7307 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7308 replacing the pWIDE etc. symbols removed from editfns.c.
7309
3300e6fd
PE
7310 * keyboard.h (num_input_events): Now uintmax_t.
7311 This is (very slightly) less likely to mess up due to wraparound.
7312 All uses changed.
7313
fd05c7e9
PE
7314 * buffer.c: Integer signedness fixes.
7315 (alloc_buffer_text, enlarge_buffer_text):
7316 Use ptrdiff_t rather than size_t when either will do, as we prefer
7317 signed integers.
7318
903fe15d
PE
7319 * alloc.c: Integer signedness and overflow fixes.
7320 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7321 (__malloc_size_t): Default to size_t, not to int.
7322 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7323 (Fgarbage_collect, mark_object_loop_halt, mark_object):
7324 Prefer ptrdiff_t to size_t when either would do, as we prefer
7325 signed integers.
7326 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7327 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7328 Now const. Initialize with values that are in range even if char
7329 is signed.
7330 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7331 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
7332 These functions do the right thing with sizes > 2**32.
7333 (check_depth): Now ptrdiff_t, not int.
7334 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7335 Adjust to new way of storing sizes. Check for size overflow bugs
7336 in rest of code.
7337 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
7338 slightly wrong anyway, as it missed one instance of
7339 XMALLOC_OVERRUN_CHECK_OVERHEAD.
7340 (refill_memory_reserve): Omit needless cast to size_t.
7341 (mark_object_loop_halt): Mark as externally visible.
7342
ac82cc6a
PE
7343 * xselect.c: Integer signedness and overflow fixes.
7344 (Fx_register_dnd_atom, x_handle_dnd_message):
7345 Use ptrdiff_t, not size_t, since we prefer signed.
7346 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7347 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7348 x_dnd_atoms_size and x_dnd_atoms_length.
7349
c2d1e36d
PE
7350 * doprnt.c: Prefer signed to unsigned when either works.
7351 * eval.c (verror):
7352 * doprnt.c (doprnt):
7353 * lisp.h (doprnt):
7354 * xdisp.c (vmessage):
7355 Use ptrdiff_t, not size_t, when using or implementing doprnt,
7356 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7357 prefer signed arithmetic to avoid comparison confusion.
7358 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7359 but is a bit tricky.
7360
0e926e56
PE
7361 Assume freestanding C89 headers, string.h, stdlib.h.
7362 * data.c, doprnt.c, floatfns.c, print.c:
7363 Include float.h unconditionally.
7364 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7365 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
7366 * regex.c: Likewise for stddef.h, string.h.
7367 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
7368 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7369 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7370 (STDC_HEADERS): Remove obsolete defines.
7371 * sysdep.c: Include limits.h unconditionally.
7372
9cfdb3ec
PE
7373 Assume support for memcmp, memcpy, memmove, memset.
7374 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7375 * regex.c (memcmp, memcpy):
7376 Remove; we assume C89 now.
7377
7378 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7379 (__malloc_safe_bcopy): Remove; no longer needed.
7380
cf950e6b 7381 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
7382 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
7383 well either way, and we prefer signed to unsigned.
7384
dbf38e02
LMI
73852011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
7386
7387 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7388 closes the connection while we're reading (bug#9182).
7389
d6f0886c 73902011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 7391
d6f0886c
JD
7392 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7393 are specified (Bug#9168).
24e0f6b1 7394
2eb1f9e6
PE
73952011-07-25 Paul Eggert <eggert@cs.ucla.edu>
7396
7397 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7398 Found by GCC static checking and --with-wide-int on a 32-bit host.
7399
22381272 74002011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
7401
7402 * xdisp.c (compute_display_string_pos): Fix logic of caching
7403 previous display string position. Initialize cached_prev_pos to
7404 -1. Fixes slow-down at the beginning of a buffer.
7405
f25e39b4
EZ
74062011-07-24 Eli Zaretskii <eliz@gnu.org>
7407
7408 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7409 for attrs[LFACE_FONTSET_INDEX].
7410
04c4b52e
PE
74112011-07-23 Paul Eggert <eggert@cs.ucla.edu>
7412
7413 * xml.c (parse_region): Remove unused local
7414 that was recently introduced.
7415
c1734fbd
EZ
74162011-07-23 Eli Zaretskii <eliz@gnu.org>
7417
be18c5a5
EZ
7418 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7419 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7420
c1734fbd
EZ
7421 * xdisp.c (move_it_in_display_line_to): Record the best matching
7422 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
7423 exit if none of the characters scanned was an exact match.
7424 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
7425 when exact match is impossible due to invisible text, and the
7426 lines are truncated.
7427
a258d627
JD
74282011-07-23 Jan Djärv <jan.h.d@swipnet.se>
7429
7430 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7431 for OSX >= 10.7.
7432
b6d5a689
EZ
74332011-07-22 Eli Zaretskii <eliz@gnu.org>
7434
0f74f785
EZ
7435 Fix a significant slow-down of cursor motion with C-n, C-p,
7436 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7437 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 7438 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
7439 (next_element_from_buffer): Call compute_stop_pos_backwards to
7440 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
7441 base_level_stop.
7442 (reseat): Don't look for prev_stop, as that could mean a very long
7443 run.
7444 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7445 <cached_disp_overlay_modiff>: Cache for last found display string
7446 position.
551918c1 7447 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
7448 about the same buffer in the same area of character positions, and
7449 the buffer wasn't changed since the time the display string
7450 position was cached.
551918c1 7451
b2d0c91a
EZ
74522011-07-22 Eli Zaretskii <eliz@gnu.org>
7453
7454 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7455 is an integer, which is important for empty lines. (Bug#9149)
7456
043604ee
CY
74572011-07-22 Chong Yidong <cyd@stupidchicken.com>
7458
7459 * frame.c (Fmodify_frame_parameters): In tty case, update the
7460 default face if necessary (Bug#4238).
7461
da4adb04
CY
74622011-07-21 Chong Yidong <cyd@stupidchicken.com>
7463
7464 * editfns.c (Fstring_to_char): No need to explain what a character
7465 is in the docstring (Bug#6576).
7466
9abd0532
LMI
74672011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7468
7469 * xml.c (parse_region): Make sure we always return a tree.
7470
36881d16
HK
74712011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
7472
7473 * xml.c (parse_region): If a document contains only comments,
7474 return that, too.
7475
1e98674d
LMI
74762011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
7477
7478 * xml.c (make_dom): Return comments, too.
7479
590bd467
PE
74802011-07-19 Paul Eggert <eggert@cs.ucla.edu>
7481
7482 Port to OpenBSD.
7483 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
7484 and the surrounding thread.
7485 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
7486 rather than fgets, and retry after EINTR. Otherwise, 'emacs
7487 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
7488 timer goes off.
7489 * s/openbsd.h (BROKEN_SIGIO): Define.
7490 * unexelf.c (unexec) [__OpenBSD__]:
7491 Don't update the .mdebug section of the Alpha COFF symbol table.
7492
f41628b2
LMI
74932011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
7494
7495 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
7496 (bug#8460).
7497
b59b67c5
PE
74982011-07-18 Paul Eggert <eggert@cs.ucla.edu>
7499
15e3a074
PE
7500 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
7501 This fixes some race conditions on the permissions of any newly
7502 created file.
7503
41bed37d
PE
7504 * alloc.c (valid_pointer_p): Use pipe, not open.
7505 This fixes some permissions issues when debugging.
7506
b59b67c5
PE
7507 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
7508 If fchown fails to set both uid and gid, try to set just gid,
7509 as that is sometimes allowed. Adjust the file's mode to eliminate
7510 setuid or setgid bits that are inappropriate if fchown fails.
7511
925a6be7
SM
75122011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
7513
7514 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
7515 to compare Lisp_Objects.
7516 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
7517 global_gnutls_log_level, don't mistake it for a Lisp_Object.
7518 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
7519
52968808
AS
75202011-07-17 Andreas Schwab <schwab@linux-m68k.org>
7521
0a6a104b
AS
7522 * lread.c (read_integer): Unread even EOF character.
7523 (read1): Likewise. Properly record start position of symbol.
7524
52968808
AS
7525 * lread.c (read1): Read `#:' as empty uninterned symbol if no
7526 symbol character follows.
7527
9e381cdd
PE
75282011-07-17 Paul Eggert <eggert@cs.ucla.edu>
7529
7530 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
7531 This works around a problem with the previous change to Fcopy_file.
7532 Recent glibc declares fchown with __attribute__((warn_unused_result)),
7533 and without this change, GCC might complain about discarding
7534 fchown's return value.
7535
b5641435
JB
75362011-07-16 Juanma Barranquero <lekktu@gmail.com>
7537
7538 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
7539
a8031457
PE
75402011-07-16 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
7543
dd889327
LMI
75442011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
7545
750c33f7
LMI
7546 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
7547 it's used from the C level.
7548
dd889327
LMI
7549 * process.c: Use the same condition for POLL_FOR_INPUT in both
7550 keyboard.c and process.c (bug#1858).
7551
87e86684
LM
75522011-07-09 Lawrence Mitchell <wence@gmx.li>
7553
7554 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
7555 (Fgnutls_boot): Use it.
7556
64348f40
AS
75572011-07-15 Andreas Schwab <schwab@linux-m68k.org>
7558
7559 * doc.c (Fsubstitute_command_keys): Revert last change.
7560
1d698799
LMI
75612011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
7562
f863868c
LMI
7563 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
7564 quotes the next character, and doesn't affect other longer
7565 sequences (bug#8935).
7566
1d698799
LMI
7567 * lread.c (syms_of_lread): Clarify that is isn't only
7568 `eval-buffer' and `eval-defun' that's affected by
7569 `lexical-binding' (bug#8460).
7570
aa4b6df6
EZ
75712011-07-15 Eli Zaretskii <eliz@gnu.org>
7572
7573 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 7574 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 7575
5d856da6
PE
75762011-07-14 Paul Eggert <eggert@cs.ucla.edu>
7577
ad6042bb
PE
7578 Fix minor problems found by static checking.
7579 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
7580 (elsz): Now a signed constant, not a size_t var. We prefer signed
7581 types to unsigned, to avoid integer comparison confusion. Without
7582 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
7583 "cannot optimize loop, the loop counter may overflow", a symptom
7584 of the confusion.
f00bbb22 7585 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
7586 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
7587
6468f31c
LMI
75882011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7589
49080b10
LMI
7590 * search.c (Fre_search_backward): Mention `case-fold-search' in
7591 all the re_search_* functions (bug#8138).
7592
6468f31c
LMI
7593 * keyboard.c (Fopen_dribble_file): Document when the file is
7594 closed (bug#8056).
7595
c965adc5
EZ
75962011-07-14 Eli Zaretskii <eliz@gnu.org>
7597
df9733bf
EZ
7598 * bidi.c (bidi_dump_cached_states): Fix format of displaying
7599 bidi_cache_idx.
7600
0bb23927
EZ
7601 Support bidi reordering of display and overlay strings.
7602 * xdisp.c (compute_display_string_pos)
7603 (compute_display_string_end): Accept additional argument STRING.
7604 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
7605 (reseat_to_string): Initialize bidi_it->string.s and
7606 bidi_it->string.schars.
7607 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
7608 NULL (avoids a crash in bidi_paragraph_init).
7609 Initialize itb.string.lstring.
0bb23927
EZ
7610 (init_iterator): Call bidi_init_it only of a valid
7611 buffer position was specified. Initialize paragraph_embedding to
7612 L2R.
7613 (reseat_to_string): Initialize the bidi iterator.
7614 (display_string): If we need to ignore text properties of
7615 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
7616 original value of -1 will not work with bidi.)
7617 (compute_display_string_pos): First arg is now struct
7618 `text_pos *'; all callers changed. Support display properties on
7619 Lisp strings.
7620 (compute_display_string_end): Support display properties on Lisp
7621 strings.
7622 (init_iterator, reseat_1, reseat_to_string): Initialize the
7623 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
7624 when iterating on a string not from display properties).
640c8776
SM
7625 (compute_display_string_pos, compute_display_string_end):
7626 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
7627 arrow keys.
7628 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
7629 base_level_stop; instead, set base_level_stop to BEGV.
7630 Fixes crashes in vertical-motion.
0bb23927
EZ
7631 (next_element_from_buffer): Improve commentary for when
7632 the iterator is before prev_stop.
7633 (init_iterator): Initialize bidi_p from the default value of
7634 bidi-display-reordering, not from buffer-local value. Use the
7635 buffer-local value only if initializing for buffer iteration.
7636 (handle_invisible_prop): Support invisible properties on strings
7637 that are being bidi-reordered.
7638 (set_iterator_to_next): Support bidi reordering of C strings and
7639 Lisp strings.
7640 (next_element_from_string): Support bidi reordering of Lisp
7641 strings.
7642 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
7643 (display_string): Support display of R2L glyph rows.
7644 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
7645 (init_iterator): Don't initialize it->bidi_p for strings
7646 here.
7647 (reseat_to_string): Initialize it->bidi_p for strings here.
7648 (next_element_from_string, next_element_from_c_string)
7649 (next_element_from_buffer): Add xassert's for correspondence
7650 between IT's object being iterated and it->bidi_it.string
7651 structure.
7652 (face_before_or_after_it_pos): Support bidi iteration.
7653 (next_element_from_c_string): Handle the case of the first string
7654 character that is not the first one in the visual order.
7655 (get_visually_first_element): New function, refactored from common
7656 parts of next_element_from_buffer, next_element_from_string, and
7657 next_element_from_c_string.
7658 (tool_bar_lines_needed, redisplay_tool_bar)
7659 (display_menu_bar): Force left-to-right direction. Add a FIXME
7660 comment for making that be controlled by a user option.
7661 (push_it, pop_it): Save and restore the state of the
7662 bidi iterator. Save and restore the bidi_p flag.
7663 (pop_it): Iterate out of display property for string iteration as
7664 well.
7665 (iterate_out_of_display_property): Support iteration over strings.
7666 (handle_single_display_spec): Set up it->bidi_it for iteration
7667 over a display string, and call bidi_init_it.
7668 (handle_single_display_spec, next_overlay_string)
7669 (get_overlay_strings_1, push_display_prop): Set up the bidi
7670 iterator for displaying display or overlay strings.
7671 (forward_to_next_line_start): Don't use the shortcut if
7672 bidi-iterating.
7673 (back_to_previous_visible_line_start): If handle_display_prop
7674 pushed the iterator stack, restore the internal state of the bidi
7675 iterator by calling bidi_pop_it same number of times.
7676 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
7677 and we are bidi-iterating, don't decrement the iterator position;
7678 instead, set the first_elt flag in the bidi iterator, to produce
7679 the same effect.
7680 (reseat_1): Remove redundant setting of string_from_display_prop_p.
7681 (push_display_prop): xassert that we are iterating a buffer.
7682 (push_it, pop_it): Save and restore paragraph_embedding member.
7683 (handle_single_display_spec, next_overlay_string)
7684 (get_overlay_strings_1, reseat_1, reseat_to_string)
7685 (push_display_prop): Set up the `unibyte' member of bidi_it.string
7686 correctly. Don't assume unibyte strings are not bidi-reordered.
7687 (compute_display_string_pos)
7688 (compute_display_string_end): Fix handling the case of C string.
7689 (push_it, pop_it): Save and restore from_disp_prop_p.
7690 (handle_single_display_spec, push_display_prop): Set the
7691 from_disp_prop_p flag.
7692 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
7693 (pop_it): Call iterate_out_of_display_property only if we are
7694 popping after iteration over a string that came from a display
7695 property. Fix a typo in popping stretch info. Add an assertion
7696 for verifying that the iterator position is in sync with the bidi
7697 iterator.
7698 (handle_single_display_spec, get_overlay_strings_1)
7699 (push_display_prop): Fix initialization of paragraph direction for
7700 string when that of the parent object is not yet determined.
7701 (reseat_1): Call bidi_init_it to resync the bidi
7702 iterator with IT's position. (Bug#7616)
7703 (find_row_edges): If ROW->start.pos gives position
7704 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
7705 (handle_stop, back_to_previous_visible_line_start, reseat_1):
7706 Reset the from_disp_prop_p flag.
7707 (SAVE_IT, RESTORE_IT): New macros.
7708 (pos_visible_p, face_before_or_after_it_pos)
7709 (back_to_previous_visible_line_start)
7710 (move_it_in_display_line_to, move_it_in_display_line)
7711 (move_it_to, move_it_vertically_backward, move_it_by_lines)
7712 (try_scrolling, redisplay_window, display_line): Use them when
7713 saving a temporary copy of the iterator and restoring it back.
7714 (back_to_previous_visible_line_start, reseat_1)
7715 (init_iterator): Empty the bidi cache "stack".
7716 (move_it_in_display_line_to): If iterator ended up at
7717 EOL, but we never saw any buffer positions smaller than
7718 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
7719 motion in bidi-reordered lines.
7720 (move_it_in_display_line_to): Record prev_method and prev_pos
7721 immediately before the call to set_iterator_to_next. Fixes cursor
7722 motion in bidi-reordered lines with stretch glyphs and strings
7723 displayed in margins. (Bug#8133) (Bug#8867)
7724 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
7725 TO_CHARPOS.
640c8776
SM
7726 (pos_visible_p): Support positions in bidi-reordered lines.
7727 Save and restore bidi cache.
0bb23927
EZ
7728
7729 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
7730 (bidi_paragraph_info): Delete unused struct.
7731 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
7732 (bidi_cache_start): New variable.
7733 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
7734 to zero.
7735 (bidi_cache_fetch_state, bidi_cache_search)
7736 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7737 (bidi_cache_find, bidi_peek_at_next_level)
7738 (bidi_level_of_next_char, bidi_find_other_level_edge)
7739 (bidi_move_to_visually_next): Compare cache index with
7740 bidi_cache_start rather than with zero.
7741 (bidi_fetch_char): Accept new argument STRING; all callers
7742 changed. Support iteration over a string. Support strings with
7743 display properties. Support unibyte strings. Fix the type of
7744 `len' according to what STRING_CHAR_AND_LENGTH expects.
7745 (bidi_paragraph_init, bidi_resolve_explicit_1)
7746 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
7747 (bidi_level_of_next_char, bidi_move_to_visually_next):
7748 Support iteration over a string.
0bb23927
EZ
7749 (bidi_set_sor_type, bidi_resolve_explicit_1)
7750 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
7751 can now be zero (for strings); special values 0 and -1 were
7752 changed to -1 and -2, respectively.
7753 (bidi_char_at_pos): New function.
7754 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
7755 Call it instead of FETCH_MULTIBYTE_CHAR.
7756 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
7757 initialized to valid values.
7758 (bidi_init_it): Don't initialize charpos and bytepos with invalid
7759 values.
7760 (bidi_level_of_next_char): Allow the sentinel "position" to pass
7761 the test for valid cached positions. Fix the logic for looking up
7762 the sentinel state in the cache. GCPRO the Lisp string we are
7763 iterating.
7764 (bidi_push_it, bidi_pop_it): New functions.
7765 (bidi_initialize): Initialize the bidi cache start stack pointer.
7766 (bidi_cache_ensure_space): New function, refactored from part of
7767 bidi_cache_iterator_state. Don't assume the required size is just
7768 one BIDI_CACHE_CHUNK away.
7769 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
7770 (bidi_count_bytes, bidi_char_at_pos): New functions.
7771 (bidi_cache_search): Don't assume bidi_cache_last_idx is
7772 always valid if bidi_cache_idx is valid.
7773 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
7774 is valid if it's going to be used.
7775 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
7776 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
7777 (bidi_cache_find_level_change, bidi_cache_ensure_space)
7778 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
7779 (bidi_find_other_level_edge, bidi_cache_start_stack):
7780 All variables related to cache indices are now EMACS_INT.
c965adc5 7781
0bb23927
EZ
7782 * dispextern.h (struct bidi_string_data): New structure.
7783 (struct bidi_it): New member `string'. Make flag members be 1-bit
7784 fields, and put them last in the struct.
640c8776
SM
7785 (compute_display_string_pos, compute_display_string_end):
7786 Update prototypes.
0bb23927
EZ
7787 (bidi_push_it, bidi_pop_it): Add prototypes.
7788 (struct iterator_stack_entry): New members bidi_p,
7789 paragraph_embedding, and from_disp_prop_p.
7790 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
7791 (bidi_shelve_cache, bidi_unshelve_cache):
7792 Declare prototypes.
0bb23927
EZ
7793
7794 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
7795 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
7796 and vector-like objects.
7797
7798 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
7799 cache around display iteration.
7800
7801 * window.c (Fwindow_end, window_scroll_pixel_based)
7802 (displayed_window_lines, Frecenter): Save and restore the bidi
7803 cache around display iteration.
7804
3bbd2265
LMI
78052011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
7806
7807 * editfns.c (Fdelete_region): Clarify the use of the named
7808 parameters (bug#6788).
7809
adc47434
MR
78102011-07-14 Martin Rudalics <rudalics@gmx.at>
7811
7812 * indent.c (Fvertical_motion): Set and restore w->pointm when
7813 saving and restoring the window's buffer (Bug#9006).
7814
837c31f8
LMI
78152011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
7816
7817 * editfns.c (Fstring_to_char): Clarify just what is returned
7818 (bug#6576). Text by Eli Zaretskii.
7819
ac389d0c
JB
78202011-07-13 Juanma Barranquero <lekktu@gmail.com>
7821
7822 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
7823
0be0ce47
EZ
78242011-07-13 Eli Zaretskii <eliz@gnu.org>
7825
7826 * buffer.c (mmap_find): Fix a typo.
7827
cd18e7e3
JB
78282011-07-13 Johan Bockgård <bojohan@gnu.org>
7829
7830 Fix execution of x selection hooks.
7831 * xselect.c (Qx_lost_selection_functions)
7832 (Qx_sent_selection_functions): New vars.
7833 (syms_of_xselect): DEFSYM them.
7834 (x_handle_selection_request): Pass Qx_sent_selection_functions
7835 rather than Vx_sent_selection_functions to Frun_hook_with_args.
7836 (x_handle_selection_clear,x_clear_frame_selections):
7837 Pass Qx_lost_selection_functions rather than
7838 Vx_lost_selection_functions to Frun_hook_with_args.
7839
47ea7f44
PE
78402011-07-13 Paul Eggert <eggert@cs.ucla.edu>
7841
ac389d0c 7842 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
7843 The old code sometimes used this field without initializing it.
7844
47ea7f44
PE
7845 * alloc.c (gc_sweep): Don't read past end of array.
7846 In theory, the old code could also have corrupted Emacs internals,
7847 though it'd be very unlikely.
7848
bc985c87
AS
78492011-07-12 Andreas Schwab <schwab@linux-m68k.org>
7850
7851 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 7852 argument. (Bug#4026)
bc985c87 7853
0cf34688
LMI
78542011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
7855
b3dadd76
LMI
7856 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
7857 key" (bug#4257).
7858
0cf34688
LMI
7859 * window.c (Fset_window_start): Doc fix (bug#4199).
7860 (Fset_window_hscroll): Ditto.
7861
270768cd
PE
78622011-07-12 Paul Eggert <eggert@cs.ucla.edu>
7863
077e3dda 7864 Fix minor new problems caught by GCC 4.6.1.
270768cd 7865 * term.c (init_tty): Remove unused local.
490011a6 7866 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 7867 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 7868 not used otherwise.
270768cd 7869
b1f58454
CY
78702011-07-12 Chong Yidong <cyd@stupidchicken.com>
7871
7872 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
7873
22b9578d
LMI
78742011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
7875
6e70ab07
LMI
7876 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
7877 are the mini-buffer and the echo area (bug#3320).
7878
22b9578d
LMI
7879 * term.c (init_tty): Remove support for supdup, c10 and perq
7880 terminals, which are no longer supported (bug#1482).
7881
8974cc9f
JB
78822011-07-10 Johan Bockgård <bojohan@gnu.org>
7883
7884 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
7885
a560d974
JD
78862011-07-10 Jan Djärv <jan.h.d@swipnet.se>
7887
7888 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
7889 for non-popups (Bug#3642).
7890
1dae0f0a
AS
78912011-07-10 Andreas Schwab <schwab@linux-m68k.org>
7892
268c2c36 7893 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 7894 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
7895 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
7896 * cm.c (losecursor): Likewise.
1dae0f0a
AS
7897 * data.c (fmod): Likewise.
7898 * dispnew.c (swap_glyphs_in_rows): Likewise.
7899 * emacs.c (memory_warning_signal): Likewise.
7900 * floatfns.c (float_error): Likewise.
7901 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
7902 (otf_open, font_otf_capability, generate_otf_features)
7903 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
7904 Likewise.
7905 * image.c (pbm_read_file): Likewise.
7906 * indent.c (string_display_width): Likewise.
7907 * intervals.c (check_for_interval, search_for_interval)
7908 (inc_interval_count, count_intervals, root_interval)
7909 (adjust_intervals_for_insertion, make_new_interval): Likewise.
7910 * lread.c (defalias): Likewise.
268c2c36 7911 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
7912 * regex.c (set_image_of_range_1, set_image_of_range)
7913 (regex_grow_registers): Likewise.
7914 * sysdep.c (strerror): Likewise.
7915 * termcap.c (valid_filename_p, tprint, main): Likewise.
7916 * tparam.c (main): Likewise.
7917 * unexhp9k800.c (run_time_remap, save_data_space)
7918 (update_file_ptrs, read_header, write_header, calculate_checksum)
7919 (copy_file, copy_rest, display_header): Likewise.
7920 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
7921 Likewise.
7922 * xdisp.c (check_it): Likewise.
7923 * xfaces.c (register_color, unregister_color, unregister_colors):
7924 Likewise.
7925 * xfns.c (print_fontset_result): Likewise.
7926 * xrdb.c (member, fatal, main): Likewise.
7927
99033785
PE
79282011-07-10 Paul Eggert <eggert@cs.ucla.edu>
7929
7930 Fix minor problems found by static checking (Bug#9031).
7931 * chartab.c (char_table_set_range, map_sub_char_table):
7932 Remove unused locals.
7933 (uniprop_table): Now static.
7934 * composite.c (_work_char): Remove unused static var.
7935
9cb2ac56
JB
79362011-07-09 Juanma Barranquero <lekktu@gmail.com>
7937
7938 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
7939
f25661f0
JD
79402011-07-09 Jan Djärv <jan.h.d@swipnet.se>
7941
7942 * gtkutil.c (qttip_cb): Remove code without function.
7943
8278c4fe
EZ
79442011-07-09 Eli Zaretskii <eliz@gnu.org>
7945
7946 * w32.c (pthread_sigmask): New stub.
7947
1692ae2d 79482011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 7949
8a6ebd58 7950 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
7951 sigprocmask is portable only for single-threaded applications, and
7952 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
7953 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
7954 (LIBES): Use it.
7955 * callproc.c (Fcall_process):
7956 * process.c (create_process):
7957 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
7958 Use pthread_sigmask, not sigprocmask.
123403e4 7959
1b854618
JD
79602011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7961
7962 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
7963 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
7964 wrong (Bug#8591).
7965
3fe4b549
JD
79662011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7967
0ce7e563
JD
7968 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
7969 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
7970 (xg_hide_tooltip): Fix comment.
7971
3fe4b549
JD
7972 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
7973 in registerServicesMenuSendTypes.
7974 (validRequestorForSendType): Don't check ns_return_types.
7975
7976 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
7977 ns_return_type.
7978
5df75e47
JR
79792011-07-08 Jason Rumney <jasonr@gnu.org>
7980
22610910
JR
7981 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
7982 SH_SHOW for hidden windows (Bug#5482).
7983
5df75e47
JR
7984 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
7985 frame struct members of non-existent frames (Bug#6284).
7986
699c10bd
JD
79872011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7988
4393663b
JD
7989 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
7990 variable firstTime not needed on OSX >= 10.6.
7991 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
7992 >= 10.5. Use setKnobProportion, setDoubleValue.
7993
7994 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
7995 (MAC_OS_X_VERSION_10_5): Define if not defined.
7996 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
7997 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
7998 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
7999
8000 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 8001 cString and lossyCString on OSX >= 10.4.
4393663b 8002
58179cce 8003 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
8004 sizeToFit on OSX >= 10.2.
8005
8006 * nsimage.m (allocInitFromFile): Don't use deprecated method
8007 bestRepresentationForDevice on OSX >= 10.6.
8008
8009 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8010 to avoid warning.
8011
8012 * emacs.c: Declare unexec_init_emacs_zone.
8013
a63e0781
JD
8014 * nsgui.h: Fix compiler warning about gnulib redefining verify.
8015
699c10bd
JD
8016 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8017
8018 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8019 on svcsMenu (Bug#8842).
8020
8021 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8022 ns_return_types.
8023 (Fns_list_services): Just return Qnil on 10.6, code not working there.
8024
8025 * nsterm.m (QUTF8_STRING): Declare.
8026 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8027 (validRequestorForSendType): Return type is (id).
8028 Change indexOfObjectIdenticalTo to indexOfObject.
8029 Check if we have local selection before returning self (Bug#8842).
8030 (writeSelectionToPasteboard): Put local selection into paste board
8031 if we have a local selection (Bug#8842).
8032 (syms_of_nsterm): DEFSYM QUTF8_STRING.
8033
8034 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8035 (ns_get_local_selection): Declare.
8036
54e10184
LMI
80372011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
8038
9888ff71
LMI
8039 * keymap.c (describe_map_tree): Don't insert a double newline at
8040 the end of the buffer (bug#1169) and return whether we inserted
8041 something.
8042
54e10184
LMI
8043 * callint.c (Fcall_interactively): Change "reading args" to
8044 "providing args" to try to clarify what it does (bug#1010).
8045
15fa4783
KH
80462011-07-07 Kenichi Handa <handa@m17n.org>
8047
8048 * composite.c (composition_compute_stop_pos): Ignore a static
8049 composition starting before CHARPOS (Bug#8915).
8050
8051 * xdisp.c (handle_composition_prop): Likewise.
8052
a8815b00
EZ
80532011-07-07 Eli Zaretskii <eliz@gnu.org>
8054
8055 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8056 (Bug#9015)
8057
ef7b981d 80582011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
8059
8060 * character.h (unicode_category_t): New enum type.
8061
8062 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8063 (Qchar_code_property_table): New variable.
8064 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8065 (UNIPROP_COMPRESSED_FORM_P): New macros.
8066 (char_table_ascii): Uncompress the compressed values.
8067 (sub_char_table_ref): New arg is_uniprop. Callers changed.
8068 Uncompress the compressed values.
ac389d0c 8069 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
8070 (char_table_ref_and_range): Uncompress the compressed values.
8071 (sub_char_table_set): New arg is_uniprop. Callers changed.
8072 Uncompress the compressed values.
8073 (sub_char_table_set_range): Args changed. Callers changed.
8074 (char_table_set_range): Adjuted for the above change.
8075 (map_sub_char_table): Delete args default_val and parent. Add arg
8076 top. Give decoded values to a Lisp function.
640c8776 8077 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
8078 values to a Lisp function. Gcpro more variables.
8079 (uniprop_table_uncompress)
8080 (uniprop_decode_value_run_length): New functions.
8081 (uniprop_decoder, uniprop_decoder_count): New variables.
8082 (uniprop_get_decoder, uniprop_encode_value_character)
8083 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8084 New functions.
8085 (uniprop_encoder, uniprop_encoder_count): New variables.
8086 (uniprop_get_encoder, uniprop_table)
8087 (Funicode_property_table_internal, Fget_unicode_property_internal)
8088 (Fput_unicode_property_internal): New functions.
8089 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8090 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 8091 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
8092 char-code-property-alist.
8093
640c8776 8094 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
8095 Vunicode_category_table.
8096
640c8776 8097 * font.c (font_range): Adjust for the change of
c805dec0
KH
8098 Vunicode_category_table.
8099
76b397fb
DN
81002011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
8101
8102 * m/iris4d.h: Remove file, move contents ...
8103 * s/irix6-5.h: ... here.
8104
22b4128e
PE
81052011-07-06 Paul Eggert <eggert@cs.ucla.edu>
8106
8107 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
8108 * alloc.c (mark_buffer):
8109 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8110 (clone_per_buffer_values): Don't assume that
22b4128e
PE
8111 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8112 This isn't true in general, and it's particularly not true
8113 if Emacs is configured with --with-wide-int.
8114 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8115 New macros, used in the buffer.c change.
8116
869795d6
JD
81172011-07-05 Jan Djärv <jan.h.d@swipnet.se>
8118
8119 * xsettings.c: Use both GConf and GSettings if both are available.
8120 (store_config_changed_event): Add comment.
8121 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8122 (store_tool_bar_style_changed): New functions.
5e617bc2 8123 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
8124 (struct xsettings): Move font inside HAVE_XFT.
8125 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 8126 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 8127 Move inside HAVE_XFT.
640c8776 8128 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
8129 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8130 also.
8131 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 8132 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 8133 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
8134 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8135 (parse_settings): Move check for font inside HAVE_XFT.
8136 (read_settings, apply_xft_settings): Add comment.
8137 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
8138 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
8139 call store_font_name_changed.
8140 (xft_settings_event): Add comment.
8141 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
8142 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
8143 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
8144 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
8145 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
8146 (xsettings_get_system_font, xsettings_get_system_normal_font):
8147 Add comment.
869795d6 8148
d8ed26bd
PE
81492011-07-05 Paul Eggert <eggert@cs.ucla.edu>
8150
8151 Random fixes. E.g., (random) never returned negative values.
8152 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8153 subseconds part to the entropy, as that's a bit more random.
8154 Prefer signed to unsigned, since the signedness doesn't matter and
8155 in general we prefer signed. When given a limit, use a
8156 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8157 latter isn't right if USE_2_TAGS_FOR_INTS.
8158 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8159 not 0..VALMASK. Don't discard "excess" bits that random () returns.
8160
cabf1cac
SM
81612011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
8162
8163 * textprop.c (text_property_stickiness):
8164 Obey Vtext_property_default_nonsticky.
8165 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8166 * w32fns.c (syms_of_w32fns):
8167 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8168
6e9b2be9
PE
81692011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8170
8171 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8172 This is more efficient than Ffile_directory_p and avoids a minor race.
8173
90186c68
LMI
81742011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
8175
7c301272
LMI
8176 * buffer.c (Foverlay_put): Say what the return value is
8177 (bug#7835).
8178
c4f2d8d4
LMI
8179 * fileio.c (barf_or_query_if_file_exists): Check first if the file
8180 is a directory before asking whether to use the file name
8181 (bug#7564).
ad637907
LMI
8182 (barf_or_query_if_file_exists): Make the "File is a directory"
8183 error be more correct.
c4f2d8d4 8184
90186c68
LMI
8185 * fns.c (Frequire): Remove the mention of the .gz files, since
8186 that's installation-specific, but keep the mention of
8187 `get-load-suffixes'.
8188
da64016e
PE
81892011-07-04 Paul Eggert <eggert@cs.ucla.edu>
8190
8191 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8192 Report string overflow if the output is too long.
8193
7d47b580
JB
81942011-07-04 Juanma Barranquero <lekktu@gmail.com>
8195
a555cb87
JB
8196 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8197 (syms_of_gnutls): Remove duplicate DEFSYM for
8198 Qgnutls_bootprop_verify_hostname_error, an error for
8199 Qgnutls_bootprop_verify_error (which is no longer used).
8200
7d47b580
JB
8201 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8202 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
8203 Also (re)move comments that are misplaced or no longer relevant.
8204
1e49bfab
LMI
82052011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8206
8207 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8208
1485f4c0
CY
82092011-07-03 Chong Yidong <cyd@stupidchicken.com>
8210
8211 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8212 and background color parameters if they have been changed.
8213
a9ab721e
LMI
82142011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8215
8216 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8217
cf7cff57
PE
82182011-07-03 Paul Eggert <eggert@cs.ucla.edu>
8219
2e13213d
PE
8220 * xsettings.c (SYSTEM_FONT): Define only when used.
8221 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8222
cf7cff57
PE
8223 * keymap.c (access_keymap_1): Now static.
8224
7a8e04f7
CY
82252011-07-02 Chong Yidong <cyd@stupidchicken.com>
8226
8227 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8228 leave any prefix arg for the up event (Bug#1586).
8229
61352f62
LMI
82302011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
8231
69bb1ef7
LMI
8232 * lread.c (syms_of_lread): Mention single symbols defined by
8233 `defvar' or `defconst' (bug#7154).
8234
61352f62 8235 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 8236 (Frequire): Mention get-load-suffixes.
61352f62 8237
28545e04
MR
82382011-07-02 Martin Rudalics <rudalics@gmx.at>
8239
8240 * window.h (window): Remove clone_number slot.
8241 * window.c (Fwindow_clone_number, Fset_window_clone_number):
8242 Remove.
8243 (make_parent_window, make_window, saved_window)
8244 (Fset_window_configuration, save_window_save): Don't deal with
8245 clone numbers.
8246 * buffer.c (Qclone_number): Remove declaration.
8247 (sort_overlays, overlay_strings): Don't deal with clone numbers.
8248
3349e122
SM
82492011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
8250
8251 Add multiple inheritance to keymaps.
8252 * keymap.c (Fmake_composed_keymap): New function.
8253 (Fset_keymap_parent): Simplify.
8254 (fix_submap_inheritance): Remove.
8255 (access_keymap_1): New function extracted from access_keymap to handle
8256 embedded parents and handle lists of maps.
8257 (access_keymap): Use it.
8258 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8259 (Fcopy_keymap): Handle embedded parents.
8260 (Fcommand_remapping, define_as_prefix): Simplify.
8261 (Fkey_binding): Simplify.
8262 (syms_of_keymap): Move minibuffer-local-completion-map,
8263 minibuffer-local-filename-completion-map,
8264 minibuffer-local-must-match-map, and
8265 minibuffer-local-filename-must-match-map to Elisp.
8266 (syms_of_keymap): Defsubr make-composed-keymap.
8267 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8268 (parse_menu_item): Trivial simplification.
8269
3279eb87
GM
82702011-07-01 Glenn Morris <rgm@gnu.org>
8271
8272 * Makefile.in (SETTINGS_LIBS): Fix typo.
8273
4550efdf
KI
82742011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
8275
8276 * coding.c (Fencode_coding_string): Record the last coding system
8277 used, as the function doc string says (bug#8738).
8278
0949d2b6
JD
82792011-07-01 Jan Djärv <jan.h.d@swipnet.se>
8280
8281 * xsettings.c (store_monospaced_changed): Take new font as arg and
8282 check for change against current_mono_font.
8283 (EMACS_TYPE_SETTINGS): Remove this and related defines.
8284 (emacs_settings_constructor, emacs_settings_get_property)
8285 (emacs_settings_set_property, emacs_settings_class_init)
8286 (emacs_settings_init, gsettings_obj): Remove.
8287 (something_changedCB): New function for HAVE_GSETTINGS.
8288 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8289 with value as argument.
8290 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8291 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 8292 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
8293 "changed".
8294
8295 * xgselect.c: Add defined (HAVE_GSETTINGS).
8296 (xgselect_initialize): Ditto.
8297
8298 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8299 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8300 xg_select.
8301
bbc6b304
PE
83022011-07-01 Paul Eggert <eggert@cs.ucla.edu>
8303
8304 * eval.c (struct backtrace): Simplify and port the data structure.
8305 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8306 signed bit field, as this assumption is not portable and it makes
8307 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
8308 "char debug_on_exit : 1" as this is not portable either; instead,
8309 use the portable "unsigned int debug_on_exit : 1". Remove unused
8310 member evalargs. Remove obsolete comments about cc bombing out.
8311
9851bfc5
JD
83122011-06-30 Jan Djärv <jan.h.d@swipnet.se>
8313
51bb811f 8314 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
8315 Let HAVE_GSETTINGS override HAVE_GCONF.
8316 (store_monospaced_changed): New function.
8317 (EMACS_SETTINGS): A new type derived from GObject to handle
8318 GSettings notifications.
8319 (emacs_settings_constructor, emacs_settings_get_property)
8320 (emacs_settings_set_property, emacs_settings_class_init):
8321 New functions.
8322 (gsettings_client, gsettings_obj): New variables.
8323 (GSETTINGS_SCHEMA): New define.
8324 (something_changedCB): Call store_monospaced_changed.
8325 (init_gsettings): New function.
8326 (xsettings_initialize): Call init_gsettings.
8327 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8328 to NULL.
8329
640c8776 8330 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
8331 GCONF_CFLAGS/LIBS.
8332
5386012d
MR
83332011-06-29 Martin Rudalics <rudalics@gmx.at>
8334
8335 * window.c (resize_root_window, grow_mini_window)
8336 (shrink_mini_window): Rename Qresize_root_window to
8337 Qwindow_resize_root_window and Qresize_root_window_vertically to
8338 Qwindow_resize_root_window_vertically.
8339
f13e0b08
PE
83402011-06-28 Paul Eggert <eggert@cs.ucla.edu>
8341
8342 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8343
94515237
JB
83442011-06-27 Juanma Barranquero <lekktu@gmail.com>
8345
8346 * makefile.w32-in: Redesign dependencies so they reflect more
8347 clearly which files are directly included by each source file,
8348 and not through other includes.
8349
e43b6e43
MR
83502011-06-27 Martin Rudalics <rudalics@gmx.at>
8351
8352 * buffer.c (Qclone_number): Declare static and DEFSYM it.
8353 (sort_overlays, overlay_strings): When an overlay's clone number
8354 matches the window's clone number process the overlay even if
8355 the overlay's window property doesn't match the current window.
8356
d68443dc
MR
8357 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8358 (Fwindow_hchild): Rename to Fwindow_left_child.
8359 (Fwindow_next): Rename to Fwindow_next_sibling.
8360 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
8361 (resize_window_check): Rename to window_resize_check.
8362 (resize_window_apply): Rename to window_resize_apply.
8363 (Fresize_window_apply): Rename to Fwindow_resize_apply.
8364 (Fdelete_other_windows_internal, resize_frame_windows)
8365 (Fsplit_window_internal, Fdelete_window_internal)
8366 (grow_mini_window, shrink_mini_window)
8367 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 8368
c7e73be5
JD
83692011-06-26 Jan Djärv <jan.h.d@swipnet.se>
8370
8371 * emacsgtkfixed.h: State that this is only used with Gtk+3.
8372 (emacs_fixed_set_min_size): Remove.
8373 (emacs_fixed_new): Take frame as argument.
8374
8375 * emacsgtkfixed.c: State that this is only used with Gtk+3.
8376 (_EmacsFixedPrivate): Remove minwidth/height.
8377 Add struct frame *f.
8378 (emacs_fixed_init): Initialize priv->f.
8379 (get_parent_class, emacs_fixed_set_min_size): Remove.
8380 (emacs_fixed_new): Set priv->f to argument.
8381 (emacs_fixed_get_preferred_width)
8382 (emacs_fixed_get_preferred_height): Use min_width/height from
8383 frames size_hint to set minimum and natural (Bug#8919).
8384 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8385 and use min_width/height from frames size_hint to set
8386 min_width/height (Bug#8919).
8387
8388 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
8389 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8390 Fix indentation.
c7e73be5 8391
cf99dcf8
EZ
83922011-06-26 Eli Zaretskii <eliz@gnu.org>
8393
8394 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8395 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8396 called at ZV.
8397
029529ac
CY
83982011-06-26 Chong Yidong <cyd@stupidchicken.com>
8399
8400 * process.c (wait_reading_process_output): Bypass select if
8401 waiting for a cell while ignoring keyboard input, and input is
8402 pending. Suggested by Jan Djärv (Bug#8869).
8403
7a7ef429
PE
84042011-06-25 Paul Eggert <eggert@cs.ucla.edu>
8405
8406 Use gnulib's dup2 module instead of rolling our own.
8407 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8408
11fdef7d 84092011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
8410
8411 * dispnew.c (scrolling_window): Before scrolling, turn off a
8412 mouse-highlight in the window being scrolled.
8413
cd3520a4
JB
84142011-06-24 Juanma Barranquero <lekktu@gmail.com>
8415
8416 Move DEFSYM to lisp.h and use everywhere.
8417
8418 * character.h (DEFSYM): Move declaration...
8419 * lisp.h (DEFSYM): ...here.
8420
8421 * gnutls.c:
8422 * minibuf.c:
8423 * w32menu.c:
8424 * w32proc.c:
8425 * w32select.c: Don't include character.h.
8426
8427 * alloc.c (syms_of_alloc):
8428 * buffer.c (syms_of_buffer):
8429 * bytecode.c (syms_of_bytecode):
8430 * callint.c (syms_of_callint):
8431 * casefiddle.c (syms_of_casefiddle):
8432 * casetab.c (init_casetab_once):
8433 * category.c (init_category_once, syms_of_category):
8434 * ccl.c (syms_of_ccl):
8435 * cmds.c (syms_of_cmds):
8436 * composite.c (syms_of_composite):
8437 * dbusbind.c (syms_of_dbusbind):
8438 * dired.c (syms_of_dired):
8439 * dispnew.c (syms_of_display):
8440 * doc.c (syms_of_doc):
8441 * editfns.c (syms_of_editfns):
8442 * emacs.c (syms_of_emacs):
8443 * eval.c (syms_of_eval):
8444 * fileio.c (syms_of_fileio):
8445 * fns.c (syms_of_fns):
8446 * frame.c (syms_of_frame):
8447 * fringe.c (syms_of_fringe):
8448 * insdel.c (syms_of_insdel):
8449 * keymap.c (syms_of_keymap):
8450 * lread.c (init_obarray, syms_of_lread):
8451 * macros.c (syms_of_macros):
8452 * msdos.c (syms_of_msdos):
8453 * print.c (syms_of_print):
8454 * process.c (syms_of_process):
8455 * search.c (syms_of_search):
8456 * sound.c (syms_of_sound):
8457 * syntax.c (init_syntax_once, syms_of_syntax):
8458 * terminal.c (syms_of_terminal):
8459 * textprop.c (syms_of_textprop):
8460 * undo.c (syms_of_undo):
8461 * w32.c (globals_of_w32):
8462 * window.c (syms_of_window):
8463 * xdisp.c (syms_of_xdisp):
8464 * xfaces.c (syms_of_xfaces):
8465 * xfns.c (syms_of_xfns):
8466 * xmenu.c (syms_of_xmenu):
8467 * xsettings.c (syms_of_xsettings):
8468 * xterm.c (syms_of_xterm): Use DEFSYM.
8469
4228cf16
TZ
84702011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
8471
cd3520a4 8472 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 8473
7fcccf1e
PE
84742011-06-23 Paul Eggert <eggert@cs.ucla.edu>
8475
7efb4e0e
PE
8476 Integer and buffer overflow fixes (Bug#8873).
8477
ff5844ad
PE
8478 * print.c (printchar, strout): Check for string overflow.
8479 (PRINTPREPARE, printchar, strout):
8480 Don't set size unless allocation succeeds.
8481
90532f02
PE
8482 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
8483 for sizes. Check for string overflow more accurately.
8484 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
8485
6d84508d
PE
8486 * macros.c: Integer and buffer overflow fixes.
8487 * keyboard.h (struct keyboard.kbd_macro_bufsize):
8488 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
8489 Use ptrdiff_t, not int, for sizes.
8490 Don't increment bufsize until after realloc succeeds.
8491 Check for size-calculation overflow.
8492 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
8493
437b2cb4
PE
8494 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
8495
8b9ac8b4
PE
8496 * lread.c: Integer overflow fixes.
8497 (read_integer): Radix is now EMACS_INT, not int,
8498 to improve quality of diagnostics for out-of-range radices.
8499 Calculate buffer size correctly for out-of-range radices.
8500 (read1): Check for integer overflow in radices, and in
8501 read-circle numbers.
82cb60d3
PE
8502 (read_escape): Avoid int overflow.
8503 (Fload, openp, read_buffer_size, read1)
8504 (substitute_object_recurse, read_vector, read_list, map_obarray):
8505 Use ptrdiff_t, not int, for sizes.
8506 (read1): Use EMACS_INT, not int, for sizes.
20270765 8507 Check for size overflow.
8b9ac8b4 8508
7fcccf1e
PE
8509 * image.c (cache_image): Check for size arithmetic overflow.
8510
bfbbd7e7
PE
8511 * lread.c: Integer overflow issues.
8512 (saved_doc_string_size, saved_doc_string_length)
8513 (prev_saved_doc_string_size, prev_saved_doc_string_length):
8514 Now ptrdiff_t, not int.
8515 (read1): Don't assume doc string length fits in int. Check for
8516 out-of-range doc string lengths.
8517 (read_list): Don't assume file position fits in int.
39019e54 8518 (read_escape): Check for hex character overflow.
bfbbd7e7 8519
4e323265
LL
85202011-06-22 Leo Liu <sdl.web@gmail.com>
8521
8522 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
8523 Move to minibuffer.el.
8524
85fece3e
PE
85252011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8526
20b84ce9 8527 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
8528 The following patches are for when GLYPH_DEBUG && !XASSERT.
8529 * dispextern.h (trace_redisplay_p, dump_glyph_string):
8530 * dispnew.c (flush_stdout):
8531 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
8532 Mark as externally visible.
8533 * dispnew.c (check_window_matrix_pointers): Now static.
8534 * dispnew.c (window_to_frame_vpos):
8535 * xfns.c (unwind_create_frame):
8536 * xterm.c (x_check_font): Remove unused local.
8537 * scroll.c (CHECK_BOUNDS):
8538 * xfaces.c (cache_fache): Rename local to avoid shadowing.
8539 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
8540 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
8541 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
8542 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
8543 Now static.
8544 (debug_method_add): Use va_list and vsprintf rather than relying
8545 on undefined behavior with wrong number of arguments.
8546 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
8547 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
8548 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
8549 since we're not interested in debugging glyphs with old libraries.
8550 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
8551 GCC 4.6.0's static checking.
8552
0766b489
PE
85532011-06-22 Paul Eggert <eggert@cs.ucla.edu>
8554
31fd4b32
PE
8555 Integer overflow and signedness fixes (Bug#8873).
8556 A few related buffer overrun fixes, too.
8557
b79e8648
PE
8558 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
8559
0766b489
PE
8560 * dispextern.h (struct face.stipple):
8561 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
8562 (x_bitmap_mask, x_allocate_bitmap_record)
8563 (x_create_bitmap_from_data, x_create_bitmap_from_file)
8564 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
8565 (x_create_bitmap_from_xpm_data):
8566 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
8567 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
8568 (.bitmaps_last):
8569 * xfaces.c (load_pixmap):
8570 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
8571 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
8572 (.bitmaps_last, struct x_output.icon_bitmap):
8573 Use ptrdiff_t, not int, for bitmap indexes.
8574 (x_allocate_bitmap_record): Check for size overflow.
8575 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
8576
b081724f
PE
8577 Use ptrdiff_t, not int, for overlay counts.
8578 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
8579 * editfns.c (overlays_around, get_pos_property):
8580 * textprop.c (get_char_property_and_overlay):
8581 * xdisp.c (next_overlay_change, note_mouse_highlight):
8582 * xfaces.c (face_at_buffer_position):
21514da7
PE
8583 * buffer.c (OVERLAY_COUNT_MAX): New macro.
8584 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
8585 (Fnext_overlay_change, Fprevious_overlay_change)
8586 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 8587 Use ptrdiff_t, not int, for sizes.
21514da7 8588 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 8589
3de73e5e
PE
8590 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
8591
2606c57b
PE
8592 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
8593 (x_session_initialize): Do not assume string length fits in int.
8594
aaafe47a
PE
8595 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
8596 This is unlikely, but can occur if DPI is outlandish.
8597
2674ddc8 8598 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
8599 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
8600
28154962
PE
8601 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
8602 * xrdb.c (magic_file_p, search_magic_path):
8603 Omit last arg SUFFIX; it was always 0. All callers changed.
8604 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
8605
7de51af5
PE
8606 * xfont.c (xfont_match): Avoid need for strlen.
8607
25ed6cc3
PE
8608 * xfns.c: Don't assume strlen fits in int.
8609 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
8610
4eab31dd
PE
8611 * xdisp.c (message_log_check_duplicate): Return intmax_t,
8612 not unsigned long, as we prefer signed integers. All callers changed.
8613 Detect integer overflow in repeat count.
8614 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 8615 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 8616
171e2a58
PE
8617 * termcap.c: Don't assume sizes fit in int and never overflow.
8618 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
8619 (gobble_line): Check for size-calculation overflow.
8620
ad39faca 8621 * minibuf.c (Fread_buffer):
6e5bb2dc 8622 * lread.c (intern, intern_c_string):
74ca2eb3
PE
8623 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
8624 Don't assume string length fits in int.
8625
52c61c22 8626 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
8627 * gtkutil.c (style_changed_cb): Avoid need for strlen.
8628
b5b8c9e5
PE
8629 * font.c: Don't assume string length fits in int.
8630 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
8631 Use ptrdiff_t, not int.
ccd6111c
PE
8632 (font_intern_prop): Don't assume string length fits in int.
8633 Don't assume integer property fits in fixnum.
8634 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 8635
882f0d81 8636 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 8637 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
8638 Reformulate so as not to need the command string.
8639 Invoke gzip -cd rather than gunzip, as it's more portable.
8640 (lock_info_type, lock_file_1, lock_file):
8641 Don't assume pid_t and time_t fit in unsigned long.
8642 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
8643 (current_lock_owner): Prefer signed type for sizes.
8644 Use memcpy, not strncpy, where memcpy is what is really wanted.
8645 Don't assume (via atoi) that time_t and pid_t fit in int.
8646 Check for time_t and/or pid_t out of range, e.g., via a network share.
8647 Don't alloca where an auto var works fine.
8648
93f4cf88
PE
8649 * fileio.c: Fix some integer overflow issues.
8650 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
8651 Don't assume string length fits in int.
8652 (directory_file_name): Don't assume string length fits in long.
8653 (make_temp_name): Don't assume pid fits in int, or that its print
8654 length is less than 20.
8655
f3e92b69
PE
8656 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
8657
1bfdaf10
PE
8658 * coding.c (make_subsidiaries): Don't assume string length fits in int.
8659
35016e9a
PE
8660 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
8661
3d1e65a1
PE
8662 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
8663 We prefer signed integers, even for size calculations.
8664
0b963a93
PE
8665 * emacs.c: Don't assume string length fits in 'int'.
8666 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
8667 (main): Don't invoke strlen when not needed.
8668
573f4b54
PE
8669 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
8670 (XD_DEBUG_MESSAGE): Don't waste a byte.
8671
989f33ba
PE
8672 * callproc.c (getenv_internal_1, getenv_internal)
8673 (Fgetenv_internal):
965d34eb
PE
8674 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
8675
e4d29b33
PE
8676 * lread.c (invalid_syntax): Omit length argument.
8677 All uses changed. This doesn't fix a bug, but it simplifies the
8678 code away from its former Hollerith-constant appearance, and it's
8679 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 8680 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 8681
eb49b136
PE
8682 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
8683 This didn't break anything, but it didn't help either.
8684 It's confusing to put a bogus integer in a place where the actual
8685 value does not matter.
9f62aeb1 8686 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 8687 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 8688
15375a22
PE
8689 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
8690 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
8691 implementation.
b61cc01c
PE
8692 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
8693 We prefer signed types, and the value cannot exceed the EMACS_INT
8694 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
8695 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
8696 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
8697 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 8698
53b2623d
PE
8699 * indent.c (sane_tab_width): New function.
8700 (current_column, scan_for_column, Findent_to, position_indentation)
8701 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 8702 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 8703
51cab52b 8704 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 8705
f2ed8a70
PE
8706 * lisp.h (lint_assume): New macro.
8707 * composite.c (composition_gstring_put_cache):
8708 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
8709
abe80cc6
PE
8710 * editfns.c, insdel.c:
8711 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 8712
b02c740e
PE
8713 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
8714
ebc96716
PE
8715 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
8716
b4e50fa0 8717 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 8718 Use much-faster test for byte-length change.
311d5d7c 8719 Don't assume string byte-length fits in 'int'.
a4cf38e4 8720 Check that character arg fits in 'int'.
85461888 8721 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 8722
c0c1ee9f
PE
8723 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
8724
a498d7f4
PE
8725 * fns.c (concat): Catch string overflow earlier.
8726 Do not rely on integer wraparound.
8727
51cab52b
PE
8728 * dispextern.h (struct it.overlay_strings_charpos)
8729 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
8730 * xdisp.c (forward_to_next_line_start)
8731 (back_to_previous_visible_line_start)
8732 (reseat_at_next_visible_line_start, next_element_from_buffer):
8733 Don't arbitrarily truncate the value of 'selective' to int.
8734
76031fad
PE
8735 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
8736
5eb55db9
PE
8737 * composite.c: Don't truncate sizes to 'int'.
8738 (composition_gstring_p, composition_reseat_it)
8739 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
8740 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
8741 not EMACS_UINT, for indexes.
5eb55db9 8742
0703a717
PE
8743 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
8744
d6202519
PE
8745 * buffer.c: Include <verify.h>.
8746 (struct sortvec.priority, struct sortstr.priority):
8961a454 8747 Now EMACS_INT, not int.
c20998a7 8748 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
8749 (struct sortstr.size, record_overlay_string)
8750 (struct sortstrlist.size, struct sortlist.used):
8751 Don't truncate size to int.
8752 (record_overlay_string): Check for size-calculation overflow.
d6202519 8753 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 8754
d5a19415
JM
87552011-06-22 Jim Meyering <meyering@redhat.com>
8756
029529ac 8757 Don't leak an XBM-image-sized buffer
d5a19415
JM
8758 * image.c (xbm_load): Free the image buffer after using it.
8759
a9041e6c
PE
87602011-06-21 Paul Eggert <eggert@cs.ucla.edu>
8761
8762 Port to Sun C.
8763 * composite.c (find_automatic_composition): Omit needless 'return 0;'
8764 that Sun C diagnosed.
8765 * fns.c (secure_hash): Fix pointer signedness issue.
8766 * intervals.c (static_offset_intervals): New function.
8767 (offset_intervals): Use it.
8768
7f3f739f
LL
87692011-06-21 Leo Liu <sdl.web@gmail.com>
8770
8771 * deps.mk (fns.o):
8772 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
8773 sha512.h.
8774
8775 * fns.c (secure_hash): Rename from crypto_hash_function and change
8776 the first arg to accept symbols.
5b66d427 8777 (Fsecure_hash): New primitive.
7f3f739f
LL
8778 (syms_of_fns): New symbols.
8779
76147d94
DD
87802011-06-20 Deniz Dogan <deniz@dogan.se>
8781
8782 * process.c (Fset_process_buffer): Clarify return value in
8783 docstring.
8784
7d7d0045
CY
87852011-06-18 Chong Yidong <cyd@stupidchicken.com>
8786
8787 * dispnew.c (add_window_display_history): Use BVAR.
8788
8789 * xdisp.c (debug_method_add): Use BVAR.
8790 (check_window_end, dump_glyph_matrix, dump_glyph)
8791 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
8792
8793 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
8794 Likewise.
8795
8796 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
8797 check till after the cache is created in init_frame_faces.
8798
ff2bc410
SM
87992011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
8800
8801 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
8802
28177add
PE
88032011-06-16 Paul Eggert <eggert@cs.ucla.edu>
8804
dd3482fe
PE
8805 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
8806 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
8807 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
8808
393d71f3 8809 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
8810 * fileio.c (Finsert_file_contents):
8811 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
8812 Remove the old (too-loose) buffer overflow checks.
8813 They weren't needed, since make_gap checks for buffer overflow.
8814 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
8815 The old code merely checked for Emacs fixnum overflow, and relied
8816 on undefined (wraparound) behavior. The new code avoids undefined
8817 behavior, and also checks for ptrdiff_t and/or size_t overflow.
8818
2e6813b0 8819 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
8820 Tune. Don't use wider integers than needed. Don't use alloca.
8821 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 8822
599a9e4f
PE
8823 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
8824
99561444
PE
8825 * insdel.c, lisp.h (buffer_overflow): New function.
8826 (insert_from_buffer_1, replace_range, replace_range_2):
8827 * insdel.c (make_gap_larger):
8828 * editfns.c (Finsert_char):
8829 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
8830
28177add
PE
8831 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
8832
e69dafad
PE
88332011-06-15 Paul Eggert <eggert@cs.ucla.edu>
8834
4baa020d 8835 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 8836
b1c46f02
PE
8837 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
8838 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
8839
e69dafad
PE
8840 * fileio.c: Don't assume EMACS_INT fits in off_t.
8841 (emacs_lseek): New static function.
8842 (Finsert_file_contents, Fwrite_region): Use it.
8843 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
8844
566684ea
PE
8845 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
8846
e6966cd6
PE
8847 * fns.c: Don't overflow int when computing a list length.
8848 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
8849 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
8850 truncation on 64-bit hosts. Check for QUIT every
8851 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
8852 faster and is responsive enough.
8853 (Flength): Report an error instead of overflowing an integer.
8854 (Fsafe_length): Return a float if the value is not representable
8855 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 8856 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 8857 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 8858
dd0b0efb
PE
8859 * alloc.c: Check that resized vectors' lengths fit in fixnums.
8860 (header_size, word_size): New constants.
8861 (allocate_vectorlike): Don't check size overflow here.
8862 (allocate_vector): Check it here instead, since this is the only
8863 caller of allocate_vectorlike that could cause overflow.
8864 Check that the new vector's length is representable as a fixnum.
8865
86fe5cfe
PE
8866 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
8867 The previous code was bogus. For example, next_almost_prime (32)
8868 returned 39, which is undesirable as it is a multiple of 3; and
8869 next_almost_prime (24) returned 25, which is a multiple of 5 so
8870 why was the code bothering to check for multiples of 7?
8871
80e88859
PE
8872 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
8873
4a2f0ad6
PE
8874 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
8875
f66c7cf8
PE
8876 Variadic C functions now count arguments with ptrdiff_t.
8877 This partly undoes my 2011-03-30 change, which replaced int with size_t.
8878 Back then I didn't know that the Emacs coding style prefers signed int.
8879 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
8880 were being counted with int, which may truncate counts on 64-bit
8881 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
8882 * lisp.h (struct Lisp_Subr.function.aMANY)
8883 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
8884 Arg counts are now ptrdiff_t, not size_t.
8885 All variadic functions and their callers changed accordingly.
8886 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
8887 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
8888 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
8889 * callint.c (Fcall_interactively): Check arg count for overflow,
8890 to avoid potential buffer overrun. Use signed char, not 'int',
8891 for 'varies' array, so that we needn't bother to check its size
8892 calculation for overflow.
8893 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
8894 * eval.c (apply_lambda):
8895 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
8896 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
8897 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
8898
a1759b76
PE
8899 * callint.c (Fcall_interactively): Don't use index var as event count.
8900
d96be9fc
PE
8901 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
8902 * mem-limits.h (SIZE): Remove; no longer used.
8903
a690a978 8904 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 8905
578c21e6
PE
8906 Remove unnecessary casts.
8907 * xterm.c (x_term_init):
8908 * xfns.c (x_set_border_pixel):
8909 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
8910 These aren't needed now that we assume ANSI C.
8911
96f53c6c
PE
8912 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
8913 It's more likely to cause problems (due to unsigned overflow)
8914 than to cure them.
8915
83c77d31
PE
8916 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
8917
ee2079f1
PE
8918 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
8919
6da65536
PE
8920 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
8921
7147c4a4
PE
8922 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
8923
193e32d9
PE
8924 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
8925
e5533da6
PE
8926 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
8927
9910e595
PE
8928 GLYPH_CODE_FACE returns EMACS_INT, not int.
8929 * dispextern.h (merge_faces):
8930 * xfaces.c (merge_faces):
01103c44
PE
8931 * xdisp.c (get_next_display_element, next_element_from_display_vector):
8932 Don't assume EMACS_INT fits in int.
9910e595 8933
2638320e
PE
8934 * character.h (CHAR_VALID_P): Remove unused parameter.
8935 * fontset.c, lisp.h, xdisp.c: All uses changed.
8936
045eb8d9
PE
8937 * editfns.c (Ftranslate_region_internal): Omit redundant test.
8938
c1f134b5
PE
8939 * fns.c (concat): Minor tuning based on overflow analysis.
8940 This doesn't fix any bugs. Use int to hold character, instead
8941 of constantly refetching from Emacs object. Use XFASTINT, not
8942 XINT, for value known to be a character. Don't bother comparing
8943 a single byte to 0400, as it's always less.
8944
395fcb93 8945 * floatfns.c (Fexpt):
327eeec8
PE
8946 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
8947
abbd3d23
PE
8948 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
8949 for characters.
8950
684a03ef
PE
8951 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
8952
0fed43f3
PE
8953 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
8954 Without this fix, on a 64-bit host (aset S 0 4294967386) would
8955 incorrectly succeed when S was a string, because 4294967386 was
8956 truncated before it was used.
8957
8fd02eb7
PE
8958 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
8959 Otherwise, an out-of-range integer could cause undefined behavior
8960 on a 64-bit host.
8961
f8c86b69
PE
8962 * composite.c: Use int, not EMACS_INT, for characters.
8963 (fill_gstring_body, composition_compute_stop_pos): Use int, not
8964 EMACS_INT, for values that are known to be in character range.
8965 This doesn't fix any bugs but is the usual style inside Emacs and
8966 may generate better code on 32-bit machines.
8967
34206dd2
PE
8968 Make sure a 64-bit char is never passed to ENCODE_CHAR.
8969 This is for reasons similar to the recent CHAR_STRING fix.
8970 * charset.c (Fencode_char): Check that character arg is actually
8971 a character. Pass an int to ENCODE_CHAR.
8972 * charset.h (ENCODE_CHAR): Verify that the character argument is no
8973 wider than 'int', as a compile-time check to prevent future regressions
8974 in this area.
8975
c5958d4c 8976 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
8977
8978 Make sure a 64-bit char is never passed to CHAR_STRING.
8979 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
8980 by silently ignoring the top 32 bits, allowing some values
8981 that were far too large to be valid characters.
8982 * character.h: Include <verify.h>.
8983 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
8984 arguments are no wider than unsigned, as a compile-time check
8985 to prevent future regressions in this area.
8986 * data.c (Faset):
01103c44 8987 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
8988 (Fsubst_char_in_region):
8989 * fns.c (concat):
8990 * xdisp.c (decode_mode_spec_coding):
8991 Adjust to CHAR_STRING's new requirement.
8992 * editfns.c (Finsert_char, Fsubst_char_in_region):
8993 * fns.c (concat): Check that character args are actually
8994 characters. Without this test, these functions did the wrong
8995 thing with wildly out-of-range values on 64-bit hosts.
8996
d37ca623
PE
8997 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
8998 These casts should not be needed on 32-bit hosts, either.
8999 * keyboard.c (read_char):
9000 * lread.c (Fload): Remove casts to unsigned.
9001
ea204efb
PE
9002 * lisp.h (UNSIGNED_CMP): New macro.
9003 This fixes comparison bugs on 64-bit hosts.
9004 (ASCII_CHAR_P): Use it.
9005 * casefiddle.c (casify_object):
01103c44 9006 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
9007 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9008 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9009 * dispextern.h (FACE_FROM_ID):
9010 * keyboard.c (read_char): Use UNSIGNED_CMP.
9011
41cb286c
PE
9012 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9013 not to EMACS_INT, to avoid GCC warning.
9014
4a1b9832
PE
9015 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9016
55daad71
PE
9017 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9018 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9019 isn't needed on 32-bit machines.
8f95c75c 9020
01103c44
PE
9021 * buffer.c (Fgenerate_new_buffer_name):
9022 Use EMACS_INT for count, not int.
0ceccced 9023 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
9024
9025 * data.c (Qcompiled_function): Now static.
9026
c6f072e7
PE
9027 * window.c (window_body_lines): Now static.
9028
20ce5912
PE
9029 * image.c (gif_load): Rename local to avoid shadowing.
9030
9c4c5f81
PE
9031 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9032 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9033 * alloc.c (make_save_value): Integer argument is now of type
9034 ptrdiff_t, not int.
9035 (mark_object): Use ptrdiff_t, not int.
9036 * lisp.h (pD): New macro.
9037 * print.c (print_object): Use it.
9038
c0c5c8ae
PE
9039 * alloc.c: Use EMACS_INT, not int, to count objects.
9040 (total_conses, total_markers, total_symbols, total_vector_size)
9041 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
9042 (total_free_floats, total_floats, total_free_intervals)
9043 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
9044 Now EMACS_INT, not int. All uses changed.
9045 (Fgarbage_collect): Compute overall total using a double, so that
9046 integer overflow is less likely to be a problem. Check for overflow
9047 when converting back to an integer.
5a25e253
PE
9048 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9049 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9050 These were 'int' variables that could overflow on 64-bit hosts;
9051 they were never used, so remove them instead of repairing them.
211a0b2a 9052 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
9053 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9054 Previously, this ceilinged at INT_MAX, but that doesn't work on
9055 64-bit machines.
e46bb31a 9056 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 9057
c78baabf 9058 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 9059 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
9060 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9061 when a (possibly-narrower) signed value would do just as well.
9062 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 9063
c9d624c6
PE
9064 * alloc.c: Catch some string size overflows that we were missing.
9065 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9066 for convenience in STRING_BYTES_MAX.
9067 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9068 The definition here is exact; the one in lisp.h was approximate.
9069 (allocate_string_data): Check for string overflow. This catches
9070 some instances we weren't catching before. Also, it catches
9071 size_t overflow on (unusual) hosts where SIZE_MAX <= min
9072 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9073 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 9074
c9d624c6
PE
9075 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9076 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 9077 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 9078
353032ce
PE
9079 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9080
2bccce07
PE
9081 * alloc.c (Fmake_string): Check for out-of-range init.
9082
0ac30604
SM
90832011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
9084
9085 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9086
c195f2de
JD
90872011-06-14 Jan Djärv <jan.h.d@swipnet.se>
9088
9089 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9090 xg_get_default_scrollbar_width.
9091
9092 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9093 (int_gtk_range_get_value): Move to the scroll bar part of the file.
9094 (style_changed_cb): Call update_theme_scrollbar_width and call
9095 x_set_scroll_bar_default_width and xg_frame_set_char_size for
9096 all frames (Bug#8505).
9097 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9098 Call gtk_window_set_resizable if HAVE_GTK3.
9099 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9100 and height if HAVE_GTK3 (Bug#8505).
9101 (scroll_bar_width_for_theme): New variable.
9102 (update_theme_scrollbar_width): New function.
9103 (xg_get_default_scrollbar_width): Move code to
9104 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9105 (xg_initialize): Call update_theme_scrollbar_width.
9106
9107 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9108
9109 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9110
e10ac9f1
MR
91112011-06-12 Martin Rudalics <rudalics@gmx.at>
9112
9113 * frame.c (make_frame): Call other_buffer_safely instead of
9114 other_buffer.
9115
9116 * window.c (temp_output_buffer_show): Call display_buffer with
9117 second argument Vtemp_buffer_show_specifiers and reset latter
9118 immediately after the call.
9119 (Vtemp_buffer_show_specifiers): New variable.
9120 (auto_window_vscroll_p, next_screen_context_lines)
9121 (Vscroll_preserve_screen_position): Remove leading asterisks from
9122 doc-strings.
9123
2d3c217e 91242011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 9125
7b7f97e8 9126 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
9127 * buffer.c (Qclone_number): Remove for now, as it's unused.
9128 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9129 (record_buffer): Remove unused local.
9130 * frame.c (other_visible_frames, frame_buffer_list): Now static.
9131 (set_frame_buffer_list): Remove; unused.
9132 * frame.h (other_visible_frames): Remove decl.
9133 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9134 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9135 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9136 if HAVE_GPM.
9137 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9138 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9139 Define only if HAVE_GPM.
9140 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9141 (update_hints_inhibit): Remove; never set. All uses removed.
9142 * widgetprv.h (emacsFrameClassRec): Remove decl.
9143 * window.c (delete_deletable_window): Now returns void, since it
9144 wasn't returning anything.
9145 (compare_window_configurations): Remove unused locals.
9146 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9147 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
9148 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9149 the same widths as pointers. This follows up on the 2011-05-06 patch.
9150 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9151 * xterm.h: Likewise.
9152 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9153
1384b89e
JB
91542011-06-12 Juanma Barranquero <lekktu@gmail.com>
9155
9156 * makefile.w32-in: Update dependencies.
9157 (LISP_H): Add lib/intprops.h.
9158
1100a63c
CY
91592011-06-11 Chong Yidong <cyd@stupidchicken.com>
9160
9161 * image.c (gif_load): Add animation frame delay to the metadata.
9162 (syms_of_image): Use DEFSYM. New symbol `delay'.
9163
6198ccd0
MR
91642011-06-11 Martin Rudalics <rudalics@gmx.at>
9165
9166 * window.c (delete_deletable_window): Re-add.
9167 (Fset_window_configuration): Rewrite to handle dead buffers and
9168 consequently deletable windows.
9169 (window_tree, Fwindow_tree): Remove. Supply functionality in
9170 window.el.
9171 (compare_window_configurations): Simplify code.
9172
b6e3633c
AS
91732011-06-11 Andreas Schwab <schwab@linux-m68k.org>
9174
1ab0dee5
AS
9175 * image.c (imagemagick_load_image): Fix type mismatch.
9176 (Fimagemagick_types): Likewise.
9177
b6e3633c
AS
9178 * window.h (replace_buffer_in_windows): Declare.
9179
9397e56f
MR
91802011-06-11 Martin Rudalics <rudalics@gmx.at>
9181
9182 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9183 Qclone_number. Remove external declaration of Qdelete_window.
9184 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
9185 code.
640c8776
SM
9186 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9187 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
9188 (Fother_buffer): Rewrite doc-string. Major rewrite for new
9189 buffer list implementation.
9190 (other_buffer_safely): New function.
9191 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9192 calls to replace_buffer_in_windows and
9193 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
9194 if allowed.
9195 (record_buffer): Inhibit quitting and rewrite using quittable
9196 functions. Run Qbuffer_list_update_hook if allowed.
9197 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
9198 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9199 Move switch-to-buffer to window.el.
9397e56f
MR
9200 (bury-buffer): Move to window.el.
9201 (Vbuffer_list_update_hook): New variable.
9202
9203 * lisp.h (other_buffer_safely): Add prototype in buffer.c
9204 section.
9205
9206 * window.h (resize_frame_windows): Move up in code.
9207 (Fwindow_frame): Remove EXFUN.
9208 (replace_buffer_in_all_windows): Remove prototype.
9209 (replace_buffer_in_windows_safely): Add prototype.
9210
9211 * window.c: Declare Qdelete_window static again. Move down
9212 declaration of select_count.
9213 (Fnext_window, Fprevious_window): Rewrite doc-strings.
9214 (Fother_window): Move to window.el.
9215 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9216 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9217 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9218 window.el.
9219 (replace_buffer_in_windows): Implement by calling
9220 Qreplace_buffer_in_windows.
9221 (replace_buffer_in_all_windows): Remove with some functionality
9222 moved into replace_buffer_in_windows_safely.
9223 (replace_buffer_in_windows_safely): New function.
9224 (select_window_norecord, select_frame_norecord): Move in front
9225 of run_window_configuration_change_hook. Remove now obsolete
9226 declarations.
640c8776
SM
9227 (Fset_window_buffer): Rewrite doc-string.
9228 Call Qrecord_window_buffer.
9397e56f
MR
9229 (keys_of_window): Move binding for other-window to window.el.
9230
b50691aa
CY
92312011-06-11 Chong Yidong <cyd@stupidchicken.com>
9232
9233 * dispextern.h (struct image): Replace data member, whose int_val
9234 and ptr_val fields were not used by anything, with a single
9235 lisp_val object.
9236
9237 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9238 (gif_clear_image, gif_load, imagemagick_load_image)
9239 (gs_clear_image, gs_load): Callers changed.
9240
3f754b86
PE
92412011-06-10 Paul Eggert <eggert@cs.ucla.edu>
9242
cca69397
PE
9243 * buffer.h: Include <time.h>, for time_t.
9244 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
9245
109e28d0
PE
9246 Fix minor problems found by static checking.
9247
60737f02
PE
9248 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9249
4b66faf3
PE
9250 Make identifiers static if they are not used in other modules.
9251 * data.c (Qcompiled_function, Qframe, Qvector):
9252 * image.c (QimageMagick, Qsvg):
9253 * minibuf.c (Qmetadata):
9254 * window.c (resize_window_check, resize_root_window): Now static.
9255 * window.h (resize_window_check, resize_root_window): Remove decls.
9256
109e28d0
PE
9257 * window.c (window_deletion_count, delete_deletable_window):
9258 Remove; unused.
46a4ce9e
PE
9259 (window_body_lines): Now static.
9260 (Fdelete_other_windows_internal): Mark vars as initialized.
9261 Make sure 'resize_failed' is initialized.
9262 (run_window_configuration_change_hook): Rename local to avoid shadowing.
9263 (resize_window_apply): Remove unused local.
9264 * window.h (delete_deletable_window): Remove decl.
9265
109e28d0 9266 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
9267 (imagemagick_load_image): Fix pointer signedness problem by changing
9268 last arg from unsigned char * to char *. All uses changed.
9269 Also, fix a local for similar reasons.
9270 Remove unused locals. Remove locals to avoid shadowing.
9271 (fn_rsvg_handle_free): Remove; unused.
9272 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 9273 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 9274
3f754b86
PE
9275 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9276
2547adb1
CY
92772011-06-10 Chong Yidong <cyd@stupidchicken.com>
9278
9279 * image.c (gif_load): Fix omitted cast error introduced by
9280 2011-06-06 change.
9281
2c8e37d4
MR
92822011-06-10 Martin Rudalics <rudalics@gmx.at>
9283
9284 * window.h (resize_proportionally, orig_total_lines)
9285 (orig_top_line): Remove from window structure.
9286 (set_window_height, set_window_width, change_window_heights)
9287 (Fdelete_window): Remove prototypes.
9288 (resize_frame_windows): Remove duplicate declaration.
9289
440a42e3
EZ
92902011-06-10 Eli Zaretskii <eliz@gnu.org>
9291
9292 * window.h (resize_frame_windows, resize_window_check)
9293 (delete_deletable_window, resize_root_window)
9294 (resize_frame_windows): Declare prototypes.
9295
9296 * window.c (resize_window_apply): Make definition be "static" to
9297 match the prototype.
9298
562dd5e9
MR
92992011-06-10 Martin Rudalics <rudalics@gmx.at>
9300
9301 * window.c: Remove declarations of Qwindow_size_fixed,
9302 window_min_size_1, window_min_size_2, window_min_size,
9303 size_window, window_fixed_size_p, enlarge_window, delete_window.
9304 Remove static from declaration of Qdelete_window, it's
9305 temporarily needed by Fbury_buffer.
9306 (replace_window): Don't assign orig_top_line and
9307 orig_total_lines.
9308 (Fdelete_window, delete_window): Remove. Window deletion is
9309 handled by window.el.
640c8776
SM
9310 (window_loop): Remove DELETE_OTHER_WINDOWS case.
9311 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
9312 (Fdelete_other_windows): Remove. Deleting other windows is
9313 handled by window.el.
9314 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
9315 handled in window.el.
9316 (window_min_size_2, window_min_size_1, window_min_size): Remove.
9317 Window minimum sizes are handled in window.el.
9318 (shrink_windows, size_window, set_window_height)
9319 (set_window_width, change_window_heights, window_height)
9320 (window_width, CURBEG, CURSIZE, enlarge_window)
9321 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9322 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
9323 handled in window.el.
9324 (make_dummy_parent): Rename to make_parent_window and give it a
9325 second argument horflag.
9326 (make_window): Don't set resize_proportionally any more.
9327 (Fsplit_window): Remove. Windows are split in window.el.
9328 (save_restore_action, save_restore_orig_size)
9329 (shrink_window_lowest_first, save_restore_orig_size): Remove.
9330 Resize mini windows in window.el.
9331 (grow_mini_window, shrink_mini_window): Implement by calling
9332 Qresize_root_window_vertically, resize_window_check and
9333 resize_window_apply.
640c8776
SM
9334 (saved_window, Fset_window_configuration, save_window_save):
9335 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
9336 resize_proportionally.
9337 (window_min_height, window_min_width): Move to window.el.
9338 (keys_of_window): Move bindings for delete-other-windows,
9339 split-window, delete-window and enlarge-window to window.el.
9340
9341 * buffer.c: Temporarily extern Qdelete_window.
9342 (Fbury_buffer): Temporarily call Qdelete_window instead of
9343 Fdelete_window (Fbury_buffer will move to window.el soon).
9344
9345 * frame.c (set_menu_bar_lines_1): Remove code handling
9346 orig_top_line and orig_total_lines.
9347
9348 * dispnew.c (adjust_frame_glyphs_initially): Don't use
9349 set_window_height but set heights directly.
9350 (change_frame_size_1): Use resize_frame_windows.
9351
9352 * xdisp.c (init_xdisp): Don't use set_window_height but set
9353 heights directly.
9354
640c8776
SM
9355 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9356 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
9357 run_window_configuration_change_hook.
9358
9359 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9360 instead of change_window_heights and run
9361 run_window_configuration_change_hook.
9362
1a13852e
MR
93632011-06-09 Martin Rudalics <rudalics@gmx.at>
9364
9365 * window.c (replace_window): Rename second argument REPLACEMENT to
9366 NEW. New third argument SETFLAG. Rewrite.
9367 (delete_window, make_dummy_parent): Call replace_window with
9368 third argument 1.
9369 (window_list_1): Move down in code.
9370 (run_window_configuration_change_hook): Move set_buffer part
9371 before select_frame_norecord part in order to unwind correctly.
9372 Rename count1 to count.
9373 (recombine_windows, delete_deletable_window, resize_root_window)
9374 (Fdelete_other_windows_internal)
9375 (Frun_window_configuration_change_hook, make_parent_window)
9376 (resize_window_check, resize_window_apply, Fresize_window_apply)
9377 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
9378 (Fdelete_window_internal, Fresize_mini_window_internal):
9379 New functions.
1a13852e
MR
9380 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9381
f3d1777e
MR
93822011-06-08 Martin Rudalics <rudalics@gmx.at>
9383
496e208e
MR
9384 * window.h (window): Add some new members to window structure -
9385 normal_lines, normal_cols, new_total, new_normal, clone_number,
9386 splits, nest, prev_buffers, next_buffers.
9387 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 9388 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 9389
f3d1777e
MR
9390 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9391 Remove.
496e208e
MR
9392 (make_dummy_parent): Set new members of windows structure.
9393 (make_window): Move down in code. Handle new members of window
9394 structure.
9395 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9396 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9397 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9398 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
9399 (Fset_window_next_buffers, Fset_window_clone_number):
9400 New functions.
496e208e
MR
9401 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9402 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9403 Doc-string fixes.
9404 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9405 Argument WINDOW can be now internal window too.
9406 (Fwindow_use_time): Move up in code.
9407 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9408 Rewrite doc-string.
9409 (Fset_window_configuration, saved_window)
9410 (Fcurrent_window_configuration, save_window_save): Handle new
9411 members of window structure.
b9e809c2
MR
9412 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9413 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9414 (syms_of_window): New Lisp objects Qrecord_window_buffer,
9415 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9416 Qget_mru_window, Qresize_root_window,
9417 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9418 Qauto_buffer_name; staticpro them.
f3d1777e 9419
abde8f8c
MR
94202011-06-07 Martin Rudalics <rudalics@gmx.at>
9421
9422 * window.c (Fwindow_total_size, Fwindow_left_column)
9423 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9424 (Fwindow_list_1): New functions.
9425 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
9426 (Fwindow_width, Fscroll_left, Fscroll_right):
9427 Use window_body_cols instead of window_box_text_cols.
9428 (delete_window, Fset_window_configuration):
9429 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
9430 (delete_all_subwindows): Take a window as argument and not a
9431 structure. Rewrite.
190b47e6
MR
9432 (window_loop): Remove handling of GET_LRU_WINDOW and
9433 GET_LARGEST_WINDOW.
9434 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
9435
9436 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
9437 window_box_text_cols. delete_all_subwindows now takes a
9438 Lisp_Object as argument.
abde8f8c 9439
640c8776
SM
9440 * indent.c (compute_motion, Fcompute_motion):
9441 Use window_body_cols instead of window_box_text_cols.
abde8f8c 9442
fa8a67e6
MR
9443 * frame.c (delete_frame): Call delete_all_subwindows with root
9444 window as argument.
9445
a54e3482
DC
94462011-06-07 Daniel Colascione <dan.colascione@gmail.com>
9447
9448 * fns.c (Fputhash): Document return value.
9449
60002bf5
CY
94502011-06-06 Chong Yidong <cyd@stupidchicken.com>
9451
9452 * image.c (gif_load): Implement gif89a spec "no disposal" method.
9453
0c671da6 94542011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 9455
b862a52a 9456 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 9457
be44ca6c
PE
9458 Check for overflow when converting integer to cons and back.
9459 * charset.c (Fdefine_charset_internal, Fdecode_char):
9460 Use cons_to_unsigned to catch overflow.
9461 (Fencode_char): Use INTEGER_TO_CONS.
9462 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
9463 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9464 * data.c (long_to_cons, cons_to_long): Remove.
9465 (cons_to_unsigned, cons_to_signed): New functions.
9466 These signal an error for invalid or out-of-range values.
9467 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9468 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9469 * font.c (Ffont_variation_glyphs):
9470 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9471 * lisp.h: Include <intprops.h>.
9472 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9473 (cons_to_signed, cons_to_unsigned): New decls.
9474 (long_to_cons, cons_to_long): Remove decls.
9475 * undo.c (record_first_change): Use INTEGER_TO_CONS.
9476 (Fprimitive_undo): Use CONS_TO_INTEGER.
9477 * xfns.c (Fx_window_property): Likewise.
9478 * xselect.c: Include <limits.h>.
9479 (x_own_selection, selection_data_to_lisp_data):
9480 Use INTEGER_TO_CONS.
9481 (x_handle_selection_request, x_handle_selection_clear)
9482 (x_get_foreign_selection, Fx_disown_selection_internal)
9483 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
9484 (lisp_data_to_selection_data): Use cons_to_unsigned.
9485 (x_fill_property_data): Use cons_to_signed.
9486 Report values out of range.
9487
d1f3d2af
PE
9488 Check for buffer and string overflow more precisely.
9489 * buffer.h (BUF_BYTES_MAX): New macro.
9490 * lisp.h (STRING_BYTES_MAX): New macro.
9491 * alloc.c (Fmake_string):
9492 * character.c (string_escape_byte8):
9493 * coding.c (coding_alloc_by_realloc):
9494 * doprnt.c (doprnt):
9495 * editfns.c (Fformat):
9496 * eval.c (verror):
9497 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
9498 since they may not be the same number.
9499 * editfns.c (Finsert_char):
9500 * fileio.c (Finsert_file_contents):
9501 Likewise for BUF_BYTES_MAX.
9502
dd52fcea
PE
9503 * image.c: Use ptrdiff_t, not int, for sizes.
9504 (slurp_file): Switch from int to ptrdiff_t.
9505 All uses changed.
9506 (slurp_file): Check that file size fits in both size_t (for
9507 malloc) and ptrdiff_t (for sanity and safety).
9508
7f9bbdbb
PE
9509 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
9510 if b->modtime has its maximal value.
9511
dfe18f82
PE
9512 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
9513
84acfcf0
PE
9514 Don't assume time_t can fit into int.
9515 * buffer.h (struct buffer.modtime): Now time_t, not int.
9516 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
9517 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
9518
ccd9a01a
PE
9519 Minor fixes for signed vs unsigned integers.
9520 * character.h (MAYBE_UNIFY_CHAR):
9521 * charset.c (maybe_unify_char):
9522 * keyboard.c (read_char, reorder_modifiers):
9523 XINT -> XFASTINT, since the integer must be nonnegative.
9524 * ftfont.c (ftfont_spec_pattern):
9525 * keymap.c (access_keymap, silly_event_symbol_error):
9526 XUINT -> XFASTINT, since the integer must be nonnegative.
9527 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
9528 since it makes no difference and we prefer signed.
9529 * keyboard.c (record_char): Use XUINT when all the neighbors do.
9530 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
9531 nonnegative.
9532
d6d100dd
SM
95332011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
9534
9535 * window.h (Fwindow_frame): Declare.
9536
2b6148e4
PE
95372011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9538
9539 * alloc.c: Simplify handling of large-request failures (Bug#8800).
9540 (SPARE_MEMORY): Always define.
9541 (LARGE_REQUEST): Remove.
9542 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
9543
f230ecc9
MR
95442011-06-06 Martin Rudalics <rudalics@gmx.at>
9545
727e958e
MR
9546 * lisp.h: Move EXFUNS for Fframe_root_window,
9547 Fframe_first_window and Fset_frame_selected_window to window.h.
9548
9549 * window.h: Move EXFUNS for Fframe_root_window,
9550 Fframe_first_window and Fset_frame_selected_window here from
9551 lisp.h.
9552
9553 * frame.c (Fwindow_frame, Fframe_first_window)
9554 (Fframe_root_window, Fframe_selected_window)
9555 (Fset_frame_selected_window): Move to window.c.
9556 (Factive_minibuffer_window): Move to minibuf.c.
9557 (Fother_visible_frames_p): New function.
9558
9559 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
9560
f230ecc9
MR
9561 * window.c (decode_window, decode_any_window): Move up in code.
9562 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
9563 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
9564 (Fwindow_buffer): Move up and rewrite doc-string.
9565 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
9566 (Fwindow_prev): New functions.
727e958e
MR
9567 (Fwindow_frame): Move here from frame.c. Accept any window as
9568 argument.
9569 (Fframe_root_window, Fframe_first_window)
9570 (Fframe_selected_window): Move here from frame.c. Accept frame
9571 or arbitrary window as argument. Update doc-strings.
9572 (Fminibuffer_window): Move up in code.
9573 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
9574 (Fset_frame_selected_window): Move here from frame.c.
9575 Marginal rewrite.
727e958e
MR
9576 (Fselected_window, select_window, Fselect_window): Move up in
9577 code. Minor doc-string fixes.
f230ecc9 9578
4d09bcf6
PE
95792011-06-06 Paul Eggert <eggert@cs.ucla.edu>
9580
9581 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
9582 Do not assume that spare memory exists; that assumption is valid
9583 only if SYSTEM_MALLOC.
9584 (LARGE_REQUEST): New macro, so that the issue of large requests
9585 is separated from the issue of spare memory.
9586
810928a2
AS
95872011-06-05 Andreas Schwab <schwab@linux-m68k.org>
9588
172418ad
AS
9589 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
9590 format. (Bug#8806)
9591
43f862f7
AS
9592 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
9593
810928a2
AS
9594 * xfns.c (x_set_scroll_bar_default_width): Move declarations
9595 before statements.
9596
a059fe24
JD
95972011-06-05 Jan Djärv <jan.h.d@swipnet.se>
9598
9599 * gtkutil.c (xg_get_default_scrollbar_width): New function.
9600
9601 * gtkutil.h: Declare xg_get_default_scrollbar_width.
9602
9603 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
9604 min width by calling x_set_scroll_bar_default_width (Bug#8505).
9605
989bf368
JB
96062011-06-05 Juanma Barranquero <lekktu@gmail.com>
9607
9608 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
9609
4b80f674
CY
96102011-06-04 Chong Yidong <cyd@stupidchicken.com>
9611
9612 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
9613 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
9614 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
9615 New error handlers.
4b80f674
CY
9616 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
9617 Obey Vx_select_enable_clipboard_manager. Catch errors in
9618 x_clipboard_manager_save (Bug#8779).
9619 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 9620 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 9621
99a33b77 96222011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
9623
9624 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
9625
99a33b77 96262011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
9627
9628 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
9629 in the current matrix if keep_current_p is non-zero.
9630
8264569d
EZ
96312011-06-04 Eli Zaretskii <eliz@gnu.org>
9632
9633 * bidi.c (bidi_level_of_next_char): Fix last change.
9634
57f97249
EZ
96352011-06-03 Eli Zaretskii <eliz@gnu.org>
9636
fec2107c 9637 Support bidi reordering of text covered by display properties.
57f97249 9638
fec2107c
EZ
9639 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
9640 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
9641 (bidi_cache_search, bidi_cache_iterator_state)
9642 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
9643 (bidi_level_of_next_char, bidi_move_to_visually_next):
9644 Support character positions inside a run of characters covered by a
fec2107c
EZ
9645 display string.
9646 (bidi_paragraph_init, bidi_resolve_explicit_1)
9647 (bidi_level_of_next_char): Call bidi_fetch_char and
9648 bidi_fetch_char_advance instead of FETCH_CHAR and
9649 FETCH_CHAR_ADVANCE.
9650 (bidi_init_it): Initialize new members.
9651 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
9652 definitions.
9653 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
9654 instead of using explicit *_CHAR codes.
d6d100dd
SM
9655 (bidi_resolve_explicit, bidi_resolve_weak):
9656 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
9657 bidirectional text is supported only in multibyte buffers.
9658 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
9659 it to initialize the frame_window_p member of struct bidi_it.
9660 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
9661 (bidi_resolve_explicit, bidi_resolve_weak)
9662 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
9663 bidi_it->nchars is non-positive.
9664 (bidi_level_of_next_char): Don't try to lookup the cache for the
9665 next/previous character if nothing is cached there yet, or if we
9666 were just reseat()'ed to a new position.
c40e2fb2 9667
0e14fe90
EZ
9668 * xdisp.c (set_cursor_from_row): Set start and stop points
9669 according to the row's direction when priming the loop that looks
9670 for the glyph on which to display cursor.
9671 (single_display_spec_intangible_p): Function deleted.
9672 (display_prop_intangible_p): Reimplement to call
9673 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
9674 Accept 3 additional arguments needed by handle_display_spec.
9675 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
9676 values: lists, `(when COND...)' forms, etc.
9677 (single_display_spec_string_p): Support property values that are
9678 lists with the argument STRING its top-level element.
9679 (display_prop_string_p): Fix the condition for processing a
9680 property that is a list to be consistent with handle_display_spec.
fec2107c 9681 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
9682 last portion of handle_display_prop.
9683 (compute_display_string_pos): Accept additional argument
9684 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
9685 value of a `display' property is a "replacing spec".
9686 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
9687 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
9688 the display property, but just return a value indicating whether
9689 the display property will replace the characters it covers.
9690 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
9691 frame_window_p members of struct bidi_it.
d6d100dd
SM
9692 (compute_display_string_pos, compute_display_string_end):
9693 New functions.
fec2107c
EZ
9694 (push_it): Accept second argument POSITION, where pop_it should
9695 jump to continue iteration.
9696 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 9697
fec2107c
EZ
9698 * keyboard.c (adjust_point_for_property): Adjust the call to
9699 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
9700
9701 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
9702 (bidi_init_it): Update prototypes.
9703 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
9704 (compute_display_string_pos, compute_display_string_end):
9705 Declare prototypes.
fec2107c
EZ
9706 (struct bidi_it): New members nchars and disp_pos. ch_len is now
9707 EMACS_INT.
fc6f18ce 9708
40087514 97092011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 9710
57f53182
PE
9711 Malloc failure behavior now depends on size of allocation.
9712 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
9713 * lisp.h: Change signatures accordingly.
9714 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
9715 All callers changed. (Bug#8762)
9716
9717 * gnutls.c: Use Emacs's memory allocators.
9718 Without this change, the gnutls library would invoke malloc etc.
9719 directly, which causes problems on non-SYNC_INPUT hosts, and which
9720 runs afoul of improving memory_full behavior. (Bug#8761)
9721 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
9722 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
9723 xfree instead of the default malloc, realloc, free.
9724 (Fgnutls_boot): No need to check for memory allocation failure,
9725 since xmalloc does that for us.
9726
ac32cd99 9727 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
9728 * category.c (hash_get_category_set):
9729 * ccl.c (ccl_driver):
9730 * charset.c (Fdefine_charset_internal):
9731 * charset.h (struct charset.hash_index):
9732 * composite.c (get_composition_id, gstring_lookup_cache)
9733 (composition_gstring_put_cache):
9734 * composite.h (struct composition.hash_index):
9735 * dispextern.h (struct image.hash):
9736 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
9737 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
9738 (hashfn_equal, hashfn_user_defined, make_hash_table)
9739 (maybe_resize_hash_table, hash_lookup, hash_put)
9740 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
9741 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
9742 (Fsxhash, Fgethash, Fputhash, Fmaphash):
9743 * image.c (make_image, search_image_cache, lookup_image)
9744 (xpm_put_color_table_h):
9745 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 9746 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 9747 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 9748 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
9749 * alloc.c (allocate_vectorlike):
9750 Check for overflow in vector size calculations.
9751 * ccl.c (ccl_driver):
9752 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
9753 * fns.c, image.c: Remove unnecessary static decls that would otherwise
9754 need to be updated by these changes.
40087514
PE
9755 * fns.c (make_hash_table, maybe_resize_hash_table):
9756 Check for integer overflow with large hash tables.
0de4bb68
PE
9757 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
9758 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
9759 (SXHASH_REDUCE): New macro.
9760 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
9761 Use it instead of discarding useful hash info with large hash values.
9762 (sxhash_float): New function.
9763 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
9764 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
9765 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
9766 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
9767 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
9768 Adjust signatures to match updated version of code.
9769 (consing_since_gc): Now EMACS_INT, since a single hash table can
9770 use more than INT_MAX bytes.
9771
698d32e2
DN
97722011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
9773
9774 Make it possible to build with GCC-4.6+ -O2 -flto.
9775
9776 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
9777
fd6fa53f
SM
97782011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
9779
9780 * minibuf.c (get_minibuffer, read_minibuf_unwind):
9781 Call minibuffer-inactive-mode.
9782
864db017
JB
97832011-05-31 Juanma Barranquero <lekktu@gmail.com>
9784
9785 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
9786 Update dependencies.
9787
2ad0baf4
DN
97882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9789
9790 * data.c (init_data): Remove code for UTS, this system is not
9791 supported anymore.
9792
4fcc2638
DN
97932011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9794
9795 Don't force ./temacs to start in terminal mode.
9796
9797 * frame.c (make_initial_frame): Initialize faces in all cases, not
9798 only when CANNOT_DUMP is defined.
9799 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
9800
c56e0fd5
DN
98012011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9802
9803 * dispnew.c (add_window_display_history): Use const for the string
9804 pointer. Remove declaration, not needed.
9805
333d54da 98062011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 9807
55d4c1b2 9808 Use 'inline', not 'INLINE'.
333d54da 9809 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
9810 * alloc.c, fontset.c (INLINE): Remove.
9811 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
9812 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
9813 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
9814 * gmalloc.c (register_heapinfo): Use inline unconditionally.
9815 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
9816
738db178
DN
98172011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
9818
9819 Make it possible to run ./temacs.
9820
9821 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
9822 syms_of_callproc does the same thing. Remove test for
9823 "initialized", do it in the caller.
9824 * emacs.c (main): Avoid calling set_initial_environment when dumping.
9825
620c53a6
SM
98262011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
9827
9828 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
9829 (read_minibuf): Use get_minibuffer.
9830 (syms_of_minibuf): Use DEFSYM.
9831 (Qmetadata): New var.
9832 * data.c (Qbuffer): Don't make it static.
9833 (syms_of_data): Use DEFSYM.
9834
e003a292
PE
98352011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9836
9837 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
9838 (CCL_CODE_MIN): New macro.
9839
ed008a6d
PE
98402011-05-30 Paul Eggert <eggert@cs.ucla.edu>
9841
3687c2ef
PE
9842 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
9843
ed008a6d
PE
9844 * eval.c (Qdebug): Now static.
9845 * lisp.h (Qdebug): Remove decl. This reverts a part of the
9846 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
9847 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
9848
d66c4c7c
CY
98492011-05-29 Chong Yidong <cyd@stupidchicken.com>
9850
9851 * image.c: Various fixes to ImageMagick code comments.
9852 (Fimagemagick_types): Doc fix.
9853
5fbc2025
PE
98542011-05-29 Paul Eggert <eggert@cs.ucla.edu>
9855
0196f88a
PE
9856 Minor fixes prompted by GCC 4.6.0 warnings.
9857
9858 * xselect.c (converted_selections, conversion_fail_tag): Now static.
9859
5fbc2025
PE
9860 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
9861 (x_clipboard_manager_save_all): Move extern decl to ...
9862 * xterm.h: ... here, so that it can be checked for consistency.
9863
1dd3c2d9
CY
98642011-05-29 Chong Yidong <cyd@stupidchicken.com>
9865
9866 * xselect.c (x_clipboard_manager_save_frame)
9867 (x_clipboard_manager_save_all): New functions.
9868 (Fx_clipboard_manager_save): Lisp function deleted.
9869
9870 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
9871 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
9872
9873 * xterm.h: Update prototype.
9874
5ba6571d
WX
98752011-05-28 William Xu <william.xwl@gmail.com>
9876
9877 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
9878 exiting (Bug#8239).
9879
3eaff834
JM
98802011-05-28 Jim Meyering <meyering@redhat.com>
9881
e1900994 9882 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
9883 * fns.c (to_uchar): Define.
9884 (crypto_hash_function): Use it to convert some newly-signed
9885 variables to unsigned, to avoid sign-extension bugs. For example,
9886 without this change, (md5 "truc") would evaluate to
9887 45723a2aff78ff4fff7fff1114760e62 rather than the expected
9888 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 9889 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 9890
0f6990a7
PE
98912011-05-27 Paul Eggert <eggert@cs.ucla.edu>
9892
9893 Integer overflow fixes.
c8a9ca5a 9894
08686060
PE
9895 * dbusbind.c: Serial number integer overflow fixes.
9896 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
9897 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
9898 to hold a serial number that is too large for a fixnum.
9899 (Fdbus_method_return_internal, Fdbus_method_error_internal):
9900 Check for serial numbers out of range. Decode any serial number
59568bf0 9901 that was so large that it became a float. (Bug#8722)
08686060 9902
2d1fc3c7
PE
9903 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
9904 (Fdbus_call_method, Fdbus_call_method_asynchronously):
9905 Use XFASTINT rather than XUINT when numbers are nonnegative.
9906 (xd_append_arg, Fdbus_method_return_internal):
9907 (Fdbus_method_error_internal): Likewise. Also, for unsigned
9908 arguments, check that Lisp number is nonnegative, rather than
59568bf0 9909 silently wrapping negative numbers around. (Bug#8722)
30217ff0 9910 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 9911 (Bug#8722)
2d1fc3c7 9912
c8a9ca5a
PE
9913 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
9914
519e1d69
PE
9915 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
9916
6df6ae42 9917 ccl: Add integer overflow checks.
30569699
PE
9918 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
9919 (IN_INT_RANGE): New macros.
9920 (ccl_driver): Use them to check for integer overflow when
9921 decoding a CCL program. Many of the new checks are whether XINT (x)
9922 fits in int; it doesn't always, on 64-bit hosts. The new version
9923 doesn't catch all possible integer overflows, but it's an
847044ea 9924 improvement. (Bug#8719)
30569699 9925
c11285dc
PE
9926 * alloc.c (make_event_array): Use XINT, not XUINT.
9927 There's no need for unsigned here.
9928
fdccd48e
PE
9929 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
9930 This follows up to the 2011-05-06 change that substituted uintptr_t
9931 for EMACS_INT. This case wasn't caught back then.
9932
37910ab2
PE
9933 Rework Fformat to avoid integer overflow issues.
9934 * editfns.c: Include <float.h> unconditionally, as it's everywhere
9935 now (part of C89). Include <verify.h>.
9936 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
9937 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
9938 (Fformat): Avoid the prepass trying to compute sizes; it was only
9939 approximate and thus did not catch overflow reliably. Instead, walk
9940 through the format just once, formatting and computing sizes as we go,
9941 checking for integer overflow at every step, and allocating a larger
9942 buffer as needed. Keep track separately whether the format is
9943 multibyte. Keep only the most-recently calculated precision, rather
9944 than them all. Record whether each argument has been converted to
9945 string. Use EMACS_INT, not int, for byte and char and arg counts.
9946 Support field widths and precisions larger than INT_MAX. Avoid
9947 sprintf's undefined behavior with conversion specifications such as %#d
9948 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
9949 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
9950 formatting out-of-range floating point numbers with int
9173deec 9951 formats. (Bug#8668)
37910ab2 9952
2e6578fb
PE
9953 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
9954
0ae6bdee
PE
9955 * data.c: Avoid integer truncation in expressions involving floats.
9956 * data.c: Include <intprops.h>.
9957 (arith_driver): When there's an integer overflow in an expression
9958 involving floating point, convert the integers to floating point
9959 so that the resulting value does not suffer from catastrophic
9960 integer truncation. For example, on a 64-bit host (* 4
9961 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
9962 Do not rely on undefined behavior after integer overflow.
9963
de883a70
PE
9964 merge count_size_as_multibyte, parse_str_to_multibyte
9965 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 9966 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
9967 Check for integer overflow.
9968 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
9969 since it's now a duplicate of the other. This is more of
9970 a character than a buffer op, so better that it's in character.c.
9971 * fns.c, print.c: Adjust to above changes.
9972
2ff916cb
PE
99732011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
9974
9975 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
9976
f1b54466
PE
99772011-05-27 Paul Eggert <eggert@cs.ucla.edu>
9978
fb1ac845
PE
9979 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
9980 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
9981 (x_clipboard_manager_save): Now static.
9982 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
9983
f1b54466
PE
9984 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
9985 (crypto_hash_function): Now static.
9986 Fix pointer signedness problems. Avoid unnecessary initializations.
9987
a9f737ee
CY
99882011-05-27 Chong Yidong <cyd@stupidchicken.com>
9989
9990 * termhooks.h (Vselection_alist): Make it terminal-local.
9991
9992 * terminal.c (create_terminal): Initialize it.
9993
9994 * xselect.c: Support for clipboard managers.
9995 (Vselection_alist): Move to termhooks.h as terminal-local var.
9996 (LOCAL_SELECTION): New macro.
9997 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
9998 (symbol_to_x_atom): Remove gratuitous arg.
9999 (x_handle_selection_request, lisp_data_to_selection_data)
10000 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
10001 (x_own_selection, x_get_local_selection, x_convert_selection):
10002 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
10003 (some_frame_on_display): Delete unused function.
10004 (Fx_own_selection_internal, Fx_get_selection_internal)
10005 (Fx_disown_selection_internal, Fx_selection_owner_p)
10006 (Fx_selection_exists_p): New optional frame arg.
10007 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10008 (x_handle_selection_clear): Don't treat other terminals with the
10009 same keyboard specially. Use the terminal-local Vselection_alist.
10010 (x_clear_frame_selections): Use Frun_hook_with_args.
10011
10012 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10013
10014 * xterm.h: Add support for those atoms.
10015
e067f0c1
CY
100162011-05-26 Chong Yidong <cyd@stupidchicken.com>
10017
10018 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10019 (converted_selections, conversion_fail_tag): New global variables.
10020 (x_selection_request_lisp_error): Free the above.
10021 (x_get_local_selection): Remove unnecessary code.
10022 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
10023 of converted selections stored in converted_selections.
10024 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
10025 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10026 (x_convert_selection): New function.
10027 (x_handle_selection_event): Simplify.
10028 (x_get_foreign_selection): Don't ignore incoming requests while
10029 waiting for an answer; this will fail when we implement
10030 SAVE_TARGETS, and seems unnecessary anyway.
10031 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10032 (Vx_sent_selection_functions): Doc fix.
10033
0f4aebc0
LL
100342011-05-26 Leo Liu <sdl.web@gmail.com>
10035
10036 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
10037
e61124cd
YM
100382011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10039
10040 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10041
10042 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10043 for fringe update if it has periodic bitmap.
ac389d0c 10044 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
10045 and fringe_bitmap_periodic_p.
10046
10047 * fringe.c (get_fringe_bitmap_data): New function.
10048 (draw_fringe_bitmap_1, update_window_fringes): Use it.
10049 (update_window_fringes): Record periodicity of fringe bitmap in glyph
10050 row. Mark glyph row for fringe update if periodicity changed.
10051
10052 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10053 for fringe update unless it has periodic bitmap.
10054
f16d9837
KH
100552011-05-25 Kenichi Handa <handa@m17n.org>
10056
10057 * xdisp.c (get_next_display_element): Set correct it->face_id for
10058 a static composition.
10059
e1b90ef6
LL
100602011-05-24 Leo Liu <sdl.web@gmail.com>
10061
10062 * deps.mk (fns.o):
10063 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10064
10065 * fns.c (crypto_hash_function, Fsha1): New function.
10066 (Fmd5): Use crypto_hash_function.
10067 (syms_of_fns): Add Ssha1.
10068
7400048f
PE
100692011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10070
10071 * gnutls.c: Remove unused macros.
10072 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10073 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10074 Remove macros that are defined and never used.
10075 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10076
abb71cf4
CY
100772011-05-22 Chong Yidong <cyd@stupidchicken.com>
10078
10079 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10080 (Fx_get_selection_internal): Minor cleanup.
10081 (Fx_own_selection_internal): Rename arguments for consistency with
10082 select.el.
10083
6307db39
PE
100842011-05-22 Paul Eggert <eggert@cs.ucla.edu>
10085
10086 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10087
f3d4e0a4
CY
100882011-05-22 Chong Yidong <cyd@stupidchicken.com>
10089
10090 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10091
4d8ade89
YM
100922011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10093
10094 * dispnew.c (scrolling_window): Don't exclude the case that the
10095 last enabled row in the desired matrix touches the bottom boundary.
10096
32078c8d
GM
100972011-05-21 Glenn Morris <rgm@gnu.org>
10098
10099 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
10100 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10101 and add some more files.
32078c8d 10102
7285dc67
EZ
101032011-05-20 Eli Zaretskii <eliz@gnu.org>
10104
10105 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10106 report_file_error introduced by the change from 2011-05-07.
10107
89d1bd22
PE
101082011-05-20 Paul Eggert <eggert@cs.ucla.edu>
10109
10110 * systime.h (Time): Define only if emacs is defined.
10111 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10112 where the include path doesn't have X11/X.h by default. See
10113 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10114
cd394be1 101152011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
10116
10117 * composite.c (find_automatic_composition): Fix previous change.
10118
b9704ad9
GM
101192011-05-20 Glenn Morris <rgm@gnu.org>
10120
10121 * lisp.mk: New file, split from Makefile.in.
10122 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10123 (shortlisp): Remove.
10124 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10125
4a720484
GM
101262011-05-19 Glenn Morris <rgm@gnu.org>
10127
10128 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10129 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10130 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10131 (lisp): Set the order to that of loadup.el.
10132 (shortlisp): Make it a copy of $lisp.
10133 (SOME_MACHINE_LISP): Remove.
10134 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10135 Use just $shortlisp, not $SOME_MACHINE_LISP too.
10136
a28d4396
KH
101372011-05-18 Kenichi Handa <handa@m17n.org>
10138
10139 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10140 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10141 (find_automatic_composition): Mostly rewrite for efficiency.
10142
a2b1fa8e
JB
101432011-05-18 Juanma Barranquero <lekktu@gmail.com>
10144
10145 * makefile.w32-in: Update dependencies.
10146
8e1f5610
CS
101472011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
10148
10149 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 10150 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 10151
7025ee00 101522011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 10153
cdfa6eab
PE
10154 Fix some integer overflow issues, such as string length overflow.
10155
06d6db33
PE
10156 * insdel.c (count_size_as_multibyte): Check for string overflow.
10157
2b4560a8
PE
10158 * character.c (lisp_string_width): Check for string overflow.
10159 Use EMACS_INT, not int, for string indexes and lengths; in
10160 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
10161 the resulting string length overflows an EMACS_INT; instead,
10162 report a string overflow if no precision given. When checking for
10163 precision exhaustion, use a check that cannot possibly have
10164 integer overflow. (Bug#8675)
10165 * character.h (lisp_string_width): Adjust to new signature.
10166
cb93f9be
PE
10167 * alloc.c (string_overflow): New function.
10168 (Fmake_string): Use it. This doesn't change behavior, but saves
10169 a few bytes and will simplify future changes.
10170 * character.c (string_escape_byte8): Likewise.
10171 * lisp.h (string_overflow): New decl.
10172
1a1f3366
PE
10173 Fixups, following up to the user-interface timestamp change.
10174 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10175 for UI timestamps, instead of unsigned long.
9fbd6841
PE
10176 * msdos.c (mouse_get_pos): Likewise.
10177 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
10178 * w32gui.h (Time): Define by including "systime.h" rather than by
10179 declaring it ourselves. (Bug#8664)
10180
d4e3e4d3
PE
10181 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10182 * image.c (clear_image_cache): Likewise.
10183
f6a24d19
PE
10184 * term.c (term_mouse_position): Don't assume time_t wraparound.
10185
08dc5ae6
PE
10186 Be more systematic about user-interface timestamps.
10187 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
10188 and sometimes 'EMACS_UINT', to represent these timestamps.
10189 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
10190 This makes the code easier to follow, and makes it easier to catch
10191 integer overflow bugs such as Bug#8664.
10192 * frame.c (Fmouse_position, Fmouse_pixel_position):
10193 Use Time, not unsigned long, for user-interface timestamps.
10194 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10195 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10196 * keyboard.h (last_event_timestamp): Likewise.
10197 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10198 * menu.h (xmenu_show): Likewise.
10199 * term.c (term_mouse_position): Likewise.
10200 * termhooks.h (struct input_event.timestamp): Likewise.
10201 (struct terminal.mouse_position_hook): Likewise.
10202 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10203 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10204 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
10205 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10206 what it was before.
10207 * menu.h, termhooks.h: Include "systime.h", for Time.
10208
8e55734a
PE
10209 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10210 Don't assume that the difference between two unsigned long values
10211 can fit into an integer. At this point, we know button_down_time
10212 <= event->timestamp, so the difference must be nonnegative, so
10213 there's no need to cast the result if double-click-time is
10214 nonnegative, as it should be; check that it's nonnegative, just in
10215 case. This bug is triggered when events are more than 2**31 ms
86db42d2 10216 apart (about 25 days). (Bug#8664)
8e55734a 10217
841f1b75 10218 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 10219 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 10220
3e26f69c
PE
10221 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10222 that always fit in int. Use a sentinel instead of a counter, to
10223 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
10224 * frame.h (struct frame): Use int for menu_bar_items_used
10225 instead of EMACS_INT, since it always fits in int.
3e26f69c 10226
5cc152c0
PE
10227 * menu.c (grow_menu_items): Check for int overflow.
10228
d89eb65e
PE
10229 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10230
5235bd3e
PE
10231 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10232 Before, the code was not consistent. These values cannot exceed
10233 2**31 - 1 so there's no need to make them unsigned.
10234 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10235 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10236 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10237 as modifiers.
10238 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10239
bc827e23
PE
10240 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10241 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10242 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10243 presumably because the widths might not match.
10244
78eb494e
PE
10245 * window.c (size_window): Avoid needless test at loop start.
10246
04f2d78b
CB
102472011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
10248
10249 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10250
d2fc7e3d 102512011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
10252
10253 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10254
d2fc7e3d 102552011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
10256
10257 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10258 `width' to `bar_area_x' and `bar_area_width', respectively.
10259 (x_scroll_run): Take account of fringe background extension.
10260
04f2d78b
CB
10261 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10262 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
10263 `bar_area_width', respectively.
10264 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10265 background extension.
10266
79b70037
GM
102672011-05-10 Jim Meyering <meyering@redhat.com>
10268
10269 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10270
2f142cc5
JB
102712011-05-10 Juanma Barranquero <lekktu@gmail.com>
10272
10273 * image.c (Finit_image_library): Return t for built-in image types,
10274 like pbm and xbm. (Bug#8640)
10275
57679c86
AS
102762011-05-09 Andreas Schwab <schwab@linux-m68k.org>
10277
10278 * w32menu.c (set_frame_menubar): Fix submenu allocation.
10279
888c9e86
EZ
102802011-05-07 Eli Zaretskii <eliz@gnu.org>
10281
b0512a1d
EZ
10282 * w32console.c (Fset_screen_color): Doc fix.
10283 (Fget_screen_color): New function.
10284 (syms_of_ntterm): Defsubr it.
10285
7285dc67
EZ
10286 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10287 unlink the temporary file if Fcall_process didn't create it in the
10288 first place.
10289 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10290 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
10291 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10292 cue to call_process_cleanup not to close that handle.
10293
4d3fcc8e
BK
102942011-05-07 Ben Key <bkey76@gmail.com>
10295
10296 * makefile.w32-in: The bootstrap-temacs rule now makes use of
10297 one of two shell specific rules, either bootstrap-temacs-CMD or
10298 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
10299 to the previous implementation of the bootstrap-temacs rule.
10300 The bootstrap-temacs-CMD rule is similar to the previous
10301 implementation of the bootstrap-temacs rule except that it
10302 makes use of the ESC_CFLAGS variable instead of the CFLAGS
10303 variable.
10304
10305 These changes, along with some changes to nt/configure.bat,
10306 nt/gmake.defs, and nt/nmake.defs, are required to extend my
10307 earlier fix to add support for --cflags and --ldflags options
10308 that include quotes so that it works whether make uses cmd or
10309 sh as the shell.
10310
b4289b64
MA
103112011-05-06 Michael Albinus <michael.albinus@gmx.de>
10312
10313 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10314 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10315 is a constant.
10316 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10317 a string. Handle both cases.
10318 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10319 (Fdbus_register_method): Use Qinvalid_function.
10320
af4c0e28
JB
103212011-05-06 Juanma Barranquero <lekktu@gmail.com>
10322
10323 * makefile.w32-in: Update dependencies.
10324 (LISP_H): Add inttypes.h and stdin.h.
10325 (PROCESS_H): Add unistd.h.
10326
c51453d9
EZ
103272011-05-06 Eli Zaretskii <eliz@gnu.org>
10328
10329 * lread.c: Include limits.h (fixes the MS-Windows build broken by
10330 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10331
8ff0ac3c 103322011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 10333
4c4b566b
PE
10334 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10335
aab2b9b5
PE
10336 * term.c (vfatal): Remove stray call to va_end.
10337 It's not needed and the C Standard doesn't allow it here anyway.
10338
c378da0b
PE
10339 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10340 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
10341
288b08c7
PE
10342 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10343 bytes.
10344
e3601888
PE
10345 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10346
db6c0e74
PE
10347 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10348
dd5963ea
PE
10349 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10350
88c9450f
PE
10351 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10352
2f9442b8
PE
10353 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10354
c032b5f8
PE
10355 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10356 * charset.c (Fdefine_charset_internal): Don't initialize
10357 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 10358 32-bit int (Bug#8600).
a108c10b
PE
10359
10360 * lread.c (read_integer): Be more consistent with string-to-number.
10361 Use string_to_number to do the actual conversion; this avoids
10362 rounding errors and fixes some other screwups. Without this fix,
10363 for example, #x1fffffffffffffff was misread as -2305843009213693952.
10364 (digit_to_number): Move earlier, for benefit of read_integer.
10365 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 10366 not a digit in any supported base. (Bug#8602)
a108c10b 10367
ad5f9eea
PE
10368 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10369
aec1708a
PE
10370 * dispnew.c (scrolling_window): Return 1 if we scrolled,
10371 to match comment at start of function. This also removes a
10372 GCC warning about overflow in a 32+64-bit port.
10373
47be4ab5
PE
10374 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10375
371cac43
PE
10376 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10377 Reported by Stefan Monnier in
10378 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
10379 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10380 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 10381
d01a7826
PE
10382 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
10383 (EMACS_UINTPTR): Likewise, with uintptr_t.
10384
7fd47d5c
PE
10385 * lisp.h: Prefer 64-bit EMACS_INT if available.
10386 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10387 on 32-bit hosts that have 64-bit int, so that they can access
10388 large files.
122b0c86
PE
10389 However, temporarily disable this change unless the temporary
10390 symbol WIDE_EMACS_INT is defined.
7fd47d5c 10391
8727937b
PE
10392 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10393
8ac068ac
PE
10394 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10395 This removes an assumption that EMACS_INT and long are the same
10396 width as pointers. The assumption is true for Emacs porting targets
10397 now, but we want to make other targets possible.
10398 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10399 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10400 In the rest of the code, change types of integers that hold casted
10401 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10402 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10403 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10404 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10405 No need to cast type when ORing.
10406 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10407 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10408 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10409 assume EMACS_INT is the same width as char *.
10410 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10411 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10412 Remove no-longer-needed casts.
10413 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10414 (xg_tool_bar_help_callback, xg_make_tool_item):
10415 Use EMACS_INTPTR to hold an integer
10416 that will be cast to void *; this can avoid a GCC warning
10417 if EMACS_INT is not the same width as void *.
10418 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10419 * xdisp.c (display_echo_area_1, resize_mini_window_1):
10420 (current_message_1, set_message_1):
10421 Use a local to convert to proper width without a cast.
10422 * xmenu.c (dialog_selection_callback): Likewise.
10423
ede49d71
PE
10424 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10425 Also, don't assume VALBITS / RAND_BITS is less than 5,
10426 and don't rely on undefined behavior when shifting a 1 left into
10427 the sign bit.
10428 * lisp.h (get_random): Change signature to match.
10429
2f30ecd0
PE
10430 * lread.c (hash_string): Use size_t, not int, for hash computation.
10431 Normally we prefer signed values; but hashing is special, because
10432 it's better to use unsigned division on hash table sizes so that
10433 the remainder is nonnegative. Also, size_t is the natural width
10434 for hashing into memory. The previous code used 'int', which doesn't
10435 retain enough info to hash well into very large tables.
10436 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10437
2a866e7b
PE
10438 * dbusbind.c: Don't possibly lose pointer info when converting.
10439 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10440 Use XPNTR rather than XHASH, so that the high-order bits of
10441 the pointer aren't lost when converting through void *.
10442
51639eac
PE
10443 * eval.c (Fautoload): Don't double-shift a pointer.
10444
92394119
PE
10445 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10446
dbdb9a7c
JB
104472011-05-06 Juanma Barranquero <lekktu@gmail.com>
10448
10449 * gnutls.c (DEF_GNUTLS_FN):
10450 * image.c (DEF_IMGLIB_FN): Make function pointers static.
10451
db7a0b4f
AS
104522011-05-05 Andreas Schwab <schwab@linux-m68k.org>
10453
10454 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10455 marker. (Bug#8610)
10456
cd394be1 104572011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
10458
10459 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
10460 New version that can reserve upto 2GB of heap space.
10461
f7ff1b0f 104622011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
10463
10464 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10465
639c109b
TZ
104662011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
10467
10468 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10469 `gnutls_certificate_set_x509_key_file'.
10470
d2127135
JB
104712011-05-05 Juanma Barranquero <lekktu@gmail.com>
10472
10473 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
10474 Update dependencies.
10475
e968f4f3
JB
104762011-05-04 Juanma Barranquero <lekktu@gmail.com>
10477
10478 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
10479 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10480 Remove unused parameter `fildes'.
10481 * process.c (read_process_output, send_process): Don't pass it.
10482
84d358f0
JB
104832011-05-04 Juanma Barranquero <lekktu@gmail.com>
10484
10485 Fix previous change: the library cache is defined in w32.c.
10486 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
10487 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
10488
0898ca10
JB
104892011-05-04 Juanma Barranquero <lekktu@gmail.com>
10490
10491 Implement dynamic loading of GnuTLS on Windows.
10492
10493 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
10494 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
10495 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10496 Declare.
10497
10498 * gnutls.c (Qgnutls_dll): Define.
10499 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
10500 (gnutls_*): Declare function pointers.
10501 (init_gnutls_functions): New function to initialize function pointers.
10502 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
10503 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
10504 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10505 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
10506 (emacs_gnutls_write, emacs_gnutls_read)
10507 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
10508 (Fgnutls_available_p): New function.
10509 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
10510 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
10511 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
10512
10513 * image.c: Include w32.h.
10514 (Vimage_type_cache): Delete.
10515 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
10516 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
10517 (w32_delayed_load): Move to w32.c.
10518
10519 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
10520
10521 * w32.c (QCloaded_from, Vlibrary_cache): Define.
10522 (w32_delayed_load): Move from image.c. When loading a library, record
10523 its filename in the :loaded-from property of the library id.
10524 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
10525 Initialize and staticpro them.
10526 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
10527
10528 * process.c: Include lisp.h before w32.h, not after.
10529 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
10530 instead of gnutls_record_check_pending.
10531
10532 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
10533
ff4de4aa
TZ
105342011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
10535
10536 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
10537 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
10538 as passed in.
10539
abe95abb
JD
105402011-05-03 Jan Djärv <jan.h.d@swipnet.se>
10541
10542 * xterm.c (x_set_frame_alpha): Do not set property on anything
10543 else than FRAME_X_OUTER_WINDOW (Bug#8608).
10544
e16e55d4
JB
105452011-05-02 Juanma Barranquero <lekktu@gmail.com>
10546
10547 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
10548
bafcf6a5
JB
105492011-05-02 Juanma Barranquero <lekktu@gmail.com>
10550
10551 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
10552 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
10553 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
10554 (gnutls_global_initialized, Qgnutls_bootprop_priority)
10555 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
10556 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
10557 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
10558 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
10559 (Qgnutls_bootprop_callbacks_verify): Make static.
10560
e7a6747f
AS
105612011-05-01 Andreas Schwab <schwab@linux-m68k.org>
10562
19ed11ba
AS
10563 * callproc.c: Indentation fixup.
10564
e7a6747f 10565 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
10566 (wait_for_termination, interruptible_wait_for_termination):
10567 Move after wait_for_termination_1.
e7a6747f 10568
1ef14cb4
LMI
105692011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
10570
10571 * sysdep.c (interruptible_wait_for_termination): New function
10572 which is like wait_for_termination, but allows keyboard
10573 interruptions.
10574
10575 * callproc.c (Fcall_process): Add (:file "file") as an option for
10576 the STDOUT buffer.
10577 (Fcall_process_region): Ditto.
10578
330d880c
EZ
105792011-04-30 Eli Zaretskii <eliz@gnu.org>
10580
8db90b73
EZ
10581 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
10582 rather than `XVECTOR (FOO)->size'.
10583
330d880c
EZ
10584 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
10585 inttypes.h, as a gnulib replacement is used if it not available in
10586 system headers.
10587
15cbd324
EZ
105882011-04-21 Eli Zaretskii <eliz@gnu.org>
10589
10590 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
10591 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
10592 of MOST_POSITIVE_FIXNUM. (Bug#8528)
10593
10594 * coding.c (coding_alloc_by_realloc): Error out if destination
10595 will grow beyond MOST_POSITIVE_FIXNUM.
10596 (decode_coding_emacs_mule): Abort if there isn't enough place in
10597 charbuf for the composition carryover bytes. Reserve an extra
10598 space for up to 2 characters produced in a loop.
10599 (decode_coding_iso_2022): Abort if there isn't enough place in
10600 charbuf for the composition carryover bytes.
10601
106022011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 10603
ae940cca
EZ
10604 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
10605 aborting when %lld or %lll format is passed.
10606 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
10607 %llo or %llx format is passed. (Bug#8545)
10608
03ab8921
EZ
10609 * window.c (window_scroll_line_based): Use a marker instead of
10610 simple variables to record original value of point. (Bug#7952)
10611
afda1437
EZ
10612 * doprnt.c (doprnt): Fix the case where a multibyte sequence
10613 produced by %s or %c overflows available buffer space. (Bug#8545)
10614
f76dee0c
PE
106152011-04-28 Paul Eggert <eggert@cs.ucla.edu>
10616
10617 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 10618 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 10619
fdc5744d
JB
106202011-04-28 Juanma Barranquero <lekktu@gmail.com>
10621
10622 * w32.c (init_environment): Warn about defaulting HOME to C:\.
10623
638f053a
JB
106242011-04-28 Juanma Barranquero <lekktu@gmail.com>
10625
10626 * keyboard.c (Qdelayed_warnings_hook): Define.
10627 (command_loop_1): Run `delayed-warnings-hook'
10628 if Vdelayed_warnings_list is non-nil.
10629 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
10630 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
10631
d178f871
EZ
106322011-04-28 Eli Zaretskii <eliz@gnu.org>
10633
10634 * doprnt.c (doprnt): Don't return value smaller than the buffer
10635 size if the message was truncated. (Bug#8545).
10636
b124fd93
JB
106372011-04-28 Juanma Barranquero <lekktu@gmail.com>
10638
10639 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
10640 (Fx_window_property): #if-0 the whole functions, not just the bodies.
10641
e810457d
PE
106422011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10643
10644 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
10645
ea51cceb
JB
106462011-04-27 Juanma Barranquero <lekktu@gmail.com>
10647
10648 * makefile.w32-in: Update dependencies.
10649
94dcfacf
EZ
106502011-04-27 Eli Zaretskii <eliz@gnu.org>
10651
10652 Improve `doprnt' and its usage. (Bug#8545)
10653 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
10654 `format_end'. Remove support for %l as a conversion specifier.
10655 Don't use xrealloc. Improve diagnostics when the %l size modifier
10656 is used. Update the commentary.
10657
10658 * eval.c (verror): Simplify calculation of size_t.
10659
10660 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
10661 messages.
10662
f61f41d7
PE
106632011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
10664
10665 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
10666 change.
10667
96fb4434
PE
106682011-04-27 Paul Eggert <eggert@cs.ucla.edu>
10669
10670 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
10671 This makes this file independent of the recent pseudovector change.
10672
671875da 106732011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 10674
69e9b5a3
PE
10675 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
10676
b5f869a7 10677 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 10678 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 10679 Remove unused local.
c8926152 10680 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 10681
841a1577 10682 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
10683 GCC 4.6.0 optimizes based on type-based alias analysis.
10684 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
10685 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
10686 != &v->size, and therefore "v->size = 1; b->size = 2; return
10687 v->size;" must therefore return 1. This assumption is incorrect
10688 for Emacs, since it type-puns struct Lisp_Vector * with many other
10689 types. To fix this problem, this patch adds a new type struct
f904488f 10690 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
10691 and pseudovectors, and helps optimizing compilers not get fooled
10692 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
10693 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
10694 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
10695 the size member.
eab3844f
PE
10696 (XSETPVECTYPE): Rewrite in terms of new macro.
10697 (XSETPVECTYPESIZE): New macro, specifying both type and size.
10698 This is a bit clearer, and further avoids the possibility of
10699 undesirable aliasing.
10700 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 10701 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
10702 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
10703 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
10704 (ASIZE): Now uses header.size rather than size.
10705 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
10706 to avoid the hassle of writing XVECTOR (foo)->header.size.
10707 (struct vectorlike_header): New type.
eab3844f
PE
10708 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
10709 object, to help avoid aliasing.
10710 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
10711 (SUBRP): Likewise, since Lisp_Subr is a special case.
10712 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
10713 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
10714 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 10715 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
10716 changed to be "header.size" and "header.next".
10717 * buffer.h (struct buffer): Likewise.
10718 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
10719 * frame.h (struct frame): Likewise.
10720 * process.h (struct Lisp_Process): Likewise.
10721 * termhooks.h (struct terminal): Likewise.
10722 * window.c (struct save_window_data, struct saved_window): Likewise.
10723 * window.h (struct window): Likewise.
10724 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
10725 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
10726 * buffer.c (init_buffer_once): Likewise.
10727 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
10728 special case.
10729 * process.c (Fformat_network_address): Use local var for size,
10730 for brevity.
10731
0df1eac5
PE
10732 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
10733
847ab9d1 10734 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
10735 * data.c (atof): Remove decl; no longer used or needed.
10736 (digit_to_number): Move to lread.c.
10737 (Fstring_to_number): Use new string_to_number function, to be
10738 consistent with how the Lisp reader treats infinities and NaNs.
10739 Do not assume that floating-point numbers represent EMACS_INT
10740 without losing information; this is not true on most 64-bit hosts.
10741 Avoid double-rounding errors, by insisting on integers when
10742 parsing non-base-10 numbers, as the documentation specifies.
10743 * lisp.h (string_to_number): New decl, replacing ...
10744 (isfloat_string): Remove.
bc0a5c13 10745 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 10746 (read1): Do not accept +. and -. as integers; this
452f4150
PE
10747 appears to have been a coding error. Similarly, do not accept
10748 strings like +-1e0 as floating point numbers. Do not report
10749 overflow for integer overflows unless the base is not 10 which
10750 means we have no simple and reliable way to continue.
10751 Break out the floating-point parsing into a new
10752 function string_to_number, so that Fstring_to_number parses
10753 floating point numbers consistently with the Lisp reader.
04f2d78b 10754 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
10755 (E_CHAR, EXP_INT): Remove, replacing with ...
10756 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
10757 (string_to_number): New function, replacing isfloat_string.
10758 This function checks for valid syntax and produces the resulting
10759 Lisp float number too. Rework it so that string-to-number
bc0a5c13 10760 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
10761 so that overflow for non-base-10 numbers is reported only when
10762 there's no portable and simple way to convert to floating point.
452f4150 10763
67769ffc
PE
10764 * textprop.c (set_text_properties_1): Rewrite for clarity,
10765 and to avoid GCC warning about integer overflow.
10766
c20db43f
PE
10767 * intervals.h (struct interval): Use EMACS_INT for members
10768 where EMACS_UINT might cause problems. See
10769 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
10770 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
10771 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
10772 All uses changed.
37aa2f85
PE
10773 (offset_intervals): Tell GCC not to worry about length overflow
10774 when negating a negative length.
c20db43f 10775
2538aa2f
PE
10776 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
10777 (overrun_check_free): Likewise.
10778
f2d3008d
PE
10779 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
10780 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
10781 word size.
10782
ec8df744
PE
10783 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10784 (gnutls_make_error): Rename local to avoid shadowing.
10785 (gnutls_emacs_global_deinit): ifdef out; not used.
10786 (Fgnutls_boot): Use const for pointer to readonly storage.
10787 Comment out unused local. Fix pointer signedness problems.
10788
640ee02d
PE
10789 * lread.c (openp): Don't stuff size_t into an 'int'.
10790 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
10791 about possible signed overflow.
10792
6048fb2a
PE
10793 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10794 (GDK_KEY_g): Don't define if already defined.
10795 (xg_prepare_tooltip): Avoid pointer signedness problem.
10796 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
10797
fa3c87e1
PE
10798 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
10799 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
10800
2172544b
PE
10801 * xfns.c (Fx_window_property): Simplify a bit,
10802 to make a bit faster and to avoid GCC 4.6.0 warning.
10803 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
10804
9b821a21
PE
10805 * fns.c (internal_equal): Don't assume size_t fits in int.
10806
3c616cfa
PE
10807 * alloc.c (compact_small_strings): Tighten assertion a little.
10808
c2982e87
PE
10809 Replace pEd with more-general pI, and fix some printf arg casts.
10810 * lisp.h (pI): New macro, generalizing old pEd macro to other
10811 conversion specifiers. For example, use "...%"pI"d..." rather
10812 than "...%"pEd"...".
10813 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 10814 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
10815 * alloc.c (check_pure_size): Don't overflow by converting size to int.
10816 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
10817 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
10818 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
10819 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
10820 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
10821 64-bit hosts.
10822 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
10823 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
10824 * print.c (safe_debug_print, print_object): Likewise.
10825 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
10826 to int.
6f04d126
PE
10827 Use pI instead of if-then-else-abort. Use %p to avoid casts,
10828 avoiding the 0 flag, which is not portable.
c2982e87
PE
10829 * process.c (Fmake_network_process): Use pI to avoid cast.
10830 * region-cache.c (pp_cache): Likewise.
10831 * xdisp.c (decode_mode_spec): Likewise.
10832 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
10833 behavior on 64-bit hosts with printf arg.
6f04d126 10834 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
10835 (x_stop_queuing_selection_requests): Likewise.
10836 (x_get_window_property): Don't truncate byte count to an 'int'
10837 when tracing.
0b432f21 10838
5e073ec7
PE
10839 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
10840 here, since it parses constructs like leading '-' and spaces,
10841 which are not wanted; and it overflows with large numbers.
10842 Instead, simply match F[0-9]+, which is what is wanted anyway.
10843
36372bf9
PE
10844 * alloc.c: Remove unportable assumptions about struct layout.
10845 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
10846 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
10847 (allocate_vectorlike, make_pure_vector): Use the new macros,
10848 plus offsetof, to remove unportable assumptions about struct layout.
10849 These assumptions hold on all porting targets that I know of, but
10850 they are not guaranteed, they're easy to remove, and removing them
10851 makes further changes easier.
10852
0b432f21
PE
10853 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
10854 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
10855 (string_overrun_cookie): Now const. Use initializers that
10856 don't formally overflow signed char, to avoid warnings.
000098c1
PE
10857 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
10858 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
10859 (allocate_buffer): Don't assume sizeof (struct buffer) is a
10860 multiple of sizeof (EMACS_INT); it need not be, if
10861 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 10862 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 10863
895009e1
JB
108642011-04-26 Juanma Barranquero <lekktu@gmail.com>
10865
10866 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
10867
6a7a1b0b
TZ
108682011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
10869
10870 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 10871 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
10872 Reported by Paul Eggert <eggert@cs.ucla.edu>.
10873
841a1577 108742011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
10875
10876 * lisp.h (Qdebug): List symbol.
895009e1 10877 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
10878 * keyboard.c (debug-on-event): New variable.
10879 (handle_user_signal): Break into debugger when debug-on-event
10880 matches the current signal symbol.
10881
f2d3ba6f
DN
108822011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
10883
10884 * alloc.c (check_sblock, check_string_bytes)
10885 (check_string_free_list): Convert to standard C.
10886
42ce4c63
TZ
108872011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
10888
10889 * w32.c (emacs_gnutls_push): Fix typo.
10890
825cd63c
EZ
108912011-04-25 Eli Zaretskii <eliz@gnu.org>
10892
fb11d64d
EZ
10893 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
10894 "cast to pointer from integer of different size".
10895
825cd63c
EZ
10896 Improve doprnt and its use in verror. (Bug#8545)
10897 * doprnt.c (doprnt): Document the set of format control sequences
10898 supported by the function. Use SAFE_ALLOCA instead of always
10899 using `alloca'.
10900
10901 * eval.c (verror): Don't limit the buffer size at size_max-1, that
10902 is one byte too soon. Don't use xrealloc; instead xfree and
10903 xmalloc anew.
10904
e061a11b
TZ
109052011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
10906
10907 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
10908 callbacks stage.
10909
10910 * gnutls.c: Renamed global_initialized to
10911 gnutls_global_initialized. Added internals for the
10912 :verify-hostname-error, :verify-error, and :verify-flags
10913 parameters of `gnutls-boot' and documented those parameters in the
10914 docstring. Start callback support.
9173deec
JB
10915 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
10916 unless a fatal error occurred. Call gnutls_alert_send_appropriate
10917 on error. Return error code.
e061a11b
TZ
10918 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
10919 (emacs_gnutls_read): Likewise.
10920 (Fgnutls_boot): Return handshake error code.
10921 (emacs_gnutls_handle_error): New function.
10922 (wsaerror_to_errno): Likewise.
10923
10924 * w32.h (emacs_gnutls_pull): Add prototype.
10925 (emacs_gnutls_push): Likewise.
10926
10927 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
10928 (emacs_gnutls_push): Likewise.
10929
109302011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
10931
10932 * process.c (wait_reading_process_output): Check if GnuTLS
10933 buffered some data internally if no FDs are set for TLS
10934 connections.
10935
10936 * makefile.w32-in (OBJ2): Add gnutls.$(O).
10937 (LIBS): Link to USER_LIBS.
10938 ($(BLD)/gnutls.$(0)): New target.
10939
fa6996bc
EZ
109402011-04-24 Eli Zaretskii <eliz@gnu.org>
10941
eb35682e
EZ
10942 * xdisp.c (handle_single_display_spec): Rename the
10943 display_replaced_before_p argument into display_replaced_p, to
10944 make it consistent with the commentary. Fix typos in the
10945 commentary.
10946
e2ad650c
EZ
10947 * textprop.c (syms_of_textprop): Remove dead code.
10948 (copy_text_properties): Delete obsolete commentary about an
10949 interface that was deleted long ago. Fix typos in the description
10950 of arguments.
10951
1b2de274
EZ
10952 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
10953 to changes in oldXMenu/XMenu.h from 2011-04-16.
10954 <menu_help_message, prev_menu_help_message>: Constify.
10955 (IT_menu_make_room): menu->help_text is now `const char **';
10956 adjust.
10957
10958 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
10959 to changes in oldXMenu/XMenu.h from 2011-04-16.
10960 (struct XMenu): Declare `help_text' `const char **'.
10961
10962 * xfaces.c <Qunspecified>: Make extern again.
10963
10964 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 10965 required by POSIX.
1b2de274 10966
762b15be
EZ
10967 * doc.c (get_doc_string): Improve the format passed to `error'.
10968
10969 * doprnt.c (doprnt): Improve commentary.
10970
10971 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
10972
10973 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
10974 them with etags.
10975
f1052e5d
EZ
10976 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
10977 changes in globals.h immediately force recompilation.
762b15be
EZ
10978 (TAGS): Depend on $(CURDIR)/m/intel386.h and
10979 $(CURDIR)/s/ms-w32.h.
10980 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 10981
fa6996bc
EZ
10982 * character.c (Fchar_direction): Function deleted.
10983 (syms_of_character): Don't defsubr it.
10984 <char-direction-table>: Deleted.
10985
e6c3da20
EZ
109862011-04-23 Eli Zaretskii <eliz@gnu.org>
10987
10988 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
10989 * doprnt.c: Include limits.h.
10990 (SIZE_MAX): New macro.
04f2d78b
CB
10991 (doprnt): Return a size_t value. 2nd arg is now size_t.
10992 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
10993 Improve overflow protection. Support `l' modifier for integer
10994 conversions. Support %l conversion. Don't assume an EMACS_INT
10995 argument for integer conversions and for %c.
10996
10997 * lisp.h (doprnt): Restore prototype.
10998
10999 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11000 $(SRC)/character.h.
11001
11002 * Makefile.in (base_obj): Add back doprnt.o.
11003
11004 * deps.mk (doprnt.o): Add back prerequisites.
11005 (callint.o): Depend on character.h.
11006
11007 * eval.c (internal_lisp_condition_case): Include the handler
11008 representation in the error message.
11009 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
11010 when breaking from the loop.
11011
11012 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11013
11014 * callint.c (Fcall_interactively): When displaying error message
11015 about invalid control letter, pass the character's codepoint, not
11016 a pointer to its multibyte form. Improve display of the character
11017 in octal and display also its hex code.
11018
11019 * character.c (char_string): Use %x to display the (unsigned)
11020 codepoint of an invalid character, to avoid displaying a bogus
11021 negative value.
11022
11023 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11024 `error', not SYMBOL_NAME itself.
11025
11026 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11027 character arguments to `error'.
11028
11029 * charset.c (check_iso_charset_parameter): Fix incorrect argument
11030 to `error' in error message about FINAL_CHAR argument. Make sure
11031 FINAL_CHAR is a character, and use %c when it is passed as
11032 argument to `error'.
11033
4ffd0d6b 110342011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
11035
11036 * s/ms-w32.h (localtime): Redirect to sys_localtime.
11037
11038 * w32.c: Include <time.h>.
11039 (sys_localtime): New function.
11040
4ffd0d6b 110412011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
11042
11043 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11044
4ffd0d6b 11045 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 11046
4ffd0d6b 110472011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 11048
4ffd0d6b
GM
11049 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11050 zombies (Bug#8467).
aac0c6e3 11051
04c56954
EZ
110522011-04-19 Eli Zaretskii <eliz@gnu.org>
11053
11054 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11055 gl_state.e_property when gl_state.object is Qt.
11056
11057 * insdel.c (make_gap_larger): Remove limitation of buffer size
11058 to <= INT_MAX.
11059
16a43933
CY
110602011-04-18 Chong Yidong <cyd@stupidchicken.com>
11061
11062 * xdisp.c (lookup_glyphless_char_display)
11063 (produce_glyphless_glyph): Handle cons cell entry in
11064 glyphless-char-display.
11065 (Vglyphless_char_display): Document it.
11066
11067 * term.c (produce_glyphless_glyph): Handle cons cell entry in
11068 glyphless-char-display.
11069
4581706e
CY
110702011-04-17 Chong Yidong <cyd@stupidchicken.com>
11071
11072 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11073
11074 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11075
11076 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11077 definition for no-X builds.
11078
4887c6e2 110792011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 11080
fd35b6f9
PE
11081 Static checks with GCC 4.6.0 and non-default toolkits.
11082
5c1ccb01
PE
11083 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11084
006c5daa
PE
11085 * process.c (keyboard_bit_set): Define only if SIGIO.
11086 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11087 (send_process): Repair possible setjmp clobbering.
11088
efc736d3
PE
11089 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11090
4e2fe2e6
PE
11091 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11092
f97334a2
PE
11093 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11094
4e75f29d
PE
11095 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11096 Define only if needed.
11097
90efadd1
PE
11098 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11099 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 11100 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 11101
3c647824
PE
11102 * dispextern.h (struct redisplay_interface): Rename param
11103 to avoid shadowing.
e264f262 11104 * termhooks.h (struct terminal): Likewise.
761383f4 11105 * xterm.c (xembed_send_message): Likewise.
3c647824 11106
b58c5c4a
PE
11107 * insdel.c (make_gap_smaller): Define only if
11108 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11109
cad59032
PE
11110 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11111 it.
11112
c339dc2e
PE
11113 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11114 so that we aren't warned about unused symbols.
11115
91a3e27b
PE
11116 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11117
399c71d3 11118 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 11119
8ffc96f5
PE
11120 * xfns.c (x_real_positions): Mark locals as initialized.
11121
eef9bc79
PE
11122 * xmenu.c (xmenu_show): Don't use uninitialized vars.
11123
098db9dd
PE
11124 * xterm.c: Fix problems found by static analysis with other toolkits.
11125 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
11126 (x_dispatch_event): Declare static if USE_GTK, and
11127 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 11128 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 11129 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
11130 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11131 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 11132
eb18f6cc
PE
11133 * xmenu.c (menu_help_callback): Pointer type fixes.
11134 Use const pointers when pointing at readonly data. Avoid pointer
11135 signedness clashes.
11136 (FALSE): Remove unused macro.
11137 (update_frame_menubar): Remove unused decl.
11138
1fe72bf8
PE
11139 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11140
60d9e1db
PE
11141 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11142 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11143 (single_menu_item): Rename local to avoid shadowing.
11144
39261c26
PE
11145 * keyboard.c (make_lispy_event): Remove unused local var.
11146
018c5e19
PE
11147 * frame.c, frame.h (x_get_resource_string): Bring this back, but
11148 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11149
63d2b86e
PE
11150 * bitmaps: Change bitmaps from unsigned char back to the X11
11151 compatible char. Avoid the old compiler warnings about
11152 out-of-range initializers by using, for example, '\xab' rather
11153 than 0xab.
11154
aefd87e1
PE
11155 * xgselect.c (xgselect_initialize): Check vs interface
11156 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11157
bf501fb9
PE
11158 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11159
e9829fdf
PE
11160 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11161 to read-only memory.
11162
1086c095
PE
11163 * fns.c (vector): Remove; this old hack is no longer needed.
11164
2baccd04 11165 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 11166 Remove unused var.
dde42981 11167 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 11168
72391843 11169 * xrdb.c (x_load_resources): Omit unused local.
3565b346 11170
436c16df 11171 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 11172 (x_window): Rename locals to avoid shadowing.
dc5ddd85 11173 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 11174
92bb796d 11175 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 11176 (x_term_init): Remove local to avoid shadowing.
92bb796d 11177
764430a3 11178 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
11179
11180 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11181 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11182
d1dfb56c
EZ
111832011-04-16 Eli Zaretskii <eliz@gnu.org>
11184
c4354cb4
EZ
11185 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11186
d1dfb56c
EZ
11187 Fix regex.c, syntax.c and friends for buffers > 2GB.
11188 * syntax.h (struct gl_state_s): Declare character position members
11189 EMACS_INT.
11190
11191 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11192
04f2d78b
CB
11193 * textprop.c (verify_interval_modification, interval_of):
11194 Declare arguments EMACS_INT.
d1dfb56c
EZ
11195
11196 * intervals.c (adjust_intervals_for_insertion): Declare arguments
11197 EMACS_INT.
11198
11199 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11200
11201 * indent.c (Fvertical_motion): Local variable it_start is now
11202 EMACS_INT.
11203
11204 * regex.c (re_match, re_match_2, re_match_2_internal)
11205 (bcmp_translate, regcomp, regexec, print_double_string)
11206 (group_in_compile_stack, re_search, re_search_2, regex_compile)
11207 (re_compile_pattern, re_exec): Declare arguments and local
11208 variables `size_t' and `ssize_t' and return values `regoff_t', as
11209 appropriate.
11210 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11211 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11212 <compile_stack_type>: `size' and `avail' are now `size_t'.
11213
11214 * regex.h <regoff_t>: Use ssize_t, not int.
11215 (re_search, re_search_2, re_match, re_match_2): Arguments that
11216 specify buffer/string position and length are now ssize_t and
11217 size_t. Return type is regoff_t.
11218
613052cd
BK
112192011-04-16 Ben Key <bkey76@gmail.com>
11220
11221 * nsfont.m: Fixed bugs in ns_get_family and
11222 ns_descriptor_to_entity that were caused by using free to
11223 deallocate memory blocks that were allocated by xmalloc (via
11224 xstrdup). This caused Emacs to crash when compiled with
11225 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11226 --enable-checking=xmallocoverrun). xfree is now used to
11227 deallocate these memory blocks.
11228
4170f62f 112292011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 11230
71b41406
PE
11231 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11232
9587a89d
PE
11233 emacs_write: Accept and return EMACS_INT for sizes.
11234 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11235 et seq.
11236 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11237 Accept and return EMACS_INT.
11238 (emacs_gnutls_write): Return the number of bytes written on
11239 partial writes.
11240 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
11241 (emacs_read, emacs_write): Remove check for negative size, as the
11242 Emacs source code has been audited now.
9587a89d
PE
11243 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11244 (emacs_read, emacs_write): Use it.
273a5f82
PE
11245 * process.c (send_process): Adjust to the new signatures of
11246 emacs_write and emacs_gnutls_write. Do not attempt to store
11247 a byte offset into an 'int'; it might overflow.
9587a89d 11248 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 11249
3e047f51
PE
11250 * sound.c: Don't assume sizes fit in 'int'.
11251 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 11252 Return EMACS_INT, not int.
3e047f51 11253 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
11254 Accept EMACS_INT, not int.
11255 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
11256 record read return values.
11257
cc39a9db
BK
112582011-04-15 Ben Key <bkey76@gmail.com>
11259
c9d0ec6d
JB
11260 * keyboard.c (Qundefined): Don't declare static since it is used
11261 in nsfns.m.
11262 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11263 static since they are used in nsfont.m.
cc39a9db 11264
6c60eb9f
SM
112652011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
11266
11267 * process.c (Qprocessp): Don't declare static.
11268 * lisp.h (Qprocessp): Declare again.
11269
7990b61a
JB
112702011-04-15 Juanma Barranquero <lekktu@gmail.com>
11271
11272 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11273
5d4cb038
PE
112742011-04-14 Paul Eggert <eggert@cs.ucla.edu>
11275
8bd7b830 11276 Improve C-level modularity by making more things 'static'.
cd64ea1d 11277
e3b27b31
PE
11278 Don't publish debugger-only interfaces to other modules.
11279 * lisp.h (safe_debug_print, debug_output_compilation_hack):
11280 (verify_bytepos, count_markers): Move decls to the only modules
11281 that need them.
11282 * region-cache.h (pp_cache): Likewise.
11283 * window.h (check_all_windows): Likewise.
11284 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11285
5d4cb038
PE
11286 * sysdep.c (croak): Now static, if
11287 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11288 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
11289
11290 * alloc.c (refill_memory_reserve): Now static if
11291 !defined REL_ALLOC || defined SYSTEM_MALLOC.
11292 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 11293
e87b6180
PE
11294 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11295 Define only if USE_LUCID.
11296
ac64929e
PE
11297 * xrdb.c (x_customization_string, x_rm_string): Now static.
11298
6f37259d
PE
11299 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11300 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11301
1683e3ab
PE
11302 * xdisp.c (draw_row_with_mouse_face): Now static.
11303 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11304
de9c2632
PE
11305 * window.h (check_all_windows): Mark externally visible.
11306
2b96acb7
PE
11307 * window.c (window_deletion_count): Now static.
11308
11309 * undo.c: Make symbols static if they're not exported.
11310 (last_undo_buffer, last_boundary_position, pending_boundary):
11311 Now static.
11312
50436f33
PE
11313 * textprop.c (interval_insert_behind_hooks): Now static.
11314 (interval_insert_in_front_hooks): Likewise.
11315
64520e5c
PE
11316 * term.c: Make symbols static if they're not exported.
11317 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11318 (max_frame_lines, tty_set_terminal_modes):
11319 (tty_reset_terminal_modes, tty_turn_off_highlight):
11320 (get_tty_terminal): Now static.
11321 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11322 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 11323 HAVE_WINDOW_SYSTEM.
64520e5c
PE
11324 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11325 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11326
1fa53021
PE
11327 * sysdep.c: Make symbols static if they're not exported.
11328 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11329 Now static.
11330 (sigprocmask_set, full_mask): Remove; unused.
11331 (wait_debugging): Mark as visible.
11332 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11333 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11334
d4b43b22
PE
11335 * syntax.c (syntax_temp): Define only if !__GNUC__.
11336
b7c513d0
PE
11337 * sound.c (current_sound_device, current_sound): Now static.
11338
989b29ad
PE
11339 * search.c (searchbufs, searchbuf_head): Now static.
11340
13a55a78
PE
11341 * scroll.c (scroll_cost): Remove; unused.
11342 * dispextern.h (scroll_cost): Remove decl.
11343
de68a1fc
PE
11344 * region-cache.h (pp_cache): Mark as externally visible.
11345
40ccffa6
PE
11346 * process.c: Make symbols static if they're not exported.
11347 (process_tick, update_tick, create_process, chan_process):
11348 (Vprocess_alist, proc_buffered_char, datagram_access):
11349 (fd_callback_data, send_process_frame, process_sent_to): Now static.
11350 (deactivate_process): Mark defn as static, as well as decl.
11351 * lisp.h (create_process): Remove decl.
11352 * process.h (chan_process, Vprocess_alist): Remove decls.
11353
ad64fc97
PE
11354 * print.c: Make symbols static if they're not exported.
11355 (print_depth, new_backquote_output, being_printed, print_buffer):
11356 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11357 (print_interval, print_number_index, initial_stderr_stream):
11358 Now static.
11359 * lisp.h (Fprinc): Remove decl.
11360 (debug_output_compilation_hack): Mark as externally visible.
11361
adddb265
PE
11362 * sysdep.c (croak): Move decl from here to syssignal.h.
11363 * syssignal.h (croak): Put it here, so the API can be checked when
11364 'croak' is called from dissociate_if_controlling_tty.
11365
1717ede2
PE
11366 * minibuf.c: Make symbols static if they're not exported.
11367 (minibuf_save_list, choose_minibuf_frame): Now static.
11368 * lisp.h (choose_minibuf_frame): Remove decl.
11369
fa5fb2bc
PE
11370 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11371
1e3890d1
PE
11372 * lread.c: Make symbols static if they're not exported.
11373 (read_objects, initial_obarray, oblookup_last_bucket_number):
11374 Now static.
11375 (make_symbol): Remove; unused.
11376 * lisp.h (initial_obarray, make_symbol): Remove decls.
11377
8a1414fa
PE
11378 * keyboard.c: Make symbols static if they're not exported.
11379 (single_kboard, recent_keys_index, total_keys, recent_keys):
11380 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11381 (this_single_command_key_start, echoing, last_auto_save):
11382 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11383 (command_loop, echo_now, keyboard_init_hook, help_char_p):
11384 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11385 (Vlispy_mouse_stem, double_click_count):
11386 Now static.
11387 (force_auto_save_soon): Define only if SIGDANGER.
11388 (ignore_mouse_drag_p): Now static if
11389 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11390 (print_help): Remove; unused.
11391 (stop_character, last_timer_event): Mark as externally visible.
11392 * keyboard.h (ignore_mouse_drag_p): Declare only if
11393 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11394 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11395 * lisp.h (echoing): Remove decl.
11396 (force_auto_save_soon): Declare only if SIGDANGER.
11397 * xdisp.c (redisplay_window): Simplify code, to make it more
11398 obvious that ignore_mouse_drag_p is not accessed if !defined
11399 USE_GTK && !defined HAVE_NS.
11400
93ea6e8f
PE
11401 * intervals.c: Make symbols static if they're not exported.
11402 (merge_properties_sticky, merge_interval_right, delete_interval):
11403 Now static.
11404 * intervals.h (merge_interval_right, delete_interval): Remove decls.
11405
77382fcc
PE
11406 * insdel.c: Make symbols static if they're not exported.
11407 However, leave prepare_to_modify_buffer alone. It's never
11408 called from outside this function, but that appears to be a bug.
11409 (combine_after_change_list, combine_after_change_buffer):
4889fc82 11410 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
11411 (adjust_after_replace_noundo): Remove; unused.
11412 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 11413 (signal_before_change): Remove decls.
77382fcc 11414
9306c32e
PE
11415 * indent.c (val_compute_motion, val_vmotion): Now static.
11416
cd44d2eb
PE
11417 * image.c: Make symbols static if they're not exported.
11418 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11419 if USE_GTK.
11420 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11421 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11422
ad9a7a06
PE
11423 * fringe.c (standard_bitmaps): Now static.
11424 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11425
81626931
PE
11426 * frame.c: Make symbols static if they're not exported.
11427 (x_report_frame_params, make_terminal_frame): Now static.
11428 (get_frame_param): Now static, unless HAVE_NS.
11429 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11430 (x_get_resource_string): Remove; not used.
11431 * frame.h (make_terminal_frame, x_report_frame_params):
11432 (x_get_resource_string); Remove decls.
11433 (x_fullscreen_adjust): Declare only if WINDOWSNT.
11434 * lisp.h (get_frame_param): Declare only if HAVE_NS.
11435
239f9db9
PE
11436 * font.c, fontset.c: Make symbols static if they're not exported.
11437 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11438 (FACE_SUITABLE_FOR_CHAR_P): Use it.
11439 * font.c (font_close_object): Now static.
11440 * font.h (font_close_object): Remove.
11441 * fontset.c (FONTSET_OBJLIST): Remove.
11442 (free_realized_fontset) #if-0 the body, which does nothing.
11443 (face_suitable_for_char_p): #if-0, as it's never called.
11444 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
11445 * xfaces.c (face_at_string_position):
11446 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
11447 since 0 is always ASCII.
11448
dfcf3579
PE
11449 * fns.c (weak_hash_tables): Now static.
11450
5045092b
PE
11451 * fileio.c: Make symbols static if they're not exported.
11452 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11453 (Vwrite_region_annotation_buffers): Now static.
11454
57a96f5c
PE
11455 * eval.c: Make symbols static if they're not exported.
11456 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
11457 * lisp.h (backtrace_list): Remove decl.
11458
35f08c38
PE
11459 * emacs.c: Make symbols static if they're not exported.
11460 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
11461 (fatal_error_code, fatal_error_signal_hook, standard_args):
11462 Now static.
11463 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11464 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11465 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11466 * lisp.h (fatal_error_signal_hook): Remove decl.
11467 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11468
f44bd759
PE
11469 * editfns.c: Move a (normally-unused) function to its only use.
11470 * editfns.c, lisp.h (get_operating_system_release): Remove.
11471 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11472 worth the hassle of breaking this out.
11473
b532497d
PE
11474 * xterm.c: Make symbols static if they're not exported.
11475 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
11476 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
11477 (x_destroy_window, x_delete_display):
11478 Now static.
11479 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
11480 (x_mouse_leave): Remove; unused.
11481 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
11482 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
11483 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
11484 Remove decls.
11485 (x_mouse_leave): Declare only if WINDOWSNT.
11486 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
11487 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
11488 USE_X_TOOLKIT.
11489
1675728f
PE
11490 * ftxfont.c: Make symbols static if they're not exported.
11491 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
11492 HAVE_FREETYPE.
11493 * font.h (ftxfont_driver): Likewise.
11494
e4cebfca
PE
11495 * xfns.c: Make symbols static if they're not exported.
11496 (x_last_font_name, x_display_info_for_name):
11497 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
11498 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
11499 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
11500 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
11501 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
11502 (last_show_tip_args): Now static.
11503 (xic_defaut_fontset, xic_create_fontsetname): Define only if
11504 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
11505 (x_screen_planes): Remove; unused.
11506 * dispextern.h (x_screen_planes): Remove decl.
11507
5bf46f05
PE
11508 * dispnew.c: Make symbols static if they're not exported.
11509 * dispextern.h (redraw_garbaged_frames, scrolling):
11510 (increment_row_positions): Remove.
11511 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
11512 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
11513 Now static.
11514 (redraw_garbaged_frames): Remove; unused.
11515
435f4c28
PE
11516 * xfaces.c: Make symbols static if they're not exported.
11517 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
11518 Remove decls.
11519 * xterm.h (defined_color): Remove decls.
11520 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
11521 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
11522 (menu_face_changed_default, defined_color, free_realized_face):
11523 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
11524 (ascii_face_of_lisp_face): Remove; unused.
11525
8524aef3
PE
11526 * xdisp.c: Make symbols static if they're not exported.
11527 * dispextern.h (scratch_glyph_row, window_box_edges):
11528 (glyph_to_pixel_coords, set_cursor_from_row):
11529 (get_next_display_element, set_iterator_to_next):
11530 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
11531 (show_mouse_face): Remove decls
11532 * frame.h (message_buf_print): Likewise.
11533 * lisp.h (pop_message, set_message, check_point_in_composition):
11534 Likewise.
11535 * xterm.h (set_vertical_scroll_bar): Likewise.
11536 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
11537 (message_buf_print, scratch_glyph_row, displayed_buffer):
11538 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
11539 (get_next_display_element, show_mouse_face, window_box_edges):
11540 (frame_to_window_pixel_xy, check_point_in_composition):
11541 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
11542 (glyph_to_pixel_coords): Remove; unused.
11543
16390cd2
PE
11544 * dired.c (file_name_completion): Now static.
11545
11546 * dbusbind.c (xd_in_read_queued_messages): Now static.
11547
a25f4dfa
PE
11548 * lisp.h (circular_list_error, FOREACH): Remove; unused.
11549 * data.c (circular_list_error): Remove.
11550
14a9c8df
PE
11551 * commands.h (last_point_position, last_point_position_buffer):
11552 (last_point_position_window): Remove decls.
11553 * keyboard.c: Make these variables static.
11554
04f2d78b
CB
11555 * coding.h (coding, code_convert_region, encode_coding_gap):
11556 Remove decls.
74ab6df5
PE
11557 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
11558 (iso_code_class, detect_coding, code_convert_region): Now static.
11559 (encode_coding_gap): Remove; unused.
11560
38dfbee1
PE
11561 * chartab.c (chartab_chars, chartab_bits): Now static.
11562
a2cb4e63
PE
11563 * charset.h (charset_iso_8859_1): Remove decl.
11564 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
11565 Now static.
11566
127198fd
PE
11567 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
11568 * ccl.c (Vccl_program_table): Now static.
11569 (check_ccl_update): Remove; unused.
11570
d85b608f
PE
11571 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
11572 * category.h: ... from here.
11573 * category.c (check_category_table, set_category_set): Now static.
11574
31cd66f3
PE
11575 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
11576 * lisp.h: Remove these decls.
11577
c358e587
PE
11578 * buffer.c (buffer_count): Remove unused var.
11579
e78aecca
PE
11580 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
11581 so that it's not optimized away.
11582 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
11583 * dispextern.h (bidi_dump_cached_states): Remove, since it's
11584 exported only to the debugger.
11585
e192d7d3 11586 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 11587 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 11588
92470028
PE
11589 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
11590 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
11591 was inaccessible from Lisp.
11592 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
11593 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
11594
244ed907
PE
11595 alloc.c: Import and export fewer symbols, and remove unused items.
11596 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
11597 is defined.
11598 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
11599 it's not optimized away by whole-program optimization.
11600 (message_enable_multibyte, free_misc): Remove.
11601 (catchlist, handlerlist, mark_backtrace):
11602 Declare only if BYTE_MARK_STACK.
11603 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
11604 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
11605 (message_enable_multibyte): Remove decl.
11606 (free_misc, interval_free_list, float_block, float_block_index):
11607 (n_float_blocks, float_free_list, cons_block, cons_block_index):
11608 (cons_free_list, last_marked_index):
11609 Now static.
11610 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
11611 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
11612 (mark_backtrace): Define only if BYTE_MARK_STACK.
11613 * xdisp.c (message_enable_multibyte): Now static.
11614
61c2b50e 11615 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
11616 This makes it easier for human readers (and static analyzers)
11617 to see whether these variables are used from other modules.
11618 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
11619 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
11620 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
11621 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
11622 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
11623 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
11624 * xmenu.c, xselect.c:
11625 Declare Q* vars static if they are not used in other modules.
11626 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
11627 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
11628 Remove decls of unexported vars.
11629 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
11630
95c82688
PE
11631 * lisp.h (DEFINE_FUNC): Make sname 'static'.
11632
16a97296
PE
11633 Make Emacs functions such as Fatom 'static' by default.
11634 This makes it easier for human readers (and static analyzers)
11635 to see whether these functions can be called from other modules.
11636 DEFUN now defines a static function. To make the function external
11637 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
11638 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
11639 (Finit_image_library):
16a97296
PE
11640 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
11641 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
11642 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
11643 Remove decls, since these functions are now static.
11644 (Funintern, Fget_internal_run_time): New decls, since these functions
11645 were already external.
95c82688 11646
16a97296
PE
11647 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
11648 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
11649 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
11650 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
11651 * keyboard.c, keymap.c, lread.c:
11652 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
11653 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
11654 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
11655 Mark functions with DEFUE instead of DEFUN,
11656 if they are used in other modules.
11657 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
11658 decls for now-static functions.
11659 * buffer.h (Fdelete_overlay): Remove decl.
11660 * callproc.c (Fgetenv_internal): Mark as internal.
11661 * composite.c (Fremove_list_of_text_properties): Remove decl.
11662 (Fcomposition_get_gstring): New forward static decl.
11663 * composite.h (Fcomposite_get_gstring): Remove decl.
11664 * dired.c (Ffile_attributes): New forward static decl.
11665 * doc.c (Fdocumntation_property): New forward static decl.
11666 * eval.c (Ffetch_bytecode): New forward static decl.
11667 (Funintern): Remove extern decl; now in .h file where it belongs.
11668 * fileio.c (Fmake_symbolic_link): New forward static decl.
11669 * image.c (Finit_image_library): New forward static decl.
11670 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
11671 * intervals.h (Fprevious_property_change):
11672 (Fremove_list_of_text_properties): Remove decls.
11673 * keyboard.c (Fthis_command_keys): Remove decl.
11674 (Fcommand_execute): New forward static decl.
11675 * keymap.c (Flookup_key): New forward static decl.
11676 (Fcopy_keymap): Now static.
11677 * keymap.h (Flookup_key): Remove decl.
11678 * process.c (Fget_process): New forward static decl.
11679 (Fprocess_datagram_address): Mark as internal.
11680 * syntax.c (Fsyntax_table_p): New forward static decl.
11681 (skip_chars): Remove duplicate decl.
11682 * textprop.c (Fprevious_property_change): New forward static decl.
11683 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
11684 Now internal.
11685 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
11686 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
11687
785bbd42
PE
11688 * editfns.c (Fformat): Remove unreachable code.
11689
8b913b57
AS
116902011-04-14 Andreas Schwab <schwab@linux-m68k.org>
11691
11692 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
11693 change. (Bug#8496)
11694
a6744a35
EZ
116952011-04-13 Eli Zaretskii <eliz@gnu.org>
11696
11697 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
11698 when at ZV. (Bug#8487)
11699
e7974947
AS
117002011-04-12 Andreas Schwab <schwab@linux-m68k.org>
11701
baad03f0
AS
11702 * charset.c (Fclear_charset_maps): Use xfree instead of free.
11703 (Bug#8437)
11704 * keyboard.c (parse_tool_bar_item): Likewise.
11705 * sound.c (sound_cleanup, alsa_close): Likewise.
11706 * termcap.c (tgetent): Likewise.
11707 * xfns.c (x_default_font_parameter): Likewise.
11708 * xsettings.c (read_and_apply_settings): Likewise.
11709
e7974947
AS
11710 * alloc.c (overrun_check_malloc, overrun_check_realloc)
11711 (overrun_check_free): Protoize.
11712
28272684
PE
117132011-04-12 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
11716 since callers should never pass a negative size.
11717 Change the signature to match that of plain 'read' and 'write'; see
11718 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
11719 * lisp.h: Update prototypes of emacs_write and emacs_read.
11720
11997c76
EZ
117212011-04-11 Eli Zaretskii <eliz@gnu.org>
11722
11723 * xdisp.c (redisplay_window): Don't try to determine the character
11724 position of the scroll margin if the window start point w->startp
e896f03c 11725 is outside the buffer's accessible region. (Bug#8468)
11997c76 11726
8a2cbd72
EZ
117272011-04-10 Eli Zaretskii <eliz@gnu.org>
11728
11729 Fix write-region and its subroutines for buffers > 2GB.
11730 * fileio.c (a_write, e_write): Modify declaration of arguments and
11731 local variables to support buffers larger than 2GB.
11732 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
11733
11734 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
11735 argument, local variables, and return value.
11736
11737 * lisp.h: Update prototypes of emacs_write and emacs_read.
11738
11739 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
11740
4073e537 117412011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 11742
1ebfdcb6
PE
11743 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
11744
b2ded58d
PE
11745 Fix more problems found by GCC 4.6.0's static checks.
11746
7d66342c
PE
11747 * xdisp.c (vmessage): Use a better test for character truncation.
11748
bbf47d44
PE
11749 * charset.c (load_charset_map): <, not <=, for optimization,
11750 and to avoid potential problems with integer overflow.
9248994d 11751 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 11752 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 11753 * editfns.c (Fformat): Likewise.
1e69125e 11754 * syntax.c (skip_chars): Likewise.
3befa583 11755
e3019616
PE
11756 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
11757 This also lets GCC 4.6.0 generate slightly better loop code.
11758
becfa255
PE
11759 * callint.c (Fcall_interactively): <, not <=, for optimization.
11760 (Fcall_interactively): Count the number of arguments produced,
11761 not the number of arguments given. This is simpler and lets GCC
11762 4.6.0 generate slightly better code.
11763
dae0cd48
PE
11764 * ftfont.c: Distingish more carefully between FcChar8 and char.
11765 The previous code passed unsigned char * to a functions like
11766 strlen and xstrcasecmp that expect char *, which does not
11767 conform to the C standard.
11768 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
11769 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
11770 char * when the C standard requires it.
11771
76032d70
PE
11772 * keyboard.c (read_char): Remove unused var.
11773
eb3f1cc8
PE
11774 * eval.c: Port to Windows vsnprintf (Bug#8435).
11775 Include <limits.h>.
11776 (SIZE_MAX): Define if the headers do not.
11777 (verror): Do not give up if vsnprintf returns a negative count.
11778 Instead, grow the buffer. This ports to Windows vsnprintf, which
11779 does not conform to C99. Problem reported by Eli Zaretskii.
11780 Also, simplify the allocation scheme, by avoiding the need for
11781 calling realloc, and removing the ALLOCATED variable.
11782
70476b54
PE
11783 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
11784
12020a9e
PE
11785 Remove invocations of doprnt, as Emacs now uses vsnprintf.
11786 But keep the doprint source code for now, as we might revamp it
11787 and use it again (Bug#8435).
ea6c7ae6
PE
11788 * lisp.h (doprnt): Remove.
11789 * Makefile.in (base_obj): Remove doprnt.o.
11790 * deps.mk (doprnt.o): Remove.
11791
5fdb398c
PE
11792 error: Print 32- and 64-bit integers portably (Bug#8435).
11793 Without this change, on typical 64-bit hosts error ("...%d...", N)
11794 was used to print both 32- and 64-bit integers N, which relied on
11795 undefined behavior.
61bdb816 11796 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
11797 * lisp.h (error, verror): Mark as printf-like functions.
11798 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
11799 Report overflow in size calculations when allocating printf buffer.
11800 Do not truncate output string at its first null byte.
11801 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
11802 Truncate the output at a character boundary, since vsnprintf does not
11803 do that.
11804 * charset.c (check_iso_charset_parameter): Convert internal
11805 character to string before calling 'error', since %c now has the
11806 printf meaning.
11807 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
11808 overflow when computing char to be passed to 'error'. Do not
11809 pass Lisp_Object to 'error'; pass the integer instead.
11810 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
11811 formatted with plain %d.
11812
b189fa66
PE
11813 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
11814
bff87ef0
PE
11815 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
11816
7e2cac20
PE
11817 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
11818
ce4d90b5
PE
11819 * xterm.c (x_catch_errors): Remove duplicate declaration.
11820
266c9547
PE
11821 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
11822
79c49ad2
PE
11823 * xdisp.c, lisp.h (message_nolog): Remove; unused.
11824
368f4090
JM
118252011-04-10 Jim Meyering <meyering@redhat.com>
11826
11827 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
11828 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
11829 return ssize_t not "int", and use size_t as the buffer length.
11830 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
11831 * gnutls.h: Update declarations.
11832 * process.c (read_process_output): Use ssize_t, to match.
11833 (send_process): Likewise.
11834
a32d4040
CY
118352011-04-09 Chong Yidong <cyd@stupidchicken.com>
11836
11837 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
11838
8546720e 118392011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 11840
04f2d78b
CB
11841 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
11842 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 11843
8546720e
GM
11844 * xterm.c (handle_one_xevent):
11845 * xmenu.c (create_and_show_popup_menu):
11846 * xselect.c (x_decline_selection_request)
11847 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 11848
0a2f5c1a 118492011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
11850
11851 Fix some uses of `int' instead of EMACS_INT.
11852 * search.c (string_match_1, fast_string_match)
11853 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
11854 (scan_buffer, find_next_newline_no_quit)
11855 (find_before_next_newline, search_command, Freplace_match)
11856 (Fmatch_data): Make some `int' variables be EMACS_INT.
11857
11858 * xdisp.c (display_count_lines): 3rd argument and return value now
11859 EMACS_INT. All callers changed.
11860 (pint2hrstr): Last argument is now EMACS_INT.
11861
11862 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
11863 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11864 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
11865 (decode_coding_utf_16, decode_coding_emacs_mule)
11866 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
11867 (decode_coding_ccl, decode_coding_charset)
11868 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
11869 (decode_coding_iso_2022, decode_coding_emacs_mule)
11870 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
11871 <char_offset, last_offset>: Declare EMACS_INT.
11872 (encode_coding_utf_8, encode_coding_utf_16)
11873 (encode_coding_emacs_mule, encode_invocation_designation)
11874 (encode_designation_at_bol, encode_coding_iso_2022)
11875 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
11876 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
11877 Declare EMACS_INT.
11878 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
11879 (encode_invocation_designation): Last argument P_NCHARS is now
11880 EMACS_INT.
11881 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
11882 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
11883
11884 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
11885 All users changed.
11886
11887 * ccl.c (Fccl_execute_on_string): Declare some variables
11888 EMACS_INT.
11889
8546720e 118902011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
11891
11892 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
11893
4e19a977
CS
118942011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
11895
11896 * process.c (Fformat_network_address): Doc fix.
11897
87302331
R
118982011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
11899
ee7683eb 11900 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 11901
cbb59342
CY
119022011-04-08 Chong Yidong <cyd@stupidchicken.com>
11903
11904 * keyboard.c (read_char): Call Lisp function help-form-show,
11905 instead of using internal_with_output_to_temp_buffer.
11906 (Qhelp_form_show): New var.
e0d38eeb 11907 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
11908
11909 * print.c (internal_with_output_to_temp_buffer): Function deleted.
11910
11911 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
11912
e67a13ab
CY
119132011-04-06 Chong Yidong <cyd@stupidchicken.com>
11914
04f2d78b
CB
11915 * process.c (Flist_processes): Remove to Lisp.
11916 (list_processes_1): Delete.
e67a13ab 11917
973f782d
EZ
119182011-04-06 Eli Zaretskii <eliz@gnu.org>
11919
7c106b1e
EZ
11920 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
11921
973f782d
EZ
11922 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
11923
41cf7d1a 119242011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 11925
ca23cc88
PE
11926 Fix more problems found by GCC 4.6.0's static checks.
11927
f390e2d5
PE
11928 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
11929
42eea0d0
PE
11930 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
11931
b69769da 11932 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 11933
f9541e84
PE
11934 * xdisp.c (vmessage): Mark as a printf-like function.
11935
13841b55
PE
11936 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
11937
c136c10f
PE
11938 * sound.c (sound_warning): Don't crash if arg contains a printf format.
11939
5e2d4a30
PE
11940 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
11941 printf-like functions.
11942 (tiff_load): Add casts to remove these marks before passing them
11943 to system-supplied API.
11944
583f48b9
PE
11945 * eval.c (Fsignal): Remove excess argument to 'fatal'.
11946
b25d760e
PE
11947 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
11948 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
11949 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
11950 directly, rather than having caller test rule sign. This avoids
11951 some unnecessary tests.
11952 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
11953 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
11954 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 11955
bc7b6697 11956 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 11957 (xfont_open): Avoid unnecessary tests.
bc7b6697 11958
27ccc379
PE
11959 * composite.c (composition_gstring_put_cache): Use unsigned integer.
11960
dcd5c89a
PE
11961 * composite.h, composite.c (composition_gstring_put_cache):
11962 Use EMACS_INT, not int, for length.
11963
b13a45c6
PE
11964 * composite.h (COMPOSITION_DECODE_REFS): New macro,
11965 breaking out part of COMPOSITION_DECODE_RULE.
11966 (COMPOSITION_DECODE_RULE): Use it.
11967 * composite.c (get_composition_id): Remove unused local vars,
11968 by using the new macro.
11969
1e792e4d
PE
11970 * textprop.c (set_text_properties_1): Change while to do-while,
11971 since the condition is always true at first.
11972
dc6c6455 11973 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
11974 (interval_deletion_adjustment): Return unsigned value.
11975 All uses changed.
dc6c6455 11976
aba7731a
PE
11977 * process.c (list_processes_1, create_pty, read_process_output):
11978 (exec_sentinel): Remove vars that were set but not used.
afd4052b 11979 (create_pty): Remove unnecessary "volatile"s.
bc57d757 11980 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 11981 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 11982 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 11983
fdfc4bf3
PE
11984 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
11985
fca8fe46 11986 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 11987 (update_syntax_table): Use unsigned instead of int.
fca8fe46 11988
06a0259a 11989 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 11990 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 11991 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 11992
e7b9e80f
PE
11993 * print.c (print_error_message): Avoid int overflow.
11994
56201685
PE
11995 * font.c (font_list_entities): Redo for clarity,
11996 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
11997
78834453 11998 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 11999 (font_score): Avoid potential overflow in diff calculation.
78834453 12000
0bc0b309 12001 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 12002 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 12003
e610eaca
PE
12004 * eval.c (funcall_lambda): Rename local to avoid shadowing.
12005
b895abce
PE
12006 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12007 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12008 can always succeed if overflow has undefined behavior.
12009
1f1d9321 12010 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 12011 (wordify): Omit three unnecessary tests.
1f1d9321 12012
c59478bc
PE
12013 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12014 All callers changed. This avoids the need for an unused var.
12015
79b73827
PE
12016 * casefiddle.c (casify_region): Remove var that is set but not used.
12017
a4db5dfe
PE
12018 * dired.c (file_name_completion): Remove var that is set but not used.
12019
43aae36e
PE
12020 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12021
2a47c44d 12022 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 12023 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 12024
a37c69bf
PE
12025 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12026 Check for integer overflow on size calculations.
12027
328ab8e7
PE
12028 * buffer.c (Fprevious_overlay_change): Remove var that is set
12029 but not used.
12030
e5a2a5cb
PE
12031 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12032 Remove vars that are set but not used.
8d84a6eb 12033 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 12034 (timer_check_2): Mark vars as initialized.
e5a2a5cb 12035
a60e5f68
PE
12036 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12037
f661cb61 12038 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 12039 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 12040
f0397f5a
PE
12041 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12042 that are set but not used.
12043
8664db06 12044 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 12045 if XCreateBitmapFromData fails (Bug#8410).
8664db06 12046
6abdaa4a
PE
12047 * xselect.c (x_get_local_selection, x_handle_property_notify):
12048 Remove vars that are set but not used.
12049
0ce7538d 12050 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 12051 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 12052
9ae848fc
PE
12053 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12054 Remove var that is set but not used.
0b918413
PE
12055 (scroll_bar_windows_size): Now size_t, not int.
12056 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12057 Check for overflow.
9ae848fc 12058
a5a62657
PE
12059 * xfaces.c (realize_named_face): Remove vars that are set but not used.
12060 (map_tty_color) [!defined MSDOS]: Likewise.
12061
5c5cdd39
PE
12062 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12063
66ebf983
PE
12064 * coding.c: Remove vars that are set but not used.
12065 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12066 All callers changed.
12067 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12068 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12069 (decode_coding_charset): Remove vars that are set but not used.
12070
1be4d761
PE
12071 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12072 that is set but not used.
12073
47553fa8
PE
12074 * print.c (print_object): Remove var that is set but not used.
12075
1f7196bf 12076 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
12077 The gnulib version avoids calling malloc in the usual case,
12078 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12079 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12080 * filelock.c (current_lock_owner): Likewise.
12081 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12082 * sysdep.c: Include allocator.h, careadlinkat.h.
12083 (emacs_no_realloc_allocator): New static constant.
12084 (emacs_readlink): New function.
fdb61804
PE
12085 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12086 ../lib/careadlinkat.h.
d1fdcab7 12087
f84c17c7
SM
120882011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
12089
12090 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12091 first non-nil return value).
12092
ef3862ad
JD
120932011-04-03 Jan Djärv <jan.h.d@swipnet.se>
12094
12095 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12096 if not defined (Bug#8403).
12097
376a7006
JB
120982011-04-02 Juanma Barranquero <lekktu@gmail.com>
12099
12100 * xdisp.c (display_count_lines): Remove parameter `start',
12101 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12102 (get_char_face_and_encoding): Remove parameter `multibyte_p',
12103 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12104 (fill_stretch_glyph_string): Remove parameters `row' and `area',
12105 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12106 and thereabouts. All callers changed.
12107 (get_per_char_metric): Remove parameter `f', unused since
12108 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
12109
6ca3801d
JM
121102011-04-02 Jim Meyering <meyering@redhat.com>
12111
12112 do not dereference NULL upon failed strdup
12113 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12114 (ns_get_family): Likewise.
12115
d8e2b5ba
JB
121162011-04-02 Juanma Barranquero <lekktu@gmail.com>
12117
12118 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12119
8c74fcbd
JD
121202011-04-02 Jan Djärv <jan.h.d@swipnet.se>
12121
12122 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12123 later (Bug#8403).
12124
7200d79c
SM
121252011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
12126
03408648 12127 Add lexical binding.
7200d79c 12128
03408648
SM
12129 * window.c (Ftemp_output_buffer_show): New fun.
12130 (Fsave_window_excursion):
12131 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12132
12133 * lread.c (lisp_file_lexically_bound_p): New function.
12134 (Fload): Bind Qlexical_binding.
12135 (readevalloop): Remove `evalfun' arg.
12136 Bind Qinternal_interpreter_environment.
12137 (Feval_buffer): Bind Qlexical_binding.
12138 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12139 Mark as dynamic.
12140 (syms_of_lread): Declare `lexical-binding'.
12141
12142 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12143
12144 * keyboard.c (eval_dyn): New fun.
12145 (menu_item_eval_property): Use it.
ca105506
SM
12146
12147 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 12148
03408648
SM
12149 * fns.c (concat, mapcar1): Accept byte-code-functions.
12150
12151 * eval.c (Fsetq): Handle lexical vars.
12152 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12153 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12154 (FletX, Flet): Obey lexical binding.
12155 (Fcommandp): Handle closures.
12156 (Feval): New `lexical' arg.
12157 (eval_sub): New function extracted from Feval. Use it almost
12158 everywhere where Feval was used. Look up vars in lexical env.
12159 Handle closures.
12160 (Ffunctionp): Move from subr.el.
12161 (Ffuncall): Handle closures.
12162 (apply_lambda): Remove `eval_flags'.
12163 (funcall_lambda): Handle closures and new byte-code-functions.
12164 (Fspecial_variable_p): New function.
12165 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12166 but without exporting it to Lisp.
23aba0ea 12167
23aba0ea 12168 * doc.c (Fdocumentation, store_function_docstring):
03408648 12169 * data.c (Finteractive_form): Handle closures.
23aba0ea 12170
03408648
SM
12171 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12172 interactive spec.
ba83908c 12173
04f2d78b
CB
12174 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12175 New byte-codes.
03408648
SM
12176 (exec_byte_code): New function extracted from Fbyte_code to handle new
12177 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 12178
03408648 12179 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 12180
03408648 12181 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 12182
e2abce01
JB
121832011-03-31 Juanma Barranquero <lekktu@gmail.com>
12184
12185 * xdisp.c (redisplay_internal): Fix prototype.
12186
63696a73 121872011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 12188
63696a73 12189 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
12190 (try_scrolling): Use it when setting scroll_limit.
12191 Limit scrolling to 100 screen lines.
63696a73
EZ
12192 (redisplay_window): Even when falling back on "recentering",
12193 position point in the window according to scroll-conservatively,
12194 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
12195
12196 (try_scrolling): When point is above the window, allow searching
12197 as far as scroll_max, or one screenful, to compute vertical
12198 distance from PT to the scroll margin position. This prevents
12199 try_scrolling from unnecessarily failing when
12200 scroll-conservatively is set to a value slightly larger than the
12201 window height. Clean up the case of PT below the margin at bottom
12202 of window: scroll_max can no longer be INT_MAX. When aggressive
12203 scrolling is in use, don't let point enter the opposite scroll
12204 margin as result of the scroll.
12205 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
12206 threshold of 100 lines for never-recentering scrolling.
12207
e4cc2dfc
JB
122082011-03-31 Juanma Barranquero <lekktu@gmail.com>
12209
12210 * dispextern.h (move_it_by_lines):
12211 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12212 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
12213 (message_log_check_duplicate): Remove parameters `prev_bol' and
12214 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
12215 (redisplay_internal): Remove parameter `preserve_echo_area',
12216 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
12217
12218 * indent.c (Fvertical_motion):
12219 * window.c (window_scroll_pixel_based, Frecenter):
12220 Don't pass `need_y_p' to `move_it_by_lines'.
12221
1c470562
SM
122222011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
12223
44f230aa
SM
12224 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12225 steal a few bits to be more compact.
12226 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12227 Remove unneeded casts.
12228
1c470562
SM
12229 * bytecode.c (Fbyte_code): CAR and CDR can GC.
12230
888adce9
ZK
122312011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
12232
12233 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12234 binding" message (bug#7967).
12235
f838ed7b
PE
122362011-03-30 Paul Eggert <eggert@cs.ucla.edu>
12237
77861b95
PE
12238 Fix more problems found by GCC 4.6.0's static checks.
12239
de6dbc14
PE
12240 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12241 Remove unused local var.
12242
f838ed7b
PE
12243 * editfns.c (Fmessage_box): Remove unused local var.
12244
792c7b2b
PE
12245 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12246 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12247 Omit unused local vars.
c499e557 12248 * window.c (shrink_windows): Omit unused local var.
b01a1c29 12249 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
12250 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12251 Omit unused local var.
12252
ba0165e1
PE
12253 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12254 Don't assume string length fits in int.
32ad8845 12255 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 12256 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 12257
3c59b4c9
PE
12258 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12259 instead of alloca (Bug#8344).
12260
a3eed478 12261 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 12262 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 12263
eb4d412d
PE
12264 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12265
1658b401
PE
12266 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12267 concerns.
12268
12269 * term.c (produce_glyphless_glyph): Remove unnecessary test.
12270
12271 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 12272
9a2c6e05
PE
12273 * keyboard.c (syms_of_keyboard): Use the same style as later
12274 in this function when indexing through an array. This also
12275 works around GCC bug 48267.
12276
03d0a109
PE
12277 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12278
44f730c8
PE
12279 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12280
fe75f926
PE
12281 * chartab.c (sub_char_table_ref_and_range): Redo for slight
12282 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12283
ffa8c828
PE
12284 * keyboard.c, keyboard.h (num_input_events): Now size_t.
12285 This avoids undefined behavior on integer overflow, and is a bit
12286 more convenient anyway since it is compared to a size_t variable.
12287
c5101a77
PE
12288 Variadic C functions now count arguments with size_t, not int.
12289 This avoids an unnecessary limitation on 64-bit machines, which
12290 caused (substring ...) to crash on large vectors (Bug#8344).
12291 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12292 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 12293 All variadic functions and their callers changed accordingly.
c5101a77
PE
12294 (struct gcpro.nvars): Now size_t, not int. All uses changed.
12295 * data.c (arith_driver, float_arith_driver): Likewise.
12296 * editfns.c (general_insert_function): Likewise.
12297 * eval.c (struct backtrace.nargs, interactive_p)
12298 (internal_condition_case_n, run_hook_with_args, apply_lambda)
12299 (funcall_lambda, mark_backtrace): Likewise.
12300 * fns.c (concat): Likewise.
12301 * frame.c (x_set_frame_parameters): Likewise.
12302 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12303 0 if not found, not -1. All callers changed.
12304
dd3f25f7
PE
12305 * alloc.c (garbage_collect): Don't assume stack size fits in int.
12306 (stack_copy_size): Now size_t, not int.
12307 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12308
461c2ab9
JB
123092011-03-28 Juanma Barranquero <lekktu@gmail.com>
12310
12311 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12312 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12313 All callers changed.
12314
12315 * lisp.h (multibyte_char_to_unibyte):
12316 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12317 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12318 * character.h (CHAR_TO_BYTE8):
12319 * cmds.c (internal_self_insert):
12320 * editfns.c (general_insert_function):
12321 * keymap.c (push_key_description):
12322 * search.c (Freplace_match):
12323 * xdisp.c (message_dolog, set_message_1): All callers changed.
12324
f6d62986
SM
123252011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
12326
12327 * keyboard.c (safe_run_hook_funcall): New function.
12328 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12329 don't set the hook to nil, but remove the offending function instead.
12330 (Qcommand_hook_internal): Remove, unused.
12331 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12332 Vcommand_hook_internal.
12333
12334 * eval.c (enum run_hooks_condition): Remove.
12335 (funcall_nil, funcall_not): New functions.
12336 (run_hook_with_args): Call each function through a `funcall' argument.
12337 Remove `cond' argument, now redundant.
12338 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12339 (Frun_hook_with_args_until_failure): Adjust accordingly.
12340 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12341
1db5b1ad
JB
123422011-03-28 Juanma Barranquero <lekktu@gmail.com>
12343
12344 * dispextern.h (string_buffer_position): Remove declaration.
12345
12346 * print.c (strout): Remove parameter `multibyte', unused since
12347 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
12348
12349 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12350 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12351 All callers changed.
12352
12353 * w32.c (_wsa_errlist): Use braces for struct initializers.
12354
12355 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12356 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12357 All callers changed.
12358 (string_buffer_position): Likewise. Also, make static (it's never
12359 used outside xdisp.c).
12360 (cursor_row_p): Remove parameter `w', unused since
12361 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
12362 (decode_mode_spec): Remove parameter `precision', introduced during
12363 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12364 All callers changed.
12365
5ffb62aa
JD
123662011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12367
12368 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12369
461c2ab9 123702011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
12371
12372 * nsterm.m (ns_menu_bar_is_hidden): New variable.
12373 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12374 (ns_update_auto_hide_menu_bar): New functions.
12375 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12376 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12377 ns_constrain_all_frames.
12378 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12379 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12380
5c380ffb
JD
123812011-03-27 Jan Djärv <jan.h.d@swipnet.se>
12382
12383 * nsmenu.m (runDialogAt): Remove argument to timer_check.
12384
9af30bdf
GM
123852011-03-27 Glenn Morris <rgm@gnu.org>
12386
12387 * syssignal.h: Replace RETSIGTYPE with void.
12388 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12389 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12390 Replace SIGTYPE with void everywhere.
12391 * s/usg5-4-common.h (SIGTYPE): Remove definition.
12392 * s/template.h (SIGTYPE): Remove commented out definition.
12393
e2abce01
JB
123942011-03-26 Eli Zaretskii <eliz@gnu.org>
12395
12396 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12397 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
12398
f868cd8a
JB
123992011-03-26 Juanma Barranquero <lekktu@gmail.com>
12400
59eb0929
JB
12401 * w32.c (read_unc_volume): Use parameter `henum', instead of
12402 global variable `wget_enum_handle'.
12403
12404 * keymap.c (describe_vector): Remove parameters `indices' and
12405 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12406 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12407
f868cd8a
JB
12408 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12409
12410 * keyboard.c (timer_check): Remove parameter `do_it_now',
12411 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12412 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12413 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12414
12415 * keyboard.c (read_char):
12416 * w32menu.c (w32_menu_display_help):
12417 * xmenu.c (show_help_event, menu_help_callback):
12418 Adjust calls to `show_help_echo'.
12419
12420 * gtkutil.c (xg_maybe_add_timer):
12421 * keyboard.c (readable_events):
12422 * process.c (wait_reading_process_output):
12423 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12424
12425 * insdel.c (adjust_markers_gap_motion):
12426 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12427 (gap_left, gap_right): Don't call it.
12428
2ecf6fdb
CY
124292011-03-25 Chong Yidong <cyd@stupidchicken.com>
12430
12431 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12432 incurred during fontification.
12433
6b1f9ba4
JB
124342011-03-25 Juanma Barranquero <lekktu@gmail.com>
12435
12436 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12437 (DEFVAR_PER_BUFFER): Don't pass it.
12438
12439 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12440 (scrolling_window): Don't pass it.
12441
0f4a96b5
JB
124422011-03-25 Juanma Barranquero <lekktu@gmail.com>
12443
12444 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12445
12446 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12447 and `suffix'.
12448 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12449 of variables specific to SELinux and computation of `encoded_absname'.
12450
12451 * image.c (XPutPixel): Remove unused variable `height'.
12452
12453 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12454
12455 * unexw32.c (get_section_info): Remove unused variable `section'.
12456
12457 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
12458 (system_process_attributes): Remove unused variable `sess'.
12459 (sys_read): Remove unused variable `err'.
12460
12461 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
12462 (w32_wnd_proc): Remove unused variable `isdead'.
12463 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12464 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12465 (x_create_tip_frame): Remove unused variable `tem'.
12466
12467 * w32inevt.c (w32_console_read_socket):
12468 Remove unused variable `no_events'.
12469
12470 * w32term.c (x_draw_composite_glyph_string_foreground):
12471 Remove unused variable `width'.
12472
1149507c
JB
124732011-03-24 Juanma Barranquero <lekktu@gmail.com>
12474
12475 * w32term.c (x_set_glyph_string_clipping):
12476 Don't pass uninitialized region to CombineRgn.
12477
9c88f339
JB
124782011-03-23 Juanma Barranquero <lekktu@gmail.com>
12479
12480 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
12481 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
12482 (Fx_close_connection): Remove unused variable `i'.
12483
12484 * w32font.c (w32font_draw): Return number of glyphs.
12485 (w32font_open_internal): Remove unused variable `i'.
12486 (w32font_driver): Add missing initializer.
12487
12488 * w32menu.c (utf8to16): Remove unused variable `utf16'.
12489 (fill_in_menu): Remove unused variable `items_added'.
12490
12491 * w32term.c (last_mouse_press_frame): Remove static global variable.
12492 (w32_clip_to_row): Remove unused variable `f'.
12493 (x_delete_terminal): Remove unused variable `i'.
12494
12495 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
12496 (NOTHING): Remove unused static global variable.
12497 (uniscribe_check_otf): Remove unused variable `table'.
12498 (uniscribe_font_driver): Add missing initializers.
12499
dee091a3
JD
125002011-03-23 Julien Danjou <julien@danjou.info>
12501
12502 * term.c (Fsuspend_tty, Fresume_tty):
12503 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
12504 * window.c (temp_output_buffer_show):
12505 * insdel.c (signal_before_change):
12506 * frame.c (Fhandle_switch_frame):
12507 * fileio.c (Fdo_auto_save):
12508 * emacs.c (Fkill_emacs):
12509 * editfns.c (save_excursion_restore):
12510 * cmds.c (internal_self_insert):
12511 * callint.c (Fcall_interactively):
12512 * buffer.c (Fkill_all_local_variables):
12513 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
12514 Use Frun_hooks.
0f4a96b5 12515 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 12516 unconditionally since it does the check itself.
dee091a3 12517
2c520ab5 125182011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 12519
c9c49752
PE
12520 Fix more problems found by GCC 4.5.2's static checks.
12521
8abc3f12
PE
12522 * coding.c (encode_coding_raw_text): Avoid unnecessary test
12523 the first time through the loop, since we know p0 < p1 then.
12524 This also avoids a gcc -Wstrict-overflow warning.
12525
a2d26660
PE
12526 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
12527 leading to a memory leak, possible in functions like
12528 load_charset_map_from_file that can allocate an unbounded number
b12ef411 12529 of objects (Bug#8318).
a2d26660 12530
916c72e9
PE
12531 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
12532 that could (at least in theory) be that large.
12533
19ab8a18
PE
12534 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
12535 This is less likely to overflow, and avoids undefined behavior if
12536 overflow does occur. All callers changed. Use strtoul to scan
12537 for the unsigned long integer.
b7cbbd6f
PE
12538 (pint2hrstr): Simplify and tune code slightly.
12539 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 12540
f0641eff
PE
12541 * scroll.c (do_scrolling): Work around GCC bug 48228.
12542 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
12543
7f650bb9
PE
12544 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
12545 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
12546 (validate_x_resource_name): Simplify count usage.
12547 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 12548
37dd57d1
PE
12549 * fileio.c (Fcopy_file): Report error if fchown or fchmod
12550 fail (Bug#8306).
81e56e61 12551
699979fc 12552 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 12553
401bf9b4
PE
12554 * process.c (Fmake_network_process): Use socklen_t, not int,
12555 where POSIX says socklen_t is required in portable programs.
12556 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 12557 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
12558 (Fmake_network_process, server_accept_connection):
12559 (wait_reading_process_output, read_process_output):
12560 Likewise.
12561
b93aacde
PE
12562 * process.c: Rename or move locals to avoid shadowing.
12563 (list_processes_1, Fmake_network_process):
12564 (read_process_output_error_handler, exec_sentinel_error_handler):
12565 Rename or move locals.
4dc343ee 12566 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 12567 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 12568 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 12569 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 12570 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 12571
af8a867c 12572 Make tparam.h and terminfo.c consistent.
44f230aa
SM
12573 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
12574 Include tparam.h instead, since it declares them.
af8a867c
PE
12575 * cm.h (PC): Remove extern decl; tparam.h now does this.
12576 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
12577 * terminfo.c: Include tparam.h, to check interfaces.
12578 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
12579 (tparam): Adjust signature to match interface in tparam.h;
12580 this removes some undefined behavior. Check that outstring and len
12581 are zero, which they always are with Emacs.
12582 * tparam.h (PC, BC, UP): New extern decls.
12583
0248044d 12584 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 12585 (xftfont_open): Rename locals to avoid shadowing.
0248044d 12586
8ff096c1 12587 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
12588 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
12589 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 12590 (ftfont_list): Remove unused local.
49eaafba
PE
12591 (get_adstyle_property, ftfont_pattern_entity):
12592 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
12593 Rename locals to avoid shadowing.
8ff096c1 12594
e2be39f6
PE
12595 * xfont.c (xfont_list_family): Mark var as initialized.
12596
c9735e30
PE
12597 * xml.c (make_dom): Now static.
12598
8f5201ae
PE
12599 * composite.c (composition_compute_stop_pos): Rename local to
12600 avoid shadowing.
b246f932
PE
12601 (composition_reseat_it): Remove unused locals.
12602 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 12603 (composition_update_it): Mark var as initialized.
11b61122
PE
12604 (find_automatic_composition): Mark vars as initialized,
12605 with a FIXME (Bug#8290).
8f5201ae 12606
760fbc2c
PE
12607 character.h: Rename locals to avoid shadowing.
12608 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
12609 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
12610 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
12611 (BUF_DEC_POS): Be more systematic about renaming local temporaries
12612 to avoid shadowing.
12613
ff08eb85
PE
12614 * textprop.c (property_change_between_p): Remove; unused.
12615
fc7bf025
PE
12616 * intervals.c (interval_start_pos): Now static.
12617
235d7abc
PE
12618 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
12619
44f230aa
SM
12620 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
12621 Rename locals to avoid shadowing.
3e7d6594 12622
50060332
PE
12623 * sound.c (wav_play, au_play, Fplay_sound_internal):
12624 Fix pointer signedness.
d01f234b 12625 (alsa_choose_format): Remove unused local var.
c83b8872
PE
12626 (wav_play): Initialize a variable to 0, to prevent undefined
12627 behavior (Bug#8278).
50060332 12628
c4fc4e30
PE
12629 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
12630
918436ed
PE
12631 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
12632
c939f91b
PE
12633 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
12634 clobbering (Bug#8298).
b9c7f648
PE
12635 * sysdep.c (sys_subshell): Likewise.
12636 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 12637
6bd8c144
PE
12638 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
12639 This should get cleaned up, so that child_setup has the
12640 same signature on all platforms.
12641
7710357c 12642 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 12643 (relocate_fd): Rename locals to avoid shadowing.
7710357c 12644
c59da222
CY
126452011-03-22 Chong Yidong <cyd@stupidchicken.com>
12646
12647 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
12648 not to be necessary, and produces flickering.
12649
66b87493
GM
126502011-03-20 Glenn Morris <rgm@gnu.org>
12651
12652 * config.in: Remove file.
12653
45b6f6d5
JB
126542011-03-20 Juanma Barranquero <lekktu@gmail.com>
12655
12656 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
12657 are now in src/globals.h.
12658 (syms_of_minibuf): Remove spurious & from previous change.
12659
cd394be1 126602011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
12661
12662 * minibuf.c (completing-read-function): New variable.
12663 (completing-read-default): Rename from completing-read.
12664 (completing-read): Call completing-read-function.
12665
b14e3e21
CY
126662011-03-19 Juanma Barranquero <lekktu@gmail.com>
12667
12668 * xfaces.c (Fx_load_color_file):
12669 Read color file from absolute filename (bug#8250).
12670
f2b726e6
JB
126712011-03-19 Juanma Barranquero <lekktu@gmail.com>
12672
12673 * makefile.w32-in: Update dependencies.
12674
09f6ff02
EZ
126752011-03-17 Eli Zaretskii <eliz@gnu.org>
12676
12677 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
12678
29a6015a
PE
126792011-03-17 Paul Eggert <eggert@cs.ucla.edu>
12680
a3a6c54e
PE
12681 Fix more problems found by GCC 4.5.2's static checks.
12682
b766f867
PE
12683 * process.c (make_serial_process_unwind, send_process_trap):
12684 (sigchld_handler): Now static.
12685
be02381c
PE
12686 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
12687 That way, the code declares only the vars that it needs.
12688 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
12689 * s/cygwin.h (PTY_ITERATION): Likewise.
12690 * s/darwin.h (PTY_ITERATION): Likewise.
12691 * s/gnu-linux.h (PTY_ITERATION): Likewise.
12692
57048744
PE
12693 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
12694 * process.c (allocate_pty): Don't declare stb unless it's needed.
12695
7914961c 12696 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
12697 (CONSTANTLIM): Remove; unused.
12698 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
12699 Define only if needed.
7914961c 12700
b3967b18
PE
12701 * unexelf.c (unexec): Name an expression,
12702 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
12703 Use a different way to cause a compilation error if anyone uses
12704 n rather than nn, a way that does not involve shadowing.
73366a00 12705 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 12706
29a6015a
PE
12707 * deps.mk (unexalpha.o): Remove; unused.
12708
43cfc33e 12709 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 12710 * unexec.h: New file.
ce701a33
PE
12711 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
12712 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
12713 Depend on unexec.h.
12714 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
12715 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
12716 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 12717 Change as necessary to match prototype in unexec.h.
ce701a33 12718
01f44d5a
PE
12719 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
12720 shadowing.
4f63c6bb 12721 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 12722
a6670b0b
PE
12723 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
12724 Rename locals to avoid shadowing.
12725
cef2010d 12726 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 12727 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 12728
d4d7173a
PE
12729 * print.c (Fredirect_debugging_output): Fix pointer signedess.
12730
f08b802a
PE
12731 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
12732 warning when compiling print.c.
12733
3ddb0639
PE
12734 * font.c (font_unparse_fcname): Abort in an "impossible" situation
12735 instead of using an uninitialized var.
5ad03b97 12736 (font_sort_entities): Mark var as initialized.
3ddb0639 12737
170a2692
PE
12738 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
12739
e663c700
PE
12740 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
12741 pointers to constants.
89bc529a 12742 (font_parse_fcname): Remove unused vars.
7b81e2d0 12743 (font_delete_unmatched): Now static.
ea838e10 12744 (font_get_spec): Remove; unused.
13a547c6
PE
12745 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
12746 (font_update_drivers, Ffont_get_glyphs, font_add_log):
12747 Rename or move locals to avoid shadowing.
e663c700 12748
2a80c887 12749 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 12750 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 12751
1384fa33 12752 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 12753 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 12754
8b2c52e9
PE
12755 * alloc.c (mark_backtrace): Move decl from here ...
12756 * lisp.h: ... to here, so that it can be checked.
12757
475545b5 12758 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 12759 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
12760 (lisp_indirect_variable): Name an expression,
12761 to avoid gcc -Wbad-function-cast warning.
1faed8ae 12762 (Fdefvar): Rename locals to avoid shadowing.
475545b5 12763
b1349114 12764 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 12765 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 12766 Use const pointer when appropriate.
b1349114 12767
a2928364
PE
12768 * lisp.h (get_system_name, get_operating_system_release):
12769 Move decls here, to check interfaces.
12770 * process.c (get_operating_system_release): Move decl to lisp.h.
12771 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
12772 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
12773 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
12774 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
12775 (Fformat_time_string, Fencode_time, Finsert_char):
12776 (Ftranslate_region_internal, Fformat):
12777 Rename or remove local vars to avoid shadowing.
9710023e 12778 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 12779
a415e694
PE
12780 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
12781 avoid shadowing.
12782
8ef4622d
PE
12783 * lisp.h (eassert): Check that the argument compiles, even if
12784 ENABLE_CHECKING is not defined.
12785
946f9a5b
PE
12786 * data.c (Findirect_variable): Name an expression, to avoid
12787 gcc -Wbad-function-cast warning.
112396d6 12788 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 12789 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
12790 (Fmake_variable_buffer_local, Fmake_local_variable):
12791 Mark variables as initialized.
52746918 12792 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 12793
e5aab7e7 12794 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
12795 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
12796 Rename locals to avoid shadowing.
dff45157
PE
12797 (mark_stack): Move local variables into the #ifdef region where
12798 they're used.
7bc26fdb
PE
12799 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
12800 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
12801 needed otherwise.
12802 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
12803 (GC_STRING_CHARS): Remove; not used.
d40d4be1 12804 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 12805
e5aab7e7
PE
12806 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
12807 avoids undefined behavior in theory.
12808
4da60324
PE
12809 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
12810
88043301
PE
12811 Use functions, not macros, for up- and down-casing (Bug#8254).
12812 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12813 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
12814 to use the following functions instead of these macros.
12815 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
12816 EMACS_INT, since callers assume the returned value fits in int.
12817 (upcase1): Likewise, for UPCASE_TABLE.
12818 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 12819 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 12820 the race-condition problem in the old DOWNCASE.
88043301 12821
19ed5445
PE
12822 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
12823 Rename locals to avoid shadowing.
12824 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
12825 (regex_compile, re_search_2, re_match_2_internal):
12826 Remove unused local vars.
952db0d7
PE
12827 (FREE_VAR): Rewrite so as not to use empty "else",
12828 which gcc can warn about.
da053e48 12829 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
12830 (RETALLOC_IF): Define only if needed.
12831 (WORDCHAR_P): Likewise. This one is never needed, but is used
12832 only in a comment talking about a compiler bug, so put inside
12833 the #if 0 of that comment.
12834 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
12835 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
12836 Remove; unused.
19ed5445 12837
1f3561e4 12838 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
12839 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
12840 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 12841
ded6f8f7
PE
12842 * search.c (simple_search): Remove unused var.
12843
dbd37a95
PE
12844 * dired.c (compile_pattern): Move decl from here ...
12845 * lisp.h: ... to here, so that it can be checked.
12846 (struct re_registers): New forward decl.
12847
7e47afad
PE
12848 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
12849
85f24f61
PE
12850 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
12851 All uses changed.
12852 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
12853 Rename locals to avoid shadowing.
5671df8f 12854 (Fvertical_motion): Mark locals as initialized.
85f24f61 12855
181aa2be 12856 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 12857 (casify_region): Mark local as initialized.
181aa2be 12858
930d429c
PE
12859 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
12860
7082eac6
PE
12861 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
12862 New macros, so that the caller can use some names other than
12863 gcpro1, gcpro2, etc.
12864 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
12865 of the new macros.
12866 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
12867 argument, for consistency with GCPRO2_VAR, etc: it is now the
12868 prefix of the variable, not the variable itself. All uses
12869 changed.
38b2c076
PE
12870 * dired.c (directory_files_internal, file_name_completion):
12871 Rename locals to avoid shadowing.
12872
15206ed9
PE
12873 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
12874 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
12875 dired.c's scmp function, had undefined behavior.
12876 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12877 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
12878 * buffer.h: ... to here, because these macros use current_buffer,
12879 and the new implementation with inline functions needs to have
12880 current_buffer in scope now, rather than later when the macros
12881 are used.
12882 (downcase, upcase1): New static inline functions.
12883 (DOWNCASE, UPCASE1): Reimplement using these functions.
12884 This avoids undefined behavior in expressions like
12885 DOWNCASE (x) == DOWNCASE (y), which previously suffered
12886 from race conditions in accessing the global variables
12887 case_temp1 and case_temp2.
12888 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
12889 * lisp.h (case_temp1, case_temp2): Remove their decls.
12890 * character.h (ASCII_CHAR_P): Move from here ...
12891 * lisp.h: ... to here, so that the inline functions mentioned
12892 above can use them.
12893
4a6bea26
PE
12894 * dired.c (directory_files_internal_unwind): Now static.
12895
f14b7e14
PE
12896 * fileio.c (file_name_as_directory, directory_file_name):
12897 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
12898 Now static.
2893f146
PE
12899 (file_name_as_directory): Use const pointers when appropriate.
12900 (Fexpand_file_name): Likewise. In particular, newdir might
12901 point at constant storage, so make it a const pointer.
fd4ead52 12902 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
12903 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
12904 signedness issues.
f839df0c
PE
12905 (Fset_file_times, Finsert_file_contents, auto_save_error):
12906 Rename locals to avoid shadowing.
f14b7e14 12907
5716756e 12908 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
12909 (Ftry_completion, Fall_completions): Rename or remove locals
12910 to avoid shadowing.
5716756e 12911
b4c3046a
PE
12912 * marker.c (bytepos_to_charpos): Remove; unused.
12913
b45db522
PE
12914 * lisp.h (verify_bytepos, count_markers): New decls,
12915 so that gcc does not warn that these functions aren't declared.
12916
85876d07
PE
12917 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
12918 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 12919 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 12920 (copy_text): Remove unused local var.
85876d07 12921
03d78a21 12922 * filelock.c (within_one_second): Now static.
b3dd38ab 12923 (lock_file_1): Rename local to avoid shadowing.
03d78a21 12924
5df8f01b
PE
12925 * buffer.c (fix_overlays_before): Mark locals as initialized.
12926 (fix_start_end_in_overlays): Likewise. This function should be
12927 simplified by using pointers-to-pointers, but that's a different
12928 matter.
b1d876f1 12929 (switch_to_buffer_1): Now static.
8f54f30a
PE
12930 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
12931 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 12932
a70072c9 12933 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 12934 Fix pointer signedness issue.
edced198
PE
12935 (sys_subshell): Mark local as volatile if checking for lint,
12936 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 12937 (MAXPATHLEN): Define only if needed.
a70072c9 12938
a0977c44
PE
12939 * process.c (serial_open, serial_configure): Move decls from here ...
12940 * systty.h: ... to here, so that they can be checked.
12941
a884fdcc
PE
12942 * fns.c (get_random, seed_random): Move extern decls from here ...
12943 * lisp.h: ... to here, so that they can be checked.
12944
604efe86 12945 * sysdep.c (reset_io): Now static.
b8950c94 12946 (wait_for_termination_signal): Remove; unused.
604efe86 12947
38fc62d9
PE
12948 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
12949 (copy_keymap_item, append_key, push_text_char_description):
12950 Now static.
1004a21a 12951 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 12952 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
12953 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
12954 (describe_map_tree):
12955 Rename locals to avoid shadowing.
38fc62d9 12956
2f2650da
PE
12957 * keyboard.c: Declare functions static if they are not used elsewhere.
12958 (echo_char, echo_dash, cmd_error, top_level_2):
12959 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
12960 (read_char, kbd_buffer_get_event, make_lispy_position):
12961 (make_lispy_event, make_lispy_movement, apply_modifiers):
12962 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
12963 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
12964 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 12965 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 12966 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 12967
a053e86c 12968 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
12969 (mark_kboards): Move decl here ...
12970 * alloc.c (mark_kboards): ... from here.
a053e86c 12971
4752793e
PE
12972 * lisp.h (force_auto_save_soon): New decl.
12973
74f10ca7 12974 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
12975 (DEFINE_DUMMY_FUNCTION): New macro.
12976 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
12977 Use it.
c03cd23f
PE
12978 (main): Add casts to avoid warnings
12979 if GCC considers string literals to be constants.
74f10ca7 12980
022e70d4
PE
12981 * lisp.h (fatal_error_signal): Add decl, since it's exported.
12982
59d6fe83
PE
12983 * dbusbind.c: Pointer signedness fixes.
12984 (xd_signature, xd_append_arg, xd_initialize):
12985 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12986 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12987 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
12988 (Fdbus_register_signal): Use SSDATA when the context wants char *.
12989
78320123
PE
12990 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
12991 if GCC considers string literals to be constants.
49cebcca 12992 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 12993
35ac2a97
SM
129942011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
12995
fb103ca9
SM
12996 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
12997 (print_preprocess, print_object): New macro to fix last change.
12998
35ac2a97
SM
12999 * print.c (print_preprocess): Don't forget font objects.
13000
62973b41
JB
130012011-03-16 Juanma Barranquero <lekktu@gmail.com>
13002
13003 * emacs.c (USAGE3): Doc fixes.
13004
0e48bb22
AS
130052011-03-15 Andreas Schwab <schwab@linux-m68k.org>
13006
13007 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13008 structure.
13009
7684e57b
JB
130102011-03-14 Juanma Barranquero <lekktu@gmail.com>
13011
13012 * lisp.h (VWindow_system, Qfile_name_history):
13013 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13014 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13015 (w32_system_caret_x, w32_system_caret_y): Declare extern.
13016
13017 * w32select.c: Don't #include "keyboard.h".
c96bbc66 13018 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
13019
13020 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13021 * w32console.c (detect_input_pending, read_input_pending)
13022 (encode_terminal_code):
13023 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13024 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13025 (w32_system_caret_y, Qfile_name_history):
13026 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13027 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13028 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13029 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13030 * w32proc.c (Qlocal, report_file_error):
13031 * w32term.c (Vwindow_system, updating_frame):
13032 * w32uniscribe.c (initialized, uniscribe_font_driver):
13033 Remove unneeded extern declarations.
13034
2aa46d6c
CY
130352011-03-14 Chong Yidong <cyd@stupidchicken.com>
13036
c96bbc66 13037 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 13038
cffc6f3b
CY
130392011-03-13 Chong Yidong <cyd@stupidchicken.com>
13040
13041 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13042 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13043 These macros can no longer be used for assignment.
13044
44f230aa
SM
13045 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13046 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
13047 (record_buffer_markers, fetch_buffer_markers): New functions for
13048 recording and fetching special buffer markers.
13049 (set_buffer_internal_1, set_buffer_temp): Use them.
13050
13051 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13052
13053 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13054
13055 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13056 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13057
13058 * xdisp.c (hscroll_window_tree):
13059 (reconsider_clip_changes): Use PT instead of BUF_PT.
13060
d251f04b
EZ
130612011-03-13 Eli Zaretskii <eliz@gnu.org>
13062
13063 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13064 $(EMACS_ROOT)/lib/intprops.h.
13065
f0c77cd1
PE
130662011-03-13 Paul Eggert <eggert@cs.ucla.edu>
13067
3eca4629
PE
13068 Fix more problems found by GCC 4.5.2's static checks.
13069
7c86ee98
PE
13070 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13071 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
13072 (xg_free_frame_widgets): Make it clear that a local variable is
13073 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
13074 (gdk_window_get_screen): Make it clear that this macro is needed
13075 only if USE_GTK_TOOLTIP.
1e5524e7
PE
13076 (int_gtk_range_get_value): New function, which avoids a diagnostic
13077 from gcc -Wbad-function-cast.
13078 (xg_set_toolkit_scroll_bar_thumb): Use it.
13079 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13080 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
13081 (get_utf8_string, xg_get_file_with_chooser):
13082 Rename locals to avoid shadowing.
13083 (create_dialog): Move locals to avoid shadowing.
7c86ee98 13084
41729b81
PE
13085 * xgselect.c (xg_select): Remove unused var.
13086
f0c77cd1
PE
13087 * image.c (four_corners_best): Mark locals as initialized.
13088 (gif_load): Initialize transparent_p to zero (Bug#8238).
13089 Mark another local as initialized.
ec6cf4c6 13090 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 13091
ce0ad53d 13092 * image.c (clear_image_cache): Now static.
d5d5a617 13093 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 13094 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
13095 (x_edge_detection): Remove unnecessary cast that
13096 gcc -Wbad-function-cast diagnoses.
2037898d 13097 (gif_load): Fix pointer signedness.
6ae141d6
PE
13098 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13099 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 13100
33383987 131012011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 13102
d32df629
PE
13103 Improve quality of tests for time stamp overflow.
13104 For example, without this patch (encode-time 0 0 0 1 1
13105 1152921504606846976) returns the obviously-bogus value (-948597
13106 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
13107 reports time overflow. See
13108 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
13109 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13110 * editfns.c: Include limits.h and intprops.h.
13111 (TIME_T_MIN, TIME_T_MAX): New macros.
13112 (time_overflow): Move earlier, to before first use.
13113 (hi_time, lo_time): New functions, for an accurate test for
13114 out-of-range times.
13115 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13116 (Fget_internal_run_time): Don't assume time_t fits in int.
13117 (make_time): Use list2 instead of Fcons twice.
13118 (Fdecode_time): More accurate test for out-of-range times.
13119 (check_tm_member): New function.
13120 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
13121 (lisp_time_argument): Don't rely on undefined left-shift and
13122 right-shift behavior when checking for time stamp overflow.
8be6f318 13123
fe31d94c
PE
13124 * editfns.c (time_overflow): New function, refactoring common code.
13125 (Fformat_time_string, Fdecode_time, Fencode_time):
13126 (Fcurrent_time_string): Use it.
13127
8be6f318
PE
13128 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13129 * dired.c (make_time): Move to ...
13130 * editfns.c (make_time): ... here.
13131 * systime.h: Note the move.
13132
09d9db2c 131332011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 13134
126bc0dc
YM
13135 * fringe.c (update_window_fringes): Remove unused variables.
13136
c47cbdfd
YM
13137 * unexmacosx.c (copy_data_segment): Also copy __got section.
13138 (Bug#8223)
13139
7ac80be9
EZ
131402011-03-12 Eli Zaretskii <eliz@gnu.org>
13141
c96bbc66 13142 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
13143 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13144 Constify `char *' arguments and their references according to
13145 prototypes in tparam.h.
13146
ecb0f94d 13147 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 13148
7ac80be9
EZ
13149 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13150 Adapt all references accordingly.
13151
13152 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13153
ef1fd07e
TT
131542011-03-11 Tom Tromey <tromey@redhat.com>
13155
13156 * buffer.c (syms_of_buffer): Remove obsolete comment.
13157
7ef4b50c
EZ
131582011-03-11 Eli Zaretskii <eliz@gnu.org>
13159
13160 * termhooks.h (encode_terminal_code): Declare prototype.
13161
13162 * msdos.c (encode_terminal_code): Don't declare prototype.
13163
13164 * term.c (encode_terminal_code): Now external again, used by
13165 w32console.c and msdos.c.
13166
44f230aa
SM
13167 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13168 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 13169
4b1ec863 131702011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 13171
1714f52b 13172 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 13173
4b1ec863
PE
13174 * fringe.c (update_window_fringes): Mark locals as initialized
13175 (Bug#8227).
13176 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 13177
524c7aa6
PE
13178 * alloc.c (mark_fringe_data): Move decl from here ...
13179 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13180 to check its interface.
13181 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13182
a5c0af81 13183 * fontset.c (free_realized_fontset): Now static.
7519b8cd 13184 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 13185 (fontset_font): Mark local as initialized.
a9a06e0b 13186 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 13187
b4716021
PE
13188 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13189
811e9bac 13190 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 13191 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
13192 (x_own_selection, Fx_disown_selection_internal): Rename locals
13193 to avoid shadowing.
13194 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 13195
7e3ab302
PE
13196 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13197 so that the caller can use some name other than gcpro1.
13198 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
13199 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13200 (Fx_backspace_delete_keys_p):
13201 Use them to avoid shadowing, and rename vars to avoid shadowing.
13202 (x_decode_color, x_set_name, x_window): Now static.
6b437900 13203 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 13204 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
13205 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13206 Remove unused locals.
7e3ab302
PE
13207 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13208 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13209 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13210 macros.
f78faa98 13211
e2b13473
PE
13212 * xterm.h (x_mouse_leave): New decl.
13213
77f23912
PE
13214 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13215 Remove unused functions.
cdf4ba58
PE
13216 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13217 (x_calc_absolute_position): Now static.
7411c686 13218 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 13219 Don't declare local "event" unless it's used.
ed7bf3a5
PE
13220 (x_iconify_frame, x_free_frame_resources): Don't declare locals
13221 unless they are used.
38d0b34a
PE
13222 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13223 (x_fatal_error_signal): Remove; not used.
a6067996
PE
13224 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13225 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13226 (x_error_catcher, x_connection_closed, x_error_handler):
13227 (x_error_quitter, xembed_send_message, x_iconify_frame):
13228 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 13229 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 13230 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 13231
44f230aa
SM
13232 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13233 Rename or move locals to avoid shadowing.
6b463e58 13234 (tty_defined_color, merge_face_heights): Now static.
5967d051 13235 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
13236 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13237 does not deduce is never used uninitialized.
73719eba
PE
13238 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13239 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 13240
426994c3 13241 * terminal.c (store_terminal_param): Now static.
5489860b 13242
032f1620 13243 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 13244 (set_frame_menubar): Remove unused local.
d4323972 13245 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
13246 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13247 since they might point to immutable storage.
281585b0
PE
13248 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13249 since it's unused otherwise.
032f1620 13250
367c19e5 13251 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 13252 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
13253 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13254 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 13255 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
13256 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13257 does not deduce are never used uninitialized.
70739cbe 13258
07b48fa9
PE
13259 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13260
8868a238 13261 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
13262 * window.c (window_loop, size_window):
13263 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 13264
7e5cf297 13265 * window.c (display_buffer): Now static.
d6550a9f
PE
13266 (size_window): Mark variables that gcc -Wuninitialized
13267 does not deduce are never used uninitialized.
a586633d
PE
13268 * window.h (check_all_windows): New decl, to forestall
13269 gcc -Wmissing-prototypes diagnostic.
5b555da1 13270 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 13271
f6095868
PE
13272 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13273 shadowing.
13274 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
13275 Include <limits.h>.
13276 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13277 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
13278 (load_charset_map): Mark variables that gcc -Wuninitialized
13279 does not deduce are never used uninitialized.
53df7c11 13280 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 13281
f38b440c
PE
13282 * coding.c (coding_set_source, coding_set_destination):
13283 Use "else { /* comment */ }" rather than "else /* comment */;"
13284 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
13285 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13286 a block, when the outer 'i' will do.
13287 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13288 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13289 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13290 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13291 (Fdecode_sjis_char, Fdefine_coding_system_internal):
13292 Rename locals to avoid shadowing.
13293 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
13294 * coding.c (emacs_mule_char, encode_invocation_designation):
13295 Now static, since they're not used elsewhere.
413bb2db 13296 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 13297 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
13298 (decode_coding_emacs_mule): Mark variables that gcc
13299 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
13300 (detect_coding_iso_2022): Initialize a local variable that might
13301 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 13302 this initialization is needed. (Bug#8211)
5f58e762
PE
13303 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13304 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13305 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13306 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13307 Remove unused macros.
f38b440c 13308
232b38b9 13309 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 13310 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 13311 * character.c (string_count_byte8): Likewise.
232b38b9 13312
fb90da1b
PE
13313 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13314 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13315
fb93dbc2
PE
13316 * chartab.c (copy_sub_char_table): Now static, since it's not used
13317 elsewhere.
5c156ace
PE
13318 (sub_char_table_ref_and_range, char_table_ref_and_range):
13319 Rename locals to avoid shadowing.
bbcd0949 13320 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 13321
7d3b3862 13322 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 13323 (BIDI_BOB): Remove unused macro.
7d3b3862 13324
6be7d3da
PE
13325 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13326 deduce are never used uninitialized.
c2ed9c8b 13327 * term.c (encode_terminal_code): Likewise.
6be7d3da 13328
75f8807f 13329 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 13330
50938595
PE
13331 * tparam.h: New file.
13332 * term.c, tparam.h: Include it.
13333 * deps.mk (term.o, tparam.o): Depend on tparam.h.
13334 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13335 Move these decls to tparam.h, and make them agree with what
13336 is actually in tparam.c. The previous trick of using incompatible
13337 decls in different modules does not conform to the C standard.
13338 All callers of tparam changed to use tparam's actual API.
13339 * tparam.c (tparam1, tparam, tgoto):
13340 Use const pointers where appropriate.
13341
fbceeba2
PE
13342 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13343 * cm.h (struct cm): Likewise.
13344 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13345 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13346 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13347 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13348 (turn_on_face, init_tty): Likewise.
13349 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 13350
7f3f1250
PE
13351 * term.c (term_mouse_position): Rename local to avoid shadowing.
13352
e6ca6543
PE
13353 * alloc.c (mark_ttys): Move decl from here ...
13354 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13355
c40f8d15
AS
133562011-03-11 Andreas Schwab <schwab@linux-m68k.org>
13357
13358 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13359
cfe0661d
JB
133602011-03-09 Juanma Barranquero <lekktu@gmail.com>
13361
13362 * search.c (compile_pattern_1): Remove argument regp, unused since
13363 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13364 (compile_pattern): Don't pass it.
13365
0afb4571
J
133662011-03-08 Jan Djärv <jan.h.d@swipnet.se>
13367
13368 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13369 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13370 for ! HAVE_GTK3.
13371 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13372
13373 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13374
13375 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
13376 gdk_window_get_screen, gdk_window_get_geometry,
13377 gdk_x11_window_lookup_for_display and GDK_KEY_g.
13378 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13379 (xg_get_pixbuf_from_pixmap): New function.
13380 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13381 to Pixmap, take frame as parameter, remove GdkColormap parameter.
13382 Call xg_get_pixbuf_from_pixmap instead of
13383 gdk_pixbuf_get_from_drawable.
13384 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13385 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13386 (xg_check_special_colors): Use GtkStyleContext and its functions
13387 for HAVE_GTK3.
13388 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13389 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13390 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
13391 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13392 Call gtk_widget_get_preferred_size.
0afb4571
J
13393 (xg_frame_resized): gdk_window_get_geometry only takes 5
13394 parameters.
44f230aa
SM
13395 (xg_win_to_widget, xg_event_is_for_menubar):
13396 Call gdk_x11_window_lookup_for_display.
0afb4571
J
13397 (xg_set_widget_bg): New function.
13398 (delete_cb): New function.
895009e1 13399 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 13400 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
13401 (xg_set_background_color): Call xg_set_widget_bg.
13402 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13403 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13404 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13405 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13406 if ! HAVE_GTK3.
13407 (update_frame_tool_bar): Call gtk_widget_hide.
13408 (xg_initialize): Use GDK_KEY_g.
13409
13410 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13411 if ! HAVE_GTK3
13412 (x_session_initialize): Call gdk_x11_set_sm_client_id.
13413
13414 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13415 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13416 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13417
1c2cc4ef
JB
134182011-03-08 Juanma Barranquero <lekktu@gmail.com>
13419
13420 * w32xfns.c (select_palette): Check success of RealizePalette against
13421 GDI_ERROR, not zero.
13422
33383987 13423See ChangeLog.11 for earlier changes.
aac0c6e3
MR
13424
13425;; Local Variables:
13426;; coding: utf-8
aac0c6e3
MR
13427;; End:
13428
2f097256 13429 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
13430
13431 This file is part of GNU Emacs.
13432
13433 GNU Emacs is free software: you can redistribute it and/or modify
13434 it under the terms of the GNU General Public License as published by
13435 the Free Software Foundation, either version 3 of the License, or
13436 (at your option) any later version.
13437
13438 GNU Emacs is distributed in the hope that it will be useful,
13439 but WITHOUT ANY WARRANTY; without even the implied warranty of
13440 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13441 GNU General Public License for more details.
13442
13443 You should have received a copy of the GNU General Public License
13444 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.